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_coloured_bg_(new QAction(this)),
114 action_view_show_cursors_(new QAction(this)),
115 action_about_(new QAction(this))
117 , menu_decoders_add_(new pv::widgets::DecoderMenu(this, true))
120 qRegisterMetaType<util::Timestamp>("util::Timestamp");
123 restore_ui_settings();
124 if (open_file_name.empty())
125 select_init_device();
127 load_init_file(open_file_name, open_file_format);
130 QAction* MainWindow::action_open() const
135 QAction* MainWindow::action_save_as() const
137 return action_save_as_;
140 QAction* MainWindow::action_save_selection_as() const
142 return action_save_selection_as_;
145 QAction* MainWindow::action_connect() const
147 return action_connect_;
150 QAction* MainWindow::action_quit() const
155 QAction* MainWindow::action_view_zoom_in() const
157 return action_view_zoom_in_;
160 QAction* MainWindow::action_view_zoom_out() const
162 return action_view_zoom_out_;
165 QAction* MainWindow::action_view_zoom_fit() const
167 return action_view_zoom_fit_;
170 QAction* MainWindow::action_view_zoom_one_to_one() const
172 return action_view_zoom_one_to_one_;
175 QAction* MainWindow::action_view_sticky_scrolling() const
177 return action_view_sticky_scrolling_;
180 QAction* MainWindow::action_view_coloured_bg() const
182 return action_view_coloured_bg_;
185 QAction* MainWindow::action_view_show_cursors() const
187 return action_view_show_cursors_;
190 QAction* MainWindow::action_about() const
192 return action_about_;
196 QMenu* MainWindow::menu_decoder_add() const
198 return menu_decoders_add_;
202 void MainWindow::run_stop()
204 switch (session_.get_capture_state()) {
205 case Session::Stopped:
206 session_.start_capture([&](QString message) {
207 session_error("Capture failed", message); });
209 case Session::AwaitingTrigger:
210 case Session::Running:
211 session_.stop_capture();
216 void MainWindow::select_device(shared_ptr<devices::Device> device)
220 session_.set_device(device);
222 session_.set_default_device();
223 } catch (const QString &e) {
224 QMessageBox msg(this);
226 msg.setInformativeText(tr("Failed to Select Device"));
227 msg.setStandardButtons(QMessageBox::Ok);
228 msg.setIcon(QMessageBox::Warning);
233 void MainWindow::export_file(shared_ptr<OutputFormat> format,
236 using pv::dialogs::StoreProgress;
238 // Stop any currently running capture session
239 session_.stop_capture();
242 const QString dir = settings.value(SettingSaveDirectory).toString();
244 std::pair<uint64_t, uint64_t> sample_range;
246 // Selection only? Verify that the cursors are active and fetch their values
247 if (selection_only) {
248 if (!view_->cursors()->enabled()) {
249 show_session_error(tr("Missing Cursors"), tr("You need to set the " \
250 "cursors before you can save the data enclosed by them " \
251 "to a session file (e.g. using ALT-V - Show Cursors)."));
255 const double samplerate = session_.get_samplerate();
257 const pv::util::Timestamp& start_time = view_->cursors()->first()->time();
258 const pv::util::Timestamp& end_time = view_->cursors()->second()->time();
260 const uint64_t start_sample = start_time.convert_to<double>() * samplerate;
261 const uint64_t end_sample = end_time.convert_to<double>() * samplerate;
263 sample_range = std::make_pair(start_sample, end_sample);
265 sample_range = std::make_pair(0, 0);
268 // Construct the filter
269 const vector<string> exts = format->extensions();
270 QString filter = tr("%1 files ").arg(
271 QString::fromStdString(format->description()));
276 filter += QString("(*.%1);;%2 (*.*)").arg(
277 QString::fromStdString(join(exts, ", *."))).arg(
280 // Show the file dialog
281 const QString file_name = QFileDialog::getSaveFileName(
282 this, tr("Save File"), dir, filter);
284 if (file_name.isEmpty())
287 const QString abs_path = QFileInfo(file_name).absolutePath();
288 settings.setValue(SettingSaveDirectory, abs_path);
290 // Show the options dialog
291 map<string, Glib::VariantBase> options;
292 if (!format->options().empty()) {
293 dialogs::InputOutputOptions dlg(
294 tr("Export %1").arg(QString::fromStdString(
295 format->description())),
296 format->options(), this);
299 options = dlg.options();
302 StoreProgress *dlg = new StoreProgress(file_name, format, options,
303 sample_range, session_, this);
307 void MainWindow::import_file(shared_ptr<InputFormat> format)
312 const QString dir = settings.value(SettingOpenDirectory).toString();
314 // Construct the filter
315 const vector<string> exts = format->extensions();
316 const QString filter = exts.empty() ? "" :
317 tr("%1 files (*.%2)").arg(
318 QString::fromStdString(format->description())).arg(
319 QString::fromStdString(join(exts, ", *.")));
321 // Show the file dialog
322 const QString file_name = QFileDialog::getOpenFileName(
323 this, tr("Import File"), dir, tr(
324 "%1 files (*.*);;All Files (*.*)").arg(
325 QString::fromStdString(format->description())));
327 if (file_name.isEmpty())
330 // Show the options dialog
331 map<string, Glib::VariantBase> options;
332 if (!format->options().empty()) {
333 dialogs::InputOutputOptions dlg(
334 tr("Import %1").arg(QString::fromStdString(
335 format->description())),
336 format->options(), this);
339 options = dlg.options();
342 load_file(file_name, format, options);
344 const QString abs_path = QFileInfo(file_name).absolutePath();
345 settings.setValue(SettingOpenDirectory, abs_path);
348 void MainWindow::setup_ui()
350 setObjectName(QString::fromUtf8("MainWindow"));
352 // Set the window icon
354 icon.addFile(QString(":/icons/sigrok-logo-notext.svg"));
357 // Setup the central widget
358 central_widget_ = new QWidget(this);
359 vertical_layout_ = new QVBoxLayout(central_widget_);
360 vertical_layout_->setSpacing(6);
361 vertical_layout_->setContentsMargins(0, 0, 0, 0);
362 setCentralWidget(central_widget_);
364 view_ = new pv::view::View(session_, this);
366 vertical_layout_->addWidget(view_);
368 // Setup the menu bar
369 pv::widgets::HidingMenuBar *const menu_bar =
370 new pv::widgets::HidingMenuBar(this);
373 QMenu *const menu_file = new QMenu;
374 menu_file->setTitle(tr("&File"));
376 action_open_->setText(tr("&Open..."));
377 action_open_->setIcon(QIcon::fromTheme("document-open",
378 QIcon(":/icons/document-open.png")));
379 action_open_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_O));
380 action_open_->setObjectName(QString::fromUtf8("actionOpen"));
381 menu_file->addAction(action_open_);
383 action_save_as_->setText(tr("&Save As..."));
384 action_save_as_->setIcon(QIcon::fromTheme("document-save-as",
385 QIcon(":/icons/document-save-as.png")));
386 action_save_as_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_S));
387 action_save_as_->setObjectName(QString::fromUtf8("actionSaveAs"));
388 menu_file->addAction(action_save_as_);
390 action_save_selection_as_->setText(tr("Save Selected &Range As..."));
391 action_save_selection_as_->setIcon(QIcon::fromTheme("document-save-as",
392 QIcon(":/icons/document-save-as.png")));
393 action_save_selection_as_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_R));
394 action_save_selection_as_->setObjectName(QString::fromUtf8("actionSaveSelectionAs"));
395 menu_file->addAction(action_save_selection_as_);
397 menu_file->addSeparator();
399 widgets::ExportMenu *menu_file_export = new widgets::ExportMenu(this,
400 device_manager_.context());
401 menu_file_export->setTitle(tr("&Export"));
402 connect(menu_file_export,
403 SIGNAL(format_selected(std::shared_ptr<sigrok::OutputFormat>)),
404 this, SLOT(export_file(std::shared_ptr<sigrok::OutputFormat>)));
405 menu_file->addAction(menu_file_export->menuAction());
407 widgets::ImportMenu *menu_file_import = new widgets::ImportMenu(this,
408 device_manager_.context());
409 menu_file_import->setTitle(tr("&Import"));
410 connect(menu_file_import,
411 SIGNAL(format_selected(std::shared_ptr<sigrok::InputFormat>)),
412 this, SLOT(import_file(std::shared_ptr<sigrok::InputFormat>)));
413 menu_file->addAction(menu_file_import->menuAction());
415 menu_file->addSeparator();
417 action_connect_->setText(tr("&Connect to Device..."));
418 action_connect_->setObjectName(QString::fromUtf8("actionConnect"));
419 menu_file->addAction(action_connect_);
421 menu_file->addSeparator();
423 action_quit_->setText(tr("&Quit"));
424 action_quit_->setIcon(QIcon::fromTheme("application-exit",
425 QIcon(":/icons/application-exit.png")));
426 action_quit_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
427 action_quit_->setObjectName(QString::fromUtf8("actionQuit"));
428 menu_file->addAction(action_quit_);
431 QMenu *menu_view = new QMenu;
432 menu_view->setTitle(tr("&View"));
434 action_view_zoom_in_->setText(tr("Zoom &In"));
435 action_view_zoom_in_->setIcon(QIcon::fromTheme("zoom-in",
436 QIcon(":/icons/zoom-in.png")));
437 // simply using Qt::Key_Plus shows no + in the menu
438 action_view_zoom_in_->setShortcut(QKeySequence::ZoomIn);
439 action_view_zoom_in_->setObjectName(
440 QString::fromUtf8("actionViewZoomIn"));
441 menu_view->addAction(action_view_zoom_in_);
443 action_view_zoom_out_->setText(tr("Zoom &Out"));
444 action_view_zoom_out_->setIcon(QIcon::fromTheme("zoom-out",
445 QIcon(":/icons/zoom-out.png")));
446 action_view_zoom_out_->setShortcut(QKeySequence::ZoomOut);
447 action_view_zoom_out_->setObjectName(
448 QString::fromUtf8("actionViewZoomOut"));
449 menu_view->addAction(action_view_zoom_out_);
451 action_view_zoom_fit_->setCheckable(true);
452 action_view_zoom_fit_->setText(tr("Zoom to &Fit"));
453 action_view_zoom_fit_->setIcon(QIcon::fromTheme("zoom-fit",
454 QIcon(":/icons/zoom-fit.png")));
455 action_view_zoom_fit_->setShortcut(QKeySequence(Qt::Key_F));
456 action_view_zoom_fit_->setObjectName(
457 QString::fromUtf8("actionViewZoomFit"));
458 menu_view->addAction(action_view_zoom_fit_);
460 action_view_zoom_one_to_one_->setText(tr("Zoom to O&ne-to-One"));
461 action_view_zoom_one_to_one_->setIcon(QIcon::fromTheme("zoom-original",
462 QIcon(":/icons/zoom-original.png")));
463 action_view_zoom_one_to_one_->setShortcut(QKeySequence(Qt::Key_O));
464 action_view_zoom_one_to_one_->setObjectName(
465 QString::fromUtf8("actionViewZoomOneToOne"));
466 menu_view->addAction(action_view_zoom_one_to_one_);
468 menu_view->addSeparator();
470 action_view_sticky_scrolling_->setCheckable(true);
471 action_view_sticky_scrolling_->setChecked(true);
472 action_view_sticky_scrolling_->setShortcut(QKeySequence(Qt::Key_S));
473 action_view_sticky_scrolling_->setObjectName(
474 QString::fromUtf8("actionViewStickyScrolling"));
475 action_view_sticky_scrolling_->setText(tr("&Sticky Scrolling"));
476 menu_view->addAction(action_view_sticky_scrolling_);
478 view_->enable_sticky_scrolling(action_view_sticky_scrolling_->isChecked());
480 menu_view->addSeparator();
482 action_view_coloured_bg_->setCheckable(true);
483 action_view_coloured_bg_->setChecked(true);
484 action_view_coloured_bg_->setShortcut(QKeySequence(Qt::Key_B));
485 action_view_coloured_bg_->setObjectName(
486 QString::fromUtf8("actionViewColouredBg"));
487 action_view_coloured_bg_->setText(tr("Use &coloured backgrounds"));
488 menu_view->addAction(action_view_coloured_bg_);
490 view_->enable_coloured_bg(action_view_coloured_bg_->isChecked());
492 menu_view->addSeparator();
494 action_view_show_cursors_->setCheckable(true);
495 action_view_show_cursors_->setChecked(view_->cursors_shown());
496 action_view_show_cursors_->setIcon(QIcon::fromTheme("show-cursors",
497 QIcon(":/icons/show-cursors.svg")));
498 action_view_show_cursors_->setShortcut(QKeySequence(Qt::Key_C));
499 action_view_show_cursors_->setObjectName(
500 QString::fromUtf8("actionViewShowCursors"));
501 action_view_show_cursors_->setText(tr("Show &Cursors"));
502 menu_view->addAction(action_view_show_cursors_);
506 QMenu *const menu_decoders = new QMenu;
507 menu_decoders->setTitle(tr("&Decoders"));
509 menu_decoders_add_->setTitle(tr("&Add"));
510 connect(menu_decoders_add_, SIGNAL(decoder_selected(srd_decoder*)),
511 this, SLOT(add_decoder(srd_decoder*)));
513 menu_decoders->addMenu(menu_decoders_add_);
517 QMenu *const menu_help = new QMenu;
518 menu_help->setTitle(tr("&Help"));
520 action_about_->setObjectName(QString::fromUtf8("actionAbout"));
521 action_about_->setText(tr("&About..."));
522 menu_help->addAction(action_about_);
524 menu_bar->addAction(menu_file->menuAction());
525 menu_bar->addAction(menu_view->menuAction());
527 menu_bar->addAction(menu_decoders->menuAction());
529 menu_bar->addAction(menu_help->menuAction());
531 setMenuBar(menu_bar);
532 QMetaObject::connectSlotsByName(this);
534 // Also add all actions to the main window for always-enabled hotkeys
535 for (QAction* action : menu_bar->actions())
536 this->addAction(action);
539 main_bar_ = new toolbars::MainBar(session_, *this);
541 // Populate the device list and select the initially selected device
542 update_device_list();
544 addToolBar(main_bar_);
547 setWindowTitle(tr("PulseView"));
549 // Setup session_ events
550 connect(&session_, SIGNAL(capture_state_changed(int)), this,
551 SLOT(capture_state_changed(int)));
552 connect(&session_, SIGNAL(device_selected()), this,
553 SLOT(device_selected()));
554 connect(&session_, SIGNAL(trigger_event(util::Timestamp)), view_,
555 SLOT(trigger_event(util::Timestamp)));
557 // Setup view_ events
558 connect(view_, SIGNAL(sticky_scrolling_changed(bool)), this,
559 SLOT(sticky_scrolling_changed(bool)));
560 connect(view_, SIGNAL(always_zoom_to_fit_changed(bool)), this,
561 SLOT(always_zoom_to_fit_changed(bool)));
565 void MainWindow::select_init_device()
568 map<string, string> dev_info;
569 list<string> key_list;
571 // Re-select last used device if possible.
572 settings.beginGroup("Device");
573 key_list.push_back("vendor");
574 key_list.push_back("model");
575 key_list.push_back("version");
576 key_list.push_back("serial_num");
577 key_list.push_back("connection_id");
579 for (string key : key_list) {
580 const QString k = QString::fromStdString(key);
581 if (!settings.contains(k))
584 const string value = settings.value(k).toString().toStdString();
586 dev_info.insert(std::make_pair(key, value));
589 const shared_ptr<devices::HardwareDevice> device =
590 device_manager_.find_device_from_info(dev_info);
591 select_device(device);
592 update_device_list();
597 void MainWindow::load_init_file(const std::string &file_name,
598 const std::string &format)
600 shared_ptr<InputFormat> input_format;
602 if (!format.empty()) {
603 const map<string, shared_ptr<InputFormat> > formats =
604 device_manager_.context()->input_formats();
605 const auto iter = find_if(formats.begin(), formats.end(),
606 [&](const pair<string, shared_ptr<InputFormat> > f) {
607 return f.first == format; });
608 if (iter == formats.end()) {
609 cerr << "Unexpected input format: " << format << endl;
613 input_format = (*iter).second;
616 load_file(QString::fromStdString(file_name), input_format);
620 void MainWindow::save_ui_settings()
624 map<string, string> dev_info;
625 list<string> key_list;
627 settings.beginGroup("MainWindow");
628 settings.setValue("state", saveState());
629 settings.setValue("geometry", saveGeometry());
632 if (session_.device()) {
633 settings.beginGroup("Device");
634 key_list.push_back("vendor");
635 key_list.push_back("model");
636 key_list.push_back("version");
637 key_list.push_back("serial_num");
638 key_list.push_back("connection_id");
640 dev_info = device_manager_.get_device_info(
643 for (string key : key_list) {
644 if (dev_info.count(key))
645 settings.setValue(QString::fromUtf8(key.c_str()),
646 QString::fromUtf8(dev_info.at(key).c_str()));
648 settings.remove(QString::fromUtf8(key.c_str()));
655 void MainWindow::restore_ui_settings()
659 settings.beginGroup("MainWindow");
661 if (settings.contains("geometry")) {
662 restoreGeometry(settings.value("geometry").toByteArray());
663 restoreState(settings.value("state").toByteArray());
670 void MainWindow::session_error(
671 const QString text, const QString info_text)
673 QMetaObject::invokeMethod(this, "show_session_error",
674 Qt::QueuedConnection, Q_ARG(QString, text),
675 Q_ARG(QString, info_text));
678 void MainWindow::update_device_list()
680 main_bar_->update_device_list();
683 void MainWindow::load_file(QString file_name,
684 std::shared_ptr<sigrok::InputFormat> format,
685 const std::map<std::string, Glib::VariantBase> &options)
687 const QString errorMessage(
688 QString("Failed to load file %1").arg(file_name));
692 session_.set_device(shared_ptr<devices::Device>(
693 new devices::InputFile(
694 device_manager_.context(),
695 file_name.toStdString(),
698 session_.set_device(shared_ptr<devices::Device>(
699 new devices::SessionFile(
700 device_manager_.context(),
701 file_name.toStdString())));
703 show_session_error(tr("Failed to load ") + file_name, e.what());
704 session_.set_default_device();
705 update_device_list();
709 update_device_list();
711 session_.start_capture([&, errorMessage](QString infoMessage) {
712 session_error(errorMessage, infoMessage); });
715 void MainWindow::closeEvent(QCloseEvent *event)
721 void MainWindow::keyReleaseEvent(QKeyEvent *event)
723 if (event->key() == Qt::Key_Alt) {
724 menuBar()->setHidden(!menuBar()->isHidden());
725 menuBar()->setFocus();
727 QMainWindow::keyReleaseEvent(event);
730 void MainWindow::show_session_error(
731 const QString text, const QString info_text)
733 QMessageBox msg(this);
735 msg.setInformativeText(info_text);
736 msg.setStandardButtons(QMessageBox::Ok);
737 msg.setIcon(QMessageBox::Warning);
741 void MainWindow::on_actionOpen_triggered()
744 const QString dir = settings.value(SettingOpenDirectory).toString();
747 const QString file_name = QFileDialog::getOpenFileName(
748 this, tr("Open File"), dir, tr(
749 "Sigrok Sessions (*.sr);;"
752 if (!file_name.isEmpty()) {
753 load_file(file_name);
755 const QString abs_path = QFileInfo(file_name).absolutePath();
756 settings.setValue(SettingOpenDirectory, abs_path);
760 void MainWindow::on_actionSaveAs_triggered()
762 export_file(device_manager_.context()->output_formats()["srzip"]);
765 void MainWindow::on_actionSaveSelectionAs_triggered()
767 export_file(device_manager_.context()->output_formats()["srzip"], true);
770 void MainWindow::on_actionConnect_triggered()
772 // Stop any currently running capture session
773 session_.stop_capture();
775 dialogs::Connect dlg(this, device_manager_);
777 // If the user selected a device, select it in the device list. Select the
778 // current device otherwise.
780 select_device(dlg.get_selected_device());
782 update_device_list();
785 void MainWindow::on_actionQuit_triggered()
790 void MainWindow::on_actionViewZoomIn_triggered()
795 void MainWindow::on_actionViewZoomOut_triggered()
800 void MainWindow::on_actionViewZoomFit_triggered()
802 view_->zoom_fit(action_view_zoom_fit_->isChecked());
805 void MainWindow::on_actionViewZoomOneToOne_triggered()
807 view_->zoom_one_to_one();
810 void MainWindow::on_actionViewStickyScrolling_triggered()
812 view_->enable_sticky_scrolling(action_view_sticky_scrolling_->isChecked());
815 void MainWindow::on_actionViewColouredBg_triggered()
817 view_->enable_coloured_bg(action_view_coloured_bg_->isChecked());
820 void MainWindow::on_actionViewShowCursors_triggered()
824 const bool show = !view_->cursors_shown();
826 view_->centre_cursors();
828 view_->show_cursors(show);
831 void MainWindow::on_actionAbout_triggered()
833 dialogs::About dlg(device_manager_.context(), this);
837 void MainWindow::sticky_scrolling_changed(bool state)
839 action_view_sticky_scrolling_->setChecked(state);
842 void MainWindow::always_zoom_to_fit_changed(bool state)
844 action_view_zoom_fit_->setChecked(state);
847 void MainWindow::add_decoder(srd_decoder *decoder)
851 session_.add_decoder(decoder);
857 void MainWindow::capture_state_changed(int state)
859 main_bar_->set_capture_state((pv::Session::capture_state)state);
862 void MainWindow::device_selected()
864 // Set the title to include the device/file name
865 const shared_ptr<devices::Device> device = session_.device();
869 const string display_name = device->display_name(device_manager_);
870 setWindowTitle(tr("%1 - PulseView").arg(display_name.c_str()));