clj-ns-browser
clj-ns-browser copied to clipboard
Save and restore some GUI settings across sessions
Examples of what I'd like to see saved and restored across sessions:
- Window size and position
- Font, color coding
- vars-cbx choice
- doc-cbx choice
- Choices of Vars menu, items "Categorized Listing" "Search Docs Also" and "FQN Listing" if and when it is implemented.
- Choice of Clojuredocs Online/Offline
- Probably a few other things, too.
For debugging and working around bugs, should have an option to start up a browser without reading these saved settings, but I think reading and restoring these settings should be the default.
Some settings are currently shared by all browser windows, if more than one has been opened, while others are specific to each window. I'll try to divide them up here, for reference:
Shared by all browser windows:
- Choices of Vars menu, items "Categorized Listing", "FQN Listing", and "Search Docs Also"
- Choice of Clojuredocs Online/Offline
- Auto refresh on/off
Specific to each browser window:
- Window size and position
- Zoom, Font, Color coding on/off
- vars-cbx choice
- doc-cbx choice
I'm not sure what should be saved about per-window settings if more than one window is opened. One possibility is to save that info about every open browser window, and restore all of the windows if sdoc is called in a new REPL session.
I think I'll start with saving and restoring settings shared by all windows.
I've committed changes that save & restore these settings in a dot file in the user's home directory, written whenever they change one of the settings:
Shared by all browser windows:
- Choices of Vars menu, items "Categorized Listing", "FQN Listing", and "Search Docs Also"
- Choice of Clojuredocs Online/Offline
I consider the next nicest one to have as a user would be the window size and position. This can be the size and position of just the first window opened, if that simplifies the implementation.