X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=pv%2Fmainwindow.cpp;h=77e77a19728f669539c02b22d36486e09bf93031;hb=5117748b6bac221e881347cfd29d5e9164bccd9f;hp=fcc929e988c12d8f1755be8b436c1b348b77447f;hpb=f69ec72d3cead13847045ca9cdf15d503f69e370;p=pulseview.git diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index fcc929e9..77e77a19 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -123,6 +123,7 @@ void MainWindow::setup_ui() "MainWindow", "&Open...", 0, QApplication::UnicodeUTF8)); action_open->setIcon(QIcon::fromTheme("document-open", QIcon(":/icons/document-open.png"))); + action_open->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_O)); action_open->setObjectName(QString::fromUtf8("actionOpen")); menu_file->addAction(action_open); @@ -131,6 +132,7 @@ void MainWindow::setup_ui() "MainWindow", "&Save As...", 0, QApplication::UnicodeUTF8)); action_save_as->setIcon(QIcon::fromTheme("document-save-as", QIcon(":/icons/document-save-as.png"))); + action_save_as->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_S)); action_save_as->setObjectName(QString::fromUtf8("actionSaveAs")); menu_file->addAction(action_save_as); @@ -299,11 +301,9 @@ void MainWindow::update_device_list() if (std::find(devices.begin(), devices.end(), selected_device) == devices.end()) devices.push_back(selected_device); + assert(selected_device); - _sampling_bar->set_device_list(devices); - - if (selected_device) - _sampling_bar->set_selected_device(selected_device); + _sampling_bar->set_device_list(devices, selected_device); } void MainWindow::load_file(QString file_name) @@ -316,6 +316,9 @@ void MainWindow::load_file(QString file_name) _session.set_file(file_name.toStdString()); } catch(QString e) { show_session_error(tr("Failed to load ") + file_name, e); + _session.set_default_device(); + update_device_list(); + return; } update_device_list();