-rw-r--r-- | noncore/settings/netsystemtime/ntp.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/noncore/settings/netsystemtime/ntp.cpp b/noncore/settings/netsystemtime/ntp.cpp index 6f6316c..f60e38d 100644 --- a/noncore/settings/netsystemtime/ntp.cpp +++ b/noncore/settings/netsystemtime/ntp.cpp @@ -74,34 +74,34 @@ Ntp::Ntp( QWidget* parent, const char* name, WFlags fl ) connect(PushButtonSetPredTime, SIGNAL(clicked()), this, SLOT(setPredictTime())); slotCheckNtp(-1); readLookups(); } Ntp::~Ntp() { delete ntpProcess; Config ntpSrvs("/etc/ntpservers",Config::File); ntpSrvs.setGroup("servers"); int srvCount = ComboNtpSrv->count(); ntpSrvs.writeEntry("count", srvCount); - for (int i = 0; i < srvCount; i++) - { + for (int i = 0; i < srvCount; i++){ ntpSrvs.setGroup(QString::number(i)); ntpSrvs.writeEntry( "name", ComboNtpSrv->text(i) ); } Config cfg("ntp",Config::User); cfg.setGroup("settings"); cfg.writeEntry("ntpServer", ComboNtpSrv->currentItem()); cfg.writeEntry( "minLookupDiff", SpinBoxMinLookupDelay->value() ); cfg.writeEntry( "ntpRefreshFreq", SpinBoxNtpDelay->value() ); + cfg.writeEntry( "advancedFeatures", CheckBoxAdvSettings->isChecked() ); } bool Ntp::ntpDelayElapsed() { Config cfg("ntp",Config::User); cfg.setGroup("lookups"); _lookupDiff = TimeConversion::toUTC(QDateTime::currentDateTime()) - cfg.readNumEntry("time",0); return (_lookupDiff - (SpinBoxNtpDelay->value()*60)) > -60; } QString Ntp::getNtpServer() { @@ -343,25 +343,28 @@ void Ntp::showAdvancedFeatures(bool advMode) { if (advMode) { TabWidgetMain->addTab( tabPredict, tr( "Predict" ) ); TabWidgetMain->addTab( tabNtp, tr( "NTP" ) ); TextLabel1_2_2->show(); TextLabel2_3->show(); TextLabel3_3_2->show(); TextLabel1_2->show(); SpinBoxMinLookupDelay->show(); TextLabel2->show(); TextLabel3_3->show(); SpinBoxNtpDelay->show(); + Line1->show(); }else{ TabWidgetMain->removePage( tabPredict ); TabWidgetMain->removePage( tabNtp ); TextLabel1_2_2->hide(); TextLabel2_3->hide(); TextLabel3_3_2->hide(); TextLabel1_2->hide(); SpinBoxMinLookupDelay->hide(); TextLabel2->hide(); TextLabel3_3->hide(); SpinBoxNtpDelay->hide(); + Line1->hide(); }; + TabWidgetMain->show(); } |