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

Maintain checked state after refresh #196

Open
mottosso opened this issue May 9, 2016 · 2 comments
Open

Maintain checked state after refresh #196

mottosso opened this issue May 9, 2016 · 2 comments

Comments

@mottosso
Copy link
Member

mottosso commented May 9, 2016

Goal

When pressing reset, the state of checkboxes reverts to their defaults. That's annoying, and it would be better if they "remembered" their state across resets and sessions.

Implementation

During reset, store the state of each check and re-apply it when done. This can be entirely in-memory, within the same function in fact.

def reset(self):
  #1. store check state
  #2. reset models
  #3. fetch data
  #4. populate models
  #5. apply check state
@tokejepsen
Copy link
Member

What do you mean by a "session"?

@mottosso
Copy link
Member Author

mottosso commented May 9, 2016

Showing QML from another host would open a new session. I'd like check state to be remembered when you later come back to the previous host.

As an implementation tip on that, you can use on_client_changed call to determine who is connecting and then store the state relative the connecting port.

def on_client_changed(self, port):
  self.state[port] = {"checkState": "here"}
  ...

This is also where we'd remember window position and size per host, but that's another issue and another time.

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

No branches or pull requests

2 participants