author | tille <tille> | 2002-06-27 10:04:37 (UTC) |
---|---|---|
committer | tille <tille> | 2002-06-27 10:04:37 (UTC) |
commit | 7c3fe018ad8855011c6e0441ed1bef2c09e293f2 (patch) (unidiff) | |
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 ) | |||
44 | ntpTimer = new QTimer(this); | 44 | ntpTimer = new QTimer(this); |
45 | processTimer = new QTimer(this); | ||
46 | ntpTimer->start(SpinBoxNtpDelay->value()*1000*60); | ||
47 | 45 | ||
@@ -117,4 +115,2 @@ void Ntp::slotRunNtp() | |||
117 | ntpOutPut( tr("Running:")+"\nntpdate "+getNtpServer() ); | 115 | ntpOutPut( tr("Running:")+"\nntpdate "+getNtpServer() ); |
118 | connect( processTimer, SIGNAL( timeout() ), SLOT(slotTimeoutNtpProcess()) ); | ||
119 | processTimer->start(2*1000*60, true); | ||
120 | 116 | ||
@@ -144,3 +140,4 @@ void Ntp::ntpFinished(OProcess *p) | |||
144 | { | 140 | { |
145 | if (!p->normalExit()) | 141 | qDebug("p->exitStatus() %i",p->exitStatus()); |
142 | if (p->exitStatus()!=0 || !p->normalExit()) | ||
146 | { | 143 | { |
@@ -149,3 +146,2 @@ void Ntp::ntpFinished(OProcess *p) | |||
149 | } | 146 | } |
150 | processTimer->stop(); | ||
151 | Config cfg("ntp",Config::User); | 147 | Config cfg("ntp",Config::User); |
@@ -153,3 +149,3 @@ void Ntp::ntpFinished(OProcess *p) | |||
153 | int lastLookup = cfg.readNumEntry("time",0); | 149 | int lastLookup = cfg.readNumEntry("time",0); |
154 | int lookupCount = cfg.readNumEntry("count",-1); | 150 | int lookupCount = cfg.readNumEntry("count",0); |
155 | int time = TimeConversion::toUTC( QDateTime::currentDateTime() ); | 151 | int time = TimeConversion::toUTC( QDateTime::currentDateTime() ); |
@@ -196,3 +192,3 @@ void Ntp::readLookups() | |||
196 | cfg.setGroup("lookups"); | 192 | cfg.setGroup("lookups"); |
197 | int lookupCount = cfg.readNumEntry("count",-1); | 193 | int lookupCount = cfg.readNumEntry("count",0); |
198 | float last, shift, shiftPerSec; | 194 | float last, shift, shiftPerSec; |
@@ -201,5 +197,5 @@ void Ntp::readLookups() | |||
201 | TableLookups->setNumRows( lookupCount); | 197 | TableLookups->setNumRows( lookupCount); |
202 | TableLookups->horizontalHeader()->setLabel(1,"secsSinceLast"); | 198 | TableLookups->horizontalHeader()->setLabel(1,tr("last [h]")); |
203 | TableLookups->horizontalHeader()->setLabel(2,"timeShift"); | 199 | TableLookups->horizontalHeader()->setLabel(2,tr("offset [s]")); |
204 | TableLookups->horizontalHeader()->setLabel(0,"shift/s"); | 200 | TableLookups->horizontalHeader()->setLabel(0,tr("shift [s/h]")); |
205 | int cw = 50;//TableLookups->width()/4; | 201 | int cw = 50;//TableLookups->width()/4; |
@@ -220,5 +216,5 @@ void Ntp::readLookups() | |||
220 | _shiftPerSec += shiftPerSec; | 216 | _shiftPerSec += shiftPerSec; |
221 | TableLookups->setText( i,0,QString::number(shiftPerSec)); | 217 | TableLookups->setText( i,0,QString::number(shiftPerSec*60)); |
222 | TableLookups->setText( i,2,QString::number(shift)); | 218 | TableLookups->setText( i,2,QString::number(shift)); |
223 | TableLookups->setText( i,1,QString::number(last)); | 219 | TableLookups->setText( i,1,QString::number(last/60)); |
224 | } | 220 | } |
@@ -275,2 +271,3 @@ void Ntp::slotProbeNtpServer() | |||
275 | { | 271 | { |
272 | qDebug("Ntp::slotProbeNtpServer()"); | ||
276 | ntpSock->connectToHost( getNtpServer() ,123); | 273 | ntpSock->connectToHost( getNtpServer() ,123); |
@@ -289,6 +286 @@ void Ntp::ntpOutPut(QString out) | |||
289 | |||
290 | void Ntp::slotTimeoutNtpProcess() | ||
291 | { | ||
292 | ntpProcess->kill(); | ||
293 | slotProbeNtpServer(); | ||
294 | } | ||
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: | |||
27 | OProcess *ntpProcess; | 27 | OProcess *ntpProcess; |
28 | QTimer *ntpTimer, *processTimer; | 28 | QTimer *ntpTimer; |
29 | QSocket *ntpSock; | 29 | QSocket *ntpSock; |
@@ -44,3 +44,2 @@ private slots: | |||
44 | void slotNtpDelayChanged(int); | 44 | void slotNtpDelayChanged(int); |
45 | void slotTimeoutNtpProcess(); | ||
46 | }; | 45 | }; |
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 @@ | |||
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>328</width> | 14 | <width>324</width> |
15 | <height>411</height> | 15 | <height>411</height> |
@@ -302,2 +302,8 @@ | |||
302 | <property stdset="1"> | 302 | <property stdset="1"> |
303 | <name>font</name> | ||
304 | <font> | ||
305 | <pointsize>8</pointsize> | ||
306 | </font> | ||
307 | </property> | ||
308 | <property stdset="1"> | ||
303 | <name>numRows</name> | 309 | <name>numRows</name> |