]> sigrok.org Git - pulseview.git/blobdiff - pv/toolbars/mainbar.cpp
Session: Fix issue #67 by improving error handling
[pulseview.git] / pv / toolbars / mainbar.cpp
index b35e14661373d88325eb4a28c1d73a580d587e4f..cd46c063bdc8a84d78d1e42e1c616c2fc8a3b270 100644 (file)
@@ -130,7 +130,11 @@ MainBar::MainBar(Session &session, QWidget *parent, pv::views::trace::View *view
        action_open_->setText(tr("&Open..."));
        action_open_->setIcon(QIcon::fromTheme("document-open",
                QIcon(":/icons/document-open.png")));
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+       action_open_->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_O));
+#else
        action_open_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_O));
+#endif
        connect(action_open_, SIGNAL(triggered(bool)),
                this, SLOT(on_actionOpen_triggered()));
 
@@ -141,7 +145,11 @@ MainBar::MainBar(Session &session, QWidget *parent, pv::views::trace::View *view
        action_save_->setText(tr("&Save..."));
        action_save_->setIcon(QIcon::fromTheme("document-save-as",
                QIcon(":/icons/document-save-as.png")));
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+       action_save_->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_S));
+#else
        action_save_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_S));
+#endif
        connect(action_save_, SIGNAL(triggered(bool)),
                this, SLOT(on_actionSave_triggered()));
 
@@ -154,7 +162,11 @@ MainBar::MainBar(Session &session, QWidget *parent, pv::views::trace::View *view
        action_save_selection_as_->setText(tr("Save Selected &Range As..."));
        action_save_selection_as_->setIcon(QIcon::fromTheme("document-save-as",
                QIcon(":/icons/document-save-as.png")));
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+       action_save_selection_as_->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_R));
+#else
        action_save_selection_as_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_R));
+#endif
        connect(action_save_selection_as_, SIGNAL(triggered(bool)),
                this, SLOT(on_actionSaveSelectionAs_triggered()));
 
@@ -548,7 +560,7 @@ void MainBar::update_device_config_widgets()
                sample_count_supported_ = true;
 
        // Add notification of reconfigure events
-       disconnect(this, SLOT(on_config_changed()));
+       // Note: No need to disconnect the previous signal as that QObject instance is destroyed
        connect(&opts->binding(), SIGNAL(config_changed()),
                this, SLOT(on_config_changed()));