UnofficialCrusaderPatch / UCP3-GUI

Dev work on the UCP3 gui
GNU Affero General Public License v3.0
1 stars 0 forks source link

[QOL]: Last selected installation path is not saved between GUI restarts #244

Closed gynt closed 1 week ago

gynt commented 3 months ago

https://github.com/UnofficialCrusaderPatch/UCP3-GUI/issues/241#issue-2459099340

TheRedDaemon commented 2 months ago

The issue here is related to the fact that the last folder paths are still saved in the global config file (along the currently not via GUI changeable file log setting for the GUI). The reason is related to Tauris file safety. To allow all saved paths after a restart/reload, the Tauri side needs to allow them, and there is no real solution to allow this from the frontend side (outside the file modals) without basically allowing the code to permit every path/file, at which point we could just disable this safety setting.

At the moment, the folders are saved on a proper shutdown via a hook. I wanted to avoid constant writes to the file. Now, the fact that this one is not triggered by the restart is worth investigating.

TheRedDaemon commented 2 months ago

Analysis:
Behaviour is reproducible. The assumption here is that the restart does not trigger the exit event that save the config file.
No other event seems fitting (DOCS), so the solution is likely to control the saving process on the GUI side, either completely or as additional feature. As part of this, the window events should be tested which of them trigger on close and which on restart.

TheRedDaemon commented 1 month ago

The issue will now be handled via the lifecycle changes in feature-improved-game-folder-lifecycle. This will remove the GUI relaunch needed for certain changes. The only remaining case would be Updater relaunches, and these can not be handled anyway.

Stay open until the changes are on main.

gynt commented 1 week ago

Resolved with 9188589ec06b1cb03a9a36fbb33a0f7244a57280