[ui] Store main window position and layout

Issue #113 new
Boris Popov created an issue

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)

  1. Juan Pablo Caram repo owner

    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.

  2. Boris Popov reporter

    ~/.$(appname) location are kinda obsolete nowadays. The Qt-based storage takes care of it.

  3. Juan Pablo Caram 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

  4. Juan Pablo Caram repo owner

    The geometry is not automatically saved although there is a call to save_defaults() in save_geometry(). When closing the app via the close button, the geometry is saved. When closing via File->Quit, it is not.

  5. Log in to comment