Skip to content
Snippets Groups Projects
Commit c6f1a86e authored by Robert Goldmann's avatar Robert Goldmann
Browse files

Fixed #223 - settings tab is not refreshesd on command "switch"

parent c7bafbf7
No related branches found
No related tags found
No related merge requests found
......@@ -63,6 +63,7 @@ public class CommandSwitch extends Command
LanguageType previousLanguage = bundle.getParentController().getSettings().getLanguage();
bundle.getParentController().setSettings(FileHelper.loadSettings());
bundle.getParentController().getSettingsController().prefill();
RestartHandler restartHandler = new RestartHandler(bundle.getParentController());
restartHandler.handleRestart(previousLanguage);
bundle.getController().print(bundle.getString("switch.success"));
......
......@@ -420,6 +420,11 @@ public class Controller extends BaseController
return updater;
}
public SettingsController getSettingsController()
{
return settingsController;
}
public void setFilterSettings(FilterSettings filterSettings)
{
this.filterSettings = filterSettings;
......
......@@ -96,6 +96,25 @@ public class SettingsController implements Styleable
previousLanguage = LanguageType.ENGLISH;
checkboxEnableAutoUpdate.setSelected(true);
prefill();
applyStyle();
textFieldURL.setPromptText(Localization.getString(Strings.URL_PLACEHOLDER));
textFieldCurrency.setPromptText(Localization.getString(Strings.CURRENCY_PLACEHOLDER));
textAreaTrustedHosts.setPromptText(Localization.getString(Strings.TRUSTED_HOSTS_PLACEHOLDER));
ToggleGroup toggleGroup = new ToggleGroup();
radioButtonRestActivated.setToggleGroup(toggleGroup);
radioButtonRestDeactivated.setToggleGroup(toggleGroup);
hboxSettings.prefWidthProperty().bind(scrollPane.widthProperty().subtract(25));
refreshLabelsUpdate();
}
public void prefill()
{
if(controller.getSettings().isComplete())
{
textFieldURL.setText(controller.getSettings().getUrl());
......@@ -124,20 +143,6 @@ public class SettingsController implements Styleable
{
radioButtonRestDeactivated.setSelected(true);
}
applyStyle();
textFieldURL.setPromptText(Localization.getString(Strings.URL_PLACEHOLDER));
textFieldCurrency.setPromptText(Localization.getString(Strings.CURRENCY_PLACEHOLDER));
textAreaTrustedHosts.setPromptText(Localization.getString(Strings.TRUSTED_HOSTS_PLACEHOLDER));
ToggleGroup toggleGroup = new ToggleGroup();
radioButtonRestActivated.setToggleGroup(toggleGroup);
radioButtonRestDeactivated.setToggleGroup(toggleGroup);
hboxSettings.prefWidthProperty().bind(scrollPane.widthProperty().subtract(25));
refreshLabelsUpdate();
}
private void refreshLabelsUpdate()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment