summaryrefslogtreecommitdiff
authorerik <erik>2007-01-12 00:36:11 (UTC)
committer erik <erik>2007-01-12 00:36:11 (UTC)
commita7855ba97853d175de1c0e2efee6549557adeb09 (patch) (side-by-side diff)
treef8b2815f6dba5ae5f7111fc5b868a38d7c1edaa5
parentc0145131ff669a911d51cd0a2b5d3471bf150eb0 (diff)
downloadopie-a7855ba97853d175de1c0e2efee6549557adeb09.zip
opie-a7855ba97853d175de1c0e2efee6549557adeb09.tar.gz
opie-a7855ba97853d175de1c0e2efee6549557adeb09.tar.bz2
This commit switches from using hardcoded ntp servers to using a pool ntp
server.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--etc/ntpservers22
-rw-r--r--i18n/es/netsystemtime.ts4
-rw-r--r--noncore/settings/netsystemtime/settingstabwidget.cpp6
3 files changed, 16 insertions, 16 deletions
diff --git a/etc/ntpservers b/etc/ntpservers
index 5ea836b..2482d31 100644
--- a/etc/ntpservers
+++ b/etc/ntpservers
@@ -1,24 +1,24 @@
[servers]
count = 11
[0]
-name = time.fu-berlin.de
+name = de.pool.ntp.org
[1]
-name = time.ethz.ch
+name = ch.pool.ntp.org
[2]
-name = otc2.psu.edu
+name = us.pool.ntp.org
[3]
-name = ice.mcc.ac.uk
+name = uk.pool.ntp.org
[4]
-name = ptbtime1.ptb.de
+name = 0.de.pool.ntp.org
[5]
-name = bernina.ethz.ch
+name = 0.ch.pool.ntp.org
[6]
-name = ntp.univ-lyon1.fr
+name = fr.pool.ntp.org
[7]
-name = ntp.bri.connect.com.au
+name = au.pool.ntp.org
[8]
-name = nist1.datum.com
+name = 1.us.pool.ntp.org
[9]
-name = time-a.nist.gov
+name = 2.us.pool.ntp.org
[10]
-name = time-b.timefreq.bldrdoc.gov
+name = 3.us.pool.ntp.org
diff --git a/i18n/es/netsystemtime.ts b/i18n/es/netsystemtime.ts
index f777c73..4ad8631 100644
--- a/i18n/es/netsystemtime.ts
+++ b/i18n/es/netsystemtime.ts
@@ -1,134 +1,134 @@
<!DOCTYPE TS><TS>
<context>
<name>Ntp</name>
<message>
- <source>time.fu-berlin.de</source>
- <translation>time.fu-berlin.de</translation>
+ <source>pool.ntp.org</source>
+ <translation>pool.ntp.org</translation>
</message>
<message>
<source>Run NTP?</source>
<translation>¿Ejecutar NTP?</translation>
</message>
<message>
<source>You asked for a delay of </source>
<translation>Preguntó por un retraso de </translation>
</message>
<message>
<source> minutes, but only </source>
<translation> minutos, pero sólo </translation>
</message>
<message>
<source> minutes elapsed since last loopup.</source>
<translation> minutos transcurrieron desde el último ajuste.</translation>
</message>
<message>
<source>Rerun NTP?</source>
<translation>¿Reiniciar NTP?</translation>
</message>
<message>
<source>Running:</source>
<translation>Ejecutando:</translation>
</message>
<message>
<source>Error while executing ntpdate</source>
<translation>Error mientras ejecutaba ntpdate</translation>
</message>
<message>
<source> seconds</source>
<translation> segundos</translation>
</message>
<message>
<source>last [h]</source>
<translation>último [h]</translation>
</message>
<message>
<source>offset [s]</source>
<translation>corrección [s]</translation>
</message>
<message>
<source>shift [s/h]</source>
<translation>ajuste [s/h]</translation>
</message>
<message>
<source> s/h</source>
<translation> s/h</translation>
</message>
<message>
<source>Predicted time:</source>
<translation>Predicción de hora:</translation>
</message>
<message>
<source>Get time from network</source>
<translation>Obtener hora de la Red</translation>
</message>
<message>
<source>Set predicted time</source>
<translation>Fijar predicción de hora</translation>
</message>
<message>
<source>Could not connect to server </source>
<translation>No pude conectar con el servidor </translation>
</message>
</context>
<context>
<name>NtpBase</name>
<message>
<source>Network Time</source>
<translation>Hora de la Red</translation>
</message>
<message>
<source>NTP</source>
<translation>NTP</translation>
</message>
<message>
<source>Start Time:</source>
<translation>Hora inicio:</translation>
</message>
<message>
<source>nan</source>
<translation>nan</translation>
</message>
<message>
<source>Time Shift:</source>
<translation>Ajuste de hora:</translation>
</message>
<message>
<source>New Time:</source>
<translation>Nueva hora:</translation>
</message>
<message>
<source>Mean shift:</source>
<translation>Ajuste promedio:</translation>
</message>
<message>
<source>Main</source>
<translation>Principal</translation>
</message>
<message>
<source>Get time from network</source>
<translation>Obtener hora de la Red</translation>
</message>
<message>
<source>Predict</source>
<translation>Predecir</translation>
</message>
<message>
<source>Esimated Shift:</source>
<translation>Ajuste estimado:</translation>
</message>
<message>
<source>Predicted Time:</source>
<translation>Predicción de hora:</translation>
</message>
<message>
<source>Set predicted time</source>
<translation>Fijar predicción de hora</translation>
</message>
<message>
<source>Predict time</source>
<translation>Predicción de hora</translation>
</message>
<message>
<source>Settings</source>
<translation>Configuración</translation>
</message>
diff --git a/noncore/settings/netsystemtime/settingstabwidget.cpp b/noncore/settings/netsystemtime/settingstabwidget.cpp
index 3bb0ec3..b26e751 100644
--- a/noncore/settings/netsystemtime/settingstabwidget.cpp
+++ b/noncore/settings/netsystemtime/settingstabwidget.cpp
@@ -1,163 +1,163 @@
/*
                This file is part of the Opie Project
Copyright (C) Opie Team <opie-devel@handhelds.org>
=.
.=l.
           .>+-=
 _;:,     .>    :=|. This program is free software; you can
.> <`_,   >  .   <= redistribute it and/or modify it under
:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
.="- .-=="i,     .._ License as published by the Free Software
 - .   .-<_>     .<> Foundation; either version 2 of the License,
     ._= =}       : or (at your option) any later version.
    .%`+i>       _;_.
    .i_,=:_.      -<s. This program is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
: ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
..}^=.=       =       ; Library General Public License for more
++=   -.     .`     .: details.
:     =  ...= . :.=-
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "settingstabwidget.h"
#include <qpe/config.h>
#include <qpe/qpeapplication.h>
#include <qcheckbox.h>
#include <qcombobox.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qscrollview.h>
#include <qspinbox.h>
SettingsTabWidget::SettingsTabWidget( QWidget *parent )
: QWidget( parent, 0x0, 0 )
{
QVBoxLayout *tmpvb = new QVBoxLayout( this );
QScrollView *sv = new QScrollView( this );
tmpvb->addWidget( sv, 0, 0 );
sv->setResizePolicy( QScrollView::AutoOneFit );
sv->setFrameStyle( QFrame::NoFrame );
QWidget *container = new QWidget( sv->viewport() );
sv->addChild( container );
QGridLayout *layout = new QGridLayout( container );
layout->setMargin( 2 );
layout->setSpacing( 4 );
// Time server selector
layout->addWidget( new QLabel( tr( "Time server" ), container ), 0, 0 );
cbTimeServer = new QComboBox( TRUE, container );
layout->addMultiCellWidget( cbTimeServer, 1, 1, 0, 1 );
// Lookup delay selector
layout->addWidget( new QLabel( tr( "minutes between time updates" ), container ), 2, 1 );
sbNtpDelay = new QSpinBox( 1, 9999999, 1, container );
sbNtpDelay->setWrapping( TRUE );
sbNtpDelay->setMaximumWidth( 50 );
connect( sbNtpDelay, SIGNAL(valueChanged(int)), this, SIGNAL(ntpDelayChanged(int)) );
layout->addWidget( sbNtpDelay, 2, 0 );
// Prediction delay selector
layout->addWidget( new QLabel( tr( "minutes between prediction updates" ), container ), 3, 1 );
sbPredictDelay = new QSpinBox( 42, 9999999, 1, container );
sbPredictDelay->setWrapping( TRUE );
sbPredictDelay->setMaximumWidth( 50 );
layout->addWidget( sbPredictDelay, 3, 0 );
// Space filler
layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ), 4, 0 );
// Display time server information selector
chNtpTab = new QCheckBox( tr( "Display time server information" ), container );
connect( chNtpTab, SIGNAL( toggled(bool) ), this, SIGNAL( displayNTPTab(bool) ) );
layout->addMultiCellWidget( chNtpTab, 5, 5, 0, 1 );
// Display time prediction information selector
chPredictTab = new QCheckBox( tr( "Display time prediction information" ), container );
connect( chPredictTab, SIGNAL( toggled(bool) ), this, SIGNAL( displayPredictTab(bool) ) );
layout->addMultiCellWidget( chPredictTab, 6, 6, 0, 1 );
// Space filler
layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ), 7, 0 );
// Initialize values
QString ntpSrvsFile = QPEApplication::qpeDir();
ntpSrvsFile.append( "etc/ntpservers" );
Config ntpSrvs( ntpSrvsFile, Config::File );
ntpSrvs.setGroup( "servers" );
int srvCount = ntpSrvs.readNumEntry( "count", 0 );
for ( int i = 0; i < srvCount; i++ )
{
ntpSrvs.setGroup( QString::number( i ) );
cbTimeServer->insertItem( ntpSrvs.readEntry( "name" ) );
}
if ( srvCount==0 ) {
- cbTimeServer->insertItem( "time.fu-berlin.de" );
- cbTimeServer->insertItem( "time-a.nist.gov" );
- cbTimeServer->insertItem( "ntp.bri.connect.com.au" );
+ cbTimeServer->insertItem( "0.pool.ntp.org" );
+ cbTimeServer->insertItem( "1.pool.ntp.org" );
+ cbTimeServer->insertItem( "2.pool.ntp.org" );
}
Config config( "ntp" );
config.setGroup( "settings" );
sbPredictDelay->setValue( config.readNumEntry( "minLookupDiff", 720 ) );
sbNtpDelay->setValue( config.readNumEntry( "ntpRefreshFreq", 1440 ) );
cbTimeServer->setCurrentItem( config.readNumEntry( "ntpServer", 0 ) );
chNtpTab->setChecked( config.readBoolEntry( "displayNtpTab", FALSE ) );
chPredictTab->setChecked( config.readBoolEntry( "displayPredictTab", FALSE ) );
}
SettingsTabWidget::~SettingsTabWidget()
{
}
void SettingsTabWidget::saveSettings()
{
int srvCount = cbTimeServer->count();
bool serversChanged = TRUE;
int curSrv = cbTimeServer->currentItem();
QString edit = cbTimeServer->currentText();
for ( int i = 0; i < srvCount; i++ )
{
if ( edit == cbTimeServer->text( i ) )
serversChanged = FALSE;
}
if ( serversChanged )
{
QString ntpSrvsFile = QPEApplication::qpeDir();
ntpSrvsFile.append( "etc/ntpservers" );
Config ntpSrvs( ntpSrvsFile, Config::File );
ntpSrvs.setGroup( "servers" );
ntpSrvs.writeEntry( "count", ++srvCount );
ntpSrvs.setGroup( "0" );
ntpSrvs.writeEntry( "name", edit );
curSrv = 0;
for ( int i = 1; i < srvCount; i++ )
{
// odebug << "ntpSrvs[" << i << "/" << srvCount << "]=" << cbTimeServer->text( i ).latin1() << "" << oendl;
ntpSrvs.setGroup( QString::number( i ) );
ntpSrvs.writeEntry( "name", cbTimeServer->text( i-1 ) );
}
}
Config config( "ntp", Config::User );
config.setGroup( "settings" );
config.writeEntry( "ntpServer", curSrv );
config.writeEntry( "minLookupDiff", sbPredictDelay->value() );
config.writeEntry( "ntpRefreshFreq", sbNtpDelay->value() );
config.writeEntry( "displayNtpTab", chNtpTab->isChecked() );
config.writeEntry( "displayPredictTab", chPredictTab->isChecked() );
}
QString SettingsTabWidget::ntpServer()
{
return cbTimeServer->currentText();
}