]>
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 <libsigrokcxx/libsigrokcxx.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(":/icons/sigrok-logo-notext.svg")); | |
200 | setWindowIcon(icon); | |
201 | ||
202 | // Setup the central widget | |
203 | central_widget_ = new QWidget(this); | |
204 | vertical_layout_ = new QVBoxLayout(central_widget_); | |
205 | vertical_layout_->setSpacing(6); | |
206 | vertical_layout_->setContentsMargins(0, 0, 0, 0); | |
207 | setCentralWidget(central_widget_); | |
208 | ||
209 | view_ = new pv::view::View(session_, this); | |
210 | ||
211 | vertical_layout_->addWidget(view_); | |
212 | ||
213 | // Setup the menu bar | |
214 | pv::widgets::HidingMenuBar *const menu_bar = | |
215 | new pv::widgets::HidingMenuBar(this); | |
216 | ||
217 | // File Menu | |
218 | QMenu *const menu_file = new QMenu; | |
219 | menu_file->setTitle(tr("&File")); | |
220 | ||
221 | action_open_->setText(tr("&Open...")); | |
222 | action_open_->setIcon(QIcon::fromTheme("document-open", | |
223 | QIcon(":/icons/document-open.png"))); | |
224 | action_open_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_O)); | |
225 | action_open_->setObjectName(QString::fromUtf8("actionOpen")); | |
226 | menu_file->addAction(action_open_); | |
227 | ||
228 | action_save_as_->setText(tr("&Save As...")); | |
229 | action_save_as_->setIcon(QIcon::fromTheme("document-save-as", | |
230 | QIcon(":/icons/document-save-as.png"))); | |
231 | action_save_as_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_S)); | |
232 | action_save_as_->setObjectName(QString::fromUtf8("actionSaveAs")); | |
233 | menu_file->addAction(action_save_as_); | |
234 | ||
235 | menu_file->addSeparator(); | |
236 | ||
237 | action_connect_->setText(tr("&Connect to Device...")); | |
238 | action_connect_->setObjectName(QString::fromUtf8("actionConnect")); | |
239 | menu_file->addAction(action_connect_); | |
240 | ||
241 | menu_file->addSeparator(); | |
242 | ||
243 | action_quit_->setText(tr("&Quit")); | |
244 | action_quit_->setIcon(QIcon::fromTheme("application-exit", | |
245 | QIcon(":/icons/application-exit.png"))); | |
246 | action_quit_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); | |
247 | action_quit_->setObjectName(QString::fromUtf8("actionQuit")); | |
248 | menu_file->addAction(action_quit_); | |
249 | ||
250 | // View Menu | |
251 | QMenu *menu_view = new QMenu; | |
252 | menu_view->setTitle(tr("&View")); | |
253 | ||
254 | action_view_zoom_in_->setText(tr("Zoom &In")); | |
255 | action_view_zoom_in_->setIcon(QIcon::fromTheme("zoom-in", | |
256 | QIcon(":/icons/zoom-in.png"))); | |
257 | // simply using Qt::Key_Plus shows no + in the menu | |
258 | action_view_zoom_in_->setShortcut(QKeySequence::ZoomIn); | |
259 | action_view_zoom_in_->setObjectName( | |
260 | QString::fromUtf8("actionViewZoomIn")); | |
261 | menu_view->addAction(action_view_zoom_in_); | |
262 | ||
263 | action_view_zoom_out_->setText(tr("Zoom &Out")); | |
264 | action_view_zoom_out_->setIcon(QIcon::fromTheme("zoom-out", | |
265 | QIcon(":/icons/zoom-out.png"))); | |
266 | action_view_zoom_out_->setShortcut(QKeySequence::ZoomOut); | |
267 | action_view_zoom_out_->setObjectName( | |
268 | QString::fromUtf8("actionViewZoomOut")); | |
269 | menu_view->addAction(action_view_zoom_out_); | |
270 | ||
271 | action_view_zoom_fit_->setText(tr("Zoom to &Fit")); | |
272 | action_view_zoom_fit_->setIcon(QIcon::fromTheme("zoom-fit", | |
273 | QIcon(":/icons/zoom-fit.png"))); | |
274 | action_view_zoom_fit_->setShortcut(QKeySequence(Qt::Key_F)); | |
275 | action_view_zoom_fit_->setObjectName( | |
276 | QString::fromUtf8("actionViewZoomFit")); | |
277 | menu_view->addAction(action_view_zoom_fit_); | |
278 | ||
279 | action_view_zoom_one_to_one_->setText(tr("Zoom to O&ne-to-One")); | |
280 | action_view_zoom_one_to_one_->setIcon(QIcon::fromTheme("zoom-original", | |
281 | QIcon(":/icons/zoom-original.png"))); | |
282 | action_view_zoom_one_to_one_->setShortcut(QKeySequence(Qt::Key_O)); | |
283 | action_view_zoom_one_to_one_->setObjectName( | |
284 | QString::fromUtf8("actionViewZoomOneToOne")); | |
285 | menu_view->addAction(action_view_zoom_one_to_one_); | |
286 | ||
287 | menu_view->addSeparator(); | |
288 | ||
289 | action_view_show_cursors_->setCheckable(true); | |
290 | action_view_show_cursors_->setChecked(view_->cursors_shown()); | |
291 | action_view_show_cursors_->setIcon(QIcon::fromTheme("show-cursors", | |
292 | QIcon(":/icons/show-cursors.svg"))); | |
293 | action_view_show_cursors_->setShortcut(QKeySequence(Qt::Key_C)); | |
294 | action_view_show_cursors_->setObjectName( | |
295 | QString::fromUtf8("actionViewShowCursors")); | |
296 | action_view_show_cursors_->setText(tr("Show &Cursors")); | |
297 | menu_view->addAction(action_view_show_cursors_); | |
298 | ||
299 | // Decoders Menu | |
300 | #ifdef ENABLE_DECODE | |
301 | QMenu *const menu_decoders = new QMenu; | |
302 | menu_decoders->setTitle(tr("&Decoders")); | |
303 | ||
304 | menu_decoders_add_->setTitle(tr("&Add")); | |
305 | connect(menu_decoders_add_, SIGNAL(decoder_selected(srd_decoder*)), | |
306 | this, SLOT(add_decoder(srd_decoder*))); | |
307 | ||
308 | menu_decoders->addMenu(menu_decoders_add_); | |
309 | #endif | |
310 | ||
311 | // Help Menu | |
312 | QMenu *const menu_help = new QMenu; | |
313 | menu_help->setTitle(tr("&Help")); | |
314 | ||
315 | action_about_->setObjectName(QString::fromUtf8("actionAbout")); | |
316 | action_about_->setText(tr("&About...")); | |
317 | menu_help->addAction(action_about_); | |
318 | ||
319 | menu_bar->addAction(menu_file->menuAction()); | |
320 | menu_bar->addAction(menu_view->menuAction()); | |
321 | #ifdef ENABLE_DECODE | |
322 | menu_bar->addAction(menu_decoders->menuAction()); | |
323 | #endif | |
324 | menu_bar->addAction(menu_help->menuAction()); | |
325 | ||
326 | setMenuBar(menu_bar); | |
327 | QMetaObject::connectSlotsByName(this); | |
328 | ||
329 | // Setup the toolbar | |
330 | main_bar_ = new toolbars::MainBar(session_, *this); | |
331 | ||
332 | // Populate the device list and select the initially selected device | |
333 | update_device_list(); | |
334 | ||
335 | addToolBar(main_bar_); | |
336 | ||
337 | // Set the title | |
338 | setWindowTitle(tr("PulseView")); | |
339 | ||
340 | // Setup session_ events | |
341 | connect(&session_, SIGNAL(capture_state_changed(int)), this, | |
342 | SLOT(capture_state_changed(int))); | |
343 | connect(&session_, SIGNAL(device_selected()), this, | |
344 | SLOT(device_selected())); | |
345 | } | |
346 | ||
347 | void MainWindow::save_ui_settings() | |
348 | { | |
349 | QSettings settings; | |
350 | ||
351 | map<string, string> dev_info; | |
352 | list<string> key_list; | |
353 | ||
354 | settings.beginGroup("MainWindow"); | |
355 | settings.setValue("state", saveState()); | |
356 | settings.setValue("geometry", saveGeometry()); | |
357 | settings.endGroup(); | |
358 | ||
359 | if (session_.device()) { | |
360 | settings.beginGroup("Device"); | |
361 | key_list.push_back("vendor"); | |
362 | key_list.push_back("model"); | |
363 | key_list.push_back("version"); | |
364 | key_list.push_back("serial_num"); | |
365 | key_list.push_back("connection_id"); | |
366 | ||
367 | dev_info = device_manager_.get_device_info( | |
368 | session_.device()); | |
369 | ||
370 | for (string key : key_list) { | |
371 | ||
372 | if (dev_info.count(key)) | |
373 | settings.setValue(QString::fromUtf8(key.c_str()), | |
374 | QString::fromUtf8(dev_info.at(key).c_str())); | |
375 | else | |
376 | settings.remove(QString::fromUtf8(key.c_str())); | |
377 | } | |
378 | ||
379 | settings.endGroup(); | |
380 | } | |
381 | } | |
382 | ||
383 | void MainWindow::restore_ui_settings() | |
384 | { | |
385 | QSettings settings; | |
386 | ||
387 | shared_ptr<HardwareDevice> device; | |
388 | ||
389 | map<string, string> dev_info; | |
390 | list<string> key_list; | |
391 | string value; | |
392 | ||
393 | settings.beginGroup("MainWindow"); | |
394 | ||
395 | if (settings.contains("geometry")) { | |
396 | restoreGeometry(settings.value("geometry").toByteArray()); | |
397 | restoreState(settings.value("state").toByteArray()); | |
398 | } else | |
399 | resize(1000, 720); | |
400 | ||
401 | settings.endGroup(); | |
402 | ||
403 | // Re-select last used device if possible. | |
404 | settings.beginGroup("Device"); | |
405 | key_list.push_back("vendor"); | |
406 | key_list.push_back("model"); | |
407 | key_list.push_back("version"); | |
408 | key_list.push_back("serial_num"); | |
409 | key_list.push_back("connection_id"); | |
410 | ||
411 | for (string key : key_list) { | |
412 | if (!settings.contains(QString::fromUtf8(key.c_str()))) | |
413 | continue; | |
414 | ||
415 | value = settings.value(QString::fromUtf8(key.c_str())).toString().toStdString(); | |
416 | ||
417 | if (value.size() > 0) | |
418 | dev_info.insert(std::make_pair(key, value)); | |
419 | } | |
420 | ||
421 | device = device_manager_.find_device_from_info(dev_info); | |
422 | ||
423 | if (device) { | |
424 | select_device(device); | |
425 | update_device_list(); | |
426 | } | |
427 | ||
428 | settings.endGroup(); | |
429 | } | |
430 | ||
431 | void MainWindow::session_error( | |
432 | const QString text, const QString info_text) | |
433 | { | |
434 | QMetaObject::invokeMethod(this, "show_session_error", | |
435 | Qt::QueuedConnection, Q_ARG(QString, text), | |
436 | Q_ARG(QString, info_text)); | |
437 | } | |
438 | ||
439 | void MainWindow::update_device_list() | |
440 | { | |
441 | main_bar_->update_device_list(); | |
442 | } | |
443 | ||
444 | void MainWindow::closeEvent(QCloseEvent *event) | |
445 | { | |
446 | save_ui_settings(); | |
447 | event->accept(); | |
448 | } | |
449 | ||
450 | void MainWindow::keyReleaseEvent(QKeyEvent *event) | |
451 | { | |
452 | if (event->key() == Qt::Key_Alt) { | |
453 | menuBar()->setHidden(!menuBar()->isHidden()); | |
454 | menuBar()->setFocus(); | |
455 | } | |
456 | QMainWindow::keyReleaseEvent(event); | |
457 | } | |
458 | ||
459 | void MainWindow::load_file(QString file_name) | |
460 | { | |
461 | const QString errorMessage( | |
462 | QString("Failed to load file %1").arg(file_name)); | |
463 | const QString infoMessage; | |
464 | ||
465 | try { | |
466 | session_.set_session_file(file_name.toStdString()); | |
467 | } catch(Error e) { | |
468 | show_session_error(tr("Failed to load ") + file_name, e.what()); | |
469 | session_.set_default_device(); | |
470 | update_device_list(); | |
471 | return; | |
472 | } | |
473 | ||
474 | update_device_list(); | |
475 | ||
476 | session_.start_capture([&, errorMessage, infoMessage](QString) { | |
477 | session_error(errorMessage, infoMessage); }); | |
478 | } | |
479 | ||
480 | void MainWindow::show_session_error( | |
481 | const QString text, const QString info_text) | |
482 | { | |
483 | QMessageBox msg(this); | |
484 | msg.setText(text); | |
485 | msg.setInformativeText(info_text); | |
486 | msg.setStandardButtons(QMessageBox::Ok); | |
487 | msg.setIcon(QMessageBox::Warning); | |
488 | msg.exec(); | |
489 | } | |
490 | ||
491 | void MainWindow::on_actionOpen_triggered() | |
492 | { | |
493 | QSettings settings; | |
494 | const QString dir = settings.value(SettingOpenDirectory).toString(); | |
495 | ||
496 | // Show the dialog | |
497 | const QString file_name = QFileDialog::getOpenFileName( | |
498 | this, tr("Open File"), dir, tr( | |
499 | "Sigrok Sessions (*.sr);;" | |
500 | "All Files (*.*)")); | |
501 | ||
502 | if (!file_name.isEmpty()) { | |
503 | load_file(file_name); | |
504 | ||
505 | const QString abs_path = QFileInfo(file_name).absolutePath(); | |
506 | settings.setValue(SettingOpenDirectory, abs_path); | |
507 | } | |
508 | } | |
509 | ||
510 | void MainWindow::on_actionSaveAs_triggered() | |
511 | { | |
512 | using pv::dialogs::StoreProgress; | |
513 | ||
514 | // Stop any currently running capture session | |
515 | session_.stop_capture(); | |
516 | ||
517 | QSettings settings; | |
518 | const QString dir = settings.value(SettingSaveDirectory).toString(); | |
519 | ||
520 | // Show the dialog | |
521 | const QString file_name = QFileDialog::getSaveFileName( | |
522 | this, tr("Save File"), dir, tr("Sigrok Sessions (*.sr)")); | |
523 | ||
524 | if (file_name.isEmpty()) | |
525 | return; | |
526 | ||
527 | const QString abs_path = QFileInfo(file_name).absolutePath(); | |
528 | settings.setValue(SettingSaveDirectory, abs_path); | |
529 | ||
530 | StoreProgress *dlg = new StoreProgress(file_name, | |
531 | device_manager_.context()->output_formats()["srzip"], | |
532 | session_, this); | |
533 | dlg->run(); | |
534 | } | |
535 | ||
536 | void MainWindow::on_actionConnect_triggered() | |
537 | { | |
538 | // Stop any currently running capture session | |
539 | session_.stop_capture(); | |
540 | ||
541 | dialogs::Connect dlg(this, device_manager_); | |
542 | ||
543 | // If the user selected a device, select it in the device list. Select the | |
544 | // current device otherwise. | |
545 | if (dlg.exec()) | |
546 | select_device(dlg.get_selected_device()); | |
547 | ||
548 | update_device_list(); | |
549 | } | |
550 | ||
551 | void MainWindow::on_actionQuit_triggered() | |
552 | { | |
553 | close(); | |
554 | } | |
555 | ||
556 | void MainWindow::on_actionViewZoomIn_triggered() | |
557 | { | |
558 | view_->zoom(1); | |
559 | } | |
560 | ||
561 | void MainWindow::on_actionViewZoomOut_triggered() | |
562 | { | |
563 | view_->zoom(-1); | |
564 | } | |
565 | ||
566 | void MainWindow::on_actionViewZoomFit_triggered() | |
567 | { | |
568 | view_->zoom_fit(); | |
569 | } | |
570 | ||
571 | void MainWindow::on_actionViewZoomOneToOne_triggered() | |
572 | { | |
573 | view_->zoom_one_to_one(); | |
574 | } | |
575 | ||
576 | void MainWindow::on_actionViewShowCursors_triggered() | |
577 | { | |
578 | assert(view_); | |
579 | ||
580 | const bool show = !view_->cursors_shown(); | |
581 | if(show) | |
582 | view_->centre_cursors(); | |
583 | ||
584 | view_->show_cursors(show); | |
585 | } | |
586 | ||
587 | void MainWindow::on_actionAbout_triggered() | |
588 | { | |
589 | dialogs::About dlg(device_manager_.context(), this); | |
590 | dlg.exec(); | |
591 | } | |
592 | ||
593 | void MainWindow::add_decoder(srd_decoder *decoder) | |
594 | { | |
595 | #ifdef ENABLE_DECODE | |
596 | assert(decoder); | |
597 | session_.add_decoder(decoder); | |
598 | #else | |
599 | (void)decoder; | |
600 | #endif | |
601 | } | |
602 | ||
603 | void MainWindow::capture_state_changed(int state) | |
604 | { | |
605 | main_bar_->set_capture_state((pv::Session::capture_state)state); | |
606 | } | |
607 | ||
608 | void MainWindow::device_selected() | |
609 | { | |
610 | // Set the title to include the device/file name | |
611 | const shared_ptr<sigrok::Device> device = session_.device(); | |
612 | if (!device) | |
613 | return; | |
614 | ||
615 | const string display_name = device_manager_.get_display_name(device); | |
616 | setWindowTitle(tr("%1 - PulseView").arg(display_name.c_str())); | |
617 | } | |
618 | ||
619 | } // namespace pv |