summaryrefslogtreecommitdiffstats
path: root/profile-widget
diff options
context:
space:
mode:
Diffstat (limited to 'profile-widget')
-rw-r--r--profile-widget/profilewidget2.cpp9
-rw-r--r--profile-widget/profilewidget2.h2
2 files changed, 5 insertions, 6 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index 178183d2e..046095465 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -976,8 +976,7 @@ void ProfileWidget2::setProfileState()
connect(DivePictureModel::instance(), SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SLOT(plotPictures()));
/* show the same stuff that the profile shows. */
- //TODO: Move the DC handling to another method.
- MainWindow::instance()->enableShortcuts();
+ emit enableShortcuts();
currentState = PROFILE;
emit enableToolbar(true);
@@ -1124,8 +1123,7 @@ void ProfileWidget2::setAddState()
mouseFollowerHorizontal->setLine(timeAxis->line());
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()->disableShortcuts(false);
+ emit 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);
@@ -1158,8 +1156,7 @@ void ProfileWidget2::setPlanState()
mouseFollowerHorizontal->setLine(timeAxis->line());
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()->disableShortcuts();
+ emit disableShortcuts(true);
actionsForKeys[Qt::Key_Left]->setShortcut(Qt::Key_Left);
actionsForKeys[Qt::Key_Right]->setShortcut(Qt::Key_Right);
actionsForKeys[Qt::Key_Up]->setShortcut(Qt::Key_Up);
diff --git a/profile-widget/profilewidget2.h b/profile-widget/profilewidget2.h
index 8ac34f625..c102bbcf3 100644
--- a/profile-widget/profilewidget2.h
+++ b/profile-widget/profilewidget2.h
@@ -90,6 +90,8 @@ signals:
void fontPrintScaleChanged(double scale);
void enableToolbar(bool enable);
void showError();
+ void enableShortcuts();
+ void disableShortcuts(bool paste);
public
slots: // Necessary to call from QAction's signals.