Repository navigation
Conversation
Fixes slovensko-digital#662. Some settings (e.g. enabling/disabling the local Autogram API server) only take effect after an application restart. Users often missed the small hint next to the setting and were confused when the change didn't seem to apply. The settings dialog now shows a modal notification after saving (or resetting) whenever such a setting was changed.
|
Demo video of the fix in action (scripted click-through of the real app): https://github.com/mrtineuAI/autogram/releases/download/demo-662/autogram-662-demo.mp4 The video shows: opening Settings, switching to the Other tab, toggling "Enable Autogram API" (a setting that requires an application restart), clicking "Save settings" — and the new "Application restart required" dialog appearing. |
The dialog shown after changing a restart-required setting now offers to restart the application directly, instead of only informing the user to do it manually. ApplicationRestarter spawns a new JVM with the same JVM arguments, classpath and program arguments, then exits the current instance.
|
Update: the dialog now has a Restart button (primary) next to Close. Clicking it relaunches Autogram on the spot — same JVM arguments, classpath and program arguments — and exits the old instance. Demo (scripted click-through of the real app): autogram-662-restart-demo.mp4The video shows: toggling "Enable Autogram API" → Save → the dialog with Restart/Close → clicking Restart → the app closing and starting again. (The "Failed to start server" notice at the end is specific to the demo machine, where another Autogram instance already occupies the API port — it also confirms the restarted app picked up the changed setting.) |
Fixes #662.
Some settings only take effect after an application restart (currently the local Autogram API server toggle — the trusted-countries list already refreshes live on save). Users often missed the small hint next to the setting and were confused when the change didn't seem to apply.
This change notifies the user upon saving: after clicking "Save settings", if any restart-required setting was changed since the last save, a modal dialog appears asking them to restart the application. The same notification is shown after confirming a settings reset, when the reset flips such a setting.
Changes:
UserSettings.restartRequiredSettingsChanged()/restartRequiredSettingsChangedByReset()— detect the change (same prefs-comparison pattern as the existingtlCountriesChanged())settings-restart-dialog.fxml+SettingsRestartDialogController, shown fromSettingsDialogController.onSaveButtonActionandSettingsResetDialogController.onConfirmResetButtonActionsettings.restart.title/settings.restart.textstrings in SK and EN bundlesUserSettingsTestVerified:
UserSettingsTest, incl. the 2 new tests).