From: <kp...@us...> - 2011-10-30 17:09:47
|
Revision: 20175 http://jedit.svn.sourceforge.net/jedit/?rev=20175&view=rev Author: kpouer Date: 2011-10-30 17:09:40 +0000 (Sun, 30 Oct 2011) Log Message: ----------- added a confirm dialog when deleting the keymap Modified Paths: -------------- jEdit/trunk/org/gjt/sp/jedit/options/ShortcutsOptionPane.java Modified: jEdit/trunk/org/gjt/sp/jedit/options/ShortcutsOptionPane.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/options/ShortcutsOptionPane.java 2011-10-30 09:40:11 UTC (rev 20174) +++ jEdit/trunk/org/gjt/sp/jedit/options/ShortcutsOptionPane.java 2011-10-30 17:09:40 UTC (rev 20175) @@ -469,13 +469,20 @@ } else if (evt.getSource() == deleteKeymap) { - KeymapManager manager = jEdit.getKeymapManager(); - KeymapManager.State keymapState = manager.getKeymapState(selectedKeymap.toString()); - if (keymapState == KeymapManager.State.User) + int ret = JOptionPane.showConfirmDialog(ShortcutsOptionPane.this, jEdit.getProperty( + "options.shortcuts.deletekeymap.dialog.label"), jEdit.getProperty( + "options.shortcuts.deletekeymap.dialog.title"), JOptionPane.YES_NO_OPTION, + JOptionPane.QUESTION_MESSAGE); + if (ret == JOptionPane.YES_OPTION) { - manager.deleteUserKeymap(selectedKeymap.toString()); - KeymapsModel model = (KeymapsModel) keymaps.getModel(); - model.reset(); + KeymapManager manager = jEdit.getKeymapManager(); + KeymapManager.State keymapState = manager.getKeymapState(selectedKeymap.toString()); + if (keymapState == KeymapManager.State.User) + { + manager.deleteUserKeymap(selectedKeymap.toString()); + KeymapsModel model = (KeymapsModel) keymaps.getModel(); + model.reset(); + } } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |