Commit c3a171ed authored by Benedikt Kleinmeier's avatar Benedikt Kleinmeier
Browse files

Bugfix in "ProjectView": Simulation summary dialog was show even if...

Bugfix in "ProjectView": Simulation summary dialog was show even if corresponding checkbox was deactivated

This bug arose because
1. "VadereConfig" did not contain the key "Project.simulationResult.show".
2. But, "ProjectView" (GUI) and "ProjectViewModel" (the underlying model)
   retrieved "Project.simulationResult.show" from config (which was not present)
   but both classes used different default values.
parent 72ca89da
Pipeline #180446 passed with stages
in 121 minutes and 19 seconds
......@@ -79,7 +79,7 @@ ProjectView.btnNewButton.text=New button
ProjectView.btnRunAllTests.text=Run all scenarios
ProjectView.mntmRunSelectetTests.text=Run selected scenario
ProjectView.mntmRunSelectedTests.text=Run selected scenarios
ProjectView.mntmSimulationResult.text=Show Simulation Result Dialog
ProjectView.mntmSimulationResult.text=Show summary after simulation
ProjectView.btnPauseRunningTests.text=Pause
ProjectView.btnRunSelectedTest.text=Run selected scenario
ProjectView.btnRunSelectedTest.toolTipText=Run selected scenario
......
......@@ -79,7 +79,7 @@ ProjectView.btnNewButton.text=Neuer Button
ProjectView.btnRunAllTests.text=Alle Szenarios ausf\u00FChren
ProjectView.mntmRunSelectetTests.text=Ausgew\u00E4hlte Szenarios ausf\u00FChren
ProjectView.mntmRunSelectedTests.text=Ausgew\u00E4hlte Szenarios ausf\u00FChren
ProjectView.mntmSimulationResult.text=Ergebnis Dialog anzeigen
ProjectView.mntmSimulationResult.text=Zusammenfassung nach Simulation anzeigen
ProjectView.btnPauseRunningTests.text=Pausieren
ProjectView.btnRunSelectedTest.text=Ausgew\u00E4hltes Szenario ausf\u00FChren
ProjectView.btnRunSelectedTest.toolTipText=Ausgew\u00E4hlten Szenario ausf\u00FChren
......
......@@ -22,7 +22,7 @@ public class ShowResultDialogAction extends AbstractAction {
@Override
public void actionPerformed(ActionEvent e) {
model.setShowSimulationResultDialog(item.getState());
VadereConfig.getConfig().setProperty("Project.simulationResult.show", item.getState());
model.setShowSimulationResultDialog(item.getState());
}
}
......@@ -251,6 +251,10 @@ public class ProjectViewModel implements IScenarioChecker {
.findAny().isPresent();
}
public boolean getShowSimulationResultDialog() {
return showSimulationResultDialog;
}
public void fireRefreshOutputStarted() {
outputRefreshListeners.forEach(l -> l.preRefresh());
}
......
......@@ -437,9 +437,7 @@ public class ProjectView extends JFrame implements ProjectFinishedListener, Sing
// Checkbox menu item to turn off result dialog of project run.
mnFile.addSeparator();
boolean showDialogDefault = VadereConfig.getConfig()
.getBoolean("Project.simulationResult.show", false);
JCheckBoxMenuItem showResultDialogMenu = new JCheckBoxMenuItem(Messages.getString("ProjectView.mntmSimulationResult.text"), null, showDialogDefault);
JCheckBoxMenuItem showResultDialogMenu = new JCheckBoxMenuItem(Messages.getString("ProjectView.mntmSimulationResult.text"), null, model.getShowSimulationResultDialog());
Action showResultDialogMenuAction = new ShowResultDialogAction(Messages.getString("ProjectView.mntmSimulationResult.text"), model, showResultDialogMenu);
showResultDialogMenu.setAction(showResultDialogMenuAction);
mnFile.add(showResultDialogMenu);
......
......@@ -259,6 +259,7 @@ public class VadereConfig {
defaultConfig.put("ProjectView.defaultDirectoryAttributes", defaultSearchDirectory);
defaultConfig.put("ProjectView.defaultDirectoryScenarios", defaultSearchDirectory);
defaultConfig.put("ProjectView.defaultDirectoryOutputProcessors", defaultSearchDirectory);
defaultConfig.put("Project.simulationResult.show", "true");
defaultConfig.put("SettingsDialog.dataFormat", "yyyy_MM_dd_HH_mm_ss");
defaultConfig.put("SettingsDialog.outputDirectory.path", ".");
defaultConfig.put("SettingsDialog.snapshotDirectory.path", ".");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment