diff --git a/python/edu/learn-python/resources/META-INF/plugin.xml b/python/edu/learn-python/resources/META-INF/plugin.xml index 59457f3a1a95..620796a8435c 100644 --- a/python/edu/learn-python/resources/META-INF/plugin.xml +++ b/python/edu/learn-python/resources/META-INF/plugin.xml @@ -54,6 +54,8 @@ description="Refresh current task"/> + diff --git a/python/edu/learn-python/src/com/jetbrains/python/edu/StudyInstructionPainter.java b/python/edu/learn-python/src/com/jetbrains/python/edu/StudyInstructionPainter.java index 96a44b2ee66a..4fa323172bcc 100644 --- a/python/edu/learn-python/src/com/jetbrains/python/edu/StudyInstructionPainter.java +++ b/python/edu/learn-python/src/com/jetbrains/python/edu/StudyInstructionPainter.java @@ -28,7 +28,10 @@ public class StudyInstructionPainter extends EditorEmptyTextPainter { painter.appendLine("PyCharm Educational Edition").underlined(new JBColor(Gray._150, Gray._180)); painter.appendLine("Navigate to the next task window with Ctrl + Enter").smaller().withBullet(); - painter.appendLine("Navigate between task windows with Ctrl + < and Ctrl + >").smaller().withBullet(); + painter.appendLine("Navigate between task windows with Ctrl + Shift + < and Ctrl + Shift + >").smaller().withBullet(); + painter.appendLine("Navigate between tasks with Ctrl + < and Ctrl + >").smaller().withBullet(); + painter.appendLine("Reset current task file with Ctrl + Shift + X").smaller().withBullet(); + painter.appendLine("Check task with Alt + Ctrl + Enter").smaller().withBullet(); painter.appendLine("Get hint for the task window using Ctrl + 7").smaller().withBullet(); painter.appendLine("To see your progress open the 'Course Description' panel").smaller().withBullet(); painter.draw(g, new PairFunction>() { diff --git a/python/edu/learn-python/src/com/jetbrains/python/edu/StudyTaskManager.java b/python/edu/learn-python/src/com/jetbrains/python/edu/StudyTaskManager.java index 3013fbcb05d3..9b935504bd5c 100644 --- a/python/edu/learn-python/src/com/jetbrains/python/edu/StudyTaskManager.java +++ b/python/edu/learn-python/src/com/jetbrains/python/edu/StudyTaskManager.java @@ -20,9 +20,7 @@ import com.intellij.openapi.vfs.VirtualFileEvent; import com.intellij.openapi.vfs.VirtualFileManager; import com.intellij.openapi.wm.*; import com.intellij.util.xmlb.XmlSerializer; -import com.jetbrains.python.edu.actions.StudyNextWindowAction; -import com.jetbrains.python.edu.actions.StudyPrevWindowAction; -import com.jetbrains.python.edu.actions.StudyShowHintAction; +import com.jetbrains.python.edu.actions.*; import com.jetbrains.python.edu.course.Course; import com.jetbrains.python.edu.course.Lesson; import com.jetbrains.python.edu.course.Task; @@ -155,6 +153,10 @@ public class StudyTaskManager implements ProjectComponent, PersistentStateCompon 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); } } }); diff --git a/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyCheckAction.java b/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyCheckAction.java index 9741a240b0ec..b5f4c003ffe8 100644 --- a/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyCheckAction.java +++ b/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyCheckAction.java @@ -41,6 +41,8 @@ public class StudyCheckAction extends DumbAwareAction { private static final Logger LOG = Logger.getInstance(StudyCheckAction.class.getName()); private static final String ANSWERS_POSTFIX = "_answers.py"; + public static final String ACTION_ID = "CheckAction"; + public static final String SHORTCUT = "ctrl alt pressed ENTER"; private static void flushWindows(@NotNull final Task task, @NotNull final VirtualFile taskDir) { diff --git a/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyNextStudyTaskAction.java b/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyNextStudyTaskAction.java index 3c971c3fe15e..27edf22529cd 100644 --- a/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyNextStudyTaskAction.java +++ b/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyNextStudyTaskAction.java @@ -8,6 +8,9 @@ import javax.swing.*; public class StudyNextStudyTaskAction extends StudyTaskNavigationAction { + public static final String ACTION_ID = "NextTaskAction"; + public static final String SHORTCUT = "ctrl pressed PERIOD"; + @Override protected JButton getButton(@NotNull final StudyEditor selectedStudyEditor) { return selectedStudyEditor.getNextTaskButton(); diff --git a/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyNextWindowAction.java b/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyNextWindowAction.java index fcf9ef40c7d4..16036a7ba91b 100644 --- a/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyNextWindowAction.java +++ b/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyNextWindowAction.java @@ -12,7 +12,7 @@ import java.util.List; */ public class StudyNextWindowAction extends StudyWindowNavigationAction { public static final String ACTION_ID = "NextWindow"; - public static final String SHORTCUT = "ctrl pressed PERIOD"; + public static final String SHORTCUT = "ctrl shift pressed PERIOD"; public static final String SHORTCUT2 = "ctrl pressed ENTER"; public StudyNextWindowAction() { diff --git a/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyPrevWindowAction.java b/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyPrevWindowAction.java index 347456189a00..1e602bd059ff 100644 --- a/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyPrevWindowAction.java +++ b/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyPrevWindowAction.java @@ -14,7 +14,7 @@ import java.util.List; */ public class StudyPrevWindowAction extends StudyWindowNavigationAction { public static final String ACTION_ID = "PrevWindowAction"; - public static final String SHORTCUT = "ctrl pressed COMMA"; + public static final String SHORTCUT = "ctrl shift pressed COMMA"; public StudyPrevWindowAction() { super("PrevWindowAction", "Select previous window", StudyIcons.Prev); diff --git a/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyPreviousStudyTaskAction.java b/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyPreviousStudyTaskAction.java index f6da6a067894..02cc36355834 100644 --- a/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyPreviousStudyTaskAction.java +++ b/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyPreviousStudyTaskAction.java @@ -9,6 +9,8 @@ import javax.swing.*; public class StudyPreviousStudyTaskAction extends StudyTaskNavigationAction { + public static final String ACTION_ID = "PreviousTaskAction"; + public static final String SHORTCUT = "ctrl pressed COMMA"; @Override protected JButton getButton(@NotNull final StudyEditor selectedStudyEditor) { return selectedStudyEditor.getPrevTaskButton(); diff --git a/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyRefreshTaskFileAction.java b/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyRefreshTaskFileAction.java index b1ff29b58270..1a15afdf7013 100644 --- a/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyRefreshTaskFileAction.java +++ b/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyRefreshTaskFileAction.java @@ -28,6 +28,8 @@ import java.io.*; public class StudyRefreshTaskFileAction extends DumbAwareAction { private static final Logger LOG = Logger.getInstance(StudyRefreshTaskFileAction.class.getName()); + public static final String ACTION_ID = "RefreshTaskAction"; + public static final String SHORTCUT = "ctrl shift pressed X"; public static void refresh(final Project project) { ApplicationManager.getApplication().invokeLater(new Runnable() { diff --git a/python/edu/learn-python/src/com/jetbrains/python/edu/editor/StudyEditor.java b/python/edu/learn-python/src/com/jetbrains/python/edu/editor/StudyEditor.java index a85df6c4cf14..ec661f8f0b88 100644 --- a/python/edu/learn-python/src/com/jetbrains/python/edu/editor/StudyEditor.java +++ b/python/edu/learn-python/src/com/jetbrains/python/edu/editor/StudyEditor.java @@ -66,7 +66,6 @@ public class StudyEditor implements TextEditor { private JButton myRefreshButton; private static final Map myDocumentListeners = new HashMap(); private final Project myProject; - private JButton myShowHintButton; public JButton getCheckButton() { return myCheckButton; @@ -193,11 +192,11 @@ public class StudyEditor implements TextEditor { } private void initializeButtons(@NotNull final JPanel taskActionsPanel, @NotNull final TaskFile taskFile) { - myCheckButton = addButton(taskActionsPanel, "Check task", StudyIcons.Resolve); - myPrevTaskButton = addButton(taskActionsPanel, "Prev Task", StudyIcons.Prev); - myNextTaskButton = addButton(taskActionsPanel, "Next Task", AllIcons.Actions.Forward); - myRefreshButton = addButton(taskActionsPanel, "Start task again", AllIcons.Actions.Refresh); - myShowHintButton = addButton(taskActionsPanel, "Show hint", StudyIcons.ShowHint); + myCheckButton = addButton(taskActionsPanel, "Check task (Ctrl + Alt + Enter)", StudyIcons.Resolve); + myPrevTaskButton = addButton(taskActionsPanel, "Previous task (Ctrl + <)", StudyIcons.Prev); + myNextTaskButton = addButton(taskActionsPanel, "Next task (Ctrl + >)", AllIcons.Actions.Forward); + myRefreshButton = addButton(taskActionsPanel, "Reset task file (Ctrl + Shift + X)", AllIcons.Actions.Refresh); + JButton myShowHintButton = addButton(taskActionsPanel, "Show hint for task window (Ctrl + 7)", StudyIcons.ShowHint); if (!taskFile.getTask().getUserTests().isEmpty()) { JButton runButton = addButton(taskActionsPanel, "Run", AllIcons.General.Run); runButton.addActionListener(new ActionListener() {