X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fmainwindow.cpp;h=150c2fccfa348d9ba9aac48f73016abe2b4c5d96;hb=4166ed6c6648d1ed82cc48787aa717772a1e103f;hp=e2f29e34d133afed3cf765d6d8dd58cfdc6e67a5;hpb=f4c92e1c49680738bde7d5fa08153fa914ac2920;p=pulseview.git diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index e2f29e34..150c2fcc 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -18,7 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#ifdef ENABLE_SIGROKDECODE #include +#endif #include @@ -118,6 +120,7 @@ void MainWindow::setup_ui() "MainWindow", "&Quit", 0, QApplication::UnicodeUTF8)); _action_quit->setIcon(QIcon::fromTheme("application-exit", QIcon(":/icons/application-exit.png"))); + _action_quit->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); _action_quit->setObjectName(QString::fromUtf8("actionQuit")); _menu_file->addAction(_action_quit); @@ -149,6 +152,7 @@ void MainWindow::setup_ui() _action_view_show_cursors = new QAction(this); _action_view_show_cursors->setCheckable(true); _action_view_show_cursors->setChecked(_view->cursors_shown()); + _action_view_show_cursors->setShortcut(QKeySequence(Qt::Key_C)); _action_view_show_cursors->setObjectName( QString::fromUtf8("actionViewShowCursors")); _action_view_show_cursors->setText(QApplication::translate( @@ -284,7 +288,12 @@ void MainWindow::on_actionViewZoomOut_triggered() void MainWindow::on_actionViewShowCursors_triggered() { assert(_view); - _view->show_cursors(_action_view_show_cursors->isChecked()); + + const bool show = !_view->cursors_shown(); + if(show) + _view->centre_cursors(); + + _view->show_cursors(show); } void MainWindow::on_actionAbout_triggered()