diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2021-04-09 21:51:42 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2021-04-10 14:15:35 -0700 |
commit | 4daf6878768fabb2db15fae4e202aacc47676dee (patch) | |
tree | 9921ac704c9275d24a74c932be69733ed8ad56a0 /desktop-widgets/mainwindow.h | |
parent | 11c54b85f6f6c567e5a9f6e6e537eace49ee6666 (diff) | |
download | subsurface-4daf6878768fabb2db15fae4e202aacc47676dee.tar.gz |
profile: remove [disable|enable]Shortcuts() signals
When switching to the "plan" or "add" (which should rather be
called "edit", by the way) mode of the profile, the "shortcuts"
for copy&paste, undo&redo, etc. are disabled. When switching
to "profile" mode, they are reenabled.
This was done in a most convoluted way:
- The MainWindow calls the set*State() function of the profile.
- The Profile emits [disable|enable]Shortcuts() signals.
- The MainWindow catches these signals and does the enabling
or disabling.
Not only is this very hard to reason about, it is also in
contradiction to the profile being part of the display layer.
Moreover, in editCurrentDive() the MainWindow disabled the
shortcuts itself, so this was all redundant.
For the sake of sanity, let's just move this logic to the
MainWindow, unslotify the [disable|enable]Shortcuts() functions
and make them private.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/mainwindow.h')
-rw-r--r-- | desktop-widgets/mainwindow.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/desktop-widgets/mainwindow.h b/desktop-widgets/mainwindow.h index 4b28c0a9e..18fc5c577 100644 --- a/desktop-widgets/mainwindow.h +++ b/desktop-widgets/mainwindow.h @@ -164,8 +164,6 @@ slots: void setEnabledToolbar(bool arg1); // Some shortcuts like "change DC" or "copy/paste dive components" // should only be enabled when the profile's visible. - void disableShortcuts(bool disablePaste = true); - void enableShortcuts(); void startDiveSiteEdit(); private: @@ -237,6 +235,8 @@ private: void setQuadrantWidget(QSplitter &splitter, const Quadrant &q, int pos); void setQuadrantWidgets(QSplitter &splitter, const Quadrant &left, const Quadrant &right); void registerApplicationState(ApplicationState state, Quadrants q); + void disableShortcuts(bool disablePaste = true); + void enableShortcuts(); QMenu *connections; QAction *share_on_fb; |