From d34965135a3b3f8fd887bb1d2a6083fb2f181fb0 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 3 Feb 2015 07:30:08 -0800 Subject: Disable dive component copy/paste shortcuts when no profile show Instead of inventing another way to do this (and inevitably forgetting a path where this should be re-enabled) I renamed the DcShortcup related function and made them enable/disable the copy and paste shortcuts as well. Of course there now is one exception (isn't there always?): in "ADD" state we don't want to be able to switch DCs, but we do want to be able to paste. Fixes #825 Signed-off-by: Dirk Hohndel --- qt-ui/profile/profilewidget2.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'qt-ui/profile') diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index ab16146e8..f04d16b3f 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -916,7 +916,7 @@ void ProfileWidget2::setProfileState() /* show the same stuff that the profile shows. */ //TODO: Move the DC handling to another method. - MainWindow::instance()->enableDcShortcuts(); + MainWindow::instance()->enableShortcuts(); currentState = PROFILE; MainWindow::instance()->setEnabledToolbar(true); @@ -1061,7 +1061,7 @@ void ProfileWidget2::setAddState() mouseFollowerVertical->setLine(QLineF(0, profileYAxis->pos().y(), 0, timeAxis->pos().y())); disconnectTemporaryConnections(); //TODO: Move this method to another place, shouldn't be on mainwindow. - MainWindow::instance()->disableDcShortcuts(); + MainWindow::instance()->disableShortcuts(false); actionsForKeys[Qt::Key_Left]->setShortcut(Qt::Key_Left); actionsForKeys[Qt::Key_Right]->setShortcut(Qt::Key_Right); actionsForKeys[Qt::Key_Up]->setShortcut(Qt::Key_Up); @@ -1094,7 +1094,7 @@ void ProfileWidget2::setPlanState() mouseFollowerVertical->setLine(QLineF(0, profileYAxis->pos().y(), 0, timeAxis->pos().y())); disconnectTemporaryConnections(); //TODO: Move this method to another place, shouldn't be on mainwindow. - MainWindow::instance()->disableDcShortcuts(); + MainWindow::instance()->disableShortcuts(); actionsForKeys[Qt::Key_Left]->setShortcut(Qt::Key_Left); actionsForKeys[Qt::Key_Right]->setShortcut(Qt::Key_Right); actionsForKeys[Qt::Key_Up]->setShortcut(Qt::Key_Up); -- cgit v1.2.3-70-g09d2