New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions to get, load, save GUI settings #236

Open
ghost opened this Issue Sep 1, 2017 · 7 comments

Comments

Projects
None yet
1 participant
@ghost
Copy link

ghost commented Sep 1, 2017

.getLocation(), .getGeometry(), .getFullscreen() not a thing!

I would love to be able to get the state of a window. sadly, this feature is nonexistent

@jarvisteach

This comment has been minimized.

Copy link
Owner

jarvisteach commented Sep 2, 2017

You're right - nothing like that exists. There's never been much of a use case... I'd love to know what you're trying to achieve.

You can access tkinter direct though, to get information.

This will give you the location & dimensions: app.topLevel.geometry()
And this will tell you if you're in full screen: app.topLevel.attributes('-fullscreen')

@jarvisteach jarvisteach added the question label Sep 2, 2017

jarvisteach added a commit that referenced this issue Sep 2, 2017

@ghost

This comment has been minimized.

Copy link
Author

ghost commented Sep 2, 2017

I'm trying to save the size of the window, so that when the next time the user opens the window, I can restore the window size of the last session.

@jarvisteach

This comment has been minimized.

Copy link
Owner

jarvisteach commented Sep 2, 2017

Hmm, that's a nice feature to build in.

appJar could create a hidden config file that stores settings like that, and update it each time .stop() is called.

Saving the config file would be turned off by default, but the user could call a function to enable it, passing an optional file name (otherwise it could be .appjar)

Loading a config file would be automatic - if appJar finds a .appJar file it will use any settings. Or if the user has enable config files, with a different name, they will be searched for instead.

This could contain:

  • height & width
  • top left X & Y
  • fullscreen True/False
  • toolbar toggle
  • various container settings: tab/page number, paned/scrolled window positions, toggle frame settings

appJar could also then provide an API to load/save user definable properties:

  • .saveProperty(name, value) - add the named property to the config file
  • .loadProperty(name, default) - get the named property from the config file

What else might be useful?

@ghost

This comment has been minimized.

Copy link
Author

ghost commented Sep 2, 2017

Oh my God, this would be absolutely perfect. I can't really think of anything else that would make it better.

jarvisteach added a commit that referenced this issue Sep 3, 2017

Fixed toggleFrame #243 Settings investigation #236
ToggleFrames only toggle once on stop.

New function to start building list of properties

@jarvisteach jarvisteach added this to the 0.09 milestone Sep 5, 2017

@jarvisteach

This comment has been minimized.

Copy link
Owner

jarvisteach commented Oct 14, 2017

As mentioned in #265 - settings should be stored in a platform specific config location.

@jarvisteach jarvisteach added new feature and removed question labels Oct 14, 2017

@jarvisteach jarvisteach changed the title .getLocation(), .getGeometry(), .getFullscreen() not a thing! Functions to get, load, save GUI settings Oct 15, 2017

jarvisteach added a commit that referenced this issue Oct 16, 2017

More work on loading/saving settings #236
Two functions:
* loadSettings() - will read config settings from file and apply them
* saveSettings() will save the settings to a configFile
@jarvisteach

This comment has been minimized.

Copy link
Owner

jarvisteach commented Oct 16, 2017

Basic concept working. Now need to build it in.

  • Command line parameter - to load a config file
  • Constructor call to load and (auto) save config file
  • stop function will need to check if is saving
  • function to set config file name/location

Need to standardise code:

  • refactor language config file and settings config file into one thing, and merge functions
  • Make the loaded config file a global variable, the user can then set fields, and when they call save - choose to update or keep originals

Generic fields:

  • Add functions to get/set generic fields

jarvisteach added a commit that referenced this issue Oct 17, 2017

Settings Updates #236
Can now have appJar use settings files automatically:
* constructor has useSettings flag
* command line argument for useSettings & optional fileName
* go() then uses a settings file
* stop() will save to the settings file

This required a change to how geom was handled - didn’t deal well with
a full geom string

Also, included fix for googleMaps #275

Also, tweaked grid entry boxes, so they are header cells #266

jarvisteach added a commit that referenced this issue Oct 17, 2017

jarvisteach added a commit that referenced this issue Oct 18, 2017

Fixed bug in load settings #236
CENTER was overriding positioning…
@jarvisteach

This comment has been minimized.

Copy link
Owner

jarvisteach commented Oct 18, 2017

When settings are saved - if a new window size has been set, it will be loaded and set as the minimum - we need to save the minimum and use that instead...

jarvisteach added a commit that referenced this issue Oct 18, 2017

Resolved midsize issue #236
Now loads/saves a minsize
Also applied toolbar pinning - although,it now enables pinning even
when not enabled…

jarvisteach added a commit that referenced this issue Oct 19, 2017

get/set Settings #236
New functions to get & set settings from the settings file. Also,
updated toolbar setting - only runs when toolbar is present now

Updated logging function to mention *args due to issue #273

jarvisteach added a commit that referenced this issue Oct 19, 2017

Updated docs #236
Updated docs.

Also, command line flag is -s

jarvisteach added a commit that referenced this issue Oct 21, 2017

Fixed geom issues #236
Setting geom can now affect centering

Also added fix for empty rows #279

jarvisteach added a commit that referenced this issue Oct 24, 2017

Fixed issues with saving subWindow settings
When saving settings, if a subWindow hadn’t been shown, but its
settings were saved - it was given a size of 1x1 subWindows are now
only saved if they’ve been shown… #236

jarvisteach added a commit that referenced this issue Oct 24, 2017

SubWindow tweaks #278
Setting `startWindow` now overrides any settings. #236

Changed the way stopFunctions work on SubWindows - hideSubWindow now
hides it straight away, doesn’t check the stopFunction. But this can be
overridden.

jarvisteach added a commit that referenced this issue Oct 26, 2017

Work on settings and positioning
#208 - working towards having subWindows follow parents

#236 - updated so that it works better

jarvisteach added a commit that referenced this issue Oct 26, 2017

Updated resizing
#208 - working towards having subWindows follow parents

#236 - updated so that it works better

jarvisteach added a commit that referenced this issue Nov 5, 2017

Updates to saveSettings
More settings on subWindows #208 & #236

jarvisteach pushed a commit that referenced this issue Nov 26, 2017

Richard Jarvis

@jarvisteach jarvisteach modified the milestones: 0.90, 1.0 Dec 10, 2017

jarvisteach added a commit that referenced this issue Dec 11, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment