summaryrefslogtreecommitdiff
authortille <tille>2002-06-26 12:45:03 (UTC)
committer tille <tille>2002-06-26 12:45:03 (UTC)
commit541bbcbb89a9e6a054fb545a82739c0bcf7804fe (patch) (unidiff)
treee2d4278a88226849cc5d46d5f69502499dc94efc
parent4b0e72bed1ead4e3c7af2209a11f34aa9209653c (diff)
downloadopie-541bbcbb89a9e6a054fb545a82739c0bcf7804fe.zip
opie-541bbcbb89a9e6a054fb545a82739c0bcf7804fe.tar.gz
opie-541bbcbb89a9e6a054fb545a82739c0bcf7804fe.tar.bz2
settings...
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/netsystemtime/ntp.cpp60
-rw-r--r--noncore/settings/netsystemtime/ntpbase.ui327
-rw-r--r--noncore/settings/netsystemtime/settime.cpp12
3 files changed, 266 insertions, 133 deletions
diff --git a/noncore/settings/netsystemtime/ntp.cpp b/noncore/settings/netsystemtime/ntp.cpp
index b2f192a..52fc6be 100644
--- a/noncore/settings/netsystemtime/ntp.cpp
+++ b/noncore/settings/netsystemtime/ntp.cpp
@@ -1,216 +1,216 @@
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 <qtable.h> 4#include <qtable.h>
5#include <qlabel.h> 5#include <qlabel.h>
6#include <qsocket.h> 6#include <qsocket.h>
7#include <qlineedit.h> 7#include <qlineedit.h>
8#include <qspinbox.h> 8#include <qspinbox.h>
9#include <qmessagebox.h>
9#include <qmultilineedit.h> 10#include <qmultilineedit.h>
10#include <opie/oprocess.h> 11#include <opie/oprocess.h>
11#include <qpe/config.h> 12#include <qpe/config.h>
12#include <qpe/global.h> 13#include <qpe/global.h>
13#include <qpe/timeconversion.h> 14#include <qpe/timeconversion.h>
14#include <qpe/tzselect.h> 15#include <qpe/tzselect.h>
15#include <qpe/timestring.h> 16#include <qpe/timestring.h>
16#include <qpe/qpedialog.h> 17#include <qpe/qpedialog.h>
17#include <sys/time.h> 18#include <sys/time.h>
18#include <time.h> 19#include <time.h>
19#include <stdlib.h> 20#include <stdlib.h>
20 21
21 22
22Ntp::Ntp( QWidget* parent, const char* name, WFlags fl ) 23Ntp::Ntp( QWidget* parent, const char* name, WFlags fl )
23 : SetDateTime( parent, name, fl ) 24 : SetDateTime( parent, name, fl )
24{ 25{
25 Config cfg("ntp",Config::User); 26 Config cfg("ntp",Config::User);
26 cfg.setGroup("settings"); 27 cfg.setGroup("settings");
27 // _maxOffset = cfg.readNumEntry("maxOffset",5); 28 // _maxOffset = cfg.readNumEntry("maxOffset",5);
28// _minLookupDiff = cfg.readNumEntry("minLookupDiff",10); 29// _minLookupDiff = cfg.readNumEntry("minLookupDiff",10);
29 SpinBoxMinDelay->setValue( cfg.readNumEntry("minLookupDiff",10) ); 30 SpinBoxMinLookupDelay->setValue( cfg.readNumEntry("minLookupDiff",60) );
30 SpinBoxMinDelay->setMinValue( 7 ); 31 SpinBoxNtpDelay->setValue( cfg.readNumEntry("ntpRefreshFreq",60) );
31 LineEditNtpSrv->setText( cfg.readEntry("ntpServer", tr("time.fu-berlin.de")) ); 32 LineEditNtpSrv->setText( cfg.readEntry("ntpServer", tr("time.fu-berlin.de")) );
32 ntpProcess = new OProcess( ); 33 ntpProcess = new OProcess( );
33 34
34 QSocket *ntpSock = new QSocket( this ); 35 QSocket *ntpSock = new QSocket( this );
35 ntpSock->connectToHost( LineEditNtpSrv->text() ,123); 36 ntpSock->connectToHost( LineEditNtpSrv->text() ,123);
36 connect( ntpSock, SIGNAL( error(int) ), 37 connect( ntpSock, SIGNAL( error(int) ),
37 SLOT(slotCheckNtp(int)) ); 38 SLOT(slotCheckNtp(int)) );
38 39
39 connect ( ntpProcess, SIGNAL(receivedStdout(OProcess*,char*,int)), 40 connect ( ntpProcess, SIGNAL(receivedStdout(OProcess*,char*,int)),
40 this, SLOT(getNtpOutput(OProcess*,char*,int))); 41 this, SLOT(getNtpOutput(OProcess*,char*,int)));
41 connect ( ntpProcess, SIGNAL(processExited(OProcess*)), 42 connect ( ntpProcess, SIGNAL(processExited(OProcess*)),
42 this, SLOT(ntpFinished(OProcess*))); 43 this, SLOT(ntpFinished(OProcess*)));
43 connect(runNtp, SIGNAL(clicked()), this, SLOT(slotRunNtp())); 44 connect(runNtp, SIGNAL(clicked()), this, SLOT(slotRunNtp()));
44 connect(PushButtonPredict, SIGNAL(clicked()), this, SLOT(preditctTime())); 45 connect(PushButtonPredict, SIGNAL(clicked()), this, SLOT(preditctTime()));
45 slotCheckNtp(-1); 46 slotCheckNtp(-1);
46// slotRunNtp(); 47// slotRunNtp();
47 readLookups(); 48 readLookups();
48} 49}
49 50
50Ntp::~Ntp() 51Ntp::~Ntp()
51{ 52{
52 Config cfg("ntp",Config::User); 53 Config cfg("ntp",Config::User);
53 cfg.setGroup("settings"); 54 cfg.setGroup("settings");
54 cfg.writeEntry("ntpServer", LineEditNtpSrv->text()); 55 cfg.writeEntry("ntpServer", LineEditNtpSrv->text());
55 cfg.writeEntry( "minLookupDiff", SpinBoxMinDelay->value() ); 56 cfg.writeEntry( "minLookupDiff", SpinBoxMinLookupDelay->value() );
57 cfg.writeEntry( "ntpRefreshFreq", SpinBoxNtpDelay->value() );
56} 58}
57 59
58 60
59void Ntp::slotRunNtp() 61void Ntp::slotRunNtp()
60{ 62{
63 Config cfg("ntp",Config::User);
64 cfg.setGroup("lookups");
65 int lookupDiff = TimeConversion::toUTC(QDateTime::currentDateTime()) - cfg.readNumEntry("time",0);
66
67 if ( lookupDiff < SpinBoxNtpDelay->value()*60 )
68 {
69 switch (
70 QMessageBox::warning(this, tr("Run ntp?"),
71 tr("You asked for a delay of ")+SpinBoxNtpDelay->text()+tr(" minutes, but only ")+
72 QString::number(lookupDiff%60)+tr(" minutes elapsed since last loopup.")+
73 "<br>"+tr("Rerun ntp?"),
74 QMessageBox::Ok,QMessageBox::Cancel)
75 ) {
76 case QMessageBox::Ok: break;
77 case QMessageBox::Cancel: return;
78 default: return;
79 }
80 }
61 TextLabelStartTime->setText(QDateTime::currentDateTime().toString()); 81 TextLabelStartTime->setText(QDateTime::currentDateTime().toString());
62 ntpProcess->clearArguments(); 82 ntpProcess->clearArguments();
63 *ntpProcess << "ntpdate" << LineEditNtpSrv->text(); 83 *ntpProcess << "ntpdate" << LineEditNtpSrv->text();
64 bool ret = ntpProcess->start(OProcess::NotifyOnExit,OProcess::AllOutput); 84 bool ret = ntpProcess->start(OProcess::NotifyOnExit,OProcess::AllOutput);
65 if ( !ret ) { 85 if ( !ret ) {
66 qDebug("Error while executing ntp"); 86 qDebug("Error while executing ntp");
67 } 87 }
68} 88}
69 89
70void Ntp::getNtpOutput(OProcess *proc, char *buffer, int buflen) 90void Ntp::getNtpOutput(OProcess *proc, char *buffer, int buflen)
71{ 91{
72 QString lineStr, lineStrOld; 92 QString lineStr, lineStrOld;
73 lineStr = buffer; 93 lineStr = buffer;
74 lineStr=lineStr.left(buflen); 94 lineStr=lineStr.left(buflen);
75 if (lineStr!=lineStrOld) 95 if (lineStr!=lineStrOld)
76 { 96 {
77 MultiLineEditntpOutPut->append(lineStr); 97 MultiLineEditntpOutPut->append(lineStr);
78 _ntpOutput += lineStr; 98 _ntpOutput += lineStr;
79 } 99 }
80 lineStrOld = lineStr; 100 lineStrOld = lineStr;
81} 101}
82 102
83void Ntp::ntpFinished(OProcess*) 103void Ntp::ntpFinished(OProcess*)
84{ 104{
85 Config cfg("ntp",Config::User); 105 Config cfg("ntp",Config::User);
86 cfg.setGroup("lookups"); 106 cfg.setGroup("lookups");
87 int lastLookup = cfg.readNumEntry("time",0); 107 int lastLookup = cfg.readNumEntry("time",0);
88 int lookupCount = cfg.readNumEntry("count",-1); 108 int lookupCount = cfg.readNumEntry("count",-1);
89 int time = TimeConversion::toUTC( QDateTime::currentDateTime() ); 109 int time = TimeConversion::toUTC( QDateTime::currentDateTime() );
90 cfg.writeEntry("time", time); 110 cfg.writeEntry("time", time);
91 cfg.setGroup("correction"); 111 cfg.setGroup("correction");
92 cfg.writeEntry("time", time); 112 cfg.writeEntry("time", time);
93 113
94 float timeShift = getTimeShift(); 114 float timeShift = getTimeShift();
95 if (timeShift == 0.0) return; 115 if (timeShift == 0.0) return;
96 int secsSinceLast = time - lastLookup; 116 int secsSinceLast = time - lastLookup;
97 TextLabelNewTime->setText(QDateTime::currentDateTime().toString()); 117 TextLabelNewTime->setText(QDateTime::currentDateTime().toString());
98 if ( lastLookup > 0 && secsSinceLast > 60*24* SpinBoxMinDelay->value()) 118 TextLabelTimeShift->setText(QString::number(timeShift)+tr(" seconds"));
119 if ( lastLookup > 0 && secsSinceLast > 60* SpinBoxMinLookupDelay->value())
99 { 120 {
100 lookupCount++; 121 lookupCount++;
101 cfg.writeEntry("count",lookupCount); 122 cfg.writeEntry("count",lookupCount);
102 cfg.setGroup("lookup_"+QString::number(lookupCount)); 123 cfg.setGroup("lookup_"+QString::number(lookupCount));
103 _shiftPerSec = timeShift / secsSinceLast; 124 _shiftPerSec = timeShift / secsSinceLast;
104// float nextCorr = _maxOffset / _shiftPerSec; 125// float nextCorr = _maxOffset / _shiftPerSec;
105 qDebug("secs since last lookup %i", secsSinceLast);qDebug("timeshift since last lookup %f", timeShift);qDebug("timeshift since per sec %f", _shiftPerSec); 126 qDebug("secs since last lookup %i", secsSinceLast);qDebug("timeshift since last lookup %f", timeShift);qDebug("timeshift since per sec %f", _shiftPerSec);
106 cfg.writeEntry("secsSinceLast",secsSinceLast); 127 cfg.writeEntry("secsSinceLast",secsSinceLast);
107 cfg.writeEntry("timeShift",QString::number(timeShift)); 128 cfg.writeEntry("timeShift",QString::number(timeShift));
108 } 129 }
109} 130}
110 131
111//void Ntp::correctClock()
112//{
113 //qDebug("current time: %s",QDateTime::currentDateTime().toString().latin1());
114 //Config cfg("ntp",Config::User);
115// cfg.setGroup("correction");
116 // int lastTime = cfg.readNumEntry("time",0);
117// if ( lastTime == 0 )
118// {
119 // return;
120// }
121// int now = TimeConversion::toUTC( QDateTime::currentDateTime() );
122// int corr = int((now - lastTime) * _shiftPerSec);
123// struct timeval myTv;
124// myTv.tv_sec = TimeConversion::toUTC( QDateTime::currentDateTime().addSecs(corr) );
125// myTv.tv_usec = 0;
126//
127// if ( myTv.tv_sec != -1 )
128// ::settimeofday( &myTv, 0 );
129// Global::writeHWClock();
130// cfg.writeEntry("time",now);
131 //qDebug("current time: %s",QDateTime::currentDateTime().toString().latin1());
132//}
133 132
134float Ntp::getTimeShift() 133float Ntp::getTimeShift()
135{ 134{
136 QString _offset = "offset"; 135 QString _offset = "offset";
137 QString _sec = "sec"; 136 QString _sec = "sec";
138 QRegExp _reOffset = QRegExp(_offset); 137 QRegExp _reOffset = QRegExp(_offset);
139 QRegExp _reEndOffset = QRegExp(_sec); 138 QRegExp _reEndOffset = QRegExp(_sec);
140 int posOffset = _reOffset.match( _ntpOutput ); 139 int posOffset = _reOffset.match( _ntpOutput );
141 int posEndOffset = _reEndOffset.match( _ntpOutput, posOffset ); 140 int posEndOffset = _reEndOffset.match( _ntpOutput, posOffset );
142 posOffset += _offset.length() + 1; 141 posOffset += _offset.length() + 1;
143 QString diff = _ntpOutput.mid(posOffset, posEndOffset-posOffset-1); 142 QString diff = _ntpOutput.mid(posOffset, posEndOffset-posOffset-1);
144 qDebug("%s", _ntpOutput.latin1()); 143 qDebug("%s", _ntpOutput.latin1());
145 qDebug("diff = >%s<",diff.latin1()); 144 qDebug("diff = >%s<",diff.latin1());
146 TextLabelTimeShift->setText(diff);
147 return diff.toFloat(); 145 return diff.toFloat();
148} 146}
149 147
150void Ntp::readLookups() 148void Ntp::readLookups()
151{ 149{
152 Config cfg("ntp",Config::User); 150 Config cfg("ntp",Config::User);
153 cfg.setGroup("lookups"); 151 cfg.setGroup("lookups");
154 int lookupCount = cfg.readNumEntry("count",-1); 152 int lookupCount = cfg.readNumEntry("count",-1);
155 float last, shift, shiftPerSec; 153 float last, shift, shiftPerSec;
156 qDebug("lookupCount = %i",lookupCount); 154 qDebug("lookupCount = %i",lookupCount);
157 TableLookups->setNumCols( 3 ); 155 TableLookups->setNumCols( 3 );
158 TableLookups->setNumRows( lookupCount); 156 TableLookups->setNumRows( lookupCount);
159 TableLookups->horizontalHeader()->setLabel(1,"secsSinceLast"); 157 TableLookups->horizontalHeader()->setLabel(1,"secsSinceLast");
160 TableLookups->horizontalHeader()->setLabel(2,"timeShift"); 158 TableLookups->horizontalHeader()->setLabel(2,"timeShift");
161 TableLookups->horizontalHeader()->setLabel(0,"shift/s"); 159 TableLookups->horizontalHeader()->setLabel(0,"shift/s");
162 int cw = 50;//TableLookups->width()/4; 160 int cw = 50;//TableLookups->width()/4;
163 qDebug("column width %i",cw); 161 qDebug("column width %i",cw);
164 TableLookups->setColumnWidth( 0, cw+30 ); 162 TableLookups->setColumnWidth( 0, cw+30 );
165 TableLookups->setColumnWidth( 1, cw ); 163 TableLookups->setColumnWidth( 1, cw );
166 TableLookups->setColumnWidth( 2, cw ); 164 TableLookups->setColumnWidth( 2, cw );
165 TableLookups->sortColumn(0, false, true );
166 // TableLookups->setSorting( true );
167 for (int i=0; i < lookupCount; i++) 167 for (int i=0; i < lookupCount; i++)
168 { 168 {
169 cfg.setGroup("lookup_"+QString::number(i)); 169 cfg.setGroup("lookup_"+QString::number(i));
170 last = cfg.readEntry("secsSinceLast",0).toFloat(); 170 last = cfg.readEntry("secsSinceLast",0).toFloat();
171 shift = QString(cfg.readEntry("timeShift",0)).toFloat(); 171 shift = QString(cfg.readEntry("timeShift",0)).toFloat();
172 // qDebug("%i last %f",i,last); 172 // qDebug("%i last %f",i,last);
173 // qDebug("%i shift %f",i,shift); 173 // qDebug("%i shift %f",i,shift);
174 shiftPerSec = shift / last; 174 shiftPerSec = shift / last;
175 _shiftPerSec += shiftPerSec; 175 _shiftPerSec += shiftPerSec;
176 TableLookups->setText( i,0,QString::number(shiftPerSec)); 176 TableLookups->setText( i,0,QString::number(shiftPerSec));
177 TableLookups->setText( i,2,QString::number(shift)); 177 TableLookups->setText( i,2,QString::number(shift));
178 TableLookups->setText( i,1,QString::number(last)); 178 TableLookups->setText( i,1,QString::number(last));
179 } 179 }
180 _shiftPerSec /= lookupCount+1; 180 _shiftPerSec /= lookupCount+1;
181 TextLabelShift->setText(QString::number(_shiftPerSec)); 181 TextLabelShift->setText(QString::number(_shiftPerSec)+tr(" seconds"));
182} 182}
183 183
184void Ntp::preditctTime() 184void Ntp::preditctTime()
185{ 185{
186 qDebug("current time: %s",QDateTime::currentDateTime().toString().latin1()); 186 qDebug("current time: %s",QDateTime::currentDateTime().toString().latin1());
187 Config cfg("ntp",Config::User); 187 Config cfg("ntp",Config::User);
188 cfg.setGroup("lookups"); 188 cfg.setGroup("lookups");
189 int lastTime = cfg.readNumEntry("time",0); 189 int lastTime = cfg.readNumEntry("time",0);
190 setenv( "TZ", tz->currentZone(), 1 ); 190 setenv( "TZ", tz->currentZone(), 1 );
191 int now = TimeConversion::toUTC( QDateTime::currentDateTime() ); 191 int now = TimeConversion::toUTC( QDateTime::currentDateTime() );
192 int corr = int((now - lastTime) * _shiftPerSec); 192 int corr = int((now - lastTime) * _shiftPerSec);
193 predictedTime = QDateTime::currentDateTime().addSecs(corr); 193 predictedTime = QDateTime::currentDateTime().addSecs(corr);
194 TextLabelPredTime->setText(predictedTime.toString()); 194 TextLabelPredTime->setText(predictedTime.toString());
195 TextLabelMainPredTime->setText(predictedTime.toString()); 195 TextLabelMainPredTime->setText(tr("Predicted time:")+"<br><b>"+predictedTime.toString()+"</b>");
196} 196}
197 197
198void Ntp::setPredictTime() 198void Ntp::setPredictTime()
199{ 199{
200 preditctTime(); 200 preditctTime();
201 setTime( predictedTime ); 201 setTime( predictedTime );
202} 202}
203 203
204void Ntp::slotCheckNtp(int i) 204void Ntp::slotCheckNtp(int i)
205{ 205{
206 if (i == 0) 206 if (i == 0)
207 { 207 {
208 TextLabelMainPredTime->hide(); 208 TextLabelMainPredTime->hide();
209 ButtonSetTime->setText( tr("Get time from network") ); 209 ButtonSetTime->setText( tr("Get time from network") );
210 connect( ButtonSetTime, SIGNAL(clicked()), SLOT(slotRunNtp()) ); 210 connect( ButtonSetTime, SIGNAL(clicked()), SLOT(slotRunNtp()) );
211 }else{ 211 }else{
212 preditctTime(); 212 preditctTime();
213 ButtonSetTime->setText( tr("Predict time") ); 213 ButtonSetTime->setText( tr("Set predicted time") );
214 connect( ButtonSetTime, SIGNAL(clicked()), SLOT(setPredictTime()) ); 214 connect( ButtonSetTime, SIGNAL(clicked()), SLOT(setPredictTime()) );
215 }; 215 };
216} 216}
diff --git a/noncore/settings/netsystemtime/ntpbase.ui b/noncore/settings/netsystemtime/ntpbase.ui
index e444065..8d32849 100644
--- a/noncore/settings/netsystemtime/ntpbase.ui
+++ b/noncore/settings/netsystemtime/ntpbase.ui
@@ -1,587 +1,716 @@
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>276</width> 14 <width>330</width>
15 <height>337</height> 15 <height>419</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>1</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>3</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>3</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>3</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>3</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>
133 <name>layoutSpacing</name>
134 </property>
132 <grid> 135 <grid>
133 <property stdset="1"> 136 <property stdset="1">
134 <name>margin</name> 137 <name>margin</name>
135 <number>11</number> 138 <number>2</number>
136 </property> 139 </property>
137 <property stdset="1"> 140 <property stdset="1">
138 <name>spacing</name> 141 <name>spacing</name>
139 <number>6</number> 142 <number>2</number>
140 </property> 143 </property>
141 <widget row="0" column="0" > 144 <widget row="0" column="0" >
142 <class>QLayoutWidget</class> 145 <class>QLayoutWidget</class>
143 <property stdset="1"> 146 <property stdset="1">
144 <name>name</name> 147 <name>name</name>
145 <cstring>Layout4</cstring> 148 <cstring>Layout4</cstring>
146 </property> 149 </property>
147 <vbox> 150 <vbox>
148 <property stdset="1"> 151 <property stdset="1">
149 <name>margin</name> 152 <name>margin</name>
150 <number>0</number> 153 <number>0</number>
151 </property> 154 </property>
152 <property stdset="1"> 155 <property stdset="1">
153 <name>spacing</name> 156 <name>spacing</name>
154 <number>6</number> 157 <number>6</number>
155 </property> 158 </property>
156 <widget> 159 <widget>
157 <class>QLabel</class> 160 <class>QLabel</class>
158 <property stdset="1"> 161 <property stdset="1">
159 <name>name</name> 162 <name>name</name>
160 <cstring>TextLabel1</cstring> 163 <cstring>TextLabel1</cstring>
161 </property> 164 </property>
162 <property stdset="1"> 165 <property stdset="1">
163 <name>autoMask</name> 166 <name>autoMask</name>
164 <bool>false</bool> 167 <bool>false</bool>
165 </property> 168 </property>
166 <property stdset="1"> 169 <property stdset="1">
167 <name>text</name> 170 <name>text</name>
168 <string>Start Time:</string> 171 <string>Start Time:</string>
169 </property> 172 </property>
170 </widget> 173 </widget>
171 <widget> 174 <widget>
172 <class>QLabel</class> 175 <class>QLabel</class>
173 <property stdset="1"> 176 <property stdset="1">
174 <name>name</name> 177 <name>name</name>
175 <cstring>TextLabelStartTime</cstring> 178 <cstring>TextLabelStartTime</cstring>
176 </property> 179 </property>
177 <property stdset="1"> 180 <property stdset="1">
178 <name>text</name> 181 <name>text</name>
179 <string>nan</string> 182 <string>nan</string>
180 </property> 183 </property>
181 </widget> 184 </widget>
182 <widget> 185 <widget>
183 <class>QLabel</class> 186 <class>QLabel</class>
184 <property stdset="1"> 187 <property stdset="1">
185 <name>name</name> 188 <name>name</name>
186 <cstring>TextLabel3</cstring> 189 <cstring>TextLabel3</cstring>
187 </property> 190 </property>
188 <property stdset="1"> 191 <property stdset="1">
189 <name>text</name> 192 <name>text</name>
190 <string>Time Shift:</string> 193 <string>Time Shift:</string>
191 </property> 194 </property>
192 </widget> 195 </widget>
193 <widget> 196 <widget>
194 <class>QLabel</class> 197 <class>QLabel</class>
195 <property stdset="1"> 198 <property stdset="1">
196 <name>name</name> 199 <name>name</name>
197 <cstring>TextLabelTimeShift</cstring> 200 <cstring>TextLabelTimeShift</cstring>
198 </property> 201 </property>
199 <property stdset="1"> 202 <property stdset="1">
200 <name>text</name> 203 <name>text</name>
201 <string>nan</string> 204 <string>nan</string>
202 </property> 205 </property>
203 </widget> 206 </widget>
204 <widget> 207 <widget>
205 <class>QLabel</class> 208 <class>QLabel</class>
206 <property stdset="1"> 209 <property stdset="1">
207 <name>name</name> 210 <name>name</name>
208 <cstring>TextLabel5</cstring> 211 <cstring>TextLabel5</cstring>
209 </property> 212 </property>
210 <property stdset="1"> 213 <property stdset="1">
211 <name>text</name> 214 <name>text</name>
212 <string>New Time:</string> 215 <string>New Time:</string>
213 </property> 216 </property>
214 </widget> 217 </widget>
215 <widget> 218 <widget>
216 <class>QLabel</class> 219 <class>QLabel</class>
217 <property stdset="1"> 220 <property stdset="1">
218 <name>name</name> 221 <name>name</name>
219 <cstring>TextLabelNewTime</cstring> 222 <cstring>TextLabelNewTime</cstring>
220 </property> 223 </property>
221 <property stdset="1"> 224 <property stdset="1">
222 <name>text</name> 225 <name>text</name>
223 <string>nan</string> 226 <string>nan</string>
224 </property> 227 </property>
225 </widget> 228 </widget>
226 <spacer> 229 <spacer>
227 <property> 230 <property>
228 <name>name</name> 231 <name>name</name>
229 <cstring>Spacer1</cstring> 232 <cstring>Spacer1</cstring>
230 </property> 233 </property>
231 <property stdset="1"> 234 <property stdset="1">
232 <name>orientation</name> 235 <name>orientation</name>
233 <enum>Vertical</enum> 236 <enum>Vertical</enum>
234 </property> 237 </property>
235 <property stdset="1"> 238 <property stdset="1">
236 <name>sizeType</name> 239 <name>sizeType</name>
237 <enum>Expanding</enum> 240 <enum>Expanding</enum>
238 </property> 241 </property>
239 <property> 242 <property>
240 <name>sizeHint</name> 243 <name>sizeHint</name>
241 <size> 244 <size>
242 <width>20</width> 245 <width>20</width>
243 <height>20</height> 246 <height>20</height>
244 </size> 247 </size>
245 </property> 248 </property>
246 </spacer> 249 </spacer>
247 </vbox> 250 </vbox>
248 </widget> 251 </widget>
249 <widget row="1" column="0" > 252 <widget row="1" column="0" >
250 <class>QMultiLineEdit</class> 253 <class>QMultiLineEdit</class>
251 <property stdset="1"> 254 <property stdset="1">
252 <name>name</name> 255 <name>name</name>
253 <cstring>MultiLineEditntpOutPut</cstring> 256 <cstring>MultiLineEditntpOutPut</cstring>
254 </property> 257 </property>
255 <property stdset="1"> 258 <property stdset="1">
259 <name>font</name>
260 <font>
261 <pointsize>7</pointsize>
262 </font>
263 </property>
264 <property stdset="1">
256 <name>wordWrap</name> 265 <name>wordWrap</name>
257 <enum>WidgetWidth</enum> 266 <enum>WidgetWidth</enum>
258 </property> 267 </property>
268 <property stdset="1">
269 <name>text</name>
270 <string></string>
271 </property>
259 </widget> 272 </widget>
260 </grid> 273 </grid>
261 </widget> 274 </widget>
262 </grid> 275 </grid>
263 </widget> 276 </widget>
264 <widget> 277 <widget>
265 <class>QWidget</class> 278 <class>QWidget</class>
266 <property stdset="1"> 279 <property stdset="1">
267 <name>name</name> 280 <name>name</name>
268 <cstring>tab</cstring> 281 <cstring>tab</cstring>
269 </property> 282 </property>
270 <attribute> 283 <attribute>
271 <name>title</name> 284 <name>title</name>
272 <string>Predict</string> 285 <string>Predict</string>
273 </attribute> 286 </attribute>
274 <grid> 287 <grid>
275 <property stdset="1"> 288 <property stdset="1">
276 <name>margin</name> 289 <name>margin</name>
277 <number>2</number> 290 <number>2</number>
278 </property> 291 </property>
279 <property stdset="1"> 292 <property stdset="1">
280 <name>spacing</name> 293 <name>spacing</name>
281 <number>2</number> 294 <number>2</number>
282 </property> 295 </property>
283 <widget row="0" column="0" > 296 <widget row="0" column="0" >
284 <class>QTable</class> 297 <class>QTable</class>
285 <property stdset="1"> 298 <property stdset="1">
286 <name>name</name> 299 <name>name</name>
287 <cstring>TableLookups</cstring> 300 <cstring>TableLookups</cstring>
288 </property> 301 </property>
289 <property stdset="1"> 302 <property stdset="1">
290 <name>numRows</name> 303 <name>numRows</name>
291 <number>2</number> 304 <number>2</number>
292 </property> 305 </property>
293 <property stdset="1"> 306 <property stdset="1">
294 <name>numCols</name> 307 <name>numCols</name>
295 <number>2</number> 308 <number>2</number>
296 </property> 309 </property>
297 </widget> 310 </widget>
298 <widget row="2" column="0" > 311 <widget row="2" column="0" >
299 <class>QPushButton</class> 312 <class>QPushButton</class>
300 <property stdset="1"> 313 <property stdset="1">
301 <name>name</name> 314 <name>name</name>
302 <cstring>PushButtonPredict</cstring> 315 <cstring>PushButtonPredict</cstring>
303 </property> 316 </property>
304 <property stdset="1"> 317 <property stdset="1">
305 <name>text</name> 318 <name>text</name>
306 <string>predict time</string> 319 <string>predict time</string>
307 </property> 320 </property>
308 </widget> 321 </widget>
309 <widget row="1" column="0" > 322 <widget row="1" column="0" >
310 <class>QLayoutWidget</class> 323 <class>QLayoutWidget</class>
311 <property stdset="1"> 324 <property stdset="1">
312 <name>name</name> 325 <name>name</name>
313 <cstring>Layout5</cstring> 326 <cstring>Layout5</cstring>
314 </property> 327 </property>
315 <grid> 328 <grid>
316 <property stdset="1"> 329 <property stdset="1">
317 <name>margin</name> 330 <name>margin</name>
318 <number>0</number> 331 <number>0</number>
319 </property> 332 </property>
320 <property stdset="1"> 333 <property stdset="1">
321 <name>spacing</name> 334 <name>spacing</name>
322 <number>6</number> 335 <number>6</number>
323 </property> 336 </property>
324 <widget row="0" column="1" > 337 <widget row="0" column="1" >
325 <class>QLabel</class> 338 <class>QLabel</class>
326 <property stdset="1"> 339 <property stdset="1">
327 <name>name</name> 340 <name>name</name>
328 <cstring>TextLabelShift</cstring> 341 <cstring>TextLabelShift</cstring>
329 </property> 342 </property>
330 <property stdset="1"> 343 <property stdset="1">
331 <name>text</name> 344 <name>text</name>
332 <string>nan</string> 345 <string>nan</string>
333 </property> 346 </property>
334 </widget> 347 </widget>
335 <widget row="1" column="1" > 348 <widget row="1" column="1" >
336 <class>QLabel</class> 349 <class>QLabel</class>
337 <property stdset="1"> 350 <property stdset="1">
338 <name>name</name> 351 <name>name</name>
339 <cstring>TextLabelPredTime</cstring> 352 <cstring>TextLabelPredTime</cstring>
340 </property> 353 </property>
341 <property stdset="1"> 354 <property stdset="1">
342 <name>text</name> 355 <name>text</name>
343 <string>nan</string> 356 <string>nan</string>
344 </property> 357 </property>
345 </widget> 358 </widget>
346 <widget row="0" column="0" > 359 <widget row="0" column="0" >
347 <class>QLabel</class> 360 <class>QLabel</class>
348 <property stdset="1"> 361 <property stdset="1">
349 <name>name</name> 362 <name>name</name>
350 <cstring>Mean_shift_label</cstring> 363 <cstring>Mean_shift_label</cstring>
351 </property> 364 </property>
352 <property stdset="1"> 365 <property stdset="1">
353 <name>text</name> 366 <name>text</name>
354 <string>Mean shift:</string> 367 <string>Mean shift:</string>
355 </property> 368 </property>
356 </widget> 369 </widget>
357 <widget row="1" column="0" > 370 <widget row="1" column="0" >
358 <class>QLabel</class> 371 <class>QLabel</class>
359 <property stdset="1"> 372 <property stdset="1">
360 <name>name</name> 373 <name>name</name>
361 <cstring>TextLabel3_2</cstring> 374 <cstring>TextLabel3_2</cstring>
362 </property> 375 </property>
363 <property stdset="1"> 376 <property stdset="1">
364 <name>text</name> 377 <name>text</name>
365 <string>Pred. Time:</string> 378 <string>Pred. Time:</string>
366 </property> 379 </property>
367 </widget> 380 </widget>
368 </grid> 381 </grid>
369 </widget> 382 </widget>
370 </grid> 383 </grid>
371 </widget> 384 </widget>
372 <widget> 385 <widget>
373 <class>QWidget</class> 386 <class>QWidget</class>
374 <property stdset="1"> 387 <property stdset="1">
375 <name>name</name> 388 <name>name</name>
376 <cstring>TabSettings</cstring> 389 <cstring>TabSettings</cstring>
377 </property> 390 </property>
378 <attribute> 391 <attribute>
379 <name>title</name> 392 <name>title</name>
380 <string>Settings</string> 393 <string>Settings</string>
381 </attribute> 394 </attribute>
382 <grid> 395 <grid>
383 <property stdset="1"> 396 <property stdset="1">
384 <name>margin</name> 397 <name>margin</name>
385 <number>3</number> 398 <number>2</number>
386 </property> 399 </property>
387 <property stdset="1"> 400 <property stdset="1">
388 <name>spacing</name> 401 <name>spacing</name>
389 <number>3</number> 402 <number>2</number>
390 </property> 403 </property>
391 <widget row="0" column="0" > 404 <widget row="0" column="0" >
392 <class>QFrame</class> 405 <class>QFrame</class>
393 <property stdset="1"> 406 <property stdset="1">
394 <name>name</name> 407 <name>name</name>
395 <cstring>FrameSettings</cstring> 408 <cstring>FrameSettings</cstring>
396 </property> 409 </property>
397 <property stdset="1"> 410 <property stdset="1">
398 <name>frameShape</name> 411 <name>frameShape</name>
399 <enum>StyledPanel</enum> 412 <enum>StyledPanel</enum>
400 </property> 413 </property>
401 <property stdset="1"> 414 <property stdset="1">
402 <name>frameShadow</name> 415 <name>frameShadow</name>
403 <enum>Raised</enum> 416 <enum>Raised</enum>
404 </property> 417 </property>
418 <property>
419 <name>layoutMargin</name>
420 </property>
421 <property>
422 <name>layoutSpacing</name>
423 </property>
405 <grid> 424 <grid>
406 <property stdset="1"> 425 <property stdset="1">
407 <name>margin</name> 426 <name>margin</name>
408 <number>11</number> 427 <number>3</number>
409 </property> 428 </property>
410 <property stdset="1"> 429 <property stdset="1">
411 <name>spacing</name> 430 <name>spacing</name>
412 <number>6</number> 431 <number>11</number>
413 </property> 432 </property>
414 <widget row="0" column="0" > 433 <widget row="0" column="0" >
415 <class>QLayoutWidget</class> 434 <class>QLayoutWidget</class>
416 <property stdset="1"> 435 <property stdset="1">
417 <name>name</name> 436 <name>name</name>
418 <cstring>Layout6</cstring> 437 <cstring>Layout6</cstring>
419 </property> 438 </property>
420 <grid> 439 <grid>
421 <property stdset="1"> 440 <property stdset="1">
422 <name>margin</name> 441 <name>margin</name>
423 <number>0</number> 442 <number>0</number>
424 </property> 443 </property>
425 <property stdset="1"> 444 <property stdset="1">
426 <name>spacing</name> 445 <name>spacing</name>
427 <number>6</number> 446 <number>6</number>
428 </property> 447 </property>
429 <spacer row="2" column="0" > 448 <widget row="0" column="0" >
449 <class>QLabel</class>
450 <property stdset="1">
451 <name>name</name>
452 <cstring>TextLabel7_2</cstring>
453 </property>
454 <property stdset="1">
455 <name>text</name>
456 <string>Use</string>
457 </property>
458 </widget>
459 <widget row="0" column="2" >
460 <class>QLabel</class>
461 <property stdset="1">
462 <name>name</name>
463 <cstring>TextLabel2_2</cstring>
464 </property>
465 <property stdset="1">
466 <name>text</name>
467 <string>as</string>
468 </property>
469 </widget>
470 <widget row="1" column="0" rowspan="1" colspan="2" >
471 <class>QLabel</class>
472 <property stdset="1">
473 <name>name</name>
474 <cstring>TextLabel1_3</cstring>
475 </property>
476 <property stdset="1">
477 <name>text</name>
478 <string>NTP server to get the time from the network.</string>
479 </property>
480 <property stdset="1">
481 <name>alignment</name>
482 <set>WordBreak|AlignVCenter|AlignLeft</set>
483 </property>
430 <property> 484 <property>
485 <name>wordwrap</name>
486 </property>
487 </widget>
488 <widget row="0" column="1" >
489 <class>QLineEdit</class>
490 <property stdset="1">
431 <name>name</name> 491 <name>name</name>
432 <cstring>Spacer2</cstring> 492 <cstring>LineEditNtpSrv</cstring>
433 </property> 493 </property>
494 </widget>
495 </grid>
496 </widget>
497 <spacer row="3" column="0" >
498 <property>
499 <name>name</name>
500 <cstring>Spacer2</cstring>
501 </property>
502 <property stdset="1">
503 <name>orientation</name>
504 <enum>Vertical</enum>
505 </property>
506 <property stdset="1">
507 <name>sizeType</name>
508 <enum>Expanding</enum>
509 </property>
510 <property>
511 <name>sizeHint</name>
512 <size>
513 <width>20</width>
514 <height>20</height>
515 </size>
516 </property>
517 </spacer>
518 <widget row="2" column="0" >
519 <class>QLayoutWidget</class>
520 <property stdset="1">
521 <name>name</name>
522 <cstring>Layout7</cstring>
523 </property>
524 <grid>
525 <property stdset="1">
526 <name>margin</name>
527 <number>0</number>
528 </property>
529 <property stdset="1">
530 <name>spacing</name>
531 <number>6</number>
532 </property>
533 <widget row="0" column="0" >
534 <class>QLabel</class>
434 <property stdset="1"> 535 <property stdset="1">
435 <name>orientation</name> 536 <name>name</name>
436 <enum>Vertical</enum> 537 <cstring>TextLabel1_2</cstring>
437 </property> 538 </property>
438 <property stdset="1"> 539 <property stdset="1">
439 <name>sizeType</name> 540 <name>text</name>
440 <enum>Expanding</enum> 541 <string>Insure a delay of</string>
542 </property>
543 </widget>
544 <widget row="0" column="2" >
545 <class>QLabel</class>
546 <property stdset="1">
547 <name>name</name>
548 <cstring>TextLabel2</cstring>
549 </property>
550 <property stdset="1">
551 <name>text</name>
552 <string>minutes until</string>
553 </property>
554 </widget>
555 <widget row="1" column="0" rowspan="1" colspan="3" >
556 <class>QLabel</class>
557 <property stdset="1">
558 <name>name</name>
559 <cstring>TextLabel3_3</cstring>
560 </property>
561 <property stdset="1">
562 <name>text</name>
563 <string>a new NTP lookup will be used to predict the time.</string>
564 </property>
565 <property stdset="1">
566 <name>alignment</name>
567 <set>WordBreak|AlignVCenter|AlignLeft</set>
441 </property> 568 </property>
442 <property> 569 <property>
443 <name>sizeHint</name> 570 <name>wordwrap</name>
444 <size>
445 <width>20</width>
446 <height>20</height>
447 </size>
448 </property> 571 </property>
449 </spacer> 572 </widget>
450 <widget row="1" column="0" > 573 <widget row="0" column="1" >
451 <class>QLayoutWidget</class> 574 <class>QSpinBox</class>
452 <property stdset="1"> 575 <property stdset="1">
453 <name>name</name> 576 <name>name</name>
454 <cstring>Layout6</cstring> 577 <cstring>SpinBoxMinLookupDelay</cstring>
455 </property> 578 </property>
456 <hbox> 579 <property stdset="1">
457 <property stdset="1"> 580 <name>maxValue</name>
458 <name>margin</name> 581 <number>9999999</number>
459 <number>0</number> 582 </property>
460 </property> 583 <property stdset="1">
461 <property stdset="1"> 584 <name>minValue</name>
462 <name>spacing</name> 585 <number>42</number>
463 <number>6</number> 586 </property>
464 </property>
465 <widget>
466 <class>QLabel</class>
467 <property stdset="1">
468 <name>name</name>
469 <cstring>TextLabel7_2</cstring>
470 </property>
471 <property stdset="1">
472 <name>text</name>
473 <string>NTP Server:</string>
474 </property>
475 </widget>
476 <widget>
477 <class>QLineEdit</class>
478 <property stdset="1">
479 <name>name</name>
480 <cstring>LineEditNtpSrv</cstring>
481 </property>
482 </widget>
483 </hbox>
484 </widget> 587 </widget>
588 </grid>
589 </widget>
590 <widget row="1" column="0" >
591 <class>QLayoutWidget</class>
592 <property stdset="1">
593 <name>name</name>
594 <cstring>Layout7_2</cstring>
595 </property>
596 <grid>
597 <property stdset="1">
598 <name>margin</name>
599 <number>0</number>
600 </property>
601 <property stdset="1">
602 <name>spacing</name>
603 <number>6</number>
604 </property>
485 <widget row="0" column="0" > 605 <widget row="0" column="0" >
486 <class>QLayoutWidget</class> 606 <class>QLabel</class>
607 <property stdset="1">
608 <name>name</name>
609 <cstring>TextLabel1_2_2</cstring>
610 </property>
611 <property stdset="1">
612 <name>text</name>
613 <string>Wait for</string>
614 </property>
615 </widget>
616 <widget row="0" column="2" >
617 <class>QLabel</class>
618 <property stdset="1">
619 <name>name</name>
620 <cstring>TextLabel2_3</cstring>
621 </property>
622 <property stdset="1">
623 <name>text</name>
624 <string>minutes until</string>
625 </property>
626 </widget>
627 <widget row="1" column="0" rowspan="1" colspan="3" >
628 <class>QLabel</class>
629 <property stdset="1">
630 <name>name</name>
631 <cstring>TextLabel3_3_2</cstring>
632 </property>
633 <property stdset="1">
634 <name>text</name>
635 <string>NTP syncronises the clock with the network</string>
636 </property>
637 <property stdset="1">
638 <name>alignment</name>
639 <set>WordBreak|AlignVCenter|AlignLeft</set>
640 </property>
641 <property>
642 <name>wordwrap</name>
643 </property>
644 </widget>
645 <widget row="0" column="1" >
646 <class>QSpinBox</class>
487 <property stdset="1"> 647 <property stdset="1">
488 <name>name</name> 648 <name>name</name>
489 <cstring>Layout5</cstring> 649 <cstring>SpinBoxNtpDelay</cstring>
490 </property> 650 </property>
491 <hbox> 651 <property stdset="1">
492 <property stdset="1"> 652 <name>maxValue</name>
493 <name>margin</name> 653 <number>9999999</number>
494 <number>0</number> 654 </property>
495 </property> 655 <property stdset="1">
496 <property stdset="1"> 656 <name>minValue</name>
497 <name>spacing</name> 657 <number>0</number>
498 <number>6</number> 658 </property>
499 </property>
500 <widget>
501 <class>QLabel</class>
502 <property stdset="1">
503 <name>name</name>
504 <cstring>TextLabel1_2</cstring>
505 </property>
506 <property stdset="1">
507 <name>text</name>
508 <string>Min. delay:</string>
509 </property>
510 </widget>
511 <widget>
512 <class>QSpinBox</class>
513 <property stdset="1">
514 <name>name</name>
515 <cstring>SpinBoxMinDelay</cstring>
516 </property>
517 </widget>
518 <widget>
519 <class>QLabel</class>
520 <property stdset="1">
521 <name>name</name>
522 <cstring>TextLabel2</cstring>
523 </property>
524 <property stdset="1">
525 <name>text</name>
526 <string>minutes</string>
527 </property>
528 </widget>
529 </hbox>
530 </widget> 659 </widget>
531 </grid> 660 </grid>
532 </widget> 661 </widget>
533 </grid> 662 </grid>
534 </widget> 663 </widget>
535 </grid> 664 </grid>
536 </widget> 665 </widget>
537 <widget> 666 <widget>
538 <class>QWidget</class> 667 <class>QWidget</class>
539 <property stdset="1"> 668 <property stdset="1">
540 <name>name</name> 669 <name>name</name>
541 <cstring>tabSetTime</cstring> 670 <cstring>tabSetTime</cstring>
542 </property> 671 </property>
543 <attribute> 672 <attribute>
544 <name>title</name> 673 <name>title</name>
545 <string>Manual</string> 674 <string>Manual</string>
546 </attribute> 675 </attribute>
547 <vbox> 676 <vbox>
548 <property stdset="1"> 677 <property stdset="1">
549 <name>margin</name> 678 <name>margin</name>
550 <number>2</number> 679 <number>2</number>
551 </property> 680 </property>
552 <property stdset="1"> 681 <property stdset="1">
553 <name>spacing</name> 682 <name>spacing</name>
554 <number>2</number> 683 <number>2</number>
555 </property> 684 </property>
556 <widget> 685 <widget>
557 <class>QFrame</class> 686 <class>QFrame</class>
558 <property stdset="1"> 687 <property stdset="1">
559 <name>name</name> 688 <name>name</name>
560 <cstring>FrameSetTime</cstring> 689 <cstring>FrameSetTime</cstring>
561 </property> 690 </property>
562 <property stdset="1"> 691 <property stdset="1">
563 <name>frameShape</name> 692 <name>frameShape</name>
564 <enum>StyledPanel</enum> 693 <enum>StyledPanel</enum>
565 </property> 694 </property>
566 <property stdset="1"> 695 <property stdset="1">
567 <name>frameShadow</name> 696 <name>frameShadow</name>
568 <enum>Raised</enum> 697 <enum>Raised</enum>
569 </property> 698 </property>
570 </widget> 699 </widget>
571 <widget> 700 <widget>
572 <class>QPushButton</class> 701 <class>QPushButton</class>
573 <property stdset="1"> 702 <property stdset="1">
574 <name>name</name> 703 <name>name</name>
575 <cstring>PushButtonSetManualTime</cstring> 704 <cstring>PushButtonSetManualTime</cstring>
576 </property> 705 </property>
577 <property stdset="1"> 706 <property stdset="1">
578 <name>text</name> 707 <name>text</name>
579 <string>Set time</string> 708 <string>Set time</string>
580 </property> 709 </property>
581 </widget> 710 </widget>
582 </vbox> 711 </vbox>
583 </widget> 712 </widget>
584 </widget> 713 </widget>
585 </grid> 714 </grid>
586</widget> 715</widget>
587</UI> 716</UI>
diff --git a/noncore/settings/netsystemtime/settime.cpp b/noncore/settings/netsystemtime/settime.cpp
index b456012..2398c08 100644
--- a/noncore/settings/netsystemtime/settime.cpp
+++ b/noncore/settings/netsystemtime/settime.cpp
@@ -168,222 +168,226 @@ SetDateTime::SetDateTime(QWidget *parent, const char *name, WFlags f )
168 dateButton->setDateFormat( df ); 168 dateButton->setDateFormat( df );
169 169
170 connect( dateFormatCombo, SIGNAL( activated(int)), 170 connect( dateFormatCombo, SIGNAL( activated(int)),
171 SLOT(formatChanged(int))); 171 SLOT(formatChanged(int)));
172 172
173 QHBoxLayout *hb4 = new QHBoxLayout( vb ); 173 QHBoxLayout *hb4 = new QHBoxLayout( vb );
174 l = new QLabel( tr("Applet format" ), FrameSystemTime ); 174 l = new QLabel( tr("Applet format" ), FrameSystemTime );
175 hb4->addWidget( l, 1 ); 175 hb4->addWidget( l, 1 );
176 176
177 clockAppletCombo = new QComboBox( FrameSystemTime ); 177 clockAppletCombo = new QComboBox( FrameSystemTime );
178 clockAppletCombo->insertItem( tr("hh:mm"), 0 ); 178 clockAppletCombo->insertItem( tr("hh:mm"), 0 );
179 clockAppletCombo->insertItem( tr("D/M hh:mm"), 1 ); 179 clockAppletCombo->insertItem( tr("D/M hh:mm"), 1 );
180 clockAppletCombo->insertItem( tr("M/D hh:mm"), 2 ); 180 clockAppletCombo->insertItem( tr("M/D hh:mm"), 2 );
181 181
182 hb4->addWidget( clockAppletCombo, 2 ); 182 hb4->addWidget( clockAppletCombo, 2 );
183 int clockApplet = config.readNumEntry("ClockApplet",0); 183 int clockApplet = config.readNumEntry("ClockApplet",0);
184 clockAppletCombo->setCurrentItem( clockApplet ); 184 clockAppletCombo->setCurrentItem( clockApplet );
185 185
186 vb->addStretch( 0 ); 186 vb->addStretch( 0 );
187 187
188 QObject::connect( PushButtonSetManualTime, SIGNAL(clicked()), 188 QObject::connect( PushButtonSetManualTime, SIGNAL(clicked()),
189 this, SLOT(commitTime())); 189 this, SLOT(commitTime()));
190 190
191 QObject::connect( tz, SIGNAL( signalNewTz( const QString& ) ), 191 QObject::connect( tz, SIGNAL( signalNewTz( const QString& ) ),
192 timeButton, SLOT( slotTzChange( const QString& ) ) ); 192 timeButton, SLOT( slotTzChange( const QString& ) ) );
193 QObject::connect( tz, SIGNAL( signalNewTz( const QString& ) ), 193 QObject::connect( tz, SIGNAL( signalNewTz( const QString& ) ),
194 SLOT( tzChange( const QString& ) ) ); 194 SLOT( tzChange( const QString& ) ) );
195 195
196 QObject::connect( weekStartCombo, SIGNAL( activated ( int )), 196 QObject::connect( weekStartCombo, SIGNAL( activated ( int )),
197 SLOT(updateSystem(int ) )); 197 SLOT(updateSystem(int ) ));
198 QObject::connect( ampmCombo, SIGNAL( activated ( int )), 198 QObject::connect( ampmCombo, SIGNAL( activated ( int )),
199 SLOT(updateSystem(int ) )); 199 SLOT(updateSystem(int ) ));
200 QObject::connect( dateFormatCombo, SIGNAL( activated ( int )), 200 QObject::connect( dateFormatCombo, SIGNAL( activated ( int )),
201 SLOT(updateSystem(int ) )); 201 SLOT(updateSystem(int ) ));
202 QObject::connect( clockAppletCombo, SIGNAL( activated ( int )), 202 QObject::connect( clockAppletCombo, SIGNAL( activated ( int )),
203 SLOT(updateSystem(int ) )); 203 SLOT(updateSystem(int ) ));
204} 204}
205 205
206SetDateTime::~SetDateTime() 206SetDateTime::~SetDateTime()
207{ 207{
208 writeSettings(); 208 writeSettings();
209 209
210} 210}
211 211
212void SetDateTime::writeSettings() 212void SetDateTime::writeSettings()
213{ 213{
214 Config config("qpe"); 214 Config config("qpe");
215 config.setGroup( "Time" ); 215 config.setGroup( "Time" );
216 config.writeEntry( "AMPM", ampmCombo->currentItem() ); 216 config.writeEntry( "AMPM", ampmCombo->currentItem() );
217 config.writeEntry( "MONDAY", weekStartCombo->currentItem() ); 217 config.writeEntry( "MONDAY", weekStartCombo->currentItem() );
218 config.setGroup( "Date" ); 218 config.setGroup( "Date" );
219 DateFormat df = date_formats[dateFormatCombo->currentItem()]; 219 DateFormat df = date_formats[dateFormatCombo->currentItem()];
220 config.writeEntry( "Separator", QString(df.separator())); 220 config.writeEntry( "Separator", QString(df.separator()));
221 config.writeEntry( "ShortOrder", df.shortOrder()); 221 config.writeEntry( "ShortOrder", df.shortOrder());
222 config.writeEntry( "LongOrder", df.longOrder()); 222 config.writeEntry( "LongOrder", df.longOrder());
223 config.writeEntry( "ClockApplet", clockAppletCombo->currentItem() ); 223 config.writeEntry( "ClockApplet", clockAppletCombo->currentItem() );
224 224
225 Config lconfig("locale"); 225 Config lconfig("locale");
226 lconfig.setGroup( "Location" ); 226 lconfig.setGroup( "Location" );
227 lconfig.writeEntry( "Timezone", tz->currentZone() ); 227 lconfig.writeEntry( "Timezone", tz->currentZone() );
228 228
229} 229}
230 230
231void SetDateTime::commitTime() 231void SetDateTime::commitTime()
232{ 232{
233 tz->setFocus(); 233 tz->setFocus();
234 // really turn off the screensaver before doing anything 234 // really turn off the screensaver before doing anything
235 { 235 {
236 // Needs to be encased in { } so that it deconstructs and sends 236 // Needs to be encased in { } so that it deconstructs and sends
237 QCopEnvelope disableScreenSaver( "QPE/System", "setScreenSaverIntervals(int,int,int)" ); 237 QCopEnvelope disableScreenSaver( "QPE/System", "setScreenSaverIntervals(int,int,int)" );
238 disableScreenSaver << 0 << 0 << 0; 238 disableScreenSaver << 0 << 0 << 0;
239 } 239 }
240 // Need to process the QCOP event generated above before proceeding 240 // Need to process the QCOP event generated above before proceeding
241 qApp->processEvents(); 241 qApp->processEvents();
242 242
243 // before we progress further, set our TZ! 243 // before we progress further, set our TZ!
244 setenv( "TZ", tz->currentZone(), 1 ); 244 setenv( "TZ", tz->currentZone(), 1 );
245 // now set the time... 245 // now set the time...
246 QDateTime dt( dateButton->date(), timeButton->time() ); 246 QDateTime dt( dateButton->date(), timeButton->time() );
247 247
248 if ( dt.isValid() ) setTime(dt); 248 if ( dt.isValid() ) setTime(dt);
249} 249}
250 250
251void SetDateTime::setTime(QDateTime dt) 251void SetDateTime::setTime(QDateTime dt)
252{ 252{
253 Config cfg("ntp",Config::User); 253 Config cfg("ntp",Config::User);
254 cfg.setGroup("correction"); 254 cfg.setGroup("correction");
255 int t = TimeConversion::toUTC(dt); 255 int t = TimeConversion::toUTC(dt);
256 struct timeval myTv; 256 struct timeval myTv;
257 myTv.tv_sec = t; 257 myTv.tv_sec = t;
258 cfg.writeEntry("time", t ); 258 cfg.writeEntry("time", t );
259 myTv.tv_usec = 0; 259 myTv.tv_usec = 0;
260 260
261 if ( myTv.tv_sec != -1 ) 261 if ( myTv.tv_sec != -1 )
262 ::settimeofday( &myTv, 0 ); 262 ::settimeofday( &myTv, 0 );
263 Global::writeHWClock(); 263 Global::writeHWClock();
264 // since time has changed quickly load in the datebookdb
265 // to allow the alarm server to get a better grip on itself
266 // (example re-trigger alarms for when we travel back in time)
267 DateBookDB db;
264} 268}
265 269
266void SetDateTime::updateSystem(int i) 270void SetDateTime::updateSystem(int i)
267{ 271{
268 qDebug("SetDateTime::updateSystem(int %i)",i); 272 qDebug("SetDateTime::updateSystem(int %i)",i);
269 writeSettings(); 273 writeSettings();
270 // since time has changed quickly load in the datebookdb
271 // to allow the alarm server to get a better grip on itself
272 // (example re-trigger alarms for when we travel back in time)
273 // DateBookDB db;
274 274
275 // set the timezone for everyone else... 275 // set the timezone for everyone else...
276 QCopEnvelope setTimeZone( "QPE/System", "timeChange(QString)" ); 276 QCopEnvelope setTimeZone( "QPE/System", "timeChange(QString)" );
277 setTimeZone << tz->currentZone(); 277 setTimeZone << tz->currentZone();
278 278
279 // AM/PM setting and notify time changed 279 // AM/PM setting and notify time changed
280 QCopEnvelope setClock( "QPE/System", "clockChange(bool)" ); 280 QCopEnvelope setClock( "QPE/System", "clockChange(bool)" );
281 setClock << ampmCombo->currentItem(); 281 setClock << ampmCombo->currentItem();
282 282
283 // Notify everyone what day we prefer to start the week on. 283 // Notify everyone what day we prefer to start the week on.
284 QCopEnvelope setWeek( "QPE/System", "weekChange(bool)" ); 284 QCopEnvelope setWeek( "QPE/System", "weekChange(bool)" );
285 setWeek << weekStartCombo->currentItem(); 285 setWeek << weekStartCombo->currentItem();
286 286
287 // Notify everyone what date format to use 287 // Notify everyone what date format to use
288 QCopEnvelope setDateFormat( "QPE/System", "setDateFormat(DateFormat)" ); 288 QCopEnvelope setDateFormat( "QPE/System", "setDateFormat(DateFormat)" );
289 setDateFormat << date_formats[dateFormatCombo->currentItem()]; 289 setDateFormat << date_formats[dateFormatCombo->currentItem()];
290 290
291 // Restore screensaver 291 // Restore screensaver
292 QCopEnvelope enableScreenSaver( "QPE/System", "setScreenSaverIntervals(int,int,int)" ); 292 QCopEnvelope enableScreenSaver( "QPE/System", "setScreenSaverIntervals(int,int,int)" );
293 enableScreenSaver << -1 << -1 << -1; 293 enableScreenSaver << -1 << -1 << -1;
294 // since time has changed quickly load in the datebookdb
295 // to allow the alarm server to get a better grip on itself
296 // (example re-trigger alarms for when we travel back in time)
297 DateBookDB db;
294 298
295} 299}
296 300
297void SetDateTime::tzChange( const QString &tz ) 301void SetDateTime::tzChange( const QString &tz )
298{ 302{
299 qDebug("SetDateTime::tzChange"); 303 qDebug("SetDateTime::tzChange");
300 // set the TZ get the time and leave gracefully... 304 // set the TZ get the time and leave gracefully...
301 QString strSave; 305 QString strSave;
302 strSave = getenv( "TZ" ); 306 strSave = getenv( "TZ" );
303 setenv( "TZ", tz, 1 ); 307 setenv( "TZ", tz, 1 );
304 308
305 QDate d = QDate::currentDate(); 309 QDate d = QDate::currentDate();
306 // reset the time. 310 // reset the time.
307 if ( !strSave.isNull() ) { 311 if ( !strSave.isNull() ) {
308 setenv( "TZ", strSave, 1 ); 312 setenv( "TZ", strSave, 1 );
309 } 313 }
310 dateButton->setDate( d ); 314 dateButton->setDate( d );
311 updateSystem(); 315 updateSystem();
312} 316}
313 317
314void SetDateTime::formatChanged(int i) 318void SetDateTime::formatChanged(int i)
315{ 319{
316 dateButton->setDateFormat(date_formats[i]); 320 dateButton->setDateFormat(date_formats[i]);
317} 321}
318 322
319static const int ValueAM = 0; 323static const int ValueAM = 0;
320static const int ValuePM = 1; 324static const int ValuePM = 1;
321 325
322 326
323 327
324SetTime::SetTime( QWidget *parent, const char *name ) 328SetTime::SetTime( QWidget *parent, const char *name )
325 : QWidget( parent, name ) 329 : QWidget( parent, name )
326{ 330{
327 use12hourTime = FALSE; 331 use12hourTime = FALSE;
328 332
329 QTime currTime = QTime::currentTime(); 333 QTime currTime = QTime::currentTime();
330 hour = currTime.hour(); 334 hour = currTime.hour();
331 minute = currTime.minute(); 335 minute = currTime.minute();
332 336
333 QHBoxLayout *hb2 = new QHBoxLayout( this ); 337 QHBoxLayout *hb2 = new QHBoxLayout( this );
334 hb2->setSpacing( 3 ); 338 hb2->setSpacing( 3 );
335 339
336 QLabel *l = new QLabel( tr("Hour"), this ); 340 QLabel *l = new QLabel( tr("Hour"), this );
337 // l->setAlignment( AlignRight | AlignVCenter ); 341 // l->setAlignment( AlignRight | AlignVCenter );
338 hb2->addWidget( l ); 342 hb2->addWidget( l );
339 343
340 sbHour = new QSpinBox( this ); 344 sbHour = new QSpinBox( this );
341 sbHour->setMinimumWidth( 30 ); 345 sbHour->setMinimumWidth( 30 );
342 if(use12hourTime) { 346 if(use12hourTime) {
343 sbHour->setMinValue(1); 347 sbHour->setMinValue(1);
344 sbHour->setMaxValue( 12 ); 348 sbHour->setMaxValue( 12 );
345 int show_hour = hour; 349 int show_hour = hour;
346 if (hour > 12) 350 if (hour > 12)
347 show_hour -= 12; 351 show_hour -= 12;
348 if (show_hour == 0) 352 if (show_hour == 0)
349 show_hour = 12; 353 show_hour = 12;
350 354
351 sbHour->setValue( show_hour ); 355 sbHour->setValue( show_hour );
352 } else { 356 } else {
353 sbHour->setMinValue( 0 ); 357 sbHour->setMinValue( 0 );
354 sbHour->setMaxValue( 23 ); 358 sbHour->setMaxValue( 23 );
355 sbHour->setValue( hour ); 359 sbHour->setValue( hour );
356 } 360 }
357 sbHour->setWrapping(TRUE); 361 sbHour->setWrapping(TRUE);
358 connect( sbHour, SIGNAL(valueChanged(int)), this, SLOT(hourChanged(int)) ); 362 connect( sbHour, SIGNAL(valueChanged(int)), this, SLOT(hourChanged(int)) );
359 hb2->addWidget( sbHour ); 363 hb2->addWidget( sbHour );
360 364
361 hb2->addStretch( 1 ); 365 hb2->addStretch( 1 );
362 366
363 l = new QLabel( tr("Minute"), this ); 367 l = new QLabel( tr("Minute"), this );
364 //l->setAlignment( AlignRight | AlignVCenter ); 368 //l->setAlignment( AlignRight | AlignVCenter );
365 hb2->addWidget( l ); 369 hb2->addWidget( l );
366 370
367 sbMin = new QSpinBox( this ); 371 sbMin = new QSpinBox( this );
368 sbMin->setMinValue( 0 ); 372 sbMin->setMinValue( 0 );
369 sbMin->setMaxValue( 59 ); 373 sbMin->setMaxValue( 59 );
370 sbMin->setWrapping(TRUE); 374 sbMin->setWrapping(TRUE);
371 sbMin->setValue( minute ); 375 sbMin->setValue( minute );
372 sbMin->setMinimumWidth( 30 ); 376 sbMin->setMinimumWidth( 30 );
373 connect( sbMin, SIGNAL(valueChanged(int)), this, SLOT(minuteChanged(int)) ); 377 connect( sbMin, SIGNAL(valueChanged(int)), this, SLOT(minuteChanged(int)) );
374 hb2->addWidget( sbMin ); 378 hb2->addWidget( sbMin );
375 379
376 hb2->addStretch( 1 ); 380 hb2->addStretch( 1 );
377 381
378 ampm = new QComboBox( this ); 382 ampm = new QComboBox( this );
379 ampm->insertItem( tr("AM"), ValueAM ); 383 ampm->insertItem( tr("AM"), ValueAM );
380 ampm->insertItem( tr("PM"), ValuePM ); 384 ampm->insertItem( tr("PM"), ValuePM );
381 connect( ampm, SIGNAL(activated(int)), this, SLOT(checkedPM(int)) ); 385 connect( ampm, SIGNAL(activated(int)), this, SLOT(checkedPM(int)) );
382 hb2->addWidget( ampm ); 386 hb2->addWidget( ampm );
383 387
384 hb2->addStretch( 1 ); 388 hb2->addStretch( 1 );
385 389
386} 390}
387 391
388QTime SetTime::time() const 392QTime SetTime::time() const
389{ 393{