author | tille <tille> | 2002-10-21 20:32:05 (UTC) |
---|---|---|
committer | tille <tille> | 2002-10-21 20:32:05 (UTC) |
commit | 1f4ab9228e9e7db275e42a3e7fcf9affdd5c447b (patch) (side-by-side diff) | |
tree | f33d988d7fb7b65637abc563cfae8b76a293ef14 /noncore/settings/netsystemtime/ntp.cpp | |
parent | 9d1a8e414d0c532266297a253e37afe19fa84ccf (diff) | |
download | opie-1f4ab9228e9e7db275e42a3e7fcf9affdd5c447b.zip opie-1f4ab9228e9e7db275e42a3e7fcf9affdd5c447b.tar.gz opie-1f4ab9228e9e7db275e42a3e7fcf9affdd5c447b.tar.bz2 |
now it has adv features
and ntpbase.ui is back since it might be usefull
Diffstat (limited to 'noncore/settings/netsystemtime/ntp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/netsystemtime/ntp.cpp | 45 |
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 @@ -8,4 +8,7 @@ #include <qlineedit.h> #include <qspinbox.h> +#include <qcheckbox.h> +#include <qtabwidget.h> +#include <qlayout.h> #include <qmessagebox.h> #include <qmultilineedit.h> @@ -40,8 +43,14 @@ Ntp::Ntp( QWidget* parent, const char* name, WFlags fl ) Config cfg("ntp",Config::User); 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(); @@ -143,5 +152,5 @@ void Ntp::getNtpOutput(OProcess *proc, char *buffer, int buflen) void Ntp::ntpFinished(OProcess *p) { - qDebug("p->exitStatus() %i",p->exitStatus()); + // qDebug("p->exitStatus() %i",p->exitStatus()); if (p->exitStatus()!=0 || !p->normalExit()) { @@ -278,5 +287,5 @@ void Ntp::slotCheckNtp(int i) }else{ 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()); connect( ButtonSetTime, SIGNAL(clicked()), SLOT(setPredictTime()) ); @@ -287,5 +296,4 @@ void Ntp::slotCheckNtp(int i) void Ntp::slotProbeNtpServer() { - qDebug("Ntp::slotProbeNtpServer()"); ntpSock->connectToHost( getNtpServer() ,123); } @@ -331,2 +339,29 @@ 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(); + }; +} |