-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A better handling of old workspaces (fixes #224) #310
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -241,8 +241,9 @@ public static Object checkWorkspace() throws IOException { | |
// this stage | ||
if (ret != null) { | ||
remember = "models".equals(ret) && WorkspacePreferences.askBeforeUsingOutdatedWorkspace() | ||
&& !openQuestion(null, "Different version of the models library", | ||
"The workspace contains a different version of the models library. Do you want to use another workspace ?"); | ||
&& openQuestion(null, "Different version of the models library", | ||
"The workspace contains a different version of the models library. Do you want GAMA to proceed and update it ?"); | ||
if (remember) { clearWorkspace(true); } | ||
Comment on lines
+244
to
+246
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❌ Getting worse: Complex Method
Comment on lines
+244
to
+246
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❌ New issue: Deep, Nested Complexity |
||
} | ||
} | ||
} | ||
|
@@ -255,7 +256,7 @@ public static Object checkWorkspace() throws IOException { | |
if (pick == 1 /* Window.CANCEL */ || wr == null) { | ||
openError(null, IKeyword.ERROR, "GAMA can not start without a workspace and will now exit."); | ||
// System.exit(0); | ||
return IApplication.EXIT_OK; | ||
return EXIT_OK; | ||
} | ||
/* Tell Eclipse what the selected location was and continue */ | ||
instanceLoc.set(new URL("file", null, wr), false); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -246,11 +246,12 @@ | |
if (askBeforeUsingOutdatedWorkspace()) { | ||
create = MessageDialog.openQuestion(Display.getDefault().getActiveShell(), | ||
"Different version of the models library", | ||
"The workspace contains a different version of the models library. Do you want to proceed anyway ?"); | ||
"The workspace contains a different version of the models library. Do you want GAMA to proceed and update it ?"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ℹ Getting worse: Complex Method |
||
} | ||
if (create) { | ||
try { | ||
dotFile.createNewFile(); | ||
Check warning on line 253 in gama.ui.application/src/gama/ui/application/workspace/WorkspacePreferences.java
|
||
Application.clearWorkspace(true); | ||
} catch (final IOException e) { | ||
return "Error updating the models library"; | ||
} | ||
|
@@ -262,7 +263,7 @@ | |
} | ||
if (cloning) { | ||
final boolean b = MessageDialog.openQuestion(Display.getDefault().getActiveShell(), "Existing workspace", | ||
"The path entered is a path to an existing workspace. All its contents will be erased and replaced by the current workspace contents. Proceed anyway ?"); | ||
"The path entered is a path to an existing workspace. Its contents will be erased and replaced by the current workspace contents. Proceed anyway ?"); | ||
if (!b) return ""; | ||
} | ||
return null; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ Getting worse: Overall Code Complexity
The mean cyclomatic complexity increases from 4.20 to 4.30, threshold = 4