]> sigrok.org Git - pulseview.git/blobdiff - pv/toolbars/mainbar.cpp
Session/MainBar: Fix device change handling
[pulseview.git] / pv / toolbars / mainbar.cpp
index 6a5992bf53ce60e7872d0e895ba09f49f35646d6..1875d3c415a34fab1cb8d2c0e65c5e486c16e7cd 100644 (file)
@@ -236,6 +236,8 @@ MainBar::MainBar(Session &session, MainWindow &main_window) :
        // Device selector menu
        connect(&device_selector_, SIGNAL(device_selected()),
                this, SLOT(on_device_selected()));
+       connect(&session, SIGNAL(device_changed()),
+               this, SLOT(on_device_changed()));
 
        // Setup the decoder button
 #ifdef ENABLE_DECODE
@@ -301,8 +303,6 @@ MainBar::MainBar(Session &session, MainWindow &main_window) :
        sample_count_.installEventFilter(this);
        sample_rate_.installEventFilter(this);
 
-       QMetaObject::connectSlotsByName(this);
-
        // Setup session_ events
        connect(&session_, SIGNAL(capture_state_changed(int)), this,
                SLOT(capture_state_changed(int)));
@@ -909,7 +909,11 @@ void MainBar::on_device_selected()
        }
 
        select_device(device);
+}
 
+void MainBar::on_device_changed()
+{
+       update_device_list();
        update_device_config_widgets();
 }