]> sigrok.org Git - pulseview.git/blobdiff - pv/mainwindow.cpp
Added Ctrl-Q and Ctrl-W shortcuts.
[pulseview.git] / pv / mainwindow.cpp
index ddc2c8f0435c798039ab369830a3368c148a23dc..662d68af2f29bdba5ceff5f68931855d18708026 100644 (file)
@@ -401,6 +401,11 @@ void MainWindow::setup_ui()
        session_selector_.setCornerWidget(static_tab_widget_, Qt::TopLeftCorner);
        session_selector_.setTabsClosable(true);
 
        session_selector_.setCornerWidget(static_tab_widget_, Qt::TopLeftCorner);
        session_selector_.setTabsClosable(true);
 
+       close_application_shortcut_ = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this, SLOT(close()));
+       close_application_shortcut_->setAutoRepeat(false);
+
+       close_current_tab_shortcut_ = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this, SLOT(on_close_current_tab()));
+
        connect(new_session_button_, SIGNAL(clicked(bool)),
                this, SLOT(on_new_session_clicked()));
        connect(run_stop_button_, SIGNAL(clicked(bool)),
        connect(new_session_button_, SIGNAL(clicked(bool)),
                this, SLOT(on_new_session_clicked()));
        connect(run_stop_button_, SIGNAL(clicked(bool)),
@@ -742,4 +747,11 @@ void MainWindow::on_actionAbout_triggered()
        dlg.exec();
 }
 
        dlg.exec();
 }
 
+void MainWindow::on_close_current_tab()
+{
+       int tab = session_selector_.currentIndex();
+
+       on_tab_close_requested(tab);
+}
+
 } // namespace pv
 } // namespace pv