diff --git a/settingswidget.cpp b/settingswidget.cpp index 12a0068..dca1d08 100644 --- a/settingswidget.cpp +++ b/settingswidget.cpp @@ -2723,6 +2723,18 @@ void settingswidget::connectionStatus(bool conn) ui->serverRXAudioInputCombo->setEnabled(!conn); ui->serverTXAudioOutputCombo->setEnabled(!conn); ui->audioSystemServerCombo->setEnabled(!conn); + + if(conn) { + ui->connectBtn->setText("Disconnect from radio"); + } else { + ui->connectBtn->setText("Connect to radio"); + } } + +void settingswidget::on_connectBtn_clicked() +{ + emit connectButtonPressed(); +} + diff --git a/settingswidget.h b/settingswidget.h index 1c06c05..38c61e6 100644 --- a/settingswidget.h +++ b/settingswidget.h @@ -96,6 +96,7 @@ signals: void changedClusterPref(prefClusterItem i); void changedUdpPref(prefUDPItem i); void changedServerPref(prefServerItem i); + void connectButtonPressed(); private slots: void on_settingsList_currentRowChanged(int currentRow); @@ -240,6 +241,8 @@ private slots: void on_revCompMeterBtn_clicked(bool checked); + void on_connectBtn_clicked(); + private: Ui::settingswidget *ui; void createSettingsListItems(); diff --git a/settingswidget.ui b/settingswidget.ui index f4e9066..e02ab10 100644 --- a/settingswidget.ui +++ b/settingswidget.ui @@ -41,7 +41,7 @@ - 1 + 0 @@ -734,6 +734,13 @@ ONLY use Manual CI-V when Transceive mode is not supported 0 + + + + Connect To Radio + + + diff --git a/wfmain.cpp b/wfmain.cpp index 654d308..2864e2b 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -886,6 +886,7 @@ void wfmain::connectSettingsWidget() //connect(setupui, SIGNAL(changedServerTXAudioOutputCombo(int)), this, SLOT(changedServerTXAudioOutput(int))); connect(this, SIGNAL(connectionStatus(bool)), setupui, SLOT(connectionStatus(bool))); + connect(setupui, SIGNAL(connectButtonPressed()), this, SLOT(handleExtConnectBtn())); } // NOT Migrated, EHL TODO, carefully remove this function @@ -4398,6 +4399,11 @@ void wfmain::receiveATUStatus(unsigned char atustatus) } } +void wfmain::handleExtConnectBtn() { + // from settings widget + on_connectBtn_clicked(); +} + void wfmain::on_connectBtn_clicked() { this->rigStatus->setText(""); // Clear status diff --git a/wfmain.h b/wfmain.h index 337ffa2..2c6989b 100644 --- a/wfmain.h +++ b/wfmain.h @@ -329,6 +329,8 @@ private slots: void extChangedUdpPref(prefUDPItem i); void extChangedServerPref(prefServerItem i); + void handleExtConnectBtn(); + void receiveScopeSettings(uchar vfo, int theme, quint16 len, int floor, int ceiling); void receiveValue(cacheItem val); void setAudioDevicesUI();