summaryrefslogtreecommitdiff
authorerik <erik>2007-01-12 00:36:11 (UTC)
committer erik <erik>2007-01-12 00:36:11 (UTC)
commita7855ba97853d175de1c0e2efee6549557adeb09 (patch) (unidiff)
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 @@
1[servers] 1[servers]
2count = 11 2count = 11
3[0] 3[0]
4name = time.fu-berlin.de 4name = de.pool.ntp.org
5[1] 5[1]
6name = time.ethz.ch 6name = ch.pool.ntp.org
7[2] 7[2]
8name = otc2.psu.edu 8name = us.pool.ntp.org
9[3] 9[3]
10name = ice.mcc.ac.uk 10name = uk.pool.ntp.org
11[4] 11[4]
12name = ptbtime1.ptb.de 12name = 0.de.pool.ntp.org
13[5] 13[5]
14name = bernina.ethz.ch 14name = 0.ch.pool.ntp.org
15[6] 15[6]
16name = ntp.univ-lyon1.fr 16name = fr.pool.ntp.org
17[7] 17[7]
18name = ntp.bri.connect.com.au 18name = au.pool.ntp.org
19[8] 19[8]
20name = nist1.datum.com 20name = 1.us.pool.ntp.org
21[9] 21[9]
22name = time-a.nist.gov 22name = 2.us.pool.ntp.org
23[10] 23[10]
24name = time-b.timefreq.bldrdoc.gov 24name = 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,54 +1,54 @@
1<!DOCTYPE TS><TS> 1<!DOCTYPE TS><TS>
2<context> 2<context>
3 <name>Ntp</name> 3 <name>Ntp</name>
4 <message> 4 <message>
5 <source>time.fu-berlin.de</source> 5 <source>pool.ntp.org</source>
6 <translation>time.fu-berlin.de</translation> 6 <translation>pool.ntp.org</translation>
7 </message> 7 </message>
8 <message> 8 <message>
9 <source>Run NTP?</source> 9 <source>Run NTP?</source>
10 <translation>¿Ejecutar NTP?</translation> 10 <translation>¿Ejecutar NTP?</translation>
11 </message> 11 </message>
12 <message> 12 <message>
13 <source>You asked for a delay of </source> 13 <source>You asked for a delay of </source>
14 <translation>Preguntó por un retraso de </translation> 14 <translation>Preguntó por un retraso de </translation>
15 </message> 15 </message>
16 <message> 16 <message>
17 <source> minutes, but only </source> 17 <source> minutes, but only </source>
18 <translation> minutos, pero sólo </translation> 18 <translation> minutos, pero sólo </translation>
19 </message> 19 </message>
20 <message> 20 <message>
21 <source> minutes elapsed since last loopup.</source> 21 <source> minutes elapsed since last loopup.</source>
22 <translation> minutos transcurrieron desde el último ajuste.</translation> 22 <translation> minutos transcurrieron desde el último ajuste.</translation>
23 </message> 23 </message>
24 <message> 24 <message>
25 <source>Rerun NTP?</source> 25 <source>Rerun NTP?</source>
26 <translation>¿Reiniciar NTP?</translation> 26 <translation>¿Reiniciar NTP?</translation>
27 </message> 27 </message>
28 <message> 28 <message>
29 <source>Running:</source> 29 <source>Running:</source>
30 <translation>Ejecutando:</translation> 30 <translation>Ejecutando:</translation>
31 </message> 31 </message>
32 <message> 32 <message>
33 <source>Error while executing ntpdate</source> 33 <source>Error while executing ntpdate</source>
34 <translation>Error mientras ejecutaba ntpdate</translation> 34 <translation>Error mientras ejecutaba ntpdate</translation>
35 </message> 35 </message>
36 <message> 36 <message>
37 <source> seconds</source> 37 <source> seconds</source>
38 <translation> segundos</translation> 38 <translation> segundos</translation>
39 </message> 39 </message>
40 <message> 40 <message>
41 <source>last [h]</source> 41 <source>last [h]</source>
42 <translation>último [h]</translation> 42 <translation>último [h]</translation>
43 </message> 43 </message>
44 <message> 44 <message>
45 <source>offset [s]</source> 45 <source>offset [s]</source>
46 <translation>corrección [s]</translation> 46 <translation>corrección [s]</translation>
47 </message> 47 </message>
48 <message> 48 <message>
49 <source>shift [s/h]</source> 49 <source>shift [s/h]</source>
50 <translation>ajuste [s/h]</translation> 50 <translation>ajuste [s/h]</translation>
51 </message> 51 </message>
52 <message> 52 <message>
53 <source> s/h</source> 53 <source> s/h</source>
54 <translation> s/h</translation> 54 <translation> s/h</translation>
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
@@ -58,99 +58,99 @@ SettingsTabWidget::SettingsTabWidget( QWidget *parent )
58 // Time server selector 58 // Time server selector
59 layout->addWidget( new QLabel( tr( "Time server" ), container ), 0, 0 ); 59 layout->addWidget( new QLabel( tr( "Time server" ), container ), 0, 0 );
60 cbTimeServer = new QComboBox( TRUE, container ); 60 cbTimeServer = new QComboBox( TRUE, container );
61 layout->addMultiCellWidget( cbTimeServer, 1, 1, 0, 1 ); 61 layout->addMultiCellWidget( cbTimeServer, 1, 1, 0, 1 );
62 62
63 // Lookup delay selector 63 // Lookup delay selector
64 layout->addWidget( new QLabel( tr( "minutes between time updates" ), container ), 2, 1 ); 64 layout->addWidget( new QLabel( tr( "minutes between time updates" ), container ), 2, 1 );
65 sbNtpDelay = new QSpinBox( 1, 9999999, 1, container ); 65 sbNtpDelay = new QSpinBox( 1, 9999999, 1, container );
66 sbNtpDelay->setWrapping( TRUE ); 66 sbNtpDelay->setWrapping( TRUE );
67 sbNtpDelay->setMaximumWidth( 50 ); 67 sbNtpDelay->setMaximumWidth( 50 );
68 connect( sbNtpDelay, SIGNAL(valueChanged(int)), this, SIGNAL(ntpDelayChanged(int)) ); 68 connect( sbNtpDelay, SIGNAL(valueChanged(int)), this, SIGNAL(ntpDelayChanged(int)) );
69 layout->addWidget( sbNtpDelay, 2, 0 ); 69 layout->addWidget( sbNtpDelay, 2, 0 );
70 70
71 // Prediction delay selector 71 // Prediction delay selector
72 layout->addWidget( new QLabel( tr( "minutes between prediction updates" ), container ), 3, 1 ); 72 layout->addWidget( new QLabel( tr( "minutes between prediction updates" ), container ), 3, 1 );
73 sbPredictDelay = new QSpinBox( 42, 9999999, 1, container ); 73 sbPredictDelay = new QSpinBox( 42, 9999999, 1, container );
74 sbPredictDelay->setWrapping( TRUE ); 74 sbPredictDelay->setWrapping( TRUE );
75 sbPredictDelay->setMaximumWidth( 50 ); 75 sbPredictDelay->setMaximumWidth( 50 );
76 layout->addWidget( sbPredictDelay, 3, 0 ); 76 layout->addWidget( sbPredictDelay, 3, 0 );
77 77
78 // Space filler 78 // Space filler
79 layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ), 4, 0 ); 79 layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ), 4, 0 );
80 80
81 // Display time server information selector 81 // Display time server information selector
82 chNtpTab = new QCheckBox( tr( "Display time server information" ), container ); 82 chNtpTab = new QCheckBox( tr( "Display time server information" ), container );
83 connect( chNtpTab, SIGNAL( toggled(bool) ), this, SIGNAL( displayNTPTab(bool) ) ); 83 connect( chNtpTab, SIGNAL( toggled(bool) ), this, SIGNAL( displayNTPTab(bool) ) );
84 layout->addMultiCellWidget( chNtpTab, 5, 5, 0, 1 ); 84 layout->addMultiCellWidget( chNtpTab, 5, 5, 0, 1 );
85 85
86 // Display time prediction information selector 86 // Display time prediction information selector
87 chPredictTab = new QCheckBox( tr( "Display time prediction information" ), container ); 87 chPredictTab = new QCheckBox( tr( "Display time prediction information" ), container );
88 connect( chPredictTab, SIGNAL( toggled(bool) ), this, SIGNAL( displayPredictTab(bool) ) ); 88 connect( chPredictTab, SIGNAL( toggled(bool) ), this, SIGNAL( displayPredictTab(bool) ) );
89 layout->addMultiCellWidget( chPredictTab, 6, 6, 0, 1 ); 89 layout->addMultiCellWidget( chPredictTab, 6, 6, 0, 1 );
90 90
91 // Space filler 91 // Space filler
92 layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ), 7, 0 ); 92 layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ), 7, 0 );
93 93
94 // Initialize values 94 // Initialize values
95 QString ntpSrvsFile = QPEApplication::qpeDir(); 95 QString ntpSrvsFile = QPEApplication::qpeDir();
96 ntpSrvsFile.append( "etc/ntpservers" ); 96 ntpSrvsFile.append( "etc/ntpservers" );
97 Config ntpSrvs( ntpSrvsFile, Config::File ); 97 Config ntpSrvs( ntpSrvsFile, Config::File );
98 ntpSrvs.setGroup( "servers" ); 98 ntpSrvs.setGroup( "servers" );
99 int srvCount = ntpSrvs.readNumEntry( "count", 0 ); 99 int srvCount = ntpSrvs.readNumEntry( "count", 0 );
100 for ( int i = 0; i < srvCount; i++ ) 100 for ( int i = 0; i < srvCount; i++ )
101 { 101 {
102 ntpSrvs.setGroup( QString::number( i ) ); 102 ntpSrvs.setGroup( QString::number( i ) );
103 cbTimeServer->insertItem( ntpSrvs.readEntry( "name" ) ); 103 cbTimeServer->insertItem( ntpSrvs.readEntry( "name" ) );
104 } 104 }
105 if ( srvCount==0 ) { 105 if ( srvCount==0 ) {
106 cbTimeServer->insertItem( "time.fu-berlin.de" ); 106 cbTimeServer->insertItem( "0.pool.ntp.org" );
107 cbTimeServer->insertItem( "time-a.nist.gov" ); 107 cbTimeServer->insertItem( "1.pool.ntp.org" );
108 cbTimeServer->insertItem( "ntp.bri.connect.com.au" ); 108 cbTimeServer->insertItem( "2.pool.ntp.org" );
109 } 109 }
110 Config config( "ntp" ); 110 Config config( "ntp" );
111 config.setGroup( "settings" ); 111 config.setGroup( "settings" );
112 sbPredictDelay->setValue( config.readNumEntry( "minLookupDiff", 720 ) ); 112 sbPredictDelay->setValue( config.readNumEntry( "minLookupDiff", 720 ) );
113 sbNtpDelay->setValue( config.readNumEntry( "ntpRefreshFreq", 1440 ) ); 113 sbNtpDelay->setValue( config.readNumEntry( "ntpRefreshFreq", 1440 ) );
114 cbTimeServer->setCurrentItem( config.readNumEntry( "ntpServer", 0 ) ); 114 cbTimeServer->setCurrentItem( config.readNumEntry( "ntpServer", 0 ) );
115 chNtpTab->setChecked( config.readBoolEntry( "displayNtpTab", FALSE ) ); 115 chNtpTab->setChecked( config.readBoolEntry( "displayNtpTab", FALSE ) );
116 chPredictTab->setChecked( config.readBoolEntry( "displayPredictTab", FALSE ) ); 116 chPredictTab->setChecked( config.readBoolEntry( "displayPredictTab", FALSE ) );
117} 117}
118 118
119SettingsTabWidget::~SettingsTabWidget() 119SettingsTabWidget::~SettingsTabWidget()
120{ 120{
121} 121}
122 122
123void SettingsTabWidget::saveSettings() 123void SettingsTabWidget::saveSettings()
124{ 124{
125 int srvCount = cbTimeServer->count(); 125 int srvCount = cbTimeServer->count();
126 bool serversChanged = TRUE; 126 bool serversChanged = TRUE;
127 int curSrv = cbTimeServer->currentItem(); 127 int curSrv = cbTimeServer->currentItem();
128 QString edit = cbTimeServer->currentText(); 128 QString edit = cbTimeServer->currentText();
129 for ( int i = 0; i < srvCount; i++ ) 129 for ( int i = 0; i < srvCount; i++ )
130 { 130 {
131 if ( edit == cbTimeServer->text( i ) ) 131 if ( edit == cbTimeServer->text( i ) )
132 serversChanged = FALSE; 132 serversChanged = FALSE;
133 } 133 }
134 if ( serversChanged ) 134 if ( serversChanged )
135 { 135 {
136 QString ntpSrvsFile = QPEApplication::qpeDir(); 136 QString ntpSrvsFile = QPEApplication::qpeDir();
137 ntpSrvsFile.append( "etc/ntpservers" ); 137 ntpSrvsFile.append( "etc/ntpservers" );
138 Config ntpSrvs( ntpSrvsFile, Config::File ); 138 Config ntpSrvs( ntpSrvsFile, Config::File );
139 ntpSrvs.setGroup( "servers" ); 139 ntpSrvs.setGroup( "servers" );
140 ntpSrvs.writeEntry( "count", ++srvCount ); 140 ntpSrvs.writeEntry( "count", ++srvCount );
141 ntpSrvs.setGroup( "0" ); 141 ntpSrvs.setGroup( "0" );
142 ntpSrvs.writeEntry( "name", edit ); 142 ntpSrvs.writeEntry( "name", edit );
143 curSrv = 0; 143 curSrv = 0;
144 for ( int i = 1; i < srvCount; i++ ) 144 for ( int i = 1; i < srvCount; i++ )
145 { 145 {
146 // odebug << "ntpSrvs[" << i << "/" << srvCount << "]=" << cbTimeServer->text( i ).latin1() << "" << oendl; 146 // odebug << "ntpSrvs[" << i << "/" << srvCount << "]=" << cbTimeServer->text( i ).latin1() << "" << oendl;
147 ntpSrvs.setGroup( QString::number( i ) ); 147 ntpSrvs.setGroup( QString::number( i ) );
148 ntpSrvs.writeEntry( "name", cbTimeServer->text( i-1 ) ); 148 ntpSrvs.writeEntry( "name", cbTimeServer->text( i-1 ) );
149 } 149 }
150 } 150 }
151 Config config( "ntp", Config::User ); 151 Config config( "ntp", Config::User );
152 config.setGroup( "settings" ); 152 config.setGroup( "settings" );
153 config.writeEntry( "ntpServer", curSrv ); 153 config.writeEntry( "ntpServer", curSrv );
154 config.writeEntry( "minLookupDiff", sbPredictDelay->value() ); 154 config.writeEntry( "minLookupDiff", sbPredictDelay->value() );
155 config.writeEntry( "ntpRefreshFreq", sbNtpDelay->value() ); 155 config.writeEntry( "ntpRefreshFreq", sbNtpDelay->value() );
156 config.writeEntry( "displayNtpTab", chNtpTab->isChecked() ); 156 config.writeEntry( "displayNtpTab", chNtpTab->isChecked() );