diff --git a/connectionwindow.cpp b/connectionwindow.cpp index ad46e77..8a8ea45 100644 --- a/connectionwindow.cpp +++ b/connectionwindow.cpp @@ -48,6 +48,9 @@ ConnectionWindow::ConnectionWindow(QWidget *parent) : #endif connect(ui->btnOK, SIGNAL(clicked(bool)), this, SLOT(handleOKButton())); + connect(ui->rbGVRET, SIGNAL(toggled(bool)), this, SLOT(handleConnTypeChanged())); + connect(ui->rbKvaser, SIGNAL(toggled(bool)), this, SLOT(handleConnTypeChanged())); + connect(ui->rbSocketCAN, SIGNAL(toggled(bool)), this, SLOT(handleConnTypeChanged())); } ConnectionWindow::~ConnectionWindow() @@ -60,6 +63,11 @@ void ConnectionWindow::showEvent(QShowEvent* event) { QDialog::showEvent(event); qDebug() << "Show connectionwindow"; + handleConnTypeChanged(); +} + +void ConnectionWindow::handleConnTypeChanged() +{ if (ui->rbGVRET->isChecked()) getSerialPorts(); if (ui->rbKvaser->isChecked()) getKvaserPorts(); if (ui->rbSocketCAN->isChecked()) getSocketcanPorts(); diff --git a/connectionwindow.h b/connectionwindow.h index 3315006..e098f67 100644 --- a/connectionwindow.h +++ b/connectionwindow.h @@ -43,6 +43,7 @@ public slots: private slots: void handleOKButton(); + void handleConnTypeChanged(); private: Ui::ConnectionWindow *ui;