-
Notifications
You must be signed in to change notification settings - Fork 2
(issue 165) remember size of main window and internal components #191
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
(issue 165) remember size of main window and internal components #191
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forget about get_widgets_with_state_to_restore. To implement it, you would need too keep track of the widgets in instance variables within the __init__
method, so directly storing them in the dict like you do now is better.
larray_editor/comparator.py
Outdated
@@ -263,13 +263,20 @@ def _setup_and_check(self, widget, data, title, readonly, **kwargs): | |||
main_splitter.addWidget(comparatorwidget) | |||
main_splitter.setSizes([5, 95]) | |||
main_splitter.setCollapsible(1, False) | |||
self.widget_state_settings['{}_main_splitter'.format(self.name)] = main_splitter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't it be cleaner if you didn't use self.name in the dict keys (but added it in save_widgets_state_and_geometry and restore_widgets_state_and_geometry)?
One more thing: remember most of (all in this case) my review comments are suggestions of how I think we could do better. You are free to disagree that it is actually better (and don't need to explain why). |
In one of your previous comment:
I am not sure of how to implement the "get_widgets_with_state_to_restore()" method? |
As I said above, forget about it. I meant the manual subclass override but what you have now is simpler anyway. |
OK to merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohhh, shit! Another one of my review comments I wrote several weeks ago and forgot to submit... Sorry.
larray_editor/editor.py
Outdated
def save_widgets_state_and_geometry(self): | ||
settings = QSettings() | ||
settings.beginGroup(self.settings_group_name) | ||
settings.setValue('geometry/{}'.format(self.name), self.saveGeometry()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't using self.name redundant now that you are using beginGroup(self.settings_group_name)? (and it causes the resulting string to mix technical/lowercase strings with "user friendly" strings).
LGTM (modulo history cleanup of course), nice work! |
…ompare() function as in the edit() function
05c5fbf
to
c8e2330
Compare
No description provided.