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

Previous view present for first-time load #101

Open
pshriwise opened this issue Jul 18, 2022 · 0 comments
Open

Previous view present for first-time load #101

pshriwise opened this issue Jul 18, 2022 · 0 comments

Comments

@pshriwise
Copy link
Collaborator

In #99 @kkiesling noted that a previous view appears in the Editmenu before any changes have been applied by the user.

The flow which causes this is:

  1. Model is loaded when initializing MainWindow
  2. PlotIndependent.masking is set to True for the initial current and active view.
  3. The GUI continues loading in MainWindow.loadGui and MainWindow.updateEditMenu is called
  4. (The crux) MainWindow.updateEditMenu calls the setChecked method of the masking check box to ensure it's state matches that of the view. If this call changes the state of that check box, then the callback method is going to trigger an applyChanges call and create a new view.

It seems to me that the default value of the masking check box in the color dialog doesn't match the view setting and results in the creation of a new view.

I verified this by adding this line in MainWindow.createMenuBar

self.maskingAction.setChecked(True)

before the item is connected to its callback method. This removed the superfluous previous view.

Because this mismatch in default value vs. widget state is subtle and likely to occur again, it might be good to consider a setting on the MainWindow class that disables the generation of new views until the GUI has finished loading.

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

No branches or pull requests

1 participant