Skip to content
Snippets Groups Projects
Commit 7c7791b8 authored by Markus Alexander Kuppe's avatar Markus Alexander Kuppe
Browse files

Don't save editor twice.

[Bug][Toolbox]
parent 455d0922
No related branches found
No related tags found
No related merge requests found
...@@ -30,6 +30,14 @@ public abstract class SaveDirtyEditorAbstractHandler extends AbstractHandler { ...@@ -30,6 +30,14 @@ public abstract class SaveDirtyEditorAbstractHandler extends AbstractHandler {
getPrefs().setDefault(this.getClass() + ".dontBother", false); getPrefs().setDefault(this.getClass() + ".dontBother", false);
if (getPrefs().getBoolean(this.getClass() + ".dontBother")) { if (getPrefs().getBoolean(this.getClass() + ".dontBother")) {
// TODO decouple from ui thread // TODO decouple from ui thread
// Use NullProgressMonitor instead of newly created monitor. The
// parent ProgressMonitorDialog would need to be properly
// initialized first.
// @see Bug #256 in general/bugzilla/index.html
//
// Generally though, saving a resource involves I/O which should be
// decoupled from the UI thread in the first place. Properly doing
// this, would be from inside a Job which provides a ProgressMonitor
activeEditor.doSave(new NullProgressMonitor()); activeEditor.doSave(new NullProgressMonitor());
} else { } else {
final Shell shell = HandlerUtil.getActiveShell(event); final Shell shell = HandlerUtil.getActiveShell(event);
...@@ -43,12 +51,6 @@ public abstract class SaveDirtyEditorAbstractHandler extends AbstractHandler { ...@@ -43,12 +51,6 @@ public abstract class SaveDirtyEditorAbstractHandler extends AbstractHandler {
} }
if (res == MessageDialog.OK || res == MessageDialog.CONFIRM) { if (res == MessageDialog.OK || res == MessageDialog.CONFIRM) {
// TODO decouple from ui thread // TODO decouple from ui thread
activeEditor.doSave(new NullProgressMonitor());
} else {
return false;
}
}
// Use NullProgressMonitor instead of newly created monitor. The // Use NullProgressMonitor instead of newly created monitor. The
// parent ProgressMonitorDialog would need to be properly // parent ProgressMonitorDialog would need to be properly
// initialized first. // initialized first.
...@@ -58,6 +60,10 @@ public abstract class SaveDirtyEditorAbstractHandler extends AbstractHandler { ...@@ -58,6 +60,10 @@ public abstract class SaveDirtyEditorAbstractHandler extends AbstractHandler {
// decoupled from the UI thread in the first place. Properly doing // decoupled from the UI thread in the first place. Properly doing
// this, would be from inside a Job which provides a ProgressMonitor // this, would be from inside a Job which provides a ProgressMonitor
activeEditor.doSave(new NullProgressMonitor()); activeEditor.doSave(new NullProgressMonitor());
} else {
return false;
}
}
} }
return true; return true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment