X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fmainwindow.cpp;h=142eb3f1c08960a8db7be4cbfe964574c5aa8d1c;hp=a43b575a989446ede299f6b56662c7369d4c33ce;hb=20f81a58a9778fa7bc0dc4367f913437ed27c5e8;hpb=b825c9cdf25562b17b61f2472e86cdadadeab2c6 diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index a43b575..142eb3f 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -270,6 +270,8 @@ void MainWindow::setup_ui() // Setup session_ events connect(&session_, SIGNAL(capture_state_changed(int)), this, SLOT(capture_state_changed(int))); + connect(&session_, SIGNAL(device_selected()), this, + SLOT(device_selected())); } void MainWindow::save_ui_settings() @@ -559,4 +561,15 @@ void MainWindow::capture_state_changed(int state) sampling_bar_->set_capture_state((pv::SigSession::capture_state)state); } +void MainWindow::device_selected() +{ + // Set the title to include the device/file name + const shared_ptr device = session_.device(); + if (!device) + return; + + const string display_name = device_manager_.get_display_name(device); + setWindowTitle(tr("%1 - PulseView").arg(display_name.c_str())); +} + } // namespace pv