-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #726 from mantidproject/705_option_to_lock_histogr…
…ams_in_compare Adds Lock Histogram button and functionality
- Loading branch information
Showing
10 changed files
with
160 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright (C) 2020 ISIS Rutherford Appleton Laboratory UKRI | ||
# SPDX - License - Identifier: GPL-3.0-or-later | ||
|
||
from mantidimaging.gui.mvp_base.presenter import BasePresenter | ||
from mantidimaging.gui.windows.stack_choice.view import Notification | ||
|
||
|
||
class StackChoicePresenterMixin(BasePresenter): | ||
""" | ||
Implements common functions for StackChoice and StackCompare, but does | ||
not do enough on it's own for a successful view initialisation - it needs | ||
to be mixed into another presenter that extends it | ||
""" | ||
def notify(self, signal: Notification): | ||
if signal == Notification.TOGGLE_LOCK_HISTOGRAMS: | ||
self.do_toggle_lock_histograms() | ||
|
||
def do_toggle_lock_histograms(self): | ||
# The state of the button changes before this signal is triggered | ||
# so on first click you get isChecked = True | ||
histograms_should_lock = self.view.lockHistograms.isChecked() | ||
|
||
if histograms_should_lock: | ||
self.view.connect_histogram_changes() | ||
else: | ||
self.view.disconnect_histogram_changes() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters