diff --git a/wfmain.cpp b/wfmain.cpp index fd2ebce..ebb4634 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -953,14 +953,6 @@ void wfmain::setServerToPrefs() // Start server if enabled in config ui->serverSetupGroup->setEnabled(serverConfig.enabled); - if (serverThread != Q_NULLPTR) { - serverThread->quit(); - serverThread->wait(); - serverThread = Q_NULLPTR; - udp = Q_NULLPTR; - ui->statusBar->showMessage(QString("Server disabled"), 1000); - } - if (serverConfig.enabled) { serverConfig.lan = prefs.enableLAN; @@ -982,7 +974,6 @@ void wfmain::setServerToPrefs() emit initServer(); connect(this, SIGNAL(sendRigCaps(rigCapabilities)), udp, SLOT(receiveRigCaps(rigCapabilities))); - ui->statusBar->showMessage(QString("Server enabled"), 1000); } } @@ -1885,6 +1876,10 @@ void wfmain::saveSettings() settings->beginGroup("Server"); + serverConfig.controlPort = ui->serverControlPortText->text().toInt(); + serverConfig.civPort = ui->serverCivPortText->text().toInt(); + serverConfig.audioPort = ui->serverAudioPortText->text().toInt(); + settings->setValue("ServerEnabled", serverConfig.enabled); settings->setValue("ServerControlPort", serverConfig.controlPort); settings->setValue("ServerCivPort", serverConfig.civPort); @@ -4556,6 +4551,35 @@ void wfmain::on_audioInputCombo_currentIndexChanged(int value) qDebug(logGui()) << "Changed default audio input to:" << txSetup.name; } + +void wfmain::on_serverRXAudioInputCombo_currentIndexChanged(int value) +{ +#if defined(RTAUDIO) + serverRxSetup.port = ui->serverRXAudioInputCombo->itemData(value).toInt(); +#elif defined(PORTAUDIO) + serverRxSetup.port = ui->serverRXAudioInputCombo->itemData(value).toInt(); +#else + QVariant v = ui->serverRXAudioInputCombo->itemData(value); + serverRxSetup.port = v.value(); +#endif + serverRxSetup.name = ui->serverRXAudioInputCombo->itemText(value); + qDebug(logGui()) << "Changed default server audio input to:" << serverRxSetup.name; +} + +void wfmain::on_serverTXAudioOutputCombo_currentIndexChanged(int value) +{ +#if defined(RTAUDIO) + serverTxSetup.port = ui->serverTXAudioOutputCombo->itemData(value).toInt(); +#elif defined(PORTAUDIO) + serverTxSetup.port = ui->serverTXAudioOutputCombo->itemData(value).toInt(); +#else + QVariant v = ui->serverTXAudioOutputCombo->itemData(value); + serverTxSetup.port = v.value(); +#endif + serverTxSetup.name = ui->serverTXAudioOutputCombo->itemText(value); + qDebug(logGui()) << "Changed default server audio output to:" << serverTxSetup.name; +} + void wfmain::on_audioSampleRateCombo_currentIndexChanged(QString text) { //udpPrefs.audioRXSampleRate = text.toInt(); @@ -5664,50 +5688,6 @@ void wfmain::on_serverEnableCheckbox_clicked(bool checked) { ui->serverSetupGroup->setEnabled(checked); serverConfig.enabled = checked; - setServerToPrefs(); -} - -void wfmain::on_serverControlPortText_textChanged(QString text) -{ - serverConfig.controlPort = ui->serverControlPortText->text().toInt(); -} - -void wfmain::on_serverCivPortText_textChanged(QString text) -{ - serverConfig.civPort = ui->serverCivPortText->text().toInt(); -} - -void wfmain::on_serverAudioPortText_textChanged(QString text) -{ - serverConfig.audioPort = ui->serverAudioPortText->text().toInt(); -} - -void wfmain::on_serverRXAudioInputCombo_currentIndexChanged(int value) -{ -#if defined(RTAUDIO) - serverRxSetup.port = ui->serverRXaudioInputCombo->itemData(value).toInt(); -#elif defined(PORTAUDIO) - serverRxSetup.port = ui->serverRXaudioInputCombo->itemData(value).toInt(); -#else - QVariant v = ui->serverRXAudioInputCombo->itemData(value); - serverRxSetup.port = v.value(); -#endif - serverRxSetup.name = ui->serverRXAudioInputCombo->itemText(value); - qDebug(logGui()) << "Changed default server audio input to:" << serverRxSetup.name; -} - -void wfmain::on_serverTXAudioOutputCombo_currentIndexChanged(int value) -{ -#if defined(RTAUDIO) - serverTxSetup.port = ui->serverTXAudioOutputCombo->itemData(value).toInt(); -#elif defined(PORTAUDIO) - serverTxSetup.port = ui->serverTXAudioOutputCombo->itemData(value).toInt(); -#else - QVariant v = ui->serverTXAudioOutputCombo->itemData(value); - serverTxSetup.port = v.value(); -#endif - serverTxSetup.name = ui->serverTXAudioOutputCombo->itemText(value); - qDebug(logGui()) << "Changed default server audio output to:" << serverTxSetup.name; } // --- DEBUG FUNCTION --- diff --git a/wfmain.h b/wfmain.h index b9bd713..09a8b86 100644 --- a/wfmain.h +++ b/wfmain.h @@ -385,6 +385,10 @@ private slots: void on_audioInputCombo_currentIndexChanged(int value); + void on_serverTXAudioOutputCombo_currentIndexChanged(int value); + + void on_serverRXAudioInputCombo_currentIndexChanged(int value); + void on_toFixedBtn_clicked(); void on_connectBtn_clicked(); @@ -506,12 +510,9 @@ private slots: void on_setClockBtn_clicked(); void on_serverEnableCheckbox_clicked(bool checked); + void on_serverUsersTable_cellClicked(int row, int col); - void on_serverControlPortText_textChanged(QString text); - void on_serverCivPortText_textChanged(QString text); - void on_serverAudioPortText_textChanged(QString text); - void on_serverTXAudioOutputCombo_currentIndexChanged(int value); - void on_serverRXAudioInputCombo_currentIndexChanged(int value); + void onServerPasswordChanged(); void on_useRTSforPTTchk_clicked(bool checked); diff --git a/wfview.vcxproj.filters b/wfview.vcxproj.filters index bfaabf2..051ed7d 100644 --- a/wfview.vcxproj.filters +++ b/wfview.vcxproj.filters @@ -120,6 +120,9 @@ Source Files + + Source Files + Source Files @@ -200,6 +203,9 @@ Header Files + + Header Files + Header Files @@ -369,6 +375,7 @@ Resource Files + @@ -384,4 +391,9 @@ + + + Generated Files + + \ No newline at end of file