Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
1baa34e5
Commit
1baa34e5
authored
8 years ago
by
Ekaterina Tuzova
Committed by
Ekaterina Tuzova
8 years ago
Browse files
Options
Download
Email Patches
Plain Diff
fix get courses in show course preview
parent
e46cb033
Branches unavailable
Tags unavailable
No related merge requests found
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
python/educational-core/src/com/jetbrains/edu/learning/courseGeneration/StudyProjectGenerator.java
+1
-1
.../edu/learning/courseGeneration/StudyProjectGenerator.java
python/educational-core/src/com/jetbrains/edu/learning/intellij/localCourses/EduLocalCoursePanel.java
+2
-2
...u/learning/intellij/localCourses/EduLocalCoursePanel.java
python/educational-core/src/com/jetbrains/edu/learning/ui/StudyNewProjectPanel.java
+4
-3
...c/com/jetbrains/edu/learning/ui/StudyNewProjectPanel.java
python/educational-python/Edu-Python/src/com/jetbrains/edu/coursecreator/CreateFromArchiveProjectStep.java
+2
-2
...rains/edu/coursecreator/CreateFromArchiveProjectStep.java
python/educational-python/Edu-Python/src/com/jetbrains/edu/learning/PyStudyDirectoryProjectGenerator.java
+5
-1
...brains/edu/learning/PyStudyDirectoryProjectGenerator.java
python/educational-python/Edu-Python/src/com/jetbrains/edu/learning/actions/PyStudyIntroductionCourseAction.java
+1
-1
...edu/learning/actions/PyStudyIntroductionCourseAction.java
with
15 additions
and
10 deletions
+15
-10
python/educational-core/src/com/jetbrains/edu/learning/courseGeneration/StudyProjectGenerator.java
+
1
-
1
View file @
1baa34e5
...
...
@@ -123,7 +123,7 @@ public class StudyProjectGenerator {
if
(
force
)
{
myCourses
=
execCancelable
(()
->
EduStepicConnector
.
getCourses
(
StepicUpdateSettings
.
getInstance
().
getUser
()));
}
if
(
force
||
myCourses
==
null
||
myCourses
.
isEmpty
()
||
(
myCourses
.
size
()
==
1
&&
myCourses
.
contains
(
CourseInfo
.
INVALID_COURSE
)))
{
if
(
myCourses
==
null
||
myCourses
.
isEmpty
()
||
(
myCourses
.
size
()
==
1
&&
myCourses
.
contains
(
CourseInfo
.
INVALID_COURSE
)))
{
myCourses
=
Collections
.
singletonList
(
getBundledIntro
());
}
sortCourses
(
myCourses
);
...
...
This diff is collapsed.
Click to expand it.
python/educational-core/src/com/jetbrains/edu/learning/intellij/localCourses/EduLocalCoursePanel.java
+
2
-
2
View file @
1baa34e5
...
...
@@ -2,8 +2,8 @@ package com.jetbrains.edu.learning.intellij.localCourses;
import
com.intellij.openapi.fileChooser.FileChooserDescriptorFactory
;
import
com.intellij.openapi.ui.TextFieldWithBrowseButton
;
import
com.jetbrains.edu.learning.courseGeneration.StudyProjectGenerator
;
import
com.jetbrains.edu.learning.courseFormat.CourseInfo
;
import
com.jetbrains.edu.learning.courseGeneration.StudyProjectGenerator
;
import
com.jetbrains.edu.learning.ui.StudyNewProjectPanel
;
import
javax.swing.*
;
...
...
@@ -45,7 +45,7 @@ public class EduLocalCoursePanel {
}
private
void
createUIComponents
()
{
myStudyPanel
=
new
StudyNewProjectPanel
(
myGenerator
);
myStudyPanel
=
new
StudyNewProjectPanel
(
myGenerator
,
true
);
myInfoPanel
=
myStudyPanel
.
getInfoPanel
();
}
}
This diff is collapsed.
Click to expand it.
python/educational-core/src/com/jetbrains/edu/learning/ui/StudyNewProjectPanel.java
+
4
-
3
View file @
1baa34e5
...
...
@@ -57,6 +57,7 @@ public class StudyNewProjectPanel extends JPanel implements PanelWithAnchor {
private
JTextPane
myDescriptionPane
;
private
JComponent
myAnchor
;
private
final
StudyProjectGenerator
myGenerator
;
private
boolean
isLocal
=
false
;
private
static
final
String
CONNECTION_ERROR
=
"<html>Failed to download courses.<br>Check your Internet connection.</html>"
;
private
static
final
String
INVALID_COURSE
=
"Selected course is invalid"
;
private
FacetValidatorsManager
myValidationManager
;
...
...
@@ -64,10 +65,10 @@ public class StudyNewProjectPanel extends JPanel implements PanelWithAnchor {
private
static
final
String
LOGIN_TO_STEPIC_MESSAGE
=
"<html><u>Login to Stepik</u> to open the adaptive course </html>"
;
private
static
final
String
LOGIN_TO_STEPIC
=
"Login to Stepik"
;
public
StudyNewProjectPanel
(
@NotNull
final
StudyProjectGenerator
generator
)
{
public
StudyNewProjectPanel
(
@NotNull
final
StudyProjectGenerator
generator
,
boolean
isLocal
)
{
super
(
new
VerticalFlowLayout
(
true
,
true
));
myGenerator
=
generator
;
this
.
isLocal
=
isLocal
;
layoutPanel
();
initListeners
();
}
...
...
@@ -116,7 +117,7 @@ public class StudyNewProjectPanel extends JPanel implements PanelWithAnchor {
private
void
initCoursesCombobox
()
{
myAvailableCourses
=
myGenerator
.
getCoursesUnderProgress
(
false
,
"Getting Available Courses"
,
ProjectManager
.
getInstance
().
getDefaultProject
());
myGenerator
.
getCoursesUnderProgress
(
!
isLocal
,
"Getting Available Courses"
,
ProjectManager
.
getInstance
().
getDefaultProject
());
if
(
myAvailableCourses
.
contains
(
CourseInfo
.
INVALID_COURSE
))
{
setError
(
CONNECTION_ERROR
);
}
...
...
This diff is collapsed.
Click to expand it.
python/educational-python/Edu-Python/src/com/jetbrains/edu/coursecreator/CreateFromArchiveProjectStep.java
+
2
-
2
View file @
1baa34e5
...
...
@@ -10,8 +10,8 @@ import com.jetbrains.edu.learning.PyStudyDirectoryProjectGenerator;
import
com.jetbrains.edu.learning.StudyTaskManager
;
import
com.jetbrains.edu.learning.core.EduNames
;
import
com.jetbrains.edu.learning.courseFormat.Course
;
import
com.jetbrains.edu.learning.courseGeneration.StudyProjectGenerator
;
import
com.jetbrains.edu.learning.courseFormat.CourseInfo
;
import
com.jetbrains.edu.learning.courseGeneration.StudyProjectGenerator
;
import
com.jetbrains.python.newProject.steps.PyCharmNewProjectStep
;
import
org.jetbrains.annotations.NotNull
;
...
...
@@ -25,7 +25,7 @@ class CreateFromArchiveProjectStep extends PyCharmNewProjectStep {
private
final
Project
myProject
;
private
final
Module
myModule
;
private
PyStudyDirectoryProjectGenerator
myGenerator
=
new
PyStudyDirectoryProjectGenerator
();
private
PyStudyDirectoryProjectGenerator
myGenerator
=
new
PyStudyDirectoryProjectGenerator
(
true
);
public
MyCustomization
(
Project
project
,
Module
module
)
{
...
...
This diff is collapsed.
Click to expand it.
python/educational-python/Edu-Python/src/com/jetbrains/edu/learning/PyStudyDirectoryProjectGenerator.java
+
5
-
1
View file @
1baa34e5
...
...
@@ -61,6 +61,10 @@ public class PyStudyDirectoryProjectGenerator extends PythonProjectGenerator<PyN
private
StudyNewProjectPanel
mySettingsPanel
;
public
PyStudyDirectoryProjectGenerator
()
{
this
(
false
);
}
public
PyStudyDirectoryProjectGenerator
(
boolean
isLocal
)
{
myGenerator
=
new
StudyProjectGenerator
();
myGenerator
.
addSettingsStateListener
(
new
StudyProjectGenerator
.
SettingsListener
()
{
@Override
...
...
@@ -69,7 +73,7 @@ public class PyStudyDirectoryProjectGenerator extends PythonProjectGenerator<PyN
}
});
mySettingsPanel
=
new
StudyNewProjectPanel
(
myGenerator
);
mySettingsPanel
=
new
StudyNewProjectPanel
(
myGenerator
,
isLocal
);
mySettingsPanel
.
registerValidators
(
new
FacetValidatorsManager
()
{
public
void
registerValidator
(
FacetEditorValidator
validator
,
JComponent
...
componentsToWatch
)
{
throw
new
UnsupportedOperationException
();
...
...
This diff is collapsed.
Click to expand it.
python/educational-python/Edu-Python/src/com/jetbrains/edu/learning/actions/PyStudyIntroductionCourseAction.java
+
1
-
1
View file @
1baa34e5
...
...
@@ -61,7 +61,7 @@ public class PyStudyIntroductionCourseAction extends AnAction {
ProjectUtil
.
openProject
(
projectDir
.
getPath
(),
null
,
false
);
}
else
{
final
PyStudyDirectoryProjectGenerator
generator
=
new
PyStudyDirectoryProjectGenerator
();
final
PyStudyDirectoryProjectGenerator
generator
=
new
PyStudyDirectoryProjectGenerator
(
true
);
final
EduPluginConfigurator
configurator
=
EduPluginConfigurator
.
INSTANCE
.
forLanguage
(
PythonLanguage
.
getInstance
());
final
String
bundledCoursePath
=
configurator
.
getBundledCoursePath
();
CourseInfo
introCourse
=
generator
.
getGenerator
().
getCourseInfo
(
bundledCoursePath
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help