Ignore:
Timestamp:
06.01.2010 20:35:56 (2 years ago)
Author:
Gubaer
Message:

new: JOSM now supports OAuth

See also online help for server preferences and new OAuth Authorisation Wizard

File:
1 edited

Legend:

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

    r2323 r2748  
    22package org.openstreetmap.josm.actions; 
    33 
     4import static org.openstreetmap.josm.gui.help.HelpUtil.ht; 
    45import static org.openstreetmap.josm.tools.I18n.tr; 
    5 import static org.openstreetmap.josm.gui.help.HelpUtil.ht; 
    66 
    7 import java.awt.Dimension; 
    8 import java.awt.GridBagLayout; 
    97import java.awt.event.ActionEvent; 
    108import java.awt.event.KeyEvent; 
    119 
    12 import javax.swing.JDialog; 
    13 import javax.swing.JOptionPane; 
    14 import javax.swing.JPanel; 
    15  
    1610import org.openstreetmap.josm.Main; 
    1711import org.openstreetmap.josm.gui.preferences.PreferenceDialog; 
    18 import org.openstreetmap.josm.tools.GBC; 
    1912import org.openstreetmap.josm.tools.Shortcut; 
    2013 
     
    3023     */ 
    3124    public PreferencesAction() { 
    32         super(tr("Preferences..."), "preference", tr("Open a preferences page for global settings."), 
    33         Shortcut.registerShortcut("system:preferences", tr("Preferences"), KeyEvent.VK_F12, Shortcut.GROUP_DIRECT), true); 
     25        super(tr("Preferences..."), "preference", tr("Open a preferences dialog for global settings."), 
     26                Shortcut.registerShortcut("system:preferences", tr("Preferences"), KeyEvent.VK_F12, Shortcut.GROUP_DIRECT), true); 
    3427        putValue("help", ht("/Action/Preferences")); 
    3528    } 
     
    4336 
    4437    public void run() { 
    45         PreferenceDialog prefDlg = new PreferenceDialog(); 
    46         prefDlg.setMinimumSize(new Dimension(400,300)); 
    47         JPanel prefPanel = new JPanel(new GridBagLayout()); 
    48         prefPanel.add(prefDlg, GBC.eol().fill(GBC.BOTH)); 
    49  
    50         JOptionPane pane = new JOptionPane(prefPanel, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION); 
    51         JDialog dlg = pane.createDialog(Main.parent, tr("Preferences")); 
    52         dlg.setResizable(true); 
    53         dlg.setMinimumSize(new Dimension(500,400)); 
    54  
    55 //      if (dlg.getWidth() > 600) 
    56 //          dlg.setSize(600, dlg.getHeight()); 
    57 //      if (dlg.getHeight() > 600) 
    58 //          dlg.setSize(dlg.getWidth(),600); 
    59  
    60         int JOSMWidth = Main.parent.getWidth(); 
    61         int JOSMHeight = Main.parent.getHeight(); 
    62  
    63         if (JOSMWidth > 2000 && JOSMWidth >  JOSMHeight * 2) 
    64             // don't center on horizontal span monitor configurations (yes, can be selfish sometimes) 
    65             JOSMWidth /= 2; 
    66  
    67         int targetWidth = JOSMWidth / 2; 
    68         if (targetWidth < 600) targetWidth = 600; 
    69         if (targetWidth > 1200) targetWidth = 1200; 
    70         int targetHeight = (JOSMHeight * 3) / 4; 
    71         if (targetHeight < 600) targetHeight = 600; 
    72         if (targetHeight > 1200) targetHeight = 1200; 
    73  
    74         int targetX = Main.parent.getX() + JOSMWidth / 2 - targetWidth / 2; 
    75         int targetY = Main.parent.getY() + JOSMHeight / 2 - targetHeight / 2; 
    76  
    77         dlg.setBounds(targetX, targetY, targetWidth, targetHeight); 
    78  
    79         dlg.setModal(true); 
    80         dlg.setVisible(true); 
    81         if (pane.getValue() instanceof Integer && (Integer)pane.getValue() == JOptionPane.OK_OPTION) 
    82             prefDlg.ok(); 
    83         dlg.dispose(); 
     38        new PreferenceDialog(Main.parent).setVisible(true); 
    8439    } 
    8540} 
Note: See TracChangeset for help on using the changeset viewer.