[ui] Store main window position and layout
Currently main window always comes up with predefined geometry and layout which is annoying. Please see the attached patch for improved behavior. QSettings are used intentionally as cross platform way suggested by Qt.
Comments (5)
-
repo owner -
reporter ~/.$(appname) location are kinda obsolete nowadays. The Qt-based storage takes care of it.
-
repo owner The current settings mechanism is working properly. It's quite complex and porting it to a different method would not be trivial. If you think the settings storage mechanism needs to be refactored, you are welcome to open a separate issue for such. In the meantime we can only proceed with this issue with the infrastructure that is in place.
By the way, according to Ubuntu, "The home directory is ... Where your application settings are stored, in hidden files and directories (their names start with a . )". source
-
repo owner @allazar, did ae2e227 solve this?
-
repo owner The geometry is not automatically saved although there is a call to
save_defaults()
insave_geometry()
. When closing the app via the close button, the geometry is saved. When closing via File->Quit, it is not. - Log in to comment
There is a mechanism for storing settings in FlatCAM already, the dictionary
FlatCAMApp.App.defaults
and is saved to~/.FlatCAM/defaults.json
in Linux. It's saved periodically or by the user from the File menu, but does not save on exit. Should add that.If the window geometry can be serialized to a string, it would really easy to use the current settings mechanism.
I like your solution, but don't want to have 2 separate settings files.