summaryrefslogtreecommitdiff
path: root/noncore/settings/netsystemtime/ntp.cpp
Unidiff
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 @@
9#include <qspinbox.h> 9#include <qspinbox.h>
10#include <qcheckbox.h>
11#include <qtabwidget.h>
12#include <qlayout.h>
10#include <qmessagebox.h> 13#include <qmessagebox.h>
@@ -41,6 +44,12 @@ Ntp::Ntp( QWidget* parent, const char* name, WFlags fl )
41 cfg.setGroup("settings"); 44 cfg.setGroup("settings");
42 SpinBoxMinLookupDelay->setValue( cfg.readNumEntry("minLookupDiff",41) ); 45 SpinBoxMinLookupDelay->setValue( cfg.readNumEntry("minLookupDiff",720) );
43 SpinBoxNtpDelay->setValue( cfg.readNumEntry("ntpRefreshFreq",42) ); 46 SpinBoxNtpDelay->setValue( cfg.readNumEntry("ntpRefreshFreq",1440) );
44 ComboNtpSrv->setCurrentItem( cfg.readNumEntry("ntpServer", 0) ); 47 ComboNtpSrv->setCurrentItem( cfg.readNumEntry("ntpServer", 0) );
45 48
49 bool advMode = cfg.readBoolEntry("advancedFeatures", false );
50 showAdvancedFeatures(advMode);
51 CheckBoxAdvSettings->setChecked( advMode );
52 connect( CheckBoxAdvSettings, SIGNAL( toggled( bool ) ),
53 SLOT( showAdvancedFeatures( bool ) ) );
54
46 makeChannel(); 55 makeChannel();
@@ -144,3 +153,3 @@ void Ntp::ntpFinished(OProcess *p)
144{ 153{
145 qDebug("p->exitStatus() %i",p->exitStatus()); 154 //qDebug("p->exitStatus() %i",p->exitStatus());
146 if (p->exitStatus()!=0 || !p->normalExit()) 155 if (p->exitStatus()!=0 || !p->normalExit())
@@ -279,3 +288,3 @@ void Ntp::slotCheckNtp(int i)
279 preditctTime(); 288 preditctTime();
280 ButtonSetTime->setText( tr("Set predicted time") ); 289 ButtonSetTime->setText( tr("Set predicted time: ")+predictedTime.toString() );
281 if (i>0)ntpOutPut(tr("Could not connect to server ")+getNtpServer()); 290 if (i>0)ntpOutPut(tr("Could not connect to server ")+getNtpServer());
@@ -288,3 +297,2 @@ void Ntp::slotProbeNtpServer()
288{ 297{
289 qDebug("Ntp::slotProbeNtpServer()");
290 ntpSock->connectToHost( getNtpServer() ,123); 298 ntpSock->connectToHost( getNtpServer() ,123);
@@ -332 +340,28 @@ void Ntp::setDocument(const QString &fileName)
332} 340}
341
342void Ntp::showAdvancedFeatures(bool advMode)
343{
344 if (advMode) {
345 TabWidgetMain->addTab( tabPredict, tr( "Predict" ) );
346 TabWidgetMain->addTab( tabNtp, tr( "NTP" ) );
347 TextLabel1_2_2->show();
348 TextLabel2_3->show();
349 TextLabel3_3_2->show();
350 TextLabel1_2->show();
351 SpinBoxMinLookupDelay->show();
352 TextLabel2->show();
353 TextLabel3_3->show();
354 SpinBoxNtpDelay->show();
355 }else{
356 TabWidgetMain->removePage( tabPredict );
357 TabWidgetMain->removePage( tabNtp );
358 TextLabel1_2_2->hide();
359 TextLabel2_3->hide();
360 TextLabel3_3_2->hide();
361 TextLabel1_2->hide();
362 SpinBoxMinLookupDelay->hide();
363 TextLabel2->hide();
364 TextLabel3_3->hide();
365 SpinBoxNtpDelay->hide();
366 };
367}