]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * This file is part of the PulseView project. | |
3 | * | |
4 | * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk> | |
5 | * | |
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. | |
10 | * | |
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. | |
15 | * | |
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 | |
19 | */ | |
20 | ||
21 | #include <cassert> | |
22 | ||
23 | #ifdef ENABLE_DECODE | |
24 | #include <libsigrokdecode/libsigrokdecode.h> | |
25 | #endif | |
26 | ||
27 | #include <algorithm> | |
28 | #include <iterator> | |
29 | ||
30 | #include <QAction> | |
31 | #include <QApplication> | |
32 | #include <QButtonGroup> | |
33 | #include <QCloseEvent> | |
34 | #include <QFileDialog> | |
35 | #include <QMessageBox> | |
36 | #include <QMenu> | |
37 | #include <QMenuBar> | |
38 | #include <QSettings> | |
39 | #include <QStatusBar> | |
40 | #include <QVBoxLayout> | |
41 | #include <QWidget> | |
42 | ||
43 | #include "mainwindow.hpp" | |
44 | ||
45 | #include "devicemanager.hpp" | |
46 | #include "dialogs/about.hpp" | |
47 | #include "dialogs/connect.hpp" | |
48 | #include "dialogs/storeprogress.hpp" | |
49 | #include "toolbars/mainbar.hpp" | |
50 | #include "view/logicsignal.hpp" | |
51 | #include "view/view.hpp" | |
52 | #ifdef ENABLE_DECODE | |
53 | #include "widgets/decodermenu.hpp" | |
54 | #endif | |
55 | #include "widgets/hidingmenubar.hpp" | |
56 | ||
57 | #include <inttypes.h> | |
58 | #include <stdint.h> | |
59 | #include <stdarg.h> | |
60 | #include <glib.h> | |
61 | #include <libsigrok/libsigrok.hpp> | |
62 | ||
63 | using std::list; | |
64 | using std::map; | |
65 | using std::shared_ptr; | |
66 | using std::string; | |
67 | ||
68 | using sigrok::Device; | |
69 | using sigrok::Error; | |
70 | using sigrok::HardwareDevice; | |
71 | ||
72 | namespace pv { | |
73 | ||
74 | namespace view { | |
75 | class ViewItem; | |
76 | } | |
77 | ||
78 | const char *MainWindow::SettingOpenDirectory = "MainWindow/OpenDirectory"; | |
79 | const char *MainWindow::SettingSaveDirectory = "MainWindow/SaveDirectory"; | |
80 | ||
81 | MainWindow::MainWindow(DeviceManager &device_manager, | |
82 | const char *open_file_name, | |
83 | QWidget *parent) : | |
84 | QMainWindow(parent), | |
85 | device_manager_(device_manager), | |
86 | session_(device_manager), | |
87 | action_open_(new QAction(this)), | |
88 | action_save_as_(new QAction(this)), | |
89 | action_connect_(new QAction(this)), | |
90 | action_quit_(new QAction(this)), | |
91 | action_view_zoom_in_(new QAction(this)), | |
92 | action_view_zoom_out_(new QAction(this)), | |
93 | action_view_zoom_fit_(new QAction(this)), | |
94 | action_view_zoom_one_to_one_(new QAction(this)), | |
95 | action_view_show_cursors_(new QAction(this)), | |
96 | action_about_(new QAction(this)), | |
97 | menu_decoders_add_(new pv::widgets::DecoderMenu(this, true)) | |
98 | { | |
99 | setup_ui(); | |
100 | restore_ui_settings(); | |
101 | if (open_file_name) { | |
102 | const QString s(QString::fromUtf8(open_file_name)); | |
103 | QMetaObject::invokeMethod(this, "load_file", | |
104 | Qt::QueuedConnection, | |
105 | Q_ARG(QString, s)); | |
106 | } | |
107 | } | |
108 | ||
109 | QAction* MainWindow::action_open() const | |
110 | { | |
111 | return action_open_; | |
112 | } | |
113 | ||
114 | QAction* MainWindow::action_save_as() const | |
115 | { | |
116 | return action_save_as_; | |
117 | } | |
118 | ||
119 | QAction* MainWindow::action_connect() const | |
120 | { | |
121 | return action_connect_; | |
122 | } | |
123 | ||
124 | QAction* MainWindow::action_quit() const | |
125 | { | |
126 | return action_quit_; | |
127 | } | |
128 | ||
129 | QAction* MainWindow::action_view_zoom_in() const | |
130 | { | |
131 | return action_view_zoom_in_; | |
132 | } | |
133 | ||
134 | QAction* MainWindow::action_view_zoom_out() const | |
135 | { | |
136 | return action_view_zoom_out_; | |
137 | } | |
138 | ||
139 | QAction* MainWindow::action_view_zoom_fit() const | |
140 | { | |
141 | return action_view_zoom_fit_; | |
142 | } | |
143 | ||
144 | QAction* MainWindow::action_view_zoom_one_to_one() const | |
145 | { | |
146 | return action_view_zoom_one_to_one_; | |
147 | } | |
148 | ||
149 | QAction* MainWindow::action_view_show_cursors() const | |
150 | { | |
151 | return action_view_show_cursors_; | |
152 | } | |
153 | ||
154 | QAction* MainWindow::action_about() const | |
155 | { | |
156 | return action_about_; | |
157 | } | |
158 | ||
159 | QMenu* MainWindow::menu_decoder_add() const | |
160 | { | |
161 | return menu_decoders_add_; | |
162 | } | |
163 | ||
164 | void MainWindow::run_stop() | |
165 | { | |
166 | switch(session_.get_capture_state()) { | |
167 | case Session::Stopped: | |
168 | session_.start_capture([&](QString message) { | |
169 | session_error("Capture failed", message); }); | |
170 | break; | |
171 | ||
172 | case Session::AwaitingTrigger: | |
173 | case Session::Running: | |
174 | session_.stop_capture(); | |
175 | break; | |
176 | } | |
177 | } | |
178 | ||
179 | void MainWindow::select_device(shared_ptr<Device> device) | |
180 | { | |
181 | try { | |
182 | session_.set_device(device); | |
183 | } catch(const QString &e) { | |
184 | QMessageBox msg(this); | |
185 | msg.setText(e); | |
186 | msg.setInformativeText(tr("Failed to Select Device")); | |
187 | msg.setStandardButtons(QMessageBox::Ok); | |
188 | msg.setIcon(QMessageBox::Warning); | |
189 | msg.exec(); | |
190 | } | |
191 | } | |
192 | ||
193 | void MainWindow::setup_ui() | |
194 | { | |
195 | setObjectName(QString::fromUtf8("MainWindow")); | |
196 | ||
197 | // Set the window icon | |
198 | QIcon icon; | |
199 | icon.addFile(QString::fromUtf8(":/icons/sigrok-logo-notext.png"), | |
200 | QSize(), QIcon::Normal, QIcon::Off); | |
201 | setWindowIcon(icon); | |
202 | ||
203 | // Setup the central widget | |
204 | central_widget_ = new QWidget(this); | |
205 | vertical_layout_ = new QVBoxLayout(central_widget_); | |
206 | vertical_layout_->setSpacing(6); | |
207 | vertical_layout_->setContentsMargins(0, 0, 0, 0); | |
208 | setCentralWidget(central_widget_); | |
209 | ||
210 | view_ = new pv::view::View(session_, this); | |
211 | ||
212 | vertical_layout_->addWidget(view_); | |
213 | ||
214 | // Setup the menu bar | |
215 | pv::widgets::HidingMenuBar *const menu_bar = | |
216 | new pv::widgets::HidingMenuBar(this); | |
217 | ||
218 | // File Menu | |
219 | QMenu *const menu_file = new QMenu; | |
220 | menu_file->setTitle(tr("&File")); | |
221 | ||
222 | action_open_->setText(tr("&Open...")); | |
223 | action_open_->setIcon(QIcon::fromTheme("document-open", | |
224 | QIcon(":/icons/document-open.png"))); | |
225 | action_open_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_O)); | |
226 | action_open_->setObjectName(QString::fromUtf8("actionOpen")); | |
227 | menu_file->addAction(action_open_); | |
228 | ||
229 | action_save_as_->setText(tr("&Save As...")); | |
230 | action_save_as_->setIcon(QIcon::fromTheme("document-save-as", | |
231 | QIcon(":/icons/document-save-as.png"))); | |
232 | action_save_as_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_S)); | |
233 | action_save_as_->setObjectName(QString::fromUtf8("actionSaveAs")); | |
234 | menu_file->addAction(action_save_as_); | |
235 | ||
236 | menu_file->addSeparator(); | |
237 | ||
238 | action_connect_->setText(tr("&Connect to Device...")); | |
239 | action_connect_->setObjectName(QString::fromUtf8("actionConnect")); | |
240 | menu_file->addAction(action_connect_); | |
241 | ||
242 | menu_file->addSeparator(); | |
243 | ||
244 | action_quit_->setText(tr("&Quit")); | |
245 | action_quit_->setIcon(QIcon::fromTheme("application-exit", | |
246 | QIcon(":/icons/application-exit.png"))); | |
247 | action_quit_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); | |
248 | action_quit_->setObjectName(QString::fromUtf8("actionQuit")); | |
249 | menu_file->addAction(action_quit_); | |
250 | ||
251 | // View Menu | |
252 | QMenu *menu_view = new QMenu; | |
253 | menu_view->setTitle(tr("&View")); | |
254 | ||
255 | action_view_zoom_in_->setText(tr("Zoom &In")); | |
256 | action_view_zoom_in_->setIcon(QIcon::fromTheme("zoom-in", | |
257 | QIcon(":/icons/zoom-in.png"))); | |
258 | // simply using Qt::Key_Plus shows no + in the menu | |
259 | action_view_zoom_in_->setShortcut(QKeySequence::ZoomIn); | |
260 | action_view_zoom_in_->setObjectName( | |
261 | QString::fromUtf8("actionViewZoomIn")); | |
262 | menu_view->addAction(action_view_zoom_in_); | |
263 | ||
264 | action_view_zoom_out_->setText(tr("Zoom &Out")); | |
265 | action_view_zoom_out_->setIcon(QIcon::fromTheme("zoom-out", | |
266 | QIcon(":/icons/zoom-out.png"))); | |
267 | action_view_zoom_out_->setShortcut(QKeySequence::ZoomOut); | |
268 | action_view_zoom_out_->setObjectName( | |
269 | QString::fromUtf8("actionViewZoomOut")); | |
270 | menu_view->addAction(action_view_zoom_out_); | |
271 | ||
272 | action_view_zoom_fit_->setText(tr("Zoom to &Fit")); | |
273 | action_view_zoom_fit_->setIcon(QIcon::fromTheme("zoom-fit", | |
274 | QIcon(":/icons/zoom-fit.png"))); | |
275 | action_view_zoom_fit_->setShortcut(QKeySequence(Qt::Key_F)); | |
276 | action_view_zoom_fit_->setObjectName( | |
277 | QString::fromUtf8("actionViewZoomFit")); | |
278 | menu_view->addAction(action_view_zoom_fit_); | |
279 | ||
280 | action_view_zoom_one_to_one_->setText(tr("Zoom to O&ne-to-One")); | |
281 | action_view_zoom_one_to_one_->setIcon(QIcon::fromTheme("zoom-original", | |
282 | QIcon(":/icons/zoom-original.png"))); | |
283 | action_view_zoom_one_to_one_->setShortcut(QKeySequence(Qt::Key_O)); | |
284 | action_view_zoom_one_to_one_->setObjectName( | |
285 | QString::fromUtf8("actionViewZoomOneToOne")); | |
286 | menu_view->addAction(action_view_zoom_one_to_one_); | |
287 | ||
288 | menu_view->addSeparator(); | |
289 | ||
290 | action_view_show_cursors_->setCheckable(true); | |
291 | action_view_show_cursors_->setChecked(view_->cursors_shown()); | |
292 | action_view_show_cursors_->setIcon(QIcon::fromTheme("show-cursors", | |
293 | QIcon(":/icons/show-cursors.svg"))); | |
294 | action_view_show_cursors_->setShortcut(QKeySequence(Qt::Key_C)); | |
295 | action_view_show_cursors_->setObjectName( | |
296 | QString::fromUtf8("actionViewShowCursors")); | |
297 | action_view_show_cursors_->setText(tr("Show &Cursors")); | |
298 | menu_view->addAction(action_view_show_cursors_); | |
299 | ||
300 | // Decoders Menu | |
301 | #ifdef ENABLE_DECODE | |
302 | QMenu *const menu_decoders = new QMenu; | |
303 | menu_decoders->setTitle(tr("&Decoders")); | |
304 | ||
305 | menu_decoders_add_->setTitle(tr("&Add")); | |
306 | connect(menu_decoders_add_, SIGNAL(decoder_selected(srd_decoder*)), | |
307 | this, SLOT(add_decoder(srd_decoder*))); | |
308 | ||
309 | menu_decoders->addMenu(menu_decoders_add_); | |
310 | #endif | |
311 | ||
312 | // Help Menu | |
313 | QMenu *const menu_help = new QMenu; | |
314 | menu_help->setTitle(tr("&Help")); | |
315 | ||
316 | action_about_->setObjectName(QString::fromUtf8("actionAbout")); | |
317 | action_about_->setText(tr("&About...")); | |
318 | menu_help->addAction(action_about_); | |
319 | ||
320 | menu_bar->addAction(menu_file->menuAction()); | |
321 | menu_bar->addAction(menu_view->menuAction()); | |
322 | #ifdef ENABLE_DECODE | |
323 | menu_bar->addAction(menu_decoders->menuAction()); | |
324 | #endif | |
325 | menu_bar->addAction(menu_help->menuAction()); | |
326 | ||
327 | setMenuBar(menu_bar); | |
328 | QMetaObject::connectSlotsByName(this); | |
329 | ||
330 | // Setup the sampling bar | |
331 | main_bar_ = new toolbars::MainBar(session_, *this); | |
332 | ||
333 | // Populate the device list and select the initially selected device | |
334 | update_device_list(); | |
335 | ||
336 | addToolBar(main_bar_); | |
337 | ||
338 | // Set the title | |
339 | setWindowTitle(tr("PulseView")); | |
340 | ||
341 | // Setup session_ events | |
342 | connect(&session_, SIGNAL(capture_state_changed(int)), this, | |
343 | SLOT(capture_state_changed(int))); | |
344 | connect(&session_, SIGNAL(device_selected()), this, | |
345 | SLOT(device_selected())); | |
346 | } | |
347 | ||
348 | void MainWindow::save_ui_settings() | |
349 | { | |
350 | QSettings settings; | |
351 | ||
352 | map<string, string> dev_info; | |
353 | list<string> key_list; | |
354 | ||
355 | settings.beginGroup("MainWindow"); | |
356 | settings.setValue("state", saveState()); | |
357 | settings.setValue("geometry", saveGeometry()); | |
358 | settings.endGroup(); | |
359 | ||
360 | if (session_.device()) { | |
361 | settings.beginGroup("Device"); | |
362 | key_list.push_back("vendor"); | |
363 | key_list.push_back("model"); | |
364 | key_list.push_back("version"); | |
365 | key_list.push_back("serial_num"); | |
366 | key_list.push_back("connection_id"); | |
367 | ||
368 | dev_info = device_manager_.get_device_info( | |
369 | session_.device()); | |
370 | ||
371 | for (string key : key_list) { | |
372 | ||
373 | if (dev_info.count(key)) | |
374 | settings.setValue(QString::fromUtf8(key.c_str()), | |
375 | QString::fromUtf8(dev_info.at(key).c_str())); | |
376 | else | |
377 | settings.remove(QString::fromUtf8(key.c_str())); | |
378 | } | |
379 | ||
380 | settings.endGroup(); | |
381 | } | |
382 | } | |
383 | ||
384 | void MainWindow::restore_ui_settings() | |
385 | { | |
386 | QSettings settings; | |
387 | ||
388 | shared_ptr<HardwareDevice> device; | |
389 | ||
390 | map<string, string> dev_info; | |
391 | list<string> key_list; | |
392 | string value; | |
393 | ||
394 | settings.beginGroup("MainWindow"); | |
395 | ||
396 | if (settings.contains("geometry")) { | |
397 | restoreGeometry(settings.value("geometry").toByteArray()); | |
398 | restoreState(settings.value("state").toByteArray()); | |
399 | } else | |
400 | resize(1000, 720); | |
401 | ||
402 | settings.endGroup(); | |
403 | ||
404 | // Re-select last used device if possible. | |
405 | settings.beginGroup("Device"); | |
406 | key_list.push_back("vendor"); | |
407 | key_list.push_back("model"); | |
408 | key_list.push_back("version"); | |
409 | key_list.push_back("serial_num"); | |
410 | key_list.push_back("connection_id"); | |
411 | ||
412 | for (string key : key_list) { | |
413 | if (!settings.contains(QString::fromUtf8(key.c_str()))) | |
414 | continue; | |
415 | ||
416 | value = settings.value(QString::fromUtf8(key.c_str())).toString().toStdString(); | |
417 | ||
418 | if (value.size() > 0) | |
419 | dev_info.insert(std::make_pair(key, value)); | |
420 | } | |
421 | ||
422 | device = device_manager_.find_device_from_info(dev_info); | |
423 | ||
424 | if (device) { | |
425 | select_device(device); | |
426 | update_device_list(); | |
427 | } | |
428 | ||
429 | settings.endGroup(); | |
430 | } | |
431 | ||
432 | void MainWindow::session_error( | |
433 | const QString text, const QString info_text) | |
434 | { | |
435 | QMetaObject::invokeMethod(this, "show_session_error", | |
436 | Qt::QueuedConnection, Q_ARG(QString, text), | |
437 | Q_ARG(QString, info_text)); | |
438 | } | |
439 | ||
440 | void MainWindow::update_device_list() | |
441 | { | |
442 | main_bar_->update_device_list(); | |
443 | } | |
444 | ||
445 | void MainWindow::closeEvent(QCloseEvent *event) | |
446 | { | |
447 | save_ui_settings(); | |
448 | event->accept(); | |
449 | } | |
450 | ||
451 | void MainWindow::keyReleaseEvent(QKeyEvent *event) | |
452 | { | |
453 | if (event->key() == Qt::Key_Alt) { | |
454 | menuBar()->setHidden(!menuBar()->isHidden()); | |
455 | menuBar()->setFocus(); | |
456 | } | |
457 | QMainWindow::keyReleaseEvent(event); | |
458 | } | |
459 | ||
460 | void MainWindow::load_file(QString file_name) | |
461 | { | |
462 | const QString errorMessage( | |
463 | QString("Failed to load file %1").arg(file_name)); | |
464 | const QString infoMessage; | |
465 | ||
466 | try { | |
467 | session_.set_file(file_name.toStdString()); | |
468 | } catch(Error e) { | |
469 | show_session_error(tr("Failed to load ") + file_name, e.what()); | |
470 | session_.set_default_device(); | |
471 | update_device_list(); | |
472 | return; | |
473 | } | |
474 | ||
475 | update_device_list(); | |
476 | ||
477 | session_.start_capture([&, errorMessage, infoMessage](QString) { | |
478 | session_error(errorMessage, infoMessage); }); | |
479 | } | |
480 | ||
481 | void MainWindow::show_session_error( | |
482 | const QString text, const QString info_text) | |
483 | { | |
484 | QMessageBox msg(this); | |
485 | msg.setText(text); | |
486 | msg.setInformativeText(info_text); | |
487 | msg.setStandardButtons(QMessageBox::Ok); | |
488 | msg.setIcon(QMessageBox::Warning); | |
489 | msg.exec(); | |
490 | } | |
491 | ||
492 | void MainWindow::on_actionOpen_triggered() | |
493 | { | |
494 | QSettings settings; | |
495 | const QString dir = settings.value(SettingOpenDirectory).toString(); | |
496 | ||
497 | // Show the dialog | |
498 | const QString file_name = QFileDialog::getOpenFileName( | |
499 | this, tr("Open File"), dir, tr( | |
500 | "Sigrok Sessions (*.sr);;" | |
501 | "All Files (*.*)")); | |
502 | ||
503 | if (!file_name.isEmpty()) { | |
504 | load_file(file_name); | |
505 | ||
506 | const QString abs_path = QFileInfo(file_name).absolutePath(); | |
507 | settings.setValue(SettingOpenDirectory, abs_path); | |
508 | } | |
509 | } | |
510 | ||
511 | void MainWindow::on_actionSaveAs_triggered() | |
512 | { | |
513 | using pv::dialogs::StoreProgress; | |
514 | ||
515 | // Stop any currently running capture session | |
516 | session_.stop_capture(); | |
517 | ||
518 | QSettings settings; | |
519 | const QString dir = settings.value(SettingSaveDirectory).toString(); | |
520 | ||
521 | // Show the dialog | |
522 | const QString file_name = QFileDialog::getSaveFileName( | |
523 | this, tr("Save File"), dir, tr("Sigrok Sessions (*.sr)")); | |
524 | ||
525 | if (file_name.isEmpty()) | |
526 | return; | |
527 | ||
528 | const QString abs_path = QFileInfo(file_name).absolutePath(); | |
529 | settings.setValue(SettingSaveDirectory, abs_path); | |
530 | ||
531 | StoreProgress *dlg = new StoreProgress(file_name, session_, this); | |
532 | dlg->run(); | |
533 | } | |
534 | ||
535 | void MainWindow::on_actionConnect_triggered() | |
536 | { | |
537 | // Stop any currently running capture session | |
538 | session_.stop_capture(); | |
539 | ||
540 | dialogs::Connect dlg(this, device_manager_); | |
541 | ||
542 | // If the user selected a device, select it in the device list. Select the | |
543 | // current device otherwise. | |
544 | if (dlg.exec()) | |
545 | select_device(dlg.get_selected_device()); | |
546 | ||
547 | update_device_list(); | |
548 | } | |
549 | ||
550 | void MainWindow::on_actionQuit_triggered() | |
551 | { | |
552 | close(); | |
553 | } | |
554 | ||
555 | void MainWindow::on_actionViewZoomIn_triggered() | |
556 | { | |
557 | view_->zoom(1); | |
558 | } | |
559 | ||
560 | void MainWindow::on_actionViewZoomOut_triggered() | |
561 | { | |
562 | view_->zoom(-1); | |
563 | } | |
564 | ||
565 | void MainWindow::on_actionViewZoomFit_triggered() | |
566 | { | |
567 | view_->zoom_fit(); | |
568 | } | |
569 | ||
570 | void MainWindow::on_actionViewZoomOneToOne_triggered() | |
571 | { | |
572 | view_->zoom_one_to_one(); | |
573 | } | |
574 | ||
575 | void MainWindow::on_actionViewShowCursors_triggered() | |
576 | { | |
577 | assert(view_); | |
578 | ||
579 | const bool show = !view_->cursors_shown(); | |
580 | if(show) | |
581 | view_->centre_cursors(); | |
582 | ||
583 | view_->show_cursors(show); | |
584 | } | |
585 | ||
586 | void MainWindow::on_actionAbout_triggered() | |
587 | { | |
588 | dialogs::About dlg(device_manager_.context(), this); | |
589 | dlg.exec(); | |
590 | } | |
591 | ||
592 | void MainWindow::add_decoder(srd_decoder *decoder) | |
593 | { | |
594 | #ifdef ENABLE_DECODE | |
595 | assert(decoder); | |
596 | session_.add_decoder(decoder); | |
597 | #else | |
598 | (void)decoder; | |
599 | #endif | |
600 | } | |
601 | ||
602 | void MainWindow::capture_state_changed(int state) | |
603 | { | |
604 | main_bar_->set_capture_state((pv::Session::capture_state)state); | |
605 | } | |
606 | ||
607 | void MainWindow::device_selected() | |
608 | { | |
609 | // Set the title to include the device/file name | |
610 | const shared_ptr<sigrok::Device> device = session_.device(); | |
611 | if (!device) | |
612 | return; | |
613 | ||
614 | const string display_name = device_manager_.get_display_name(device); | |
615 | setWindowTitle(tr("%1 - PulseView").arg(display_name.c_str())); | |
616 | } | |
617 | ||
618 | } // namespace pv |