X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fmainwindow.cpp;h=662d68af2f29bdba5ceff5f68931855d18708026;hp=1821ad1e67a69276bd3e6b04c607df0e2c1f121f;hb=763945bb95fb3f5871d8b8241c8d9db2f0f66d4c;hpb=a2b9ac403cb540b5c6499d00d3d376384ec6c94f diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 1821ad1e..662d68af 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include "mainwindow.hpp" @@ -81,6 +82,7 @@ MainWindow::MainWindow(DeviceManager &device_manager, icon_grey_(":/icons/status-grey.svg") { qRegisterMetaType("util::Timestamp"); + qRegisterMetaType("uint64_t"); setup_ui(); restore_ui_settings(); @@ -369,9 +371,11 @@ void MainWindow::setup_ui() run_stop_button_ = new QToolButton(); run_stop_button_->setAutoRaise(true); run_stop_button_->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); - run_stop_button_->setShortcut(QKeySequence(Qt::Key_Space)); run_stop_button_->setToolTip(tr("Start/Stop Acquisition")); + run_stop_shortcut_ = new QShortcut(QKeySequence(Qt::Key_Space), run_stop_button_, SLOT(click())); + run_stop_shortcut_->setAutoRepeat(false); + settings_button_ = new QToolButton(); settings_button_->setIcon(QIcon::fromTheme("configure", QIcon(":/icons/configure.png"))); @@ -397,6 +401,11 @@ void MainWindow::setup_ui() 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)), @@ -738,4 +747,11 @@ void MainWindow::on_actionAbout_triggered() dlg.exec(); } +void MainWindow::on_close_current_tab() +{ + int tab = session_selector_.currentIndex(); + + on_tab_close_requested(tab); +} + } // namespace pv