X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fmainwindow.cpp;h=6b3398f22d9a40c7bb8266b24a37e29972fe3bef;hb=2a2512b21581ea346fea7d96bd3deeb37f1cfed4;hp=dcbaf1812ab268765e626d69f5c280042c6ff65e;hpb=dc0867ff7ec693953afb62f9512ad7dd3339a2b2;p=pulseview.git diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index dcbaf181..6b3398f2 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -19,7 +19,7 @@ */ #ifdef ENABLE_SIGROKDECODE -#include +#include #endif #include @@ -41,6 +41,7 @@ #include "devicemanager.h" #include "dialogs/about.h" #include "dialogs/connect.h" +#include "toolbars/contextbar.h" #include "toolbars/samplingbar.h" #include "view/view.h" @@ -204,6 +205,11 @@ void MainWindow::setup_ui() SLOT(run_stop())); addToolBar(_sampling_bar); + // Setup the context bar + _context_bar = new toolbars::ContextBar(this); + addToolBar(_context_bar); + insertToolBarBreak(_context_bar); + // Set the title setWindowTitle(QApplication::translate("MainWindow", "PulseView", 0, QApplication::UnicodeUTF8)); @@ -269,15 +275,22 @@ void MainWindow::show_session_error( void MainWindow::on_actionOpen_triggered() { + // Enumerate the file formats + QString filters(tr("Sigrok Sessions (*.sr)")); + filters.append(tr(";;All Files (*.*)")); + + // Show the dialog const QString file_name = QFileDialog::getOpenFileName( - this, tr("Open File"), "", - tr("Sigrok Sessions (*.sr)")); + this, tr("Open File"), "", filters); if (!file_name.isEmpty()) load_file(file_name); } void MainWindow::on_actionConnect_triggered() { + // Stop any currently running capture session + _session.stop_capture(); + dialogs::Connect dlg(this, _device_manager); // If the user selected a device, select it in the device list. Select the