author | cniehaus <cniehaus> | 2003-05-18 12:17:12 (UTC) |
---|---|---|
committer | cniehaus <cniehaus> | 2003-05-18 12:17:12 (UTC) |
commit | 76cc1bf740e9134f44a1341d8b01cc9f543a4cd4 (patch) (unidiff) | |
tree | d44ebab74e1d0b59443cb9293d060f417ca8b65b | |
parent | 39860593d3de12f70a083cdb9b86adca7b98fdfb (diff) | |
download | opie-76cc1bf740e9134f44a1341d8b01cc9f543a4cd4.zip opie-76cc1bf740e9134f44a1341d8b01cc9f543a4cd4.tar.gz opie-76cc1bf740e9134f44a1341d8b01cc9f543a4cd4.tar.bz2 |
frontport to HEAD
-rw-r--r-- | noncore/settings/netsystemtime/mainwindow.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/noncore/settings/netsystemtime/mainwindow.cpp b/noncore/settings/netsystemtime/mainwindow.cpp index ab71463..85a46b7 100644 --- a/noncore/settings/netsystemtime/mainwindow.cpp +++ b/noncore/settings/netsystemtime/mainwindow.cpp | |||
@@ -160,24 +160,26 @@ void MainWindow::reject() | |||
160 | qApp->quit(); | 160 | qApp->quit(); |
161 | } | 161 | } |
162 | 162 | ||
163 | void MainWindow::runNTP() | 163 | void MainWindow::runNTP() |
164 | { | 164 | { |
165 | if ( !ntpDelayElapsed() && ntpInteractive ) | 165 | if ( !ntpDelayElapsed() && ntpInteractive ) |
166 | { | 166 | { |
167 | QString msg = tr( "You asked for a delay of " ); | 167 | QString msg = tr( "You asked for a delay of " ); |
168 | msg.append( QString::number( ntpDelay ) ); | 168 | msg.append( QString::number( ntpDelay ) ); |
169 | msg.append( tr( " minutes, but only " ) ); | 169 | msg.append( tr( " minutes, but only " ) ); |
170 | msg.append( QString::number( _lookupDiff / 60 ) ); | 170 | msg.append( QString::number( _lookupDiff / 60 ) ); |
171 | msg.append( tr(" minutes elapsed since last lookup.<br>Continue?") ); | 171 | msg.append( tr(" minutes elapsed since last lookup.<br>Continue?") ); |
172 | |||
173 | QString msg = tr( "You asked for a delay of %1 minutes, but only %2 minutes elapsed since last lookup.<br>Continue?" ).arg( QString::number( ntpDelay ) ).arg( QString::number( _lookupDiff / 60 ) ); | ||
172 | 174 | ||
173 | switch ( | 175 | switch ( |
174 | QMessageBox::warning( this, tr( "Continue?" ), msg, QMessageBox::Yes, QMessageBox::No ) | 176 | QMessageBox::warning( this, tr( "Continue?" ), msg, QMessageBox::Yes, QMessageBox::No ) |
175 | ) | 177 | ) |
176 | { | 178 | { |
177 | case QMessageBox::Yes: break; | 179 | case QMessageBox::Yes: break; |
178 | case QMessageBox::No: return; | 180 | case QMessageBox::No: return; |
179 | default: return; | 181 | default: return; |
180 | } | 182 | } |
181 | } | 183 | } |
182 | 184 | ||
183 | QString srv = settingsTab->ntpServer(); | 185 | QString srv = settingsTab->ntpServer(); |
@@ -332,26 +334,25 @@ void MainWindow::slotNtpFinished( OProcess *p ) | |||
332 | QString _sec = "sec"; | 334 | QString _sec = "sec"; |
333 | QRegExp _reOffset = QRegExp( _offset ); | 335 | QRegExp _reOffset = QRegExp( _offset ); |
334 | QRegExp _reEndOffset = QRegExp( _sec ); | 336 | QRegExp _reEndOffset = QRegExp( _sec ); |
335 | int posOffset = _reOffset.match( ntpOutput ); | 337 | int posOffset = _reOffset.match( ntpOutput ); |
336 | int posEndOffset = _reEndOffset.match( ntpOutput, posOffset ); | 338 | int posEndOffset = _reEndOffset.match( ntpOutput, posOffset ); |
337 | posOffset += _offset.length() + 1; | 339 | posOffset += _offset.length() + 1; |
338 | QString diff = ntpOutput.mid( posOffset, posEndOffset - posOffset - 1 ); | 340 | QString diff = ntpOutput.mid( posOffset, posEndOffset - posOffset - 1 ); |
339 | 341 | ||
340 | float timeShift = diff.toFloat(); | 342 | float timeShift = diff.toFloat(); |
341 | if ( timeShift == 0.0 ) | 343 | if ( timeShift == 0.0 ) |
342 | return; | 344 | return; |
343 | int secsSinceLast = time - lastLookup; | 345 | int secsSinceLast = time - lastLookup; |
344 | output = QString::number( timeShift ); | 346 | output = tr( "%1 seconds").arg(QString::number( timeShift )); |
345 | output.append( tr( " seconds" ) ); | ||
346 | 347 | ||
347 | // Display information on time server tab | 348 | // Display information on time server tab |
348 | if ( ntpTabEnabled ) | 349 | if ( ntpTabEnabled ) |
349 | { | 350 | { |
350 | ntpTab->setTimeShift( output ); | 351 | ntpTab->setTimeShift( output ); |
351 | ntpTab->setNewTime( dt.toString() ); | 352 | ntpTab->setNewTime( dt.toString() ); |
352 | } | 353 | } |
353 | 354 | ||
354 | if ( lastNtp && lastLookup > 0 && secsSinceLast > 60 * ntpDelay ) | 355 | if ( lastNtp && lastLookup > 0 && secsSinceLast > 60 * ntpDelay ) |
355 | { | 356 | { |
356 | QString grpname = QString( "lookup_" ).append( QString::number( lookupCount ) ); | 357 | QString grpname = QString( "lookup_" ).append( QString::number( lookupCount ) ); |
357 | config.setGroup( grpname ); | 358 | config.setGroup( grpname ); |