Skip to content

Commit 5067e56

Browse files
committed
Qt Gui: Fix updating option dialog for rtkpost_qt and rtknavi_qt
- option dialog did not show the latest options
1 parent ffe4d49 commit 5067e56

2 files changed

Lines changed: 40 additions & 34 deletions

File tree

app/qtapp/appcmn_qt/navi_post_opt.cpp

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ void OptDialog::showEvent(QShowEvent *event)
366366

367367
ui->tWOptions->setCurrentIndex(0);
368368

369-
updateEnable();
369+
updateUi(processingOptions, solutionOptions, fileOptions);
370370
}
371371
//---------------------------------------------------------------------------
372372
void OptDialog::loadSettings()
@@ -883,41 +883,22 @@ void OptDialog::updateOptions()
883883
baseList = ui->tEBaseList->toPlainText();
884884
}
885885
}
886-
887-
//---------------------------------------------------------------------------
888-
void OptDialog::accept()
889-
{
890-
updateOptions();
891-
892-
QDialog::accept();
893-
}
894-
//---------------------------------------------------------------------------
895-
void OptDialog::load(const QString &file)
886+
void OptDialog::updateUi(const prcopt_t &prcopt, const solopt_t &solopt, const filopt_t &filopt)
896887
{
897888
QLineEdit *editu[] = {ui->lERoverPosition1, ui->lERoverPosition2, ui->lERoverPosition3};
898889
QLineEdit *editr[] = {ui->lEReferencePosition1, ui->lEReferencePosition2, ui->lEReferencePosition3};
899-
prcopt_t prcopt = prcopt_default;
900-
solopt_t solopt = solopt_default;
901-
filopt_t filopt;
902-
903-
memset(&filopt, 0, sizeof(filopt_t));
904890

905-
resetsysopts();
906-
if (!loadopts(qPrintable(file), sysopts)) return;
907-
if (appOptions && !loadopts(qPrintable(file), appOptions)) return;
908-
if (!loadopts(qPrintable(file), naviopts)) return;
909-
getsysopts(&prcopt, &solopt, &filopt);
910891
proxyAddress = proxyaddr;
911892

912893
if (options == NaviOptions) {
913-
ui->sBServerCycle->setValue(serverCycle);
914-
ui->sBTimeoutTime->setValue(timeoutTime);
915-
ui->sBReconnectTime->setValue(reconnectTime);
916-
ui->sBNmeaCycle->setValue(nmeaCycle);
917-
ui->sBServerBufferSize->setValue(serverBufferSize);
918-
ui->cBNavSelect->setCurrentIndex(navSelect);
919-
ui->lEProxyAddress->setText(proxyaddr);
920-
ui->sBFileSwapMargin->setValue(fileSwapMargin);
894+
ui->sBServerCycle->setValue(serverCycle);
895+
ui->sBTimeoutTime->setValue(timeoutTime);
896+
ui->sBReconnectTime->setValue(reconnectTime);
897+
ui->sBNmeaCycle->setValue(nmeaCycle);
898+
ui->sBServerBufferSize->setValue(serverBufferSize);
899+
ui->cBNavSelect->setCurrentIndex(navSelect);
900+
ui->lEProxyAddress->setText(proxyaddr);
901+
ui->sBFileSwapMargin->setValue(fileSwapMargin);
921902
}
922903

923904
ui->sBSbasSatellite->setValue(prcopt.sbassatsel);
@@ -1071,7 +1052,31 @@ void OptDialog::load(const QString &file)
10711052
// filopt.trace
10721053

10731054
readAntennaList();
1074-
updateEnable();
1055+
updateEnable();
1056+
}
1057+
//---------------------------------------------------------------------------
1058+
void OptDialog::accept()
1059+
{
1060+
updateOptions();
1061+
1062+
QDialog::accept();
1063+
}
1064+
//---------------------------------------------------------------------------
1065+
void OptDialog::load(const QString &file)
1066+
{
1067+
prcopt_t prcopt = prcopt_default;
1068+
solopt_t solopt = solopt_default;
1069+
filopt_t filopt;
1070+
1071+
memset(&filopt, 0, sizeof(filopt_t));
1072+
1073+
resetsysopts();
1074+
if (!loadopts(qPrintable(file), sysopts)) return;
1075+
if (appOptions && !loadopts(qPrintable(file), appOptions)) return;
1076+
if (!loadopts(qPrintable(file), naviopts)) return;
1077+
getsysopts(&prcopt, &solopt, &filopt);
1078+
1079+
updateUi(prcopt, solopt, filopt);
10751080
}
10761081
//---------------------------------------------------------------------------
10771082
void OptDialog::save(const QString &file)
@@ -1875,7 +1880,7 @@ int OptDialog::getPosition(int type, QLineEdit **edit, double *pos)
18751880
return ret;
18761881
}
18771882
//---------------------------------------------------------------------------
1878-
void OptDialog::setPosition(int type, QLineEdit **edit, double *pos)
1883+
void OptDialog::setPosition(int type, QLineEdit **edit, const double *pos)
18791884
{
18801885
double p[3], dms1[3], dms2[3], s1, s2;
18811886

@@ -1977,7 +1982,7 @@ void OptDialog::showFrequenciesDialog()
19771982
delete freqDialog;
19781983
}
19791984
//---------------------------------------------------------------------------
1980-
QString OptDialog::excludedSatellitesString(prcopt_t *prcopt)
1985+
QString OptDialog::excludedSatellitesString(const prcopt_t *prcopt)
19811986
{
19821987
QString buff;
19831988
char id[32];

app/qtapp/appcmn_qt/navi_post_opt.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class OptDialog : public QDialog
4949

5050
protected:
5151
void showEvent(QShowEvent*);
52-
QString excludedSatellitesString(prcopt_t *prcopt);
52+
QString excludedSatellitesString(const prcopt_t *prcopt);
5353
bool fillExcludedSatellites(prcopt_t *prcopt, const QString &excludedSatellites);
5454

5555
char proxyaddr[1024]; // proxy address stores in naviopts
@@ -75,7 +75,7 @@ protected slots:
7575
void referencePositionTypeChanged(int);
7676
void roverPositionTypeChanged(int);
7777
int getPosition(int type, QLineEdit **edit, double *pos);
78-
void setPosition(int type, QLineEdit **edit, double *pos);
78+
void setPosition(int type, QLineEdit **edit, const double *pos);
7979
void selectPanelFont();
8080
void selectSolutionFont();
8181
void selectGeoidDataFile();
@@ -100,6 +100,7 @@ protected slots:
100100
void showFrequenciesDialog();
101101
void showKeyDialog();
102102
void updateOptions();
103+
void updateUi(const prcopt_t &prcopt, const solopt_t &solopt, const filopt_t &filopt);
103104
QString stripped(const QString input, const QString suffix) const;
104105
int options;
105106
Ui::OptDialog *ui;

0 commit comments

Comments
 (0)