EDU-1146 educator or student dialog has been moved to plugin

This commit is contained in:
Liana.Bakradze
2017-11-07 18:52:24 +03:00
parent 519e095880
commit ed0ea51d20
18 changed files with 0 additions and 66 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

@@ -1,56 +0,0 @@
package com.jetbrains.python.edu;
import com.intellij.ide.util.PropertiesComponent;
import com.intellij.openapi.ui.VerticalFlowLayout;
import com.intellij.util.ui.JBUI;
import icons.PythonEducationalIcons;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
public class CustomizeEduStepPanel extends JPanel {
static final String COURSE_CREATOR_ENABLED = "Edu.CourseCreator.Enabled";
private final JLabel myStudent;
public CustomizeEduStepPanel() {
final FlowLayout layout = new FlowLayout();
layout.setHgap(20);
setLayout(layout);
int iconSize = JBUI.scale(180);
final JPanel studentPanel = new JPanel(new VerticalFlowLayout());
final JLabel teacher = new JLabel(PythonEducationalIcons.Teacher);
myStudent = new JLabel(PythonEducationalIcons.StudentHover);
myStudent.setPreferredSize(new Dimension(iconSize, iconSize));
myStudent.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
PropertiesComponent.getInstance().setValue(COURSE_CREATOR_ENABLED, false);
myStudent.setIcon(PythonEducationalIcons.StudentHover);
teacher.setIcon(PythonEducationalIcons.Teacher);
}
});
studentPanel.add(myStudent);
studentPanel.add(new JLabel("Student", SwingConstants.CENTER));
add(studentPanel);
teacher.setPreferredSize(new Dimension(iconSize, iconSize));
final JPanel teacherPanel = new JPanel(new VerticalFlowLayout());
teacherPanel.add(teacher);
teacherPanel.add(new JLabel("Teacher", SwingConstants.CENTER));
teacher.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
PropertiesComponent.getInstance().setValue(COURSE_CREATOR_ENABLED, true);
myStudent.setIcon(PythonEducationalIcons.Student);
teacher.setIcon(PythonEducationalIcons.TeacherHover);
}
});
add(teacherPanel);
}
public JComponent getStudentButton() {
return myStudent;
}
}
@@ -56,7 +56,6 @@ import com.intellij.openapi.project.ProjectManager;
import com.intellij.openapi.project.ProjectManagerListener;
import com.intellij.openapi.project.ex.ProjectManagerEx;
import com.intellij.openapi.startup.StartupManager;
import com.intellij.openapi.ui.DialogBuilder;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.Ref;
@@ -213,7 +212,6 @@ public class PyCharmEduInitialConfigurator {
@Override
public void appFrameCreated(String[] commandLineArgs, @NotNull Ref<Boolean> willOpenProject) {
if (!propertiesComponent.isValueSet(CONFIGURED_V3)) {
showInitialConfigurationDialog();
propertiesComponent.setValue(CONFIGURED_V3, "true");
}
}
@@ -411,12 +409,4 @@ public class PyCharmEduInitialConfigurator {
}
}
}
private static void showInitialConfigurationDialog() {
DialogBuilder dialog = new DialogBuilder();
final CustomizeEduStepPanel panel = new CustomizeEduStepPanel();
dialog.setPreferredFocusComponent(panel.getStudentButton());
dialog.title("Are you Student or Teacher?").centerPanel(panel);
dialog.addOkAction().setText("Start using Pycharm Edu");
dialog.show();
}
}