diff --git a/src/org/openstreetmap/josm/gui/io/UploadDialog.java b/src/org/openstreetmap/josm/gui/io/UploadDialog.java
index f74b84ac4..4062b87ff 100644
|
a
|
b
|
|
| 11 | 11 | import java.awt.GraphicsEnvironment; |
| 12 | 12 | import java.awt.GridBagLayout; |
| 13 | 13 | import java.awt.event.ActionEvent; |
| | 14 | import java.awt.event.InputEvent; |
| | 15 | import java.awt.event.KeyEvent; |
| 14 | 16 | import java.awt.event.WindowAdapter; |
| 15 | 17 | import java.awt.event.WindowEvent; |
| 16 | 18 | import java.beans.PropertyChangeEvent; |
| … |
… |
|
| 28 | 30 | import java.util.concurrent.TimeUnit; |
| 29 | 31 | |
| 30 | 32 | import javax.swing.AbstractAction; |
| | 33 | import javax.swing.Action; |
| 31 | 34 | import javax.swing.BorderFactory; |
| 32 | 35 | import javax.swing.Icon; |
| 33 | 36 | import javax.swing.JButton; |
| | 37 | import javax.swing.JComponent; |
| 34 | 38 | import javax.swing.JOptionPane; |
| 35 | 39 | import javax.swing.JPanel; |
| 36 | 40 | import javax.swing.JTabbedPane; |
| | 41 | import javax.swing.KeyStroke; |
| 37 | 42 | |
| 38 | 43 | import org.openstreetmap.josm.Main; |
| 39 | 44 | import org.openstreetmap.josm.data.APIDataSet; |
| … |
… |
protected JPanel buildActionPanel() {
|
| 177 | 182 | pnl.add(btnUpload); |
| 178 | 183 | btnUpload.setFocusable(true); |
| 179 | 184 | InputMapUtils.enableEnter(btnUpload); |
| | 185 | bindCtrlEnterToAction(getRootPane(), btnUpload.getAction()); |
| 180 | 186 | |
| 181 | 187 | // -- cancel button |
| 182 | 188 | CancelAction cancelAction = new CancelAction(this); |
| … |
… |
protected boolean warnUploadTag(final String title, final String message, final
|
| 475 | 481 | return false; |
| 476 | 482 | } |
| 477 | 483 | |
| 478 | | ExtendedDialog dlg = new ExtendedDialog((Component) dialog, title, buttonTexts); |
| | 484 | ExtendedDialog dlg = new ExtendedDialog((Component) dialog, title, buttonTexts) { |
| | 485 | @Override |
| | 486 | public void setupDialog() { |
| | 487 | super.setupDialog(); |
| | 488 | bindCtrlEnterToAction(getRootPane(), buttons.get(buttons.size() - 1).getAction()); |
| | 489 | } |
| | 490 | }; |
| 479 | 491 | dlg.setContent("<html>" + message + "</html>"); |
| 480 | 492 | dlg.setButtonIcons(buttonIcons); |
| 481 | 493 | dlg.setToolTipTexts(tooltips); |
| … |
… |
public void handleMissingSource() {
|
| 684 | 696 | public void handleIllegalChunkSize() { |
| 685 | 697 | tpConfigPanels.setSelectedIndex(0); |
| 686 | 698 | } |
| | 699 | |
| | 700 | private static void bindCtrlEnterToAction(JComponent component, Action actionToBind) { |
| | 701 | final KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.CTRL_DOWN_MASK); |
| | 702 | component.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(stroke, "ctrl_enter"); |
| | 703 | component.getActionMap().put("ctrl_enter", actionToBind); |
| | 704 | } |
| 687 | 705 | } |