author | tille <tille> | 2002-06-27 10:04:37 (UTC) |
---|---|---|
committer | tille <tille> | 2002-06-27 10:04:37 (UTC) |
commit | 7c3fe018ad8855011c6e0441ed1bef2c09e293f2 (patch) (side-by-side diff) | |
tree | 299a1e9ffee7ca35f698165d07e02cb415f0010e | |
parent | 596749dc52cc89b5325f9089b79d0b9cc8240682 (diff) | |
download | opie-7c3fe018ad8855011c6e0441ed1bef2c09e293f2.zip opie-7c3fe018ad8855011c6e0441ed1bef2c09e293f2.tar.gz opie-7c3fe018ad8855011c6e0441ed1bef2c09e293f2.tar.bz2 |
imp. table
-rw-r--r-- | noncore/settings/netsystemtime/ntp.cpp | 28 | ||||
-rw-r--r-- | noncore/settings/netsystemtime/ntp.h | 3 | ||||
-rw-r--r-- | noncore/settings/netsystemtime/ntpbase.ui | 8 |
3 files changed, 18 insertions, 21 deletions
diff --git a/noncore/settings/netsystemtime/ntp.cpp b/noncore/settings/netsystemtime/ntp.cpp index 6a5c062..0abb401 100644 --- a/noncore/settings/netsystemtime/ntp.cpp +++ b/noncore/settings/netsystemtime/ntp.cpp @@ -44,4 +44,2 @@ Ntp::Ntp( QWidget* parent, const char* name, WFlags fl ) ntpTimer = new QTimer(this); - processTimer = new QTimer(this); - ntpTimer->start(SpinBoxNtpDelay->value()*1000*60); @@ -117,4 +115,2 @@ void Ntp::slotRunNtp() ntpOutPut( tr("Running:")+"\nntpdate "+getNtpServer() ); - connect( processTimer, SIGNAL( timeout() ), SLOT(slotTimeoutNtpProcess()) ); - processTimer->start(2*1000*60, true); @@ -144,3 +140,4 @@ void Ntp::ntpFinished(OProcess *p) { - if (!p->normalExit()) + qDebug("p->exitStatus() %i",p->exitStatus()); + if (p->exitStatus()!=0 || !p->normalExit()) { @@ -149,3 +146,2 @@ void Ntp::ntpFinished(OProcess *p) } - processTimer->stop(); Config cfg("ntp",Config::User); @@ -153,3 +149,3 @@ void Ntp::ntpFinished(OProcess *p) int lastLookup = cfg.readNumEntry("time",0); - int lookupCount = cfg.readNumEntry("count",-1); + int lookupCount = cfg.readNumEntry("count",0); int time = TimeConversion::toUTC( QDateTime::currentDateTime() ); @@ -196,3 +192,3 @@ void Ntp::readLookups() cfg.setGroup("lookups"); - int lookupCount = cfg.readNumEntry("count",-1); + int lookupCount = cfg.readNumEntry("count",0); float last, shift, shiftPerSec; @@ -201,5 +197,5 @@ void Ntp::readLookups() TableLookups->setNumRows( lookupCount); - TableLookups->horizontalHeader()->setLabel(1,"secsSinceLast"); - TableLookups->horizontalHeader()->setLabel(2,"timeShift"); - TableLookups->horizontalHeader()->setLabel(0,"shift/s"); + TableLookups->horizontalHeader()->setLabel(1,tr("last [h]")); + TableLookups->horizontalHeader()->setLabel(2,tr("offset [s]")); + TableLookups->horizontalHeader()->setLabel(0,tr("shift [s/h]")); int cw = 50;//TableLookups->width()/4; @@ -220,5 +216,5 @@ void Ntp::readLookups() _shiftPerSec += shiftPerSec; - TableLookups->setText( i,0,QString::number(shiftPerSec)); + TableLookups->setText( i,0,QString::number(shiftPerSec*60)); TableLookups->setText( i,2,QString::number(shift)); - TableLookups->setText( i,1,QString::number(last)); + TableLookups->setText( i,1,QString::number(last/60)); } @@ -275,2 +271,3 @@ void Ntp::slotProbeNtpServer() { + qDebug("Ntp::slotProbeNtpServer()"); ntpSock->connectToHost( getNtpServer() ,123); @@ -289,6 +286 @@ void Ntp::ntpOutPut(QString out) -void Ntp::slotTimeoutNtpProcess() -{ - ntpProcess->kill(); - slotProbeNtpServer(); -} diff --git a/noncore/settings/netsystemtime/ntp.h b/noncore/settings/netsystemtime/ntp.h index d166973..c78dc55 100644 --- a/noncore/settings/netsystemtime/ntp.h +++ b/noncore/settings/netsystemtime/ntp.h @@ -27,3 +27,3 @@ private: OProcess *ntpProcess; - QTimer *ntpTimer, *processTimer; + QTimer *ntpTimer; QSocket *ntpSock; @@ -44,3 +44,2 @@ private slots: void slotNtpDelayChanged(int); - void slotTimeoutNtpProcess(); }; diff --git a/noncore/settings/netsystemtime/ntpbase.ui b/noncore/settings/netsystemtime/ntpbase.ui index a83dc93..f5e9371 100644 --- a/noncore/settings/netsystemtime/ntpbase.ui +++ b/noncore/settings/netsystemtime/ntpbase.ui @@ -13,3 +13,3 @@ <y>0</y> - <width>328</width> + <width>324</width> <height>411</height> @@ -302,2 +302,8 @@ <property stdset="1"> + <name>font</name> + <font> + <pointsize>8</pointsize> + </font> + </property> + <property stdset="1"> <name>numRows</name> |