Ignore:
Timestamp:
2012-01-02T02:18:12+01:00 (13 years ago)
Author:
tilusnet
Message:

Preventing the use of Windows->AlignWays Mode menu entry in the JOSM main window as it's meaningless without an active map frame.

Location:
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysDialog.java

    r27348 r27387  
    1717import javax.swing.BoxLayout;
    1818import javax.swing.ButtonGroup;
     19import javax.swing.JCheckBoxMenuItem;
    1920import javax.swing.JLabel;
    2021import javax.swing.JPanel;
     
    147148
    148149        if (activeMode == true) {
    149                 // we're in alignways mode
     150            // we're in alignways mode
    150151            activateInfoPanel.setVisible(false);
    151152            modesPanel.setVisible(true);
     
    156157            dlgPane.validate();
    157158        } else {
    158                 // we're not in alignways mode
     159            // we're not in alignways mode
    159160            activateInfoPanel.setVisible(true);
    160161            modesPanel.setVisible(false);
     
    168169    }
    169170
     171    public JCheckBoxMenuItem getWindowMenuItem() {
     172        return windowMenuItem;
     173    }
     174
    170175
    171176}
  • applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysMode.java

    r27348 r27387  
    77
    88import java.awt.Cursor;
    9 import java.awt.Dimension;
    10 import java.awt.Image;
    119import java.awt.Point;
    1210import java.awt.event.ActionEvent;
     
    1715import javax.swing.BorderFactory;
    1816import javax.swing.ImageIcon;
    19 import javax.swing.JButton;
    2017import javax.swing.JDialog;
    2118import javax.swing.JOptionPane;
     
    9188        IconToggleButton optBtn = AlignWaysPlugin.getOptBtn();
    9289        if (optBtn.isSelected()) {
    93             // The option panel is switched off
     90            // The option panel will be switched off
    9491            optBtn.doClick();
    9592        }
     
    197194        AlignWaysTipsPanel atp = new AlignWaysTipsPanel();
    198195        Object[] okButton = {tr("I''m ready!")};
    199         JOptionPane tipPane = new JOptionPane(atp, JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, 
    200                                                                                       null, okButton, okButton[0]);
     196        JOptionPane tipPane = new JOptionPane(atp, JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION,
     197                null, okButton, okButton[0]);
    201198        tipPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 30, 10));
    202199        JDialog tipDialog = tipPane.createDialog(Main.parent, tr("AlignWays Tips"));
  • applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysPlugin.java

    r27348 r27387  
    3939        alignWaysMenuItem = MainMenu.add(Main.main.menu.toolsMenu, awAction);
    4040        awDialog = new AlignWaysDialog(awMode);
     41        // Prevent user clicking on the Windows menu entry while panel is meaningless
     42        awDialog.getWindowMenuItem().setEnabled(false);
    4143    }
    4244
     
    4850        if (Main.map != null) {
    4951            Main.map.addMapMode(btn);
     52            // Re-enable menu item in Windows menu
     53            awDialog.getWindowMenuItem().setEnabled(true);
    5054        }
    5155    }
Note: See TracChangeset for help on using the changeset viewer.