Fix according to review IDEA-CR-11509

This commit is contained in:
Valentina Kiryushkina
2016-06-15 21:19:27 +03:00
parent 002a601f33
commit 12c9dbe959
8 changed files with 11 additions and 33 deletions
@@ -629,7 +629,7 @@ public class StudyUtils {
return null;
}
// supposd to be called under progress
// supposed to be called under progress
@Nullable
public static <T> T execCancelable(@NotNull final Callable<T> callable) {
final Future<T> future = ApplicationManager.getApplication().executeOnPooledThread(callable);
@@ -334,7 +334,7 @@ public class StudyProjectGenerator {
}
// Supposed to be called under progress
public List<CourseInfo> getCoursesAsynchronouslyIfNeeded(boolean force) {
public List<CourseInfo> getCourses(boolean force) {
if (OUR_COURSES_DIR.exists()) {
myCourses = getCoursesFromCache();
}
@@ -355,7 +355,7 @@ public class StudyProjectGenerator {
@Override
public List<CourseInfo> compute() throws RuntimeException {
ProgressManager.getInstance().getProgressIndicator().setIndeterminate(true);
return getCoursesAsynchronouslyIfNeeded(force);
return getCourses(force);
}
}, progressTitle, true, project);
}
@@ -1,7 +1,6 @@
package com.jetbrains.edu.learning.stepic;
import com.google.gson.annotations.SerializedName;
import com.intellij.openapi.util.text.StringUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -75,27 +74,6 @@ public class CourseInfo {
this.username = username;
}
public static class Author {
int id;
String first_name = "";
String last_name = "";
public Author() {}
public Author(String firstName, String lastName) {
first_name = firstName;
last_name = lastName;
}
public String getName() {
return StringUtil.join(new String[]{first_name, last_name}, " ");
}
public int getId() {
return id;
}
}
public void setName(String name) {
myName = name;
}
@@ -195,6 +195,7 @@ public class EduAdaptiveStepicConnector {
unsolvedTask.setStepicId(task.getStepicId());
unsolvedTask.setText(task.getText());
unsolvedTask.getTestsText().clear();
unsolvedTask.setStatus(StudyStatus.Unchecked);
final Map<String, String> testsText = task.getTestsText();
for (String testName : testsText.keySet()) {
unsolvedTask.addTestsTexts(testName, testsText.get(testName));
@@ -14,7 +14,6 @@ public class LoginDialog extends DialogWrapper {
myLoginPanel = new LoginPanel(this);
setTitle("Login to Stepic");
setOKButtonText("Login");
setTitle("Login to Stepic");
init();
}
@@ -11,7 +11,7 @@ public class StepicUser {
private static final Logger LOG = Logger.getInstance(StepicUser.class);
int id;
String firstName;
String last_name;
String lastName;
String email;
public StepicUser() {
@@ -39,11 +39,11 @@ public class StepicUser {
}
public String getLastName() {
return last_name;
return lastName;
}
public void setLastName(String last_name) {
this.last_name = last_name;
this.lastName = last_name;
}
public String getEmail() {
@@ -80,6 +80,6 @@ public class StepicUser {
}
public String getName() {
return StringUtil.join(new String[]{firstName, last_name}, " ");
return StringUtil.join(new String[]{firstName, lastName}, " ");
}
}
@@ -20,7 +20,6 @@ import com.intellij.openapi.ui.popup.util.BaseListPopupStep;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.AncestorListenerAdapter;
import com.intellij.util.Consumer;
import com.jetbrains.edu.learning.StudyUtils;
import com.jetbrains.edu.learning.courseFormat.Course;
import com.jetbrains.edu.learning.courseGeneration.StudyProjectGenerator;
@@ -313,7 +312,7 @@ public class StudyNewProjectPanel {
myGenerator.myUser = stepicUser;
final List<CourseInfo> courses = myGenerator.getCoursesAsynchronouslyIfNeeded(true);
final List<CourseInfo> courses = myGenerator.getCourses(true);
if (courses != null) {
ApplicationManager.getApplication().invokeLater(() -> refreshCoursesList(courses));
}
@@ -6,11 +6,12 @@ import com.intellij.openapi.fileEditor.FileEditorManagerListener
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.openapi.wm.ToolWindow
import com.intellij.openapi.wm.ToolWindowFactory
import com.jetbrains.edu.learning.StudyUtils
import com.jetbrains.python.console.PythonConsoleView
class StudyTestResultsToolWindowFactory: StudyToolWindowFactory() {
class StudyTestResultsToolWindowFactory: ToolWindowFactory {
override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) {
val currentTask = StudyUtils.getCurrentTask(project)
if (currentTask != null) {