summaryrefslogtreecommitdiff
path: root/noncore/settings/netsystemtime/ntp.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/netsystemtime/ntp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/netsystemtime/ntp.cpp45
1 files changed, 40 insertions, 5 deletions
diff --git a/noncore/settings/netsystemtime/ntp.cpp b/noncore/settings/netsystemtime/ntp.cpp
index fbd65a2..6f6316c 100644
--- a/noncore/settings/netsystemtime/ntp.cpp
+++ b/noncore/settings/netsystemtime/ntp.cpp
@@ -9,2 +9,5 @@
#include <qspinbox.h>
+#include <qcheckbox.h>
+#include <qtabwidget.h>
+#include <qlayout.h>
#include <qmessagebox.h>
@@ -41,6 +44,12 @@ Ntp::Ntp( QWidget* parent, const char* name, WFlags fl )
cfg.setGroup("settings");
- SpinBoxMinLookupDelay->setValue( cfg.readNumEntry("minLookupDiff",41) );
- SpinBoxNtpDelay->setValue( cfg.readNumEntry("ntpRefreshFreq",42) );
+ SpinBoxMinLookupDelay->setValue( cfg.readNumEntry("minLookupDiff",720) );
+ SpinBoxNtpDelay->setValue( cfg.readNumEntry("ntpRefreshFreq",1440) );
ComboNtpSrv->setCurrentItem( cfg.readNumEntry("ntpServer", 0) );
+ bool advMode = cfg.readBoolEntry("advancedFeatures", false );
+ showAdvancedFeatures(advMode);
+ CheckBoxAdvSettings->setChecked( advMode );
+ connect( CheckBoxAdvSettings, SIGNAL( toggled( bool ) ),
+ SLOT( showAdvancedFeatures( bool ) ) );
+
makeChannel();
@@ -144,3 +153,3 @@ void Ntp::ntpFinished(OProcess *p)
{
- qDebug("p->exitStatus() %i",p->exitStatus());
+ // qDebug("p->exitStatus() %i",p->exitStatus());
if (p->exitStatus()!=0 || !p->normalExit())
@@ -279,3 +288,3 @@ void Ntp::slotCheckNtp(int i)
preditctTime();
- ButtonSetTime->setText( tr("Set predicted time") );
+ ButtonSetTime->setText( tr("Set predicted time: ")+predictedTime.toString() );
if (i>0)ntpOutPut(tr("Could not connect to server ")+getNtpServer());
@@ -288,3 +297,2 @@ void Ntp::slotProbeNtpServer()
{
- qDebug("Ntp::slotProbeNtpServer()");
ntpSock->connectToHost( getNtpServer() ,123);
@@ -332 +340,28 @@ void Ntp::setDocument(const QString &fileName)
}
+
+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();
+ }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();
+ };
+}