Skip to content

Commit

Permalink
Message box to restart if UDP setup is changed
Browse files Browse the repository at this point in the history
  • Loading branch information
PianetaRadio authored Oct 22, 2022
1 parent 68766bb commit 6978e99
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion dialogsetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <QFile>
#include <QFileDialog>
#include <QDir>
#include <QMessageBox>

extern catRotatorConfig rotCfg;

Expand Down Expand Up @@ -64,8 +65,19 @@ void DialogSetup::on_pushButton_WSJTX_clicked()

void DialogSetup::on_buttonBox_accepted()
{
//MessageBox to restart if UDP config is changed
if ((rotCfg.udp != ui->checkBox_udp->isChecked()) || (rotCfg.udpAddress != ui->lineEdit_udpAddress->text()) || (rotCfg.udpPort != ui->lineEdit_udpPort->text().toUShort()))
{
QMessageBox msgBox;
msgBox.setWindowTitle("UDP");
msgBox.setText("Please, restart CatRotator to make effective the UDP setup changes.");
msgBox.setIcon(QMessageBox::Information);
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.exec();
}

rotCfg.qthLocator = ui->lineEdit_qthLocator->text();
rotCfg.udp = ui->checkBox_udp->checkState();
rotCfg.udp = ui->checkBox_udp->isChecked();
rotCfg.udpAddress = ui->lineEdit_udpAddress->text();
rotCfg.udpPort = ui->lineEdit_udpPort->text().toUShort();
rotCfg.pathTrackWSJTX = ui->lineEdit_WSJTX->text();
Expand Down

0 comments on commit 6978e99

Please sign in to comment.