author | tille <tille> | 2002-06-26 14:27:43 (UTC) |
---|---|---|
committer | tille <tille> | 2002-06-26 14:27:43 (UTC) |
commit | 47a1461b3a250e079ab99a1075974ccea909216a (patch) (unidiff) | |
tree | 7e3586c6ba138203671bc173b06c1c0c7eee40f1 | |
parent | 531bb3c03f5576523a3c7ccecc714362507f69e1 (diff) | |
download | opie-47a1461b3a250e079ab99a1075974ccea909216a.zip opie-47a1461b3a250e079ab99a1075974ccea909216a.tar.gz opie-47a1461b3a250e079ab99a1075974ccea909216a.tar.bz2 |
inlc. timer for ntp update and ntpservers combo
-rw-r--r-- | noncore/settings/netsystemtime/ntp.cpp | 74 | ||||
-rw-r--r-- | noncore/settings/netsystemtime/ntp.h | 7 | ||||
-rw-r--r-- | noncore/settings/netsystemtime/ntpbase.ui | 111 |
3 files changed, 157 insertions, 35 deletions
diff --git a/noncore/settings/netsystemtime/ntp.cpp b/noncore/settings/netsystemtime/ntp.cpp index 52fc6be..364609d 100644 --- a/noncore/settings/netsystemtime/ntp.cpp +++ b/noncore/settings/netsystemtime/ntp.cpp | |||
@@ -1,131 +1,160 @@ | |||
1 | #include "ntp.h" | 1 | #include "ntp.h" |
2 | #include <qpushbutton.h> | 2 | #include <qpushbutton.h> |
3 | #include <qregexp.h> | 3 | #include <qregexp.h> |
4 | #include <qtimer.h> | ||
4 | #include <qtable.h> | 5 | #include <qtable.h> |
5 | #include <qlabel.h> | 6 | #include <qlabel.h> |
6 | #include <qsocket.h> | 7 | #include <qsocket.h> |
7 | #include <qlineedit.h> | 8 | #include <qlineedit.h> |
8 | #include <qspinbox.h> | 9 | #include <qspinbox.h> |
9 | #include <qmessagebox.h> | 10 | #include <qmessagebox.h> |
10 | #include <qmultilineedit.h> | 11 | #include <qmultilineedit.h> |
11 | #include <opie/oprocess.h> | 12 | #include <opie/oprocess.h> |
12 | #include <qpe/config.h> | 13 | #include <qpe/config.h> |
13 | #include <qpe/global.h> | 14 | #include <qpe/global.h> |
14 | #include <qpe/timeconversion.h> | 15 | #include <qpe/timeconversion.h> |
15 | #include <qpe/tzselect.h> | 16 | #include <qpe/tzselect.h> |
16 | #include <qpe/timestring.h> | 17 | #include <qpe/timestring.h> |
17 | #include <qpe/qpedialog.h> | 18 | #include <qpe/qpedialog.h> |
18 | #include <sys/time.h> | 19 | #include <sys/time.h> |
19 | #include <time.h> | 20 | #include <time.h> |
20 | #include <stdlib.h> | 21 | #include <stdlib.h> |
21 | 22 | ||
22 | 23 | ||
23 | Ntp::Ntp( QWidget* parent, const char* name, WFlags fl ) | 24 | Ntp::Ntp( QWidget* parent, const char* name, WFlags fl ) |
24 | : SetDateTime( parent, name, fl ) | 25 | : SetDateTime( parent, name, fl ) |
25 | { | 26 | { |
27 | |||
28 | Config ntpSrvs("/etc/ntpservers",Config::File); | ||
29 | ntpSrvs.setGroup("servers"); | ||
30 | int srvCount = ntpSrvs.readNumEntry("count", 0 ); | ||
31 | for (int i = 0; i < srvCount; i++) | ||
32 | { | ||
33 | ntpSrvs.setGroup(QString::number(i)); | ||
34 | ComboNtpSrv->insertItem( ntpSrvs.readEntry("name") ); | ||
35 | } | ||
36 | if ( srvCount==0 ) ComboNtpSrv->insertItem(tr("time.fu-berlin.de")); | ||
37 | |||
26 | Config cfg("ntp",Config::User); | 38 | Config cfg("ntp",Config::User); |
27 | cfg.setGroup("settings"); | 39 | cfg.setGroup("settings"); |
28 | // _maxOffset = cfg.readNumEntry("maxOffset",5); | 40 | // _maxOffset = cfg.readNumEntry("maxOffset",5); |
29 | // _minLookupDiff = cfg.readNumEntry("minLookupDiff",10); | 41 | // _minLookupDiff = cfg.readNumEntry("minLookupDiff",10); |
30 | SpinBoxMinLookupDelay->setValue( cfg.readNumEntry("minLookupDiff",60) ); | 42 | SpinBoxMinLookupDelay->setValue( cfg.readNumEntry("minLookupDiff",41) ); |
31 | SpinBoxNtpDelay->setValue( cfg.readNumEntry("ntpRefreshFreq",60) ); | 43 | SpinBoxNtpDelay->setValue( cfg.readNumEntry("ntpRefreshFreq",42) ); |
32 | LineEditNtpSrv->setText( cfg.readEntry("ntpServer", tr("time.fu-berlin.de")) ); | 44 | ComboNtpSrv->setCurrentItem( cfg.readNumEntry("ntpServer", 0) ); |
45 | |||
46 | ntpTimer = new QTimer(this); | ||
47 | ntpTimer->start(SpinBoxNtpDelay->value()*100); | ||
48 | |||
33 | ntpProcess = new OProcess( ); | 49 | ntpProcess = new OProcess( ); |
50 | connect( SpinBoxNtpDelay, SIGNAL( valueChanged(int) ), | ||
51 | SLOT(slotNtpDelayChanged(int)) ); | ||
34 | 52 | ||
35 | QSocket *ntpSock = new QSocket( this ); | 53 | ntpSock = new QSocket( this ); |
36 | ntpSock->connectToHost( LineEditNtpSrv->text() ,123); | ||
37 | connect( ntpSock, SIGNAL( error(int) ), | 54 | connect( ntpSock, SIGNAL( error(int) ), |
38 | SLOT(slotCheckNtp(int)) ); | 55 | SLOT(slotCheckNtp(int)) ); |
56 | slotProbeNtpServer(); | ||
39 | 57 | ||
40 | connect ( ntpProcess, SIGNAL(receivedStdout(OProcess*,char*,int)), | 58 | connect ( ntpProcess, SIGNAL(receivedStdout(OProcess*,char*,int)), |
41 | this, SLOT(getNtpOutput(OProcess*,char*,int))); | 59 | this, SLOT(getNtpOutput(OProcess*,char*,int))); |
42 | connect ( ntpProcess, SIGNAL(processExited(OProcess*)), | 60 | connect ( ntpProcess, SIGNAL(processExited(OProcess*)), |
43 | this, SLOT(ntpFinished(OProcess*))); | 61 | this, SLOT(ntpFinished(OProcess*))); |
44 | connect(runNtp, SIGNAL(clicked()), this, SLOT(slotRunNtp())); | 62 | connect(runNtp, SIGNAL(clicked()), this, SLOT(slotRunNtp())); |
45 | connect(PushButtonPredict, SIGNAL(clicked()), this, SLOT(preditctTime())); | 63 | connect(PushButtonPredict, SIGNAL(clicked()), this, SLOT(preditctTime())); |
64 | connect(PushButtonSetPredTime, SIGNAL(clicked()), this, SLOT(setPredictTime())); | ||
46 | slotCheckNtp(-1); | 65 | slotCheckNtp(-1); |
47 | // slotRunNtp(); | ||
48 | readLookups(); | 66 | readLookups(); |
49 | } | 67 | } |
50 | 68 | ||
51 | Ntp::~Ntp() | 69 | Ntp::~Ntp() |
52 | { | 70 | { |
71 | delete ntpProcess; | ||
72 | Config ntpSrvs("/etc/ntpservers",Config::File); | ||
73 | ntpSrvs.setGroup("servers"); | ||
74 | int srvCount = ComboNtpSrv->count(); | ||
75 | ntpSrvs.writeEntry("count", srvCount); | ||
76 | for (int i = 0; i < srvCount; i++) | ||
77 | { | ||
78 | ntpSrvs.setGroup(QString::number(i)); | ||
79 | ntpSrvs.writeEntry( "name", ComboNtpSrv->text(i) ); | ||
80 | } | ||
53 | Config cfg("ntp",Config::User); | 81 | Config cfg("ntp",Config::User); |
54 | cfg.setGroup("settings"); | 82 | cfg.setGroup("settings"); |
55 | cfg.writeEntry("ntpServer", LineEditNtpSrv->text()); | 83 | cfg.writeEntry("ntpServer", ComboNtpSrv->currentItem()); |
56 | cfg.writeEntry( "minLookupDiff", SpinBoxMinLookupDelay->value() ); | 84 | cfg.writeEntry( "minLookupDiff", SpinBoxMinLookupDelay->value() ); |
57 | cfg.writeEntry( "ntpRefreshFreq", SpinBoxNtpDelay->value() ); | 85 | cfg.writeEntry( "ntpRefreshFreq", SpinBoxNtpDelay->value() ); |
58 | } | 86 | } |
59 | 87 | ||
60 | 88 | ||
61 | void Ntp::slotRunNtp() | 89 | void Ntp::slotRunNtp() |
62 | { | 90 | { |
63 | Config cfg("ntp",Config::User); | 91 | Config cfg("ntp",Config::User); |
64 | cfg.setGroup("lookups"); | 92 | cfg.setGroup("lookups"); |
65 | int lookupDiff = TimeConversion::toUTC(QDateTime::currentDateTime()) - cfg.readNumEntry("time",0); | 93 | int lookupDiff = TimeConversion::toUTC(QDateTime::currentDateTime()) - cfg.readNumEntry("time",0); |
66 | 94 | ||
67 | if ( lookupDiff < SpinBoxNtpDelay->value()*60 ) | 95 | if ( lookupDiff < SpinBoxNtpDelay->value()*60 ) |
68 | { | 96 | { |
69 | switch ( | 97 | switch ( |
70 | QMessageBox::warning(this, tr("Run ntp?"), | 98 | QMessageBox::warning(this, tr("Run ntp?"), |
71 | tr("You asked for a delay of ")+SpinBoxNtpDelay->text()+tr(" minutes, but only ")+ | 99 | tr("You asked for a delay of ")+SpinBoxNtpDelay->text()+tr(" minutes, but only ")+ |
72 | QString::number(lookupDiff%60)+tr(" minutes elapsed since last loopup.")+ | 100 | QString::number(lookupDiff%60)+tr(" minutes elapsed since last loopup.")+ |
73 | "<br>"+tr("Rerun ntp?"), | 101 | "<br>"+tr("Rerun ntp?"), |
74 | QMessageBox::Ok,QMessageBox::Cancel) | 102 | QMessageBox::Ok,QMessageBox::Cancel) |
75 | ) { | 103 | ) { |
76 | case QMessageBox::Ok: break; | 104 | case QMessageBox::Ok: break; |
77 | case QMessageBox::Cancel: return; | 105 | case QMessageBox::Cancel: return; |
78 | default: return; | 106 | default: return; |
79 | } | 107 | } |
80 | } | 108 | } |
81 | TextLabelStartTime->setText(QDateTime::currentDateTime().toString()); | 109 | TextLabelStartTime->setText(QDateTime::currentDateTime().toString()); |
110 | MultiLineEditntpOutPut->append( "\n"+tr("Running:")+"\nntpdate "+ ComboNtpSrv->currentText()+"\n"); | ||
82 | ntpProcess->clearArguments(); | 111 | ntpProcess->clearArguments(); |
83 | *ntpProcess << "ntpdate" << LineEditNtpSrv->text(); | 112 | *ntpProcess << "ntpdate" << ComboNtpSrv->currentText(); |
84 | bool ret = ntpProcess->start(OProcess::NotifyOnExit,OProcess::AllOutput); | 113 | bool ret = ntpProcess->start(OProcess::NotifyOnExit,OProcess::AllOutput); |
85 | if ( !ret ) { | 114 | if ( !ret ) { |
86 | qDebug("Error while executing ntp"); | 115 | qDebug("Error while executing ntp"); |
87 | } | 116 | } |
88 | } | 117 | } |
89 | 118 | ||
90 | void Ntp::getNtpOutput(OProcess *proc, char *buffer, int buflen) | 119 | void Ntp::getNtpOutput(OProcess *proc, char *buffer, int buflen) |
91 | { | 120 | { |
92 | QString lineStr, lineStrOld; | 121 | QString lineStr, lineStrOld; |
93 | lineStr = buffer; | 122 | lineStr = buffer; |
94 | lineStr=lineStr.left(buflen); | 123 | lineStr=lineStr.left(buflen); |
95 | if (lineStr!=lineStrOld) | 124 | if (lineStr!=lineStrOld) |
96 | { | 125 | { |
97 | MultiLineEditntpOutPut->append(lineStr); | 126 | MultiLineEditntpOutPut->append(lineStr); |
98 | _ntpOutput += lineStr; | 127 | _ntpOutput += lineStr; |
99 | } | 128 | } |
100 | lineStrOld = lineStr; | 129 | lineStrOld = lineStr; |
101 | } | 130 | } |
102 | 131 | ||
103 | void Ntp::ntpFinished(OProcess*) | 132 | void Ntp::ntpFinished(OProcess*) |
104 | { | 133 | { |
105 | Config cfg("ntp",Config::User); | 134 | Config cfg("ntp",Config::User); |
106 | cfg.setGroup("lookups"); | 135 | cfg.setGroup("lookups"); |
107 | int lastLookup = cfg.readNumEntry("time",0); | 136 | int lastLookup = cfg.readNumEntry("time",0); |
108 | int lookupCount = cfg.readNumEntry("count",-1); | 137 | int lookupCount = cfg.readNumEntry("count",-1); |
109 | int time = TimeConversion::toUTC( QDateTime::currentDateTime() ); | 138 | int time = TimeConversion::toUTC( QDateTime::currentDateTime() ); |
110 | cfg.writeEntry("time", time); | 139 | cfg.writeEntry("time", time); |
111 | cfg.setGroup("correction"); | 140 | cfg.setGroup("correction"); |
112 | cfg.writeEntry("time", time); | 141 | cfg.writeEntry("time", time); |
113 | 142 | ||
114 | float timeShift = getTimeShift(); | 143 | float timeShift = getTimeShift(); |
115 | if (timeShift == 0.0) return; | 144 | if (timeShift == 0.0) return; |
116 | int secsSinceLast = time - lastLookup; | 145 | int secsSinceLast = time - lastLookup; |
117 | TextLabelNewTime->setText(QDateTime::currentDateTime().toString()); | 146 | TextLabelNewTime->setText(QDateTime::currentDateTime().toString()); |
118 | TextLabelTimeShift->setText(QString::number(timeShift)+tr(" seconds")); | 147 | TextLabelTimeShift->setText(QString::number(timeShift)+tr(" seconds")); |
119 | if ( lastLookup > 0 && secsSinceLast > 60* SpinBoxMinLookupDelay->value()) | 148 | if ( lastLookup > 0 && secsSinceLast > 60* SpinBoxMinLookupDelay->value()) |
120 | { | 149 | { |
121 | lookupCount++; | 150 | lookupCount++; |
122 | cfg.writeEntry("count",lookupCount); | 151 | cfg.writeEntry("count",lookupCount); |
123 | cfg.setGroup("lookup_"+QString::number(lookupCount)); | 152 | cfg.setGroup("lookup_"+QString::number(lookupCount)); |
124 | _shiftPerSec = timeShift / secsSinceLast; | 153 | _shiftPerSec = timeShift / secsSinceLast; |
125 | // float nextCorr = _maxOffset / _shiftPerSec; | 154 | // float nextCorr = _maxOffset / _shiftPerSec; |
126 | qDebug("secs since last lookup %i", secsSinceLast);qDebug("timeshift since last lookup %f", timeShift);qDebug("timeshift since per sec %f", _shiftPerSec); | 155 | qDebug("secs since last lookup %i", secsSinceLast);qDebug("timeshift since last lookup %f", timeShift);qDebug("timeshift since per sec %f", _shiftPerSec); |
127 | cfg.writeEntry("secsSinceLast",secsSinceLast); | 156 | cfg.writeEntry("secsSinceLast",secsSinceLast); |
128 | cfg.writeEntry("timeShift",QString::number(timeShift)); | 157 | cfg.writeEntry("timeShift",QString::number(timeShift)); |
129 | } | 158 | } |
130 | } | 159 | } |
131 | 160 | ||
@@ -145,72 +174,99 @@ float Ntp::getTimeShift() | |||
145 | return diff.toFloat(); | 174 | return diff.toFloat(); |
146 | } | 175 | } |
147 | 176 | ||
148 | void Ntp::readLookups() | 177 | void Ntp::readLookups() |
149 | { | 178 | { |
150 | Config cfg("ntp",Config::User); | 179 | Config cfg("ntp",Config::User); |
151 | cfg.setGroup("lookups"); | 180 | cfg.setGroup("lookups"); |
152 | int lookupCount = cfg.readNumEntry("count",-1); | 181 | int lookupCount = cfg.readNumEntry("count",-1); |
153 | float last, shift, shiftPerSec; | 182 | float last, shift, shiftPerSec; |
154 | qDebug("lookupCount = %i",lookupCount); | 183 | qDebug("lookupCount = %i",lookupCount); |
155 | TableLookups->setNumCols( 3 ); | 184 | TableLookups->setNumCols( 3 ); |
156 | TableLookups->setNumRows( lookupCount); | 185 | TableLookups->setNumRows( lookupCount); |
157 | TableLookups->horizontalHeader()->setLabel(1,"secsSinceLast"); | 186 | TableLookups->horizontalHeader()->setLabel(1,"secsSinceLast"); |
158 | TableLookups->horizontalHeader()->setLabel(2,"timeShift"); | 187 | TableLookups->horizontalHeader()->setLabel(2,"timeShift"); |
159 | TableLookups->horizontalHeader()->setLabel(0,"shift/s"); | 188 | TableLookups->horizontalHeader()->setLabel(0,"shift/s"); |
160 | int cw = 50;//TableLookups->width()/4; | 189 | int cw = 50;//TableLookups->width()/4; |
161 | qDebug("column width %i",cw); | 190 | qDebug("column width %i",cw); |
162 | TableLookups->setColumnWidth( 0, cw+30 ); | 191 | TableLookups->setColumnWidth( 0, cw+30 ); |
163 | TableLookups->setColumnWidth( 1, cw ); | 192 | TableLookups->setColumnWidth( 1, cw ); |
164 | TableLookups->setColumnWidth( 2, cw ); | 193 | TableLookups->setColumnWidth( 2, cw ); |
165 | TableLookups->sortColumn(0, false, true ); | 194 | TableLookups->sortColumn(0, false, true ); |
166 | // TableLookups->setSorting( true ); | 195 | // TableLookups->setSorting( true ); |
167 | for (int i=0; i < lookupCount; i++) | 196 | for (int i=0; i < lookupCount; i++) |
168 | { | 197 | { |
169 | cfg.setGroup("lookup_"+QString::number(i)); | 198 | cfg.setGroup("lookup_"+QString::number(i)); |
170 | last = cfg.readEntry("secsSinceLast",0).toFloat(); | 199 | last = cfg.readEntry("secsSinceLast",0).toFloat(); |
171 | shift = QString(cfg.readEntry("timeShift",0)).toFloat(); | 200 | shift = QString(cfg.readEntry("timeShift",0)).toFloat(); |
172 | // qDebug("%i last %f",i,last); | 201 | // qDebug("%i last %f",i,last); |
173 | // qDebug("%i shift %f",i,shift); | 202 | // qDebug("%i shift %f",i,shift); |
174 | shiftPerSec = shift / last; | 203 | shiftPerSec = shift / last; |
175 | _shiftPerSec += shiftPerSec; | 204 | _shiftPerSec += shiftPerSec; |
176 | TableLookups->setText( i,0,QString::number(shiftPerSec)); | 205 | TableLookups->setText( i,0,QString::number(shiftPerSec)); |
177 | TableLookups->setText( i,2,QString::number(shift)); | 206 | TableLookups->setText( i,2,QString::number(shift)); |
178 | TableLookups->setText( i,1,QString::number(last)); | 207 | TableLookups->setText( i,1,QString::number(last)); |
179 | } | 208 | } |
180 | _shiftPerSec /= lookupCount+1; | 209 | _shiftPerSec /= lookupCount+1; |
181 | TextLabelShift->setText(QString::number(_shiftPerSec)+tr(" seconds")); | 210 | TextLabelShift->setText(QString::number(_shiftPerSec)+tr(" seconds")); |
182 | } | 211 | } |
183 | 212 | ||
184 | void Ntp::preditctTime() | 213 | void Ntp::preditctTime() |
185 | { | 214 | { |
186 | qDebug("current time: %s",QDateTime::currentDateTime().toString().latin1()); | 215 | qDebug("current time: %s",QDateTime::currentDateTime().toString().latin1()); |
187 | Config cfg("ntp",Config::User); | 216 | Config cfg("ntp",Config::User); |
188 | cfg.setGroup("lookups"); | 217 | cfg.setGroup("lookups"); |
189 | int lastTime = cfg.readNumEntry("time",0); | 218 | int lastTime = cfg.readNumEntry("time",0); |
190 | setenv( "TZ", tz->currentZone(), 1 ); | 219 | setenv( "TZ", tz->currentZone(), 1 ); |
191 | int now = TimeConversion::toUTC( QDateTime::currentDateTime() ); | 220 | int now = TimeConversion::toUTC( QDateTime::currentDateTime() ); |
192 | int corr = int((now - lastTime) * _shiftPerSec); | 221 | int corr = int((now - lastTime) * _shiftPerSec); |
222 | TextLabelEstimatedShift->setText(QString::number(corr)+tr(" seconds")); | ||
193 | predictedTime = QDateTime::currentDateTime().addSecs(corr); | 223 | predictedTime = QDateTime::currentDateTime().addSecs(corr); |
194 | TextLabelPredTime->setText(predictedTime.toString()); | 224 | TextLabelPredTime->setText(predictedTime.toString()); |
195 | TextLabelMainPredTime->setText(tr("Predicted time:")+"<br><b>"+predictedTime.toString()+"</b>"); | 225 | TextLabelMainPredTime->setText(tr("Predicted time:")+"<br><b>"+predictedTime.toString()+"</b>"); |
196 | } | 226 | } |
197 | 227 | ||
198 | void Ntp::setPredictTime() | 228 | void Ntp::setPredictTime() |
199 | { | 229 | { |
200 | preditctTime(); | 230 | preditctTime(); |
201 | setTime( predictedTime ); | 231 | setTime( predictedTime ); |
202 | } | 232 | } |
203 | 233 | ||
204 | void Ntp::slotCheckNtp(int i) | 234 | void Ntp::slotCheckNtp(int i) |
205 | { | 235 | { |
206 | if (i == 0) | 236 | if (i == 0) |
207 | { | 237 | { |
208 | TextLabelMainPredTime->hide(); | 238 | TextLabelMainPredTime->hide(); |
209 | ButtonSetTime->setText( tr("Get time from network") ); | 239 | ButtonSetTime->setText( tr("Get time from network") ); |
210 | connect( ButtonSetTime, SIGNAL(clicked()), SLOT(slotRunNtp()) ); | 240 | connect( ButtonSetTime, SIGNAL(clicked()), SLOT(slotRunNtp()) ); |
241 | Config cfg("ntp",Config::User); | ||
242 | cfg.setGroup("lookups"); | ||
243 | int lookupDiff = TimeConversion::toUTC(QDateTime::currentDateTime()) - cfg.readNumEntry("time",0); | ||
244 | if ( lookupDiff > SpinBoxNtpDelay->value()*60 ) | ||
245 | { | ||
246 | disconnect(ntpTimer, SIGNAL( timeout() ), this, SLOT(slotProbeNtpServer()) ); | ||
247 | connect(ntpTimer, SIGNAL( timeout() ), SLOT(slotRunNtp()) ); | ||
248 | }else{ | ||
249 | disconnect(ntpTimer, SIGNAL( timeout() ), this, SLOT(slotRunNtp()) ); | ||
250 | connect(ntpTimer, SIGNAL( timeout() ), SLOT(slotProbeNtpServer()) ); | ||
251 | } | ||
211 | }else{ | 252 | }else{ |
212 | preditctTime(); | 253 | preditctTime(); |
213 | ButtonSetTime->setText( tr("Set predicted time") ); | 254 | ButtonSetTime->setText( tr("Set predicted time") ); |
214 | connect( ButtonSetTime, SIGNAL(clicked()), SLOT(setPredictTime()) ); | 255 | connect( ButtonSetTime, SIGNAL(clicked()), SLOT(setPredictTime()) ); |
215 | }; | 256 | connect( ntpTimer, SIGNAL( timeout() ), SLOT(slotProbeNtpServer()) ); |
257 | } | ||
258 | } | ||
259 | |||
260 | void Ntp::slotProbeNtpServer() | ||
261 | { | ||
262 | Config cfg("ntp",Config::User); | ||
263 | cfg.setGroup("lookups"); | ||
264 | int lookupDiff = TimeConversion::toUTC(QDateTime::currentDateTime()) - cfg.readNumEntry("time",0); | ||
265 | if ( lookupDiff > SpinBoxNtpDelay->value()*60 ) | ||
266 | ntpSock->connectToHost( ComboNtpSrv->currentText() ,123); | ||
267 | } | ||
268 | |||
269 | void Ntp::slotNtpDelayChanged(int delay) | ||
270 | { | ||
271 | ntpTimer->changeInterval( delay*100 ); | ||
216 | } | 272 | } |
diff --git a/noncore/settings/netsystemtime/ntp.h b/noncore/settings/netsystemtime/ntp.h index 284ae27..7cc309f 100644 --- a/noncore/settings/netsystemtime/ntp.h +++ b/noncore/settings/netsystemtime/ntp.h | |||
@@ -1,38 +1,43 @@ | |||
1 | #ifndef NTP_H | 1 | #ifndef NTP_H |
2 | #define NTP_H | 2 | #define NTP_H |
3 | #include "settime.h" | 3 | #include "settime.h" |
4 | #include <qdatetime.h> | 4 | #include <qdatetime.h> |
5 | 5 | ||
6 | class OProcess; | 6 | class OProcess; |
7 | class QString; | 7 | class QString; |
8 | 8 | class QTimer; | |
9 | class QSocket; | ||
9 | 10 | ||
10 | class Ntp : public SetDateTime | 11 | class Ntp : public SetDateTime |
11 | { | 12 | { |
12 | Q_OBJECT | 13 | Q_OBJECT |
13 | 14 | ||
14 | public: | 15 | public: |
15 | Ntp( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 16 | Ntp( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
16 | ~Ntp(); | 17 | ~Ntp(); |
17 | 18 | ||
18 | protected: | 19 | protected: |
19 | QDateTime predictedTime; | 20 | QDateTime predictedTime; |
20 | 21 | ||
21 | 22 | ||
22 | private: | 23 | private: |
23 | QString _ntpOutput; | 24 | QString _ntpOutput; |
24 | float _shiftPerSec; | 25 | float _shiftPerSec; |
25 | OProcess *ntpProcess; | 26 | OProcess *ntpProcess; |
27 | QTimer *ntpTimer; | ||
28 | QSocket *ntpSock; | ||
26 | 29 | ||
27 | float getTimeShift(); | 30 | float getTimeShift(); |
28 | void readLookups(); | 31 | void readLookups(); |
29 | private slots: | 32 | private slots: |
30 | void slotRunNtp(); | 33 | void slotRunNtp(); |
31 | void getNtpOutput(OProcess *proc, char *buffer, int buflen); | 34 | void getNtpOutput(OProcess *proc, char *buffer, int buflen); |
32 | void ntpFinished(OProcess*); | 35 | void ntpFinished(OProcess*); |
33 | void preditctTime(); | 36 | void preditctTime(); |
34 | void slotCheckNtp(int); | 37 | void slotCheckNtp(int); |
35 | void setPredictTime(); | 38 | void setPredictTime(); |
39 | void slotProbeNtpServer(); | ||
40 | void slotNtpDelayChanged(int); | ||
36 | }; | 41 | }; |
37 | 42 | ||
38 | #endif | 43 | #endif |
diff --git a/noncore/settings/netsystemtime/ntpbase.ui b/noncore/settings/netsystemtime/ntpbase.ui index 8d32849..4e10fd2 100644 --- a/noncore/settings/netsystemtime/ntpbase.ui +++ b/noncore/settings/netsystemtime/ntpbase.ui | |||
@@ -1,160 +1,160 @@ | |||
1 | <!DOCTYPE UI><UI> | 1 | <!DOCTYPE UI><UI> |
2 | <class>NtpBase</class> | 2 | <class>NtpBase</class> |
3 | <widget> | 3 | <widget> |
4 | <class>QWidget</class> | 4 | <class>QWidget</class> |
5 | <property stdset="1"> | 5 | <property stdset="1"> |
6 | <name>name</name> | 6 | <name>name</name> |
7 | <cstring>NtpBase</cstring> | 7 | <cstring>NtpBase</cstring> |
8 | </property> | 8 | </property> |
9 | <property stdset="1"> | 9 | <property stdset="1"> |
10 | <name>geometry</name> | 10 | <name>geometry</name> |
11 | <rect> | 11 | <rect> |
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>330</width> | 14 | <width>331</width> |
15 | <height>419</height> | 15 | <height>426</height> |
16 | </rect> | 16 | </rect> |
17 | </property> | 17 | </property> |
18 | <property stdset="1"> | 18 | <property stdset="1"> |
19 | <name>caption</name> | 19 | <name>caption</name> |
20 | <string>Network Time</string> | 20 | <string>Network Time</string> |
21 | </property> | 21 | </property> |
22 | <property> | 22 | <property> |
23 | <name>layoutMargin</name> | 23 | <name>layoutMargin</name> |
24 | </property> | 24 | </property> |
25 | <property> | 25 | <property> |
26 | <name>layoutSpacing</name> | 26 | <name>layoutSpacing</name> |
27 | </property> | 27 | </property> |
28 | <grid> | 28 | <grid> |
29 | <property stdset="1"> | 29 | <property stdset="1"> |
30 | <name>margin</name> | 30 | <name>margin</name> |
31 | <number>2</number> | 31 | <number>2</number> |
32 | </property> | 32 | </property> |
33 | <property stdset="1"> | 33 | <property stdset="1"> |
34 | <name>spacing</name> | 34 | <name>spacing</name> |
35 | <number>2</number> | 35 | <number>2</number> |
36 | </property> | 36 | </property> |
37 | <widget row="0" column="0" > | 37 | <widget row="0" column="0" > |
38 | <class>QTabWidget</class> | 38 | <class>QTabWidget</class> |
39 | <property stdset="1"> | 39 | <property stdset="1"> |
40 | <name>name</name> | 40 | <name>name</name> |
41 | <cstring>TabWidgetMain</cstring> | 41 | <cstring>TabWidgetMain</cstring> |
42 | </property> | 42 | </property> |
43 | <property> | 43 | <property> |
44 | <name>layoutMargin</name> | 44 | <name>layoutMargin</name> |
45 | </property> | 45 | </property> |
46 | <property> | 46 | <property> |
47 | <name>layoutSpacing</name> | 47 | <name>layoutSpacing</name> |
48 | </property> | 48 | </property> |
49 | <widget> | 49 | <widget> |
50 | <class>QWidget</class> | 50 | <class>QWidget</class> |
51 | <property stdset="1"> | 51 | <property stdset="1"> |
52 | <name>name</name> | 52 | <name>name</name> |
53 | <cstring>tabMain</cstring> | 53 | <cstring>tabMain</cstring> |
54 | </property> | 54 | </property> |
55 | <attribute> | 55 | <attribute> |
56 | <name>title</name> | 56 | <name>title</name> |
57 | <string>Main</string> | 57 | <string>Main</string> |
58 | </attribute> | 58 | </attribute> |
59 | <grid> | 59 | <grid> |
60 | <property stdset="1"> | 60 | <property stdset="1"> |
61 | <name>margin</name> | 61 | <name>margin</name> |
62 | <number>2</number> | 62 | <number>2</number> |
63 | </property> | 63 | </property> |
64 | <property stdset="1"> | 64 | <property stdset="1"> |
65 | <name>spacing</name> | 65 | <name>spacing</name> |
66 | <number>2</number> | 66 | <number>2</number> |
67 | </property> | 67 | </property> |
68 | <widget row="0" column="0" > | 68 | <widget row="0" column="0" > |
69 | <class>QFrame</class> | 69 | <class>QFrame</class> |
70 | <property stdset="1"> | 70 | <property stdset="1"> |
71 | <name>name</name> | 71 | <name>name</name> |
72 | <cstring>FrameSystemTime</cstring> | 72 | <cstring>FrameSystemTime</cstring> |
73 | </property> | 73 | </property> |
74 | <property stdset="1"> | 74 | <property stdset="1"> |
75 | <name>frameShape</name> | 75 | <name>frameShape</name> |
76 | <enum>StyledPanel</enum> | 76 | <enum>StyledPanel</enum> |
77 | </property> | 77 | </property> |
78 | <property stdset="1"> | 78 | <property stdset="1"> |
79 | <name>frameShadow</name> | 79 | <name>frameShadow</name> |
80 | <enum>Raised</enum> | 80 | <enum>Raised</enum> |
81 | </property> | 81 | </property> |
82 | </widget> | 82 | </widget> |
83 | </grid> | 83 | </grid> |
84 | </widget> | 84 | </widget> |
85 | <widget> | 85 | <widget> |
86 | <class>QWidget</class> | 86 | <class>QWidget</class> |
87 | <property stdset="1"> | 87 | <property stdset="1"> |
88 | <name>name</name> | 88 | <name>name</name> |
89 | <cstring>tabNtp</cstring> | 89 | <cstring>tabNtp</cstring> |
90 | </property> | 90 | </property> |
91 | <attribute> | 91 | <attribute> |
92 | <name>title</name> | 92 | <name>title</name> |
93 | <string>NTP</string> | 93 | <string>NTP</string> |
94 | </attribute> | 94 | </attribute> |
95 | <grid> | 95 | <grid> |
96 | <property stdset="1"> | 96 | <property stdset="1"> |
97 | <name>margin</name> | 97 | <name>margin</name> |
98 | <number>1</number> | 98 | <number>1</number> |
99 | </property> | 99 | </property> |
100 | <property stdset="1"> | 100 | <property stdset="1"> |
101 | <name>spacing</name> | 101 | <name>spacing</name> |
102 | <number>2</number> | 102 | <number>2</number> |
103 | </property> | 103 | </property> |
104 | <widget row="1" column="0" > | 104 | <widget row="1" column="0" > |
105 | <class>QPushButton</class> | 105 | <class>QPushButton</class> |
106 | <property stdset="1"> | 106 | <property stdset="1"> |
107 | <name>name</name> | 107 | <name>name</name> |
108 | <cstring>runNtp</cstring> | 108 | <cstring>runNtp</cstring> |
109 | </property> | 109 | </property> |
110 | <property stdset="1"> | 110 | <property stdset="1"> |
111 | <name>text</name> | 111 | <name>text</name> |
112 | <string>get time from network</string> | 112 | <string>Get time from network</string> |
113 | </property> | 113 | </property> |
114 | </widget> | 114 | </widget> |
115 | <widget row="0" column="0" > | 115 | <widget row="0" column="0" > |
116 | <class>QFrame</class> | 116 | <class>QFrame</class> |
117 | <property stdset="1"> | 117 | <property stdset="1"> |
118 | <name>name</name> | 118 | <name>name</name> |
119 | <cstring>FrameNtp</cstring> | 119 | <cstring>FrameNtp</cstring> |
120 | </property> | 120 | </property> |
121 | <property stdset="1"> | 121 | <property stdset="1"> |
122 | <name>frameShape</name> | 122 | <name>frameShape</name> |
123 | <enum>StyledPanel</enum> | 123 | <enum>StyledPanel</enum> |
124 | </property> | 124 | </property> |
125 | <property stdset="1"> | 125 | <property stdset="1"> |
126 | <name>frameShadow</name> | 126 | <name>frameShadow</name> |
127 | <enum>Raised</enum> | 127 | <enum>Raised</enum> |
128 | </property> | 128 | </property> |
129 | <property> | 129 | <property> |
130 | <name>layoutMargin</name> | 130 | <name>layoutMargin</name> |
131 | </property> | 131 | </property> |
132 | <property> | 132 | <property> |
133 | <name>layoutSpacing</name> | 133 | <name>layoutSpacing</name> |
134 | </property> | 134 | </property> |
135 | <grid> | 135 | <grid> |
136 | <property stdset="1"> | 136 | <property stdset="1"> |
137 | <name>margin</name> | 137 | <name>margin</name> |
138 | <number>2</number> | 138 | <number>2</number> |
139 | </property> | 139 | </property> |
140 | <property stdset="1"> | 140 | <property stdset="1"> |
141 | <name>spacing</name> | 141 | <name>spacing</name> |
142 | <number>2</number> | 142 | <number>2</number> |
143 | </property> | 143 | </property> |
144 | <widget row="0" column="0" > | 144 | <widget row="0" column="0" > |
145 | <class>QLayoutWidget</class> | 145 | <class>QLayoutWidget</class> |
146 | <property stdset="1"> | 146 | <property stdset="1"> |
147 | <name>name</name> | 147 | <name>name</name> |
148 | <cstring>Layout4</cstring> | 148 | <cstring>Layout4</cstring> |
149 | </property> | 149 | </property> |
150 | <vbox> | 150 | <vbox> |
151 | <property stdset="1"> | 151 | <property stdset="1"> |
152 | <name>margin</name> | 152 | <name>margin</name> |
153 | <number>0</number> | 153 | <number>0</number> |
154 | </property> | 154 | </property> |
155 | <property stdset="1"> | 155 | <property stdset="1"> |
156 | <name>spacing</name> | 156 | <name>spacing</name> |
157 | <number>6</number> | 157 | <number>6</number> |
158 | </property> | 158 | </property> |
159 | <widget> | 159 | <widget> |
160 | <class>QLabel</class> | 160 | <class>QLabel</class> |
@@ -242,189 +242,239 @@ | |||
242 | <property> | 242 | <property> |
243 | <name>sizeHint</name> | 243 | <name>sizeHint</name> |
244 | <size> | 244 | <size> |
245 | <width>20</width> | 245 | <width>20</width> |
246 | <height>20</height> | 246 | <height>20</height> |
247 | </size> | 247 | </size> |
248 | </property> | 248 | </property> |
249 | </spacer> | 249 | </spacer> |
250 | </vbox> | 250 | </vbox> |
251 | </widget> | 251 | </widget> |
252 | <widget row="1" column="0" > | 252 | <widget row="1" column="0" > |
253 | <class>QMultiLineEdit</class> | 253 | <class>QMultiLineEdit</class> |
254 | <property stdset="1"> | 254 | <property stdset="1"> |
255 | <name>name</name> | 255 | <name>name</name> |
256 | <cstring>MultiLineEditntpOutPut</cstring> | 256 | <cstring>MultiLineEditntpOutPut</cstring> |
257 | </property> | 257 | </property> |
258 | <property stdset="1"> | 258 | <property stdset="1"> |
259 | <name>font</name> | 259 | <name>font</name> |
260 | <font> | 260 | <font> |
261 | <pointsize>7</pointsize> | 261 | <pointsize>7</pointsize> |
262 | </font> | 262 | </font> |
263 | </property> | 263 | </property> |
264 | <property stdset="1"> | 264 | <property stdset="1"> |
265 | <name>wordWrap</name> | 265 | <name>wordWrap</name> |
266 | <enum>WidgetWidth</enum> | 266 | <enum>WidgetWidth</enum> |
267 | </property> | 267 | </property> |
268 | <property stdset="1"> | 268 | <property stdset="1"> |
269 | <name>text</name> | 269 | <name>text</name> |
270 | <string></string> | 270 | <string></string> |
271 | </property> | 271 | </property> |
272 | </widget> | 272 | </widget> |
273 | </grid> | 273 | </grid> |
274 | </widget> | 274 | </widget> |
275 | </grid> | 275 | </grid> |
276 | </widget> | 276 | </widget> |
277 | <widget> | 277 | <widget> |
278 | <class>QWidget</class> | 278 | <class>QWidget</class> |
279 | <property stdset="1"> | 279 | <property stdset="1"> |
280 | <name>name</name> | 280 | <name>name</name> |
281 | <cstring>tab</cstring> | 281 | <cstring>tab</cstring> |
282 | </property> | 282 | </property> |
283 | <attribute> | 283 | <attribute> |
284 | <name>title</name> | 284 | <name>title</name> |
285 | <string>Predict</string> | 285 | <string>Predict</string> |
286 | </attribute> | 286 | </attribute> |
287 | <grid> | 287 | <grid> |
288 | <property stdset="1"> | 288 | <property stdset="1"> |
289 | <name>margin</name> | 289 | <name>margin</name> |
290 | <number>2</number> | 290 | <number>5</number> |
291 | </property> | 291 | </property> |
292 | <property stdset="1"> | 292 | <property stdset="1"> |
293 | <name>spacing</name> | 293 | <name>spacing</name> |
294 | <number>2</number> | 294 | <number>6</number> |
295 | </property> | 295 | </property> |
296 | <widget row="0" column="0" > | 296 | <widget row="0" column="0" > |
297 | <class>QTable</class> | 297 | <class>QTable</class> |
298 | <property stdset="1"> | 298 | <property stdset="1"> |
299 | <name>name</name> | 299 | <name>name</name> |
300 | <cstring>TableLookups</cstring> | 300 | <cstring>TableLookups</cstring> |
301 | </property> | 301 | </property> |
302 | <property stdset="1"> | 302 | <property stdset="1"> |
303 | <name>numRows</name> | 303 | <name>numRows</name> |
304 | <number>2</number> | 304 | <number>2</number> |
305 | </property> | 305 | </property> |
306 | <property stdset="1"> | 306 | <property stdset="1"> |
307 | <name>numCols</name> | 307 | <name>numCols</name> |
308 | <number>2</number> | 308 | <number>2</number> |
309 | </property> | 309 | </property> |
310 | </widget> | 310 | </widget> |
311 | <widget row="2" column="0" > | ||
312 | <class>QPushButton</class> | ||
313 | <property stdset="1"> | ||
314 | <name>name</name> | ||
315 | <cstring>PushButtonPredict</cstring> | ||
316 | </property> | ||
317 | <property stdset="1"> | ||
318 | <name>text</name> | ||
319 | <string>predict time</string> | ||
320 | </property> | ||
321 | </widget> | ||
322 | <widget row="1" column="0" > | 311 | <widget row="1" column="0" > |
323 | <class>QLayoutWidget</class> | 312 | <class>QLayoutWidget</class> |
324 | <property stdset="1"> | 313 | <property stdset="1"> |
325 | <name>name</name> | 314 | <name>name</name> |
326 | <cstring>Layout5</cstring> | 315 | <cstring>Layout9</cstring> |
327 | </property> | 316 | </property> |
328 | <grid> | 317 | <grid> |
329 | <property stdset="1"> | 318 | <property stdset="1"> |
330 | <name>margin</name> | 319 | <name>margin</name> |
331 | <number>0</number> | 320 | <number>0</number> |
332 | </property> | 321 | </property> |
333 | <property stdset="1"> | 322 | <property stdset="1"> |
334 | <name>spacing</name> | 323 | <name>spacing</name> |
335 | <number>6</number> | 324 | <number>6</number> |
336 | </property> | 325 | </property> |
337 | <widget row="0" column="1" > | 326 | <widget row="0" column="1" > |
338 | <class>QLabel</class> | 327 | <class>QLabel</class> |
339 | <property stdset="1"> | 328 | <property stdset="1"> |
340 | <name>name</name> | 329 | <name>name</name> |
341 | <cstring>TextLabelShift</cstring> | 330 | <cstring>TextLabelShift</cstring> |
342 | </property> | 331 | </property> |
343 | <property stdset="1"> | 332 | <property stdset="1"> |
344 | <name>text</name> | 333 | <name>text</name> |
345 | <string>nan</string> | 334 | <string>nan</string> |
346 | </property> | 335 | </property> |
347 | </widget> | 336 | </widget> |
337 | <widget row="1" column="0" > | ||
338 | <class>QLabel</class> | ||
339 | <property stdset="1"> | ||
340 | <name>name</name> | ||
341 | <cstring>TextLabel4</cstring> | ||
342 | </property> | ||
343 | <property stdset="1"> | ||
344 | <name>text</name> | ||
345 | <string>Esimated Shift:</string> | ||
346 | </property> | ||
347 | </widget> | ||
348 | <widget row="1" column="1" > | 348 | <widget row="1" column="1" > |
349 | <class>QLabel</class> | 349 | <class>QLabel</class> |
350 | <property stdset="1"> | 350 | <property stdset="1"> |
351 | <name>name</name> | 351 | <name>name</name> |
352 | <cstring>TextLabelPredTime</cstring> | 352 | <cstring>TextLabelEstimatedShift</cstring> |
353 | </property> | 353 | </property> |
354 | <property stdset="1"> | 354 | <property stdset="1"> |
355 | <name>text</name> | 355 | <name>text</name> |
356 | <string>nan</string> | 356 | <string>nan</string> |
357 | </property> | 357 | </property> |
358 | </widget> | 358 | </widget> |
359 | <widget row="2" column="0" > | ||
360 | <class>QLabel</class> | ||
361 | <property stdset="1"> | ||
362 | <name>name</name> | ||
363 | <cstring>TextLabel3_2</cstring> | ||
364 | </property> | ||
365 | <property stdset="1"> | ||
366 | <name>text</name> | ||
367 | <string>Predicted Time:</string> | ||
368 | </property> | ||
369 | </widget> | ||
359 | <widget row="0" column="0" > | 370 | <widget row="0" column="0" > |
360 | <class>QLabel</class> | 371 | <class>QLabel</class> |
361 | <property stdset="1"> | 372 | <property stdset="1"> |
362 | <name>name</name> | 373 | <name>name</name> |
363 | <cstring>Mean_shift_label</cstring> | 374 | <cstring>Mean_shift_label</cstring> |
364 | </property> | 375 | </property> |
365 | <property stdset="1"> | 376 | <property stdset="1"> |
366 | <name>text</name> | 377 | <name>text</name> |
367 | <string>Mean shift:</string> | 378 | <string>Mean shift:</string> |
368 | </property> | 379 | </property> |
369 | </widget> | 380 | </widget> |
370 | <widget row="1" column="0" > | 381 | <widget row="2" column="1" > |
371 | <class>QLabel</class> | 382 | <class>QLabel</class> |
372 | <property stdset="1"> | 383 | <property stdset="1"> |
373 | <name>name</name> | 384 | <name>name</name> |
374 | <cstring>TextLabel3_2</cstring> | 385 | <cstring>TextLabelPredTime</cstring> |
375 | </property> | 386 | </property> |
376 | <property stdset="1"> | 387 | <property stdset="1"> |
377 | <name>text</name> | 388 | <name>text</name> |
378 | <string>Pred. Time:</string> | 389 | <string>nan</string> |
379 | </property> | 390 | </property> |
380 | </widget> | 391 | </widget> |
381 | </grid> | 392 | </grid> |
382 | </widget> | 393 | </widget> |
394 | <widget row="2" column="0" > | ||
395 | <class>QLayoutWidget</class> | ||
396 | <property stdset="1"> | ||
397 | <name>name</name> | ||
398 | <cstring>Layout11</cstring> | ||
399 | </property> | ||
400 | <hbox> | ||
401 | <property stdset="1"> | ||
402 | <name>margin</name> | ||
403 | <number>0</number> | ||
404 | </property> | ||
405 | <property stdset="1"> | ||
406 | <name>spacing</name> | ||
407 | <number>6</number> | ||
408 | </property> | ||
409 | <widget> | ||
410 | <class>QPushButton</class> | ||
411 | <property stdset="1"> | ||
412 | <name>name</name> | ||
413 | <cstring>PushButtonSetPredTime</cstring> | ||
414 | </property> | ||
415 | <property stdset="1"> | ||
416 | <name>text</name> | ||
417 | <string>Set predicted time</string> | ||
418 | </property> | ||
419 | </widget> | ||
420 | <widget> | ||
421 | <class>QPushButton</class> | ||
422 | <property stdset="1"> | ||
423 | <name>name</name> | ||
424 | <cstring>PushButtonPredict</cstring> | ||
425 | </property> | ||
426 | <property stdset="1"> | ||
427 | <name>text</name> | ||
428 | <string>Predict time</string> | ||
429 | </property> | ||
430 | </widget> | ||
431 | </hbox> | ||
432 | </widget> | ||
383 | </grid> | 433 | </grid> |
384 | </widget> | 434 | </widget> |
385 | <widget> | 435 | <widget> |
386 | <class>QWidget</class> | 436 | <class>QWidget</class> |
387 | <property stdset="1"> | 437 | <property stdset="1"> |
388 | <name>name</name> | 438 | <name>name</name> |
389 | <cstring>TabSettings</cstring> | 439 | <cstring>TabSettings</cstring> |
390 | </property> | 440 | </property> |
391 | <attribute> | 441 | <attribute> |
392 | <name>title</name> | 442 | <name>title</name> |
393 | <string>Settings</string> | 443 | <string>Settings</string> |
394 | </attribute> | 444 | </attribute> |
395 | <grid> | 445 | <grid> |
396 | <property stdset="1"> | 446 | <property stdset="1"> |
397 | <name>margin</name> | 447 | <name>margin</name> |
398 | <number>2</number> | 448 | <number>2</number> |
399 | </property> | 449 | </property> |
400 | <property stdset="1"> | 450 | <property stdset="1"> |
401 | <name>spacing</name> | 451 | <name>spacing</name> |
402 | <number>2</number> | 452 | <number>2</number> |
403 | </property> | 453 | </property> |
404 | <widget row="0" column="0" > | 454 | <widget row="0" column="0" > |
405 | <class>QFrame</class> | 455 | <class>QFrame</class> |
406 | <property stdset="1"> | 456 | <property stdset="1"> |
407 | <name>name</name> | 457 | <name>name</name> |
408 | <cstring>FrameSettings</cstring> | 458 | <cstring>FrameSettings</cstring> |
409 | </property> | 459 | </property> |
410 | <property stdset="1"> | 460 | <property stdset="1"> |
411 | <name>frameShape</name> | 461 | <name>frameShape</name> |
412 | <enum>StyledPanel</enum> | 462 | <enum>StyledPanel</enum> |
413 | </property> | 463 | </property> |
414 | <property stdset="1"> | 464 | <property stdset="1"> |
415 | <name>frameShadow</name> | 465 | <name>frameShadow</name> |
416 | <enum>Raised</enum> | 466 | <enum>Raised</enum> |
417 | </property> | 467 | </property> |
418 | <property> | 468 | <property> |
419 | <name>layoutMargin</name> | 469 | <name>layoutMargin</name> |
420 | </property> | 470 | </property> |
421 | <property> | 471 | <property> |
422 | <name>layoutSpacing</name> | 472 | <name>layoutSpacing</name> |
423 | </property> | 473 | </property> |
424 | <grid> | 474 | <grid> |
425 | <property stdset="1"> | 475 | <property stdset="1"> |
426 | <name>margin</name> | 476 | <name>margin</name> |
427 | <number>3</number> | 477 | <number>3</number> |
428 | </property> | 478 | </property> |
429 | <property stdset="1"> | 479 | <property stdset="1"> |
430 | <name>spacing</name> | 480 | <name>spacing</name> |
@@ -441,100 +491,104 @@ | |||
441 | <name>margin</name> | 491 | <name>margin</name> |
442 | <number>0</number> | 492 | <number>0</number> |
443 | </property> | 493 | </property> |
444 | <property stdset="1"> | 494 | <property stdset="1"> |
445 | <name>spacing</name> | 495 | <name>spacing</name> |
446 | <number>6</number> | 496 | <number>6</number> |
447 | </property> | 497 | </property> |
448 | <widget row="0" column="0" > | 498 | <widget row="0" column="0" > |
449 | <class>QLabel</class> | 499 | <class>QLabel</class> |
450 | <property stdset="1"> | 500 | <property stdset="1"> |
451 | <name>name</name> | 501 | <name>name</name> |
452 | <cstring>TextLabel7_2</cstring> | 502 | <cstring>TextLabel7_2</cstring> |
453 | </property> | 503 | </property> |
454 | <property stdset="1"> | 504 | <property stdset="1"> |
455 | <name>text</name> | 505 | <name>text</name> |
456 | <string>Use</string> | 506 | <string>Use</string> |
457 | </property> | 507 | </property> |
458 | </widget> | 508 | </widget> |
459 | <widget row="0" column="2" > | 509 | <widget row="0" column="2" > |
460 | <class>QLabel</class> | 510 | <class>QLabel</class> |
461 | <property stdset="1"> | 511 | <property stdset="1"> |
462 | <name>name</name> | 512 | <name>name</name> |
463 | <cstring>TextLabel2_2</cstring> | 513 | <cstring>TextLabel2_2</cstring> |
464 | </property> | 514 | </property> |
465 | <property stdset="1"> | 515 | <property stdset="1"> |
466 | <name>text</name> | 516 | <name>text</name> |
467 | <string>as</string> | 517 | <string>as</string> |
468 | </property> | 518 | </property> |
469 | </widget> | 519 | </widget> |
470 | <widget row="1" column="0" rowspan="1" colspan="2" > | 520 | <widget row="1" column="0" rowspan="1" colspan="2" > |
471 | <class>QLabel</class> | 521 | <class>QLabel</class> |
472 | <property stdset="1"> | 522 | <property stdset="1"> |
473 | <name>name</name> | 523 | <name>name</name> |
474 | <cstring>TextLabel1_3</cstring> | 524 | <cstring>TextLabel1_3</cstring> |
475 | </property> | 525 | </property> |
476 | <property stdset="1"> | 526 | <property stdset="1"> |
477 | <name>text</name> | 527 | <name>text</name> |
478 | <string>NTP server to get the time from the network.</string> | 528 | <string>NTP server to get the time from the network.</string> |
479 | </property> | 529 | </property> |
480 | <property stdset="1"> | 530 | <property stdset="1"> |
481 | <name>alignment</name> | 531 | <name>alignment</name> |
482 | <set>WordBreak|AlignVCenter|AlignLeft</set> | 532 | <set>WordBreak|AlignVCenter|AlignLeft</set> |
483 | </property> | 533 | </property> |
484 | <property> | 534 | <property> |
485 | <name>wordwrap</name> | 535 | <name>wordwrap</name> |
486 | </property> | 536 | </property> |
487 | </widget> | 537 | </widget> |
488 | <widget row="0" column="1" > | 538 | <widget row="0" column="1" > |
489 | <class>QLineEdit</class> | 539 | <class>QComboBox</class> |
490 | <property stdset="1"> | 540 | <property stdset="1"> |
491 | <name>name</name> | 541 | <name>name</name> |
492 | <cstring>LineEditNtpSrv</cstring> | 542 | <cstring>ComboNtpSrv</cstring> |
543 | </property> | ||
544 | <property stdset="1"> | ||
545 | <name>editable</name> | ||
546 | <bool>true</bool> | ||
493 | </property> | 547 | </property> |
494 | </widget> | 548 | </widget> |
495 | </grid> | 549 | </grid> |
496 | </widget> | 550 | </widget> |
497 | <spacer row="3" column="0" > | 551 | <spacer row="3" column="0" > |
498 | <property> | 552 | <property> |
499 | <name>name</name> | 553 | <name>name</name> |
500 | <cstring>Spacer2</cstring> | 554 | <cstring>Spacer2</cstring> |
501 | </property> | 555 | </property> |
502 | <property stdset="1"> | 556 | <property stdset="1"> |
503 | <name>orientation</name> | 557 | <name>orientation</name> |
504 | <enum>Vertical</enum> | 558 | <enum>Vertical</enum> |
505 | </property> | 559 | </property> |
506 | <property stdset="1"> | 560 | <property stdset="1"> |
507 | <name>sizeType</name> | 561 | <name>sizeType</name> |
508 | <enum>Expanding</enum> | 562 | <enum>Expanding</enum> |
509 | </property> | 563 | </property> |
510 | <property> | 564 | <property> |
511 | <name>sizeHint</name> | 565 | <name>sizeHint</name> |
512 | <size> | 566 | <size> |
513 | <width>20</width> | 567 | <width>20</width> |
514 | <height>20</height> | 568 | <height>20</height> |
515 | </size> | 569 | </size> |
516 | </property> | 570 | </property> |
517 | </spacer> | 571 | </spacer> |
518 | <widget row="2" column="0" > | 572 | <widget row="2" column="0" > |
519 | <class>QLayoutWidget</class> | 573 | <class>QLayoutWidget</class> |
520 | <property stdset="1"> | 574 | <property stdset="1"> |
521 | <name>name</name> | 575 | <name>name</name> |
522 | <cstring>Layout7</cstring> | 576 | <cstring>Layout7</cstring> |
523 | </property> | 577 | </property> |
524 | <grid> | 578 | <grid> |
525 | <property stdset="1"> | 579 | <property stdset="1"> |
526 | <name>margin</name> | 580 | <name>margin</name> |
527 | <number>0</number> | 581 | <number>0</number> |
528 | </property> | 582 | </property> |
529 | <property stdset="1"> | 583 | <property stdset="1"> |
530 | <name>spacing</name> | 584 | <name>spacing</name> |
531 | <number>6</number> | 585 | <number>6</number> |
532 | </property> | 586 | </property> |
533 | <widget row="0" column="0" > | 587 | <widget row="0" column="0" > |
534 | <class>QLabel</class> | 588 | <class>QLabel</class> |
535 | <property stdset="1"> | 589 | <property stdset="1"> |
536 | <name>name</name> | 590 | <name>name</name> |
537 | <cstring>TextLabel1_2</cstring> | 591 | <cstring>TextLabel1_2</cstring> |
538 | </property> | 592 | </property> |
539 | <property stdset="1"> | 593 | <property stdset="1"> |
540 | <name>text</name> | 594 | <name>text</name> |
@@ -564,120 +618,127 @@ | |||
564 | </property> | 618 | </property> |
565 | <property stdset="1"> | 619 | <property stdset="1"> |
566 | <name>alignment</name> | 620 | <name>alignment</name> |
567 | <set>WordBreak|AlignVCenter|AlignLeft</set> | 621 | <set>WordBreak|AlignVCenter|AlignLeft</set> |
568 | </property> | 622 | </property> |
569 | <property> | 623 | <property> |
570 | <name>wordwrap</name> | 624 | <name>wordwrap</name> |
571 | </property> | 625 | </property> |
572 | </widget> | 626 | </widget> |
573 | <widget row="0" column="1" > | 627 | <widget row="0" column="1" > |
574 | <class>QSpinBox</class> | 628 | <class>QSpinBox</class> |
575 | <property stdset="1"> | 629 | <property stdset="1"> |
576 | <name>name</name> | 630 | <name>name</name> |
577 | <cstring>SpinBoxMinLookupDelay</cstring> | 631 | <cstring>SpinBoxMinLookupDelay</cstring> |
578 | </property> | 632 | </property> |
579 | <property stdset="1"> | 633 | <property stdset="1"> |
580 | <name>maxValue</name> | 634 | <name>maxValue</name> |
581 | <number>9999999</number> | 635 | <number>9999999</number> |
582 | </property> | 636 | </property> |
583 | <property stdset="1"> | 637 | <property stdset="1"> |
584 | <name>minValue</name> | 638 | <name>minValue</name> |
585 | <number>42</number> | 639 | <number>42</number> |
586 | </property> | 640 | </property> |
587 | </widget> | 641 | </widget> |
588 | </grid> | 642 | </grid> |
589 | </widget> | 643 | </widget> |
590 | <widget row="1" column="0" > | 644 | <widget row="1" column="0" > |
591 | <class>QLayoutWidget</class> | 645 | <class>QLayoutWidget</class> |
592 | <property stdset="1"> | 646 | <property stdset="1"> |
593 | <name>name</name> | 647 | <name>name</name> |
594 | <cstring>Layout7_2</cstring> | 648 | <cstring>Layout7_2</cstring> |
595 | </property> | 649 | </property> |
596 | <grid> | 650 | <grid> |
597 | <property stdset="1"> | 651 | <property stdset="1"> |
598 | <name>margin</name> | 652 | <name>margin</name> |
599 | <number>0</number> | 653 | <number>0</number> |
600 | </property> | 654 | </property> |
601 | <property stdset="1"> | 655 | <property stdset="1"> |
602 | <name>spacing</name> | 656 | <name>spacing</name> |
603 | <number>6</number> | 657 | <number>6</number> |
604 | </property> | 658 | </property> |
605 | <widget row="0" column="0" > | 659 | <widget row="0" column="0" > |
606 | <class>QLabel</class> | 660 | <class>QLabel</class> |
607 | <property stdset="1"> | 661 | <property stdset="1"> |
608 | <name>name</name> | 662 | <name>name</name> |
609 | <cstring>TextLabel1_2_2</cstring> | 663 | <cstring>TextLabel1_2_2</cstring> |
610 | </property> | 664 | </property> |
611 | <property stdset="1"> | 665 | <property stdset="1"> |
666 | <name>sizePolicy</name> | ||
667 | <sizepolicy> | ||
668 | <hsizetype>1</hsizetype> | ||
669 | <vsizetype>1</vsizetype> | ||
670 | </sizepolicy> | ||
671 | </property> | ||
672 | <property stdset="1"> | ||
612 | <name>text</name> | 673 | <name>text</name> |
613 | <string>Wait for</string> | 674 | <string>Wait for </string> |
614 | </property> | 675 | </property> |
615 | </widget> | 676 | </widget> |
616 | <widget row="0" column="2" > | 677 | <widget row="0" column="2" > |
617 | <class>QLabel</class> | 678 | <class>QLabel</class> |
618 | <property stdset="1"> | 679 | <property stdset="1"> |
619 | <name>name</name> | 680 | <name>name</name> |
620 | <cstring>TextLabel2_3</cstring> | 681 | <cstring>TextLabel2_3</cstring> |
621 | </property> | 682 | </property> |
622 | <property stdset="1"> | 683 | <property stdset="1"> |
623 | <name>text</name> | 684 | <name>text</name> |
624 | <string>minutes until</string> | 685 | <string>minutes until</string> |
625 | </property> | 686 | </property> |
626 | </widget> | 687 | </widget> |
627 | <widget row="1" column="0" rowspan="1" colspan="3" > | 688 | <widget row="1" column="0" rowspan="1" colspan="3" > |
628 | <class>QLabel</class> | 689 | <class>QLabel</class> |
629 | <property stdset="1"> | 690 | <property stdset="1"> |
630 | <name>name</name> | 691 | <name>name</name> |
631 | <cstring>TextLabel3_3_2</cstring> | 692 | <cstring>TextLabel3_3_2</cstring> |
632 | </property> | 693 | </property> |
633 | <property stdset="1"> | 694 | <property stdset="1"> |
634 | <name>text</name> | 695 | <name>text</name> |
635 | <string>NTP syncronises the clock with the network</string> | 696 | <string>NTP tries to syncronises the clock with the network.</string> |
636 | </property> | 697 | </property> |
637 | <property stdset="1"> | 698 | <property stdset="1"> |
638 | <name>alignment</name> | 699 | <name>alignment</name> |
639 | <set>WordBreak|AlignVCenter|AlignLeft</set> | 700 | <set>WordBreak|AlignVCenter|AlignLeft</set> |
640 | </property> | 701 | </property> |
641 | <property> | 702 | <property> |
642 | <name>wordwrap</name> | 703 | <name>wordwrap</name> |
643 | </property> | 704 | </property> |
644 | </widget> | 705 | </widget> |
645 | <widget row="0" column="1" > | 706 | <widget row="0" column="1" > |
646 | <class>QSpinBox</class> | 707 | <class>QSpinBox</class> |
647 | <property stdset="1"> | 708 | <property stdset="1"> |
648 | <name>name</name> | 709 | <name>name</name> |
649 | <cstring>SpinBoxNtpDelay</cstring> | 710 | <cstring>SpinBoxNtpDelay</cstring> |
650 | </property> | 711 | </property> |
651 | <property stdset="1"> | 712 | <property stdset="1"> |
652 | <name>maxValue</name> | 713 | <name>maxValue</name> |
653 | <number>9999999</number> | 714 | <number>9999999</number> |
654 | </property> | 715 | </property> |
655 | <property stdset="1"> | 716 | <property stdset="1"> |
656 | <name>minValue</name> | 717 | <name>minValue</name> |
657 | <number>0</number> | 718 | <number>0</number> |
658 | </property> | 719 | </property> |
659 | </widget> | 720 | </widget> |
660 | </grid> | 721 | </grid> |
661 | </widget> | 722 | </widget> |
662 | </grid> | 723 | </grid> |
663 | </widget> | 724 | </widget> |
664 | </grid> | 725 | </grid> |
665 | </widget> | 726 | </widget> |
666 | <widget> | 727 | <widget> |
667 | <class>QWidget</class> | 728 | <class>QWidget</class> |
668 | <property stdset="1"> | 729 | <property stdset="1"> |
669 | <name>name</name> | 730 | <name>name</name> |
670 | <cstring>tabSetTime</cstring> | 731 | <cstring>tabSetTime</cstring> |
671 | </property> | 732 | </property> |
672 | <attribute> | 733 | <attribute> |
673 | <name>title</name> | 734 | <name>title</name> |
674 | <string>Manual</string> | 735 | <string>Manual</string> |
675 | </attribute> | 736 | </attribute> |
676 | <vbox> | 737 | <vbox> |
677 | <property stdset="1"> | 738 | <property stdset="1"> |
678 | <name>margin</name> | 739 | <name>margin</name> |
679 | <number>2</number> | 740 | <number>2</number> |
680 | </property> | 741 | </property> |
681 | <property stdset="1"> | 742 | <property stdset="1"> |
682 | <name>spacing</name> | 743 | <name>spacing</name> |
683 | <number>2</number> | 744 | <number>2</number> |