2 * This file is part of the PulseView project.
4 * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 #include <libsigrokdecode/libsigrokdecode.h>
30 #include <boost/algorithm/string/join.hpp>
33 #include <QApplication>
34 #include <QButtonGroup>
35 #include <QCloseEvent>
36 #include <QFileDialog>
37 #include <QMessageBox>
42 #include <QVBoxLayout>
45 #include "mainwindow.hpp"
47 #include "devicemanager.hpp"
49 #include "data/segment.hpp"
50 #include "devices/hardwaredevice.hpp"
51 #include "devices/inputfile.hpp"
52 #include "devices/sessionfile.hpp"
53 #include "dialogs/about.hpp"
54 #include "dialogs/connect.hpp"
55 #include "dialogs/inputoutputoptions.hpp"
56 #include "dialogs/storeprogress.hpp"
57 #include "toolbars/mainbar.hpp"
58 #include "view/logicsignal.hpp"
59 #include "view/view.hpp"
60 #include "widgets/exportmenu.hpp"
61 #include "widgets/importmenu.hpp"
63 #include "widgets/decodermenu.hpp"
65 #include "widgets/hidingmenubar.hpp"
71 #include <libsigrokcxx/libsigrokcxx.hpp>
78 using std::shared_ptr;
82 using boost::algorithm::join;
85 using sigrok::OutputFormat;
86 using sigrok::InputFormat;
94 const char *MainWindow::SettingOpenDirectory = "MainWindow/OpenDirectory";
95 const char *MainWindow::SettingSaveDirectory = "MainWindow/SaveDirectory";
97 MainWindow::MainWindow(DeviceManager &device_manager,
98 string open_file_name, string open_file_format,
101 device_manager_(device_manager),
102 session_(device_manager),
103 action_open_(new QAction(this)),
104 action_save_as_(new QAction(this)),
105 action_save_selection_as_(new QAction(this)),
106 action_connect_(new QAction(this)),
107 action_quit_(new QAction(this)),
108 action_view_zoom_in_(new QAction(this)),
109 action_view_zoom_out_(new QAction(this)),
110 action_view_zoom_fit_(new QAction(this)),
111 action_view_zoom_one_to_one_(new QAction(this)),
112 action_view_sticky_scrolling_(new QAction(this)),
113 action_view_show_cursors_(new QAction(this)),
114 action_about_(new QAction(this))
116 , menu_decoders_add_(new pv::widgets::DecoderMenu(this, true))
120 restore_ui_settings();
121 if (open_file_name.empty())
122 select_init_device();
124 load_init_file(open_file_name, open_file_format);
127 QAction* MainWindow::action_open() const
132 QAction* MainWindow::action_save_as() const
134 return action_save_as_;
137 QAction* MainWindow::action_save_selection_as() const
139 return action_save_selection_as_;
142 QAction* MainWindow::action_connect() const
144 return action_connect_;
147 QAction* MainWindow::action_quit() const
152 QAction* MainWindow::action_view_zoom_in() const
154 return action_view_zoom_in_;
157 QAction* MainWindow::action_view_zoom_out() const
159 return action_view_zoom_out_;
162 QAction* MainWindow::action_view_zoom_fit() const
164 return action_view_zoom_fit_;
167 QAction* MainWindow::action_view_zoom_one_to_one() const
169 return action_view_zoom_one_to_one_;
172 QAction* MainWindow::action_view_sticky_scrolling() const
174 return action_view_sticky_scrolling_;
177 QAction* MainWindow::action_view_show_cursors() const
179 return action_view_show_cursors_;
182 QAction* MainWindow::action_about() const
184 return action_about_;
188 QMenu* MainWindow::menu_decoder_add() const
190 return menu_decoders_add_;
194 void MainWindow::run_stop()
196 switch(session_.get_capture_state()) {
197 case Session::Stopped:
198 session_.start_capture([&](QString message) {
199 session_error("Capture failed", message); });
202 case Session::AwaitingTrigger:
203 case Session::Running:
204 session_.stop_capture();
209 void MainWindow::select_device(shared_ptr<devices::Device> device)
213 session_.set_device(device);
215 session_.set_default_device();
216 } catch(const QString &e) {
217 QMessageBox msg(this);
219 msg.setInformativeText(tr("Failed to Select Device"));
220 msg.setStandardButtons(QMessageBox::Ok);
221 msg.setIcon(QMessageBox::Warning);
226 void MainWindow::export_file(shared_ptr<OutputFormat> format)
228 using pv::dialogs::StoreProgress;
230 // Stop any currently running capture session
231 session_.stop_capture();
234 const QString dir = settings.value(SettingSaveDirectory).toString();
236 // Construct the filter
237 const vector<string> exts = format->extensions();
238 QString filter = tr("%1 files ").arg(
239 QString::fromStdString(format->description()));
244 filter += QString("(*.%1);;%2 (*.*)").arg(
245 QString::fromStdString(join(exts, ", *."))).arg(
248 // Show the file dialog
249 const QString file_name = QFileDialog::getSaveFileName(
250 this, tr("Save File"), dir, filter);
252 if (file_name.isEmpty())
255 const QString abs_path = QFileInfo(file_name).absolutePath();
256 settings.setValue(SettingSaveDirectory, abs_path);
258 // Show the options dialog
259 map<string, Glib::VariantBase> options;
260 if (!format->options().empty()) {
261 dialogs::InputOutputOptions dlg(
262 tr("Export %1").arg(QString::fromStdString(
263 format->description())),
264 format->options(), this);
267 options = dlg.options();
270 const std::pair<uint64_t, uint64_t> sample_range = std::make_pair(0, 0);
272 StoreProgress *dlg = new StoreProgress(file_name, format, options,
273 sample_range, session_, this);
277 void MainWindow::import_file(shared_ptr<InputFormat> format)
282 const QString dir = settings.value(SettingOpenDirectory).toString();
284 // Construct the filter
285 const vector<string> exts = format->extensions();
286 const QString filter = exts.empty() ? "" :
287 tr("%1 files (*.%2)").arg(
288 QString::fromStdString(format->description())).arg(
289 QString::fromStdString(join(exts, ", *.")));
291 // Show the file dialog
292 const QString file_name = QFileDialog::getOpenFileName(
293 this, tr("Import File"), dir, tr(
294 "%1 files (*.*);;All Files (*.*)").arg(
295 QString::fromStdString(format->description())));
297 if (file_name.isEmpty())
300 // Show the options dialog
301 map<string, Glib::VariantBase> options;
302 if (!format->options().empty()) {
303 dialogs::InputOutputOptions dlg(
304 tr("Import %1").arg(QString::fromStdString(
305 format->description())),
306 format->options(), this);
309 options = dlg.options();
312 load_file(file_name, format, options);
314 const QString abs_path = QFileInfo(file_name).absolutePath();
315 settings.setValue(SettingOpenDirectory, abs_path);
318 void MainWindow::setup_ui()
320 setObjectName(QString::fromUtf8("MainWindow"));
322 // Set the window icon
324 icon.addFile(QString(":/icons/sigrok-logo-notext.svg"));
327 // Setup the central widget
328 central_widget_ = new QWidget(this);
329 vertical_layout_ = new QVBoxLayout(central_widget_);
330 vertical_layout_->setSpacing(6);
331 vertical_layout_->setContentsMargins(0, 0, 0, 0);
332 setCentralWidget(central_widget_);
334 view_ = new pv::view::View(session_, this);
336 vertical_layout_->addWidget(view_);
338 // Setup the menu bar
339 pv::widgets::HidingMenuBar *const menu_bar =
340 new pv::widgets::HidingMenuBar(this);
343 QMenu *const menu_file = new QMenu;
344 menu_file->setTitle(tr("&File"));
346 action_open_->setText(tr("&Open..."));
347 action_open_->setIcon(QIcon::fromTheme("document-open",
348 QIcon(":/icons/document-open.png")));
349 action_open_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_O));
350 action_open_->setObjectName(QString::fromUtf8("actionOpen"));
351 menu_file->addAction(action_open_);
353 action_save_as_->setText(tr("&Save As..."));
354 action_save_as_->setIcon(QIcon::fromTheme("document-save-as",
355 QIcon(":/icons/document-save-as.png")));
356 action_save_as_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_S));
357 action_save_as_->setObjectName(QString::fromUtf8("actionSaveAs"));
358 menu_file->addAction(action_save_as_);
360 action_save_selection_as_->setText(tr("Save Selected &Range As..."));
361 action_save_selection_as_->setIcon(QIcon::fromTheme("document-save-as",
362 QIcon(":/icons/document-save-as.png")));
363 action_save_selection_as_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_R));
364 action_save_selection_as_->setObjectName(QString::fromUtf8("actionSaveSelectionAs"));
365 menu_file->addAction(action_save_selection_as_);
367 menu_file->addSeparator();
369 widgets::ExportMenu *menu_file_export = new widgets::ExportMenu(this,
370 device_manager_.context());
371 menu_file_export->setTitle(tr("&Export"));
372 connect(menu_file_export,
373 SIGNAL(format_selected(std::shared_ptr<sigrok::OutputFormat>)),
374 this, SLOT(export_file(std::shared_ptr<sigrok::OutputFormat>)));
375 menu_file->addAction(menu_file_export->menuAction());
377 widgets::ImportMenu *menu_file_import = new widgets::ImportMenu(this,
378 device_manager_.context());
379 menu_file_import->setTitle(tr("&Import"));
380 connect(menu_file_import,
381 SIGNAL(format_selected(std::shared_ptr<sigrok::InputFormat>)),
382 this, SLOT(import_file(std::shared_ptr<sigrok::InputFormat>)));
383 menu_file->addAction(menu_file_import->menuAction());
385 menu_file->addSeparator();
387 action_connect_->setText(tr("&Connect to Device..."));
388 action_connect_->setObjectName(QString::fromUtf8("actionConnect"));
389 menu_file->addAction(action_connect_);
391 menu_file->addSeparator();
393 action_quit_->setText(tr("&Quit"));
394 action_quit_->setIcon(QIcon::fromTheme("application-exit",
395 QIcon(":/icons/application-exit.png")));
396 action_quit_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
397 action_quit_->setObjectName(QString::fromUtf8("actionQuit"));
398 menu_file->addAction(action_quit_);
401 QMenu *menu_view = new QMenu;
402 menu_view->setTitle(tr("&View"));
404 action_view_zoom_in_->setText(tr("Zoom &In"));
405 action_view_zoom_in_->setIcon(QIcon::fromTheme("zoom-in",
406 QIcon(":/icons/zoom-in.png")));
407 // simply using Qt::Key_Plus shows no + in the menu
408 action_view_zoom_in_->setShortcut(QKeySequence::ZoomIn);
409 action_view_zoom_in_->setObjectName(
410 QString::fromUtf8("actionViewZoomIn"));
411 menu_view->addAction(action_view_zoom_in_);
413 action_view_zoom_out_->setText(tr("Zoom &Out"));
414 action_view_zoom_out_->setIcon(QIcon::fromTheme("zoom-out",
415 QIcon(":/icons/zoom-out.png")));
416 action_view_zoom_out_->setShortcut(QKeySequence::ZoomOut);
417 action_view_zoom_out_->setObjectName(
418 QString::fromUtf8("actionViewZoomOut"));
419 menu_view->addAction(action_view_zoom_out_);
421 action_view_zoom_fit_->setCheckable(true);
422 action_view_zoom_fit_->setText(tr("Zoom to &Fit"));
423 action_view_zoom_fit_->setIcon(QIcon::fromTheme("zoom-fit",
424 QIcon(":/icons/zoom-fit.png")));
425 action_view_zoom_fit_->setShortcut(QKeySequence(Qt::Key_F));
426 action_view_zoom_fit_->setObjectName(
427 QString::fromUtf8("actionViewZoomFit"));
428 menu_view->addAction(action_view_zoom_fit_);
430 action_view_zoom_one_to_one_->setText(tr("Zoom to O&ne-to-One"));
431 action_view_zoom_one_to_one_->setIcon(QIcon::fromTheme("zoom-original",
432 QIcon(":/icons/zoom-original.png")));
433 action_view_zoom_one_to_one_->setShortcut(QKeySequence(Qt::Key_O));
434 action_view_zoom_one_to_one_->setObjectName(
435 QString::fromUtf8("actionViewZoomOneToOne"));
436 menu_view->addAction(action_view_zoom_one_to_one_);
438 menu_file->addSeparator();
440 action_view_sticky_scrolling_->setCheckable(true);
441 action_view_sticky_scrolling_->setChecked(true);
442 action_view_sticky_scrolling_->setShortcut(QKeySequence(Qt::Key_S));
443 action_view_sticky_scrolling_->setObjectName(
444 QString::fromUtf8("actionViewStickyScrolling"));
445 action_view_sticky_scrolling_->setText(tr("&Sticky Scrolling"));
446 menu_view->addAction(action_view_sticky_scrolling_);
448 view_->enable_sticky_scrolling(action_view_sticky_scrolling_->isChecked());
450 menu_view->addSeparator();
452 action_view_show_cursors_->setCheckable(true);
453 action_view_show_cursors_->setChecked(view_->cursors_shown());
454 action_view_show_cursors_->setIcon(QIcon::fromTheme("show-cursors",
455 QIcon(":/icons/show-cursors.svg")));
456 action_view_show_cursors_->setShortcut(QKeySequence(Qt::Key_C));
457 action_view_show_cursors_->setObjectName(
458 QString::fromUtf8("actionViewShowCursors"));
459 action_view_show_cursors_->setText(tr("Show &Cursors"));
460 menu_view->addAction(action_view_show_cursors_);
464 QMenu *const menu_decoders = new QMenu;
465 menu_decoders->setTitle(tr("&Decoders"));
467 menu_decoders_add_->setTitle(tr("&Add"));
468 connect(menu_decoders_add_, SIGNAL(decoder_selected(srd_decoder*)),
469 this, SLOT(add_decoder(srd_decoder*)));
471 menu_decoders->addMenu(menu_decoders_add_);
475 QMenu *const menu_help = new QMenu;
476 menu_help->setTitle(tr("&Help"));
478 action_about_->setObjectName(QString::fromUtf8("actionAbout"));
479 action_about_->setText(tr("&About..."));
480 menu_help->addAction(action_about_);
482 menu_bar->addAction(menu_file->menuAction());
483 menu_bar->addAction(menu_view->menuAction());
485 menu_bar->addAction(menu_decoders->menuAction());
487 menu_bar->addAction(menu_help->menuAction());
489 setMenuBar(menu_bar);
490 QMetaObject::connectSlotsByName(this);
492 // Also add all actions to the main window for always-enabled hotkeys
493 for (QAction* action : menu_bar->actions())
494 this->addAction(action);
497 main_bar_ = new toolbars::MainBar(session_, *this);
499 // Populate the device list and select the initially selected device
500 update_device_list();
502 addToolBar(main_bar_);
505 setWindowTitle(tr("PulseView"));
507 // Setup session_ events
508 connect(&session_, SIGNAL(capture_state_changed(int)), this,
509 SLOT(capture_state_changed(int)));
510 connect(&session_, SIGNAL(device_selected()), this,
511 SLOT(device_selected()));
513 // Setup view_ events
514 connect(view_, SIGNAL(sticky_scrolling_changed(bool)), this,
515 SLOT(sticky_scrolling_changed(bool)));
516 connect(view_, SIGNAL(always_zoom_to_fit_changed(bool)), this,
517 SLOT(always_zoom_to_fit_changed(bool)));
520 void MainWindow::select_init_device() {
522 map<string, string> dev_info;
523 list<string> key_list;
525 // Re-select last used device if possible.
526 settings.beginGroup("Device");
527 key_list.push_back("vendor");
528 key_list.push_back("model");
529 key_list.push_back("version");
530 key_list.push_back("serial_num");
531 key_list.push_back("connection_id");
533 for (string key : key_list) {
534 const QString k = QString::fromStdString(key);
535 if (!settings.contains(k))
538 const string value = settings.value(k).toString().toStdString();
540 dev_info.insert(std::make_pair(key, value));
543 const shared_ptr<devices::HardwareDevice> device =
544 device_manager_.find_device_from_info(dev_info);
545 select_device(device);
546 update_device_list();
551 void MainWindow::load_init_file(const std::string &file_name,
552 const std::string &format) {
553 shared_ptr<InputFormat> input_format;
555 if (!format.empty()) {
556 const map<string, shared_ptr<InputFormat> > formats =
557 device_manager_.context()->input_formats();
558 const auto iter = find_if(formats.begin(), formats.end(),
559 [&](const pair<string, shared_ptr<InputFormat> > f) {
560 return f.first == format; });
561 if (iter == formats.end()) {
562 cerr << "Unexpected input format: " << format << endl;
566 input_format = (*iter).second;
569 load_file(QString::fromStdString(file_name), input_format);
573 void MainWindow::save_ui_settings()
577 map<string, string> dev_info;
578 list<string> key_list;
580 settings.beginGroup("MainWindow");
581 settings.setValue("state", saveState());
582 settings.setValue("geometry", saveGeometry());
585 if (session_.device()) {
586 settings.beginGroup("Device");
587 key_list.push_back("vendor");
588 key_list.push_back("model");
589 key_list.push_back("version");
590 key_list.push_back("serial_num");
591 key_list.push_back("connection_id");
593 dev_info = device_manager_.get_device_info(
596 for (string key : key_list) {
598 if (dev_info.count(key))
599 settings.setValue(QString::fromUtf8(key.c_str()),
600 QString::fromUtf8(dev_info.at(key).c_str()));
602 settings.remove(QString::fromUtf8(key.c_str()));
609 void MainWindow::restore_ui_settings()
613 settings.beginGroup("MainWindow");
615 if (settings.contains("geometry")) {
616 restoreGeometry(settings.value("geometry").toByteArray());
617 restoreState(settings.value("state").toByteArray());
624 void MainWindow::session_error(
625 const QString text, const QString info_text)
627 QMetaObject::invokeMethod(this, "show_session_error",
628 Qt::QueuedConnection, Q_ARG(QString, text),
629 Q_ARG(QString, info_text));
632 void MainWindow::update_device_list()
634 main_bar_->update_device_list();
637 void MainWindow::load_file(QString file_name,
638 std::shared_ptr<sigrok::InputFormat> format,
639 const std::map<std::string, Glib::VariantBase> &options)
641 const QString errorMessage(
642 QString("Failed to load file %1").arg(file_name));
646 session_.set_device(shared_ptr<devices::Device>(
647 new devices::InputFile(
648 device_manager_.context(),
649 file_name.toStdString(),
652 session_.set_device(shared_ptr<devices::Device>(
653 new devices::SessionFile(
654 device_manager_.context(),
655 file_name.toStdString())));
657 show_session_error(tr("Failed to load ") + file_name, e.what());
658 session_.set_default_device();
659 update_device_list();
663 update_device_list();
665 session_.start_capture([&, errorMessage](QString infoMessage) {
666 session_error(errorMessage, infoMessage); });
669 void MainWindow::save_selection_to_file()
671 // Stop any currently running capture session
672 session_.stop_capture();
674 // Verify that the cursors are active and fetch their values
675 if (!view_->cursors()->enabled()) {
676 show_session_error(tr("Missing Cursors"), tr("You need to set the " \
677 "cursors before you can save the data enclosed by them " \
678 "to a session file (e.g. using ALT-V - Show Cursors)."));
682 const double samplerate = session_.get_samplerate();
684 const pv::util::Timestamp& start_time = view_->cursors()->first()->time();
685 const pv::util::Timestamp& end_time = view_->cursors()->second()->time();
687 const uint64_t start_sample = start_time.convert_to<double>() * samplerate;
688 const uint64_t end_sample = end_time.convert_to<double>() * samplerate;
690 const std::pair<uint64_t, uint64_t> sample_range =
691 std::make_pair(start_sample, end_sample);
693 // Ask for output file name
695 const QString dir = settings.value(SettingSaveDirectory).toString();
697 shared_ptr<OutputFormat> format =
698 device_manager_.context()->output_formats()["srzip"];
700 const vector<string> exts = format->extensions();
701 QString filter = tr("%1 files ").arg(
702 QString::fromStdString(format->description()));
707 filter += QString("(*.%1);;%2 (*.*)").arg(
708 QString::fromStdString(join(exts, ", *."))).arg(
711 const QString file_name = QFileDialog::getSaveFileName(
712 this, tr("Save File"), dir, filter);
714 if (file_name.isEmpty())
717 const QString abs_path = QFileInfo(file_name).absolutePath();
718 settings.setValue(SettingSaveDirectory, abs_path);
720 // Show the options dialog
721 map<string, Glib::VariantBase> options;
722 if (!format->options().empty()) {
723 dialogs::InputOutputOptions dlg(
724 tr("Export %1").arg(QString::fromStdString(
725 format->description())),
726 format->options(), this);
729 options = dlg.options();
733 pv::dialogs::StoreProgress *dlg = new pv::dialogs::StoreProgress(file_name,
734 format, options, sample_range, session_, this);
738 void MainWindow::closeEvent(QCloseEvent *event)
744 void MainWindow::keyReleaseEvent(QKeyEvent *event)
746 if (event->key() == Qt::Key_Alt) {
747 menuBar()->setHidden(!menuBar()->isHidden());
748 menuBar()->setFocus();
750 QMainWindow::keyReleaseEvent(event);
753 void MainWindow::show_session_error(
754 const QString text, const QString info_text)
756 QMessageBox msg(this);
758 msg.setInformativeText(info_text);
759 msg.setStandardButtons(QMessageBox::Ok);
760 msg.setIcon(QMessageBox::Warning);
764 void MainWindow::on_actionOpen_triggered()
767 const QString dir = settings.value(SettingOpenDirectory).toString();
770 const QString file_name = QFileDialog::getOpenFileName(
771 this, tr("Open File"), dir, tr(
772 "Sigrok Sessions (*.sr);;"
775 if (!file_name.isEmpty()) {
776 load_file(file_name);
778 const QString abs_path = QFileInfo(file_name).absolutePath();
779 settings.setValue(SettingOpenDirectory, abs_path);
783 void MainWindow::on_actionSaveAs_triggered()
785 export_file(device_manager_.context()->output_formats()["srzip"]);
788 void MainWindow::on_actionSaveSelectionAs_triggered()
790 save_selection_to_file();
793 void MainWindow::on_actionConnect_triggered()
795 // Stop any currently running capture session
796 session_.stop_capture();
798 dialogs::Connect dlg(this, device_manager_);
800 // If the user selected a device, select it in the device list. Select the
801 // current device otherwise.
803 select_device(dlg.get_selected_device());
805 update_device_list();
808 void MainWindow::on_actionQuit_triggered()
813 void MainWindow::on_actionViewZoomIn_triggered()
818 void MainWindow::on_actionViewZoomOut_triggered()
823 void MainWindow::on_actionViewZoomFit_triggered()
825 view_->zoom_fit(action_view_zoom_fit_->isChecked());
828 void MainWindow::on_actionViewZoomOneToOne_triggered()
830 view_->zoom_one_to_one();
833 void MainWindow::on_actionViewStickyScrolling_triggered()
835 view_->enable_sticky_scrolling(action_view_sticky_scrolling_->isChecked());
838 void MainWindow::on_actionViewShowCursors_triggered()
842 const bool show = !view_->cursors_shown();
844 view_->centre_cursors();
846 view_->show_cursors(show);
849 void MainWindow::on_actionAbout_triggered()
851 dialogs::About dlg(device_manager_.context(), this);
855 void MainWindow::sticky_scrolling_changed(bool state)
857 action_view_sticky_scrolling_->setChecked(state);
860 void MainWindow::always_zoom_to_fit_changed(bool state)
862 action_view_zoom_fit_->setChecked(state);
865 void MainWindow::add_decoder(srd_decoder *decoder)
869 session_.add_decoder(decoder);
875 void MainWindow::capture_state_changed(int state)
877 main_bar_->set_capture_state((pv::Session::capture_state)state);
880 void MainWindow::device_selected()
882 // Set the title to include the device/file name
883 const shared_ptr<devices::Device> device = session_.device();
887 const string display_name = device->display_name(device_manager_);
888 setWindowTitle(tr("%1 - PulseView").arg(display_name.c_str()));