Skip to content
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

PICARD-1175: save and restore CD Lookup dialog and headers states #826

Merged
merged 2 commits into from Feb 2, 2018

Conversation

zas
Copy link
Collaborator

@zas zas commented Feb 1, 2018

Summary

  • This is a…
    • Bug fix
    • Feature addition
    • Refactoring
    • Minor / simple change (like a typo)
    • Other
  • Describe this change in 1-2 sentences:

Save CD Lookup dialog size and header state to persist options, and restore them when needed.

Problem

Every time a CD lookup is done you have to scroll or make the resulting window larger to see all the information to distinguish releases, especially the catalog number and barcode (as the last columns). The barcode column often is cut off.
Picard should store and remember that window setting (and maybe auto-size the smaller columns).

Solution

Save CD Lookup dialog size and header state to persist options, and restore them when needed.

@zas zas changed the title PICARD-1175: save and restore dialog and headers states PICARD-1175: save and restore CD Lookup dialog and headers states Feb 1, 2018
self.save_state()
QtWidgets.QDialog.reject(self)

def restore_state(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why save_state saves both size and header state but restore state only restores size? We should maintain consistency in behavior or function name

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because restoring is a two-steps action, the size of dialog is restored just after it is created, but the header stuff is done after the header is actually created. I didn't dig if it is still needed, but all save/restore are made like this. I don't want to bother with that for now, i have ideas on how to make this much simpler (and with less code redundancy).

@zas zas merged commit a982bdc into metabrainz:master Feb 2, 2018
@zas zas deleted the cdlookup_states branch February 2, 2018 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants