fixed broken shortcut for next task window action
authorLiana Bakradze <liana.bakradze@jetbrains.com>
Wed, 29 Oct 2014 13:01:05 +0000 (16:01 +0300)
committerLiana Bakradze <liana.bakradze@jetbrains.com>
Wed, 29 Oct 2014 13:01:05 +0000 (16:01 +0300)
python/edu/learn-python/src/com/jetbrains/python/edu/StudyTaskManager.java

index f37adf0b19f6b438e93bc354b9148871419454d0..365aa25afd23bc7d0587b48a5f3736b01abd3873 100644 (file)
@@ -217,14 +217,14 @@ public class StudyTaskManager implements ProjectComponent, PersistentStateCompon
                   }
                 });
               }
-              addShortcut(StudyNextWindowAction.SHORTCUT, StudyNextWindowAction.ACTION_ID);
-              addShortcut(StudyPrevWindowAction.SHORTCUT, StudyPrevWindowAction.ACTION_ID);
-              addShortcut(StudyShowHintAction.SHORTCUT, StudyShowHintAction.ACTION_ID);
-              addShortcut(StudyNextWindowAction.SHORTCUT2, StudyNextWindowAction.ACTION_ID);
-              addShortcut(StudyCheckAction.SHORTCUT, StudyCheckAction.ACTION_ID);
-              addShortcut(StudyNextStudyTaskAction.SHORTCUT, StudyNextStudyTaskAction.ACTION_ID);
-              addShortcut(StudyPreviousStudyTaskAction.SHORTCUT, StudyPreviousStudyTaskAction.ACTION_ID);
-              addShortcut(StudyRefreshTaskFileAction.SHORTCUT, StudyRefreshTaskFileAction.ACTION_ID);
+              addShortcut(StudyNextWindowAction.SHORTCUT, StudyNextWindowAction.ACTION_ID, false);
+              addShortcut(StudyPrevWindowAction.SHORTCUT, StudyPrevWindowAction.ACTION_ID, false);
+              addShortcut(StudyShowHintAction.SHORTCUT, StudyShowHintAction.ACTION_ID, false);
+              addShortcut(StudyNextWindowAction.SHORTCUT2, StudyNextWindowAction.ACTION_ID, true);
+              addShortcut(StudyCheckAction.SHORTCUT, StudyCheckAction.ACTION_ID, false);
+              addShortcut(StudyNextStudyTaskAction.SHORTCUT, StudyNextStudyTaskAction.ACTION_ID, false);
+              addShortcut(StudyPreviousStudyTaskAction.SHORTCUT, StudyPreviousStudyTaskAction.ACTION_ID, false);
+              addShortcut(StudyRefreshTaskFileAction.SHORTCUT, StudyRefreshTaskFileAction.ACTION_ID, false);
             }
           }
         });
@@ -233,10 +233,10 @@ public class StudyTaskManager implements ProjectComponent, PersistentStateCompon
   }
 
 
-  private static void addShortcut(@NotNull final String shortcutString, @NotNull final String actionIdString) {
+  private static void addShortcut(@NotNull final String shortcutString, @NotNull final String actionIdString, boolean isAdditional) {
     Keymap keymap = KeymapManager.getInstance().getActiveKeymap();
     Shortcut[] shortcuts = keymap.getShortcuts(actionIdString);
-    if (shortcuts.length > 0) {
+    if (shortcuts.length > 0 && !isAdditional) {
       return;
     }
     Shortcut studyActionShortcut = new KeyboardShortcut(KeyStroke.getKeyStroke(shortcutString), null);