X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fmainwindow.cpp;h=ddaeeda977c5ba8ad42769179fd084fa78d889c0;hp=317f3c9a701383793d869f5fda7e6a8aee42eea4;hb=0fbda3c2dda9357776afa15e99c037eb0cc97214;hpb=02412f0b16cb5ad92654c92b472a84268e79bb54 diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 317f3c9a..ddaeeda9 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -41,6 +41,7 @@ #include "devicemanager.h" #include "dialogs/about.h" #include "dialogs/connect.h" +#include "dialogs/storeprogress.h" #include "toolbars/samplingbar.h" #include "view/logicsignal.h" #include "view/view.h" @@ -120,6 +121,14 @@ void MainWindow::setup_ui() action_open->setObjectName(QString::fromUtf8("actionOpen")); menu_file->addAction(action_open); + QAction *const action_save_as = new QAction(this); + action_save_as->setText(QApplication::translate( + "MainWindow", "&Save As...", 0, QApplication::UnicodeUTF8)); + action_save_as->setIcon(QIcon::fromTheme("document-save-as", + QIcon(":/icons/document-save-as.png"))); + action_save_as->setObjectName(QString::fromUtf8("actionSaveAs")); + menu_file->addAction(action_save_as); + menu_file->addSeparator(); QAction *const action_connect = new QAction(this); @@ -328,6 +337,24 @@ void MainWindow::on_actionOpen_triggered() load_file(file_name); } +void MainWindow::on_actionSaveAs_triggered() +{ + using pv::dialogs::StoreProgress; + + // Stop any currently running capture session + _session.stop_capture(); + + // Show the dialog + const QString file_name = QFileDialog::getSaveFileName( + this, tr("Save File"), "", tr("Sigrok Sessions (*.sr)")); + + if (file_name.isEmpty()) + return; + + StoreProgress *dlg = new StoreProgress(file_name, _session, this); + dlg->run(); +} + void MainWindow::on_actionConnect_triggered() { // Stop any currently running capture session