Changeset 292 in josm for src/org/openstreetmap/josm/actions


Ignore:
Timestamp:
2007-07-19T23:19:21+02:00 (18 years ago)
Author:
imi
Message:
  • fixed Bug Report module to work better with plugins
  • fixed Plugin.getPreferenceDir and Plugin.copy
  • fixed Ctrl-Q not asking for changed data
  • fixed several typos in Shortcuts
  • removed check for latest josm version
Location:
src/org/openstreetmap/josm/actions
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/org/openstreetmap/josm/actions/AboutAction.java

    r288 r292  
    2323import javax.swing.JTabbedPane;
    2424import javax.swing.JTextArea;
    25 import javax.swing.SwingUtilities;
    2625
    2726import org.openstreetmap.josm.Main;
     
    7069
    7170                JPanel info = new JPanel(new GridBagLayout());
    72                 info.add(new JLabel(tr("Java OpenStreetMap Editor Version {0}",version)), GBC.eol());
    73                 info.add(new JLabel(tr("last change at {0}",time)), GBC.eol());
    74                 info.add(new JLabel(tr("Java Version {0}",System.getProperty("java.version"))), GBC.eol());
    75                 info.add(new JLabel(tr("Latest Version on JOSM homepage is")), GBC.std().insets(0,0,5,0));
    76                 final JLabel checkVersionLabel = new JLabel("<html><em>"+tr("checking...")+"</em></html>");
    77                 info.add(checkVersionLabel, GBC.eol());
    78                 new Thread(){
    79                         @Override public void run() {
    80                                 final String version = checkLatestVersion();
    81                                 try {
    82                                         if (version == null)
    83                                                 throw new NullPointerException();
    84                         SwingUtilities.invokeAndWait(new Runnable(){
    85                                 public void run() {
    86                                         checkVersionLabel.setText(version);
    87                             }
    88                         });
    89                 } catch (Exception e) {
    90                         checkVersionLabel.setText("failed.");
    91                 }
    92             }
    93                 }.start();
    94                
     71                info.add(new JLabel(tr("Java OpenStreetMap Editor Version {0}",version)), GBC.eol().fill(GBC.HORIZONTAL));
     72                info.add(new JLabel(tr("last change at {0}",time)), GBC.eol().fill(GBC.HORIZONTAL));
     73                info.add(new JLabel(tr("Java Version {0}",System.getProperty("java.version"))), GBC.eol().fill(GBC.HORIZONTAL));
    9574                info.add(GBC.glue(0,10), GBC.eol());
    96                
    9775                info.add(new JLabel(tr("Homepage")), GBC.std().insets(0,0,10,0));
    98                 info.add(new UrlLabel("http://josm.openstreetmap.de"), GBC.eol());
     76                info.add(new UrlLabel("http://josm.openstreetmap.de"), GBC.eol().fill(GBC.HORIZONTAL));
    9977                info.add(new JLabel(tr("Bug Reports")), GBC.std().insets(0,0,10,0));
    100                 info.add(new UrlLabel("http://josm.openstreetmap.de/newticket"), GBC.eol());
     78                info.add(new UrlLabel("http://josm.openstreetmap.de/newticket"), GBC.eol().fill(GBC.HORIZONTAL));
    10179                info.add(new JLabel(tr("News about JOSM")), GBC.std().insets(0,0,10,0));
    102                 info.add(new UrlLabel("http://www.opengeodata.org/?cat=17"), GBC.eol());
     80                info.add(new UrlLabel("http://www.opengeodata.org/?cat=17"), GBC.eol().fill(GBC.HORIZONTAL));
    10381
    10482                StringBuilder pluginsStr = new StringBuilder();
  • src/org/openstreetmap/josm/actions/AutoScaleAction.java

    r214 r292  
    2929
    3030        public AutoScaleAction(String mode) {
    31                 super(tr(mode), "dialogs/autoscale/"+mode, tr("Zoom the view to {0}."), 0, 0, true);
     31                super(tr("Zoom to {0}", mode), "dialogs/autoscale/"+mode, tr("Zoom the view to {0}.", tr(mode)), 0, 0, true);
    3232                String modeHelp = Character.toUpperCase(mode.charAt(0))+mode.substring(1);
    3333                putValue("help", "Action/AutoScale/"+modeHelp);
  • src/org/openstreetmap/josm/actions/ExitAction.java

    r178 r292  
    55import java.awt.event.ActionEvent;
    66import java.awt.event.KeyEvent;
     7
     8import org.openstreetmap.josm.Main;
    79
    810/**
     
    1820                super(tr("Exit"), "exit", tr("Exit the application."), KeyEvent.VK_Q, KeyEvent.CTRL_DOWN_MASK, true);
    1921        }
    20        
     22
    2123        public void actionPerformed(ActionEvent e) {
    22                 System.exit(0);
     24                if (!Main.breakBecauseUnsavedChanges())
     25                        System.exit(0);
    2326        }
    2427}
  • src/org/openstreetmap/josm/actions/JosmAction.java

    r208 r292  
    2727                super(name, ImageProvider.get(iconName));
    2828                setHelpId();
    29                 putValue(SHORT_DESCRIPTION, "<html>"+tooltip+" <font size='-2'>"+ShortCutLabel.name(shortCut, modifier)+"</font>&nbsp;</html>");
    30                 this.shortCut = KeyStroke.getKeyStroke(shortCut, modifier);
    31         Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(this.shortCut, name);
    32         Main.contentPane.getActionMap().put(name, this);
     29                String scl = ShortCutLabel.name(shortCut, modifier);
     30                putValue(SHORT_DESCRIPTION, "<html>"+tooltip+" <font size='-2'>"+scl+"</font>"+(scl.equals("")?"":"&nbsp;")+"</html>");
     31                if (shortCut != 0) {
     32                        this.shortCut = KeyStroke.getKeyStroke(shortCut, modifier);
     33                        Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(this.shortCut, name);
     34                        Main.contentPane.getActionMap().put(name, this);
     35                }
    3336        putValue("toolbar", iconName);
    3437        if (register)
     
    3740
    3841        public void destroy() {
    39                 Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).remove(shortCut);
    40                 Main.contentPane.getActionMap().remove(shortCut);
     42                if (shortCut != null) {
     43                        Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).remove(shortCut);
     44                        Main.contentPane.getActionMap().remove(shortCut);
     45                }
    4146        }
    4247       
  • src/org/openstreetmap/josm/actions/mapmode/ZoomAction.java

    r113 r292  
    4444         */
    4545        public ZoomAction(MapFrame mapFrame) {
    46                 super(tr("Zoom"), "zoom", tr("Zoom in by dragging. (Ctrl+up,left,down,right,+,-)"), KeyEvent.VK_Z, mapFrame, ImageProvider.getCursor("normal", "zoom"));
     46                super(tr("Zoom"), "zoom", tr("Zoom in by dragging. (Ctrl+up,left,down,right,',','.')"), KeyEvent.VK_Z, mapFrame, ImageProvider.getCursor("normal", "zoom"));
    4747                mv = mapFrame.mapView;
    4848                selectionManager = new SelectionManager(this, true, mv);
Note: See TracChangeset for help on using the changeset viewer.