summaryrefslogtreecommitdiff
authortille <tille>2002-11-10 17:01:05 (UTC)
committer tille <tille>2002-11-10 17:01:05 (UTC)
commit8394ee8e5fc0014605256b243909709864afdc9b (patch) (unidiff)
tree02718093edeb4c2df58ef8611fbf3db11abcf574
parent81e63be3c1e21da2a2f97df1fc38417e7ca814e1 (diff)
downloadopie-8394ee8e5fc0014605256b243909709864afdc9b.zip
opie-8394ee8e5fc0014605256b243909709864afdc9b.tar.gz
opie-8394ee8e5fc0014605256b243909709864afdc9b.tar.bz2
usability improvments
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/netsystemtime/netsystemtime.pro6
-rw-r--r--noncore/settings/netsystemtime/ntp.cpp36
-rw-r--r--noncore/settings/netsystemtime/ntp.h0
-rw-r--r--noncore/settings/netsystemtime/ntpbase.cpp33
-rw-r--r--noncore/settings/netsystemtime/ntpbase.h4
-rw-r--r--noncore/settings/netsystemtime/ntpbase.ui62
6 files changed, 79 insertions, 62 deletions
diff --git a/noncore/settings/netsystemtime/netsystemtime.pro b/noncore/settings/netsystemtime/netsystemtime.pro
index 898e400..a849431 100644
--- a/noncore/settings/netsystemtime/netsystemtime.pro
+++ b/noncore/settings/netsystemtime/netsystemtime.pro
@@ -1,26 +1,26 @@
1 TEMPLATE= app 1 TEMPLATE= app
2 CONFIG = qt warn_on debug 2 CONFIG = qt warn_on debug
3 #CONFIG = qt warn_on release 3 #CONFIG = qt warn_on release
4 HEADERS = ntp.h settime.h ntpbase.h 4 HEADERS = ntp.h settime.h
5 SOURCES = main.cpp ntp.cpp settime.cpp ntpbase.cpp 5 SOURCES = main.cpp ntp.cpp settime.cpp
6 INCLUDEPATH+= $(OPIEDIR)/include 6 INCLUDEPATH+= $(OPIEDIR)/include
7 DEPENDPATH+= $(OPIEDIR)/include 7 DEPENDPATH+= $(OPIEDIR)/include
8LIBS += -lqpe -lopie 8LIBS += -lqpe -lopie
9 INTERFACES= 9 INTERFACES= ntpbase.ui
10DESTDIR = $(OPIEDIR)/bin 10DESTDIR = $(OPIEDIR)/bin
11 TARGET = systemtime 11 TARGET = systemtime
12 12
13TRANSLATIONS = ../../../i18n/de/systemtime.ts \ 13TRANSLATIONS = ../../../i18n/de/systemtime.ts \
14 ../../../i18n/en/systemtime.ts \ 14 ../../../i18n/en/systemtime.ts \
15 ../../../i18n/es/systemtime.ts \ 15 ../../../i18n/es/systemtime.ts \
16 ../../../i18n/fr/systemtime.ts \ 16 ../../../i18n/fr/systemtime.ts \
17 ../../../i18n/hu/systemtime.ts \ 17 ../../../i18n/hu/systemtime.ts \
18 ../../../i18n/ja/systemtime.ts \ 18 ../../../i18n/ja/systemtime.ts \
19 ../../../i18n/ko/systemtime.ts \ 19 ../../../i18n/ko/systemtime.ts \
20 ../../../i18n/no/systemtime.ts \ 20 ../../../i18n/no/systemtime.ts \
21 ../../../i18n/pl/systemtime.ts \ 21 ../../../i18n/pl/systemtime.ts \
22 ../../../i18n/pt/systemtime.ts \ 22 ../../../i18n/pt/systemtime.ts \
23 ../../../i18n/pt_BR/systemtime.ts \ 23 ../../../i18n/pt_BR/systemtime.ts \
24 ../../../i18n/sl/systemtime.ts \ 24 ../../../i18n/sl/systemtime.ts \
25 ../../../i18n/zh_CN/systemtime.ts \ 25 ../../../i18n/zh_CN/systemtime.ts \
26 ../../../i18n/zh_TW/systemtime.ts 26 ../../../i18n/zh_TW/systemtime.ts
diff --git a/noncore/settings/netsystemtime/ntp.cpp b/noncore/settings/netsystemtime/ntp.cpp
index 40805a0..111f7d4 100644
--- a/noncore/settings/netsystemtime/ntp.cpp
+++ b/noncore/settings/netsystemtime/ntp.cpp
@@ -25,48 +25,65 @@
25#include <sys/time.h> 25#include <sys/time.h>
26#include <time.h> 26#include <time.h>
27#include <stdlib.h> 27#include <stdlib.h>
28 28
29 29
30Ntp::Ntp( QWidget* parent, const char* name, WFlags fl ) 30Ntp::Ntp( QWidget* parent, const char* name, WFlags fl )
31 : SetDateTime( parent, name, fl ) 31 : SetDateTime( parent, name, fl )
32{ 32{
33 Config ntpSrvs(QPEApplication::qpeDir()+"etc/ntpservers",Config::File); 33 Config ntpSrvs(QPEApplication::qpeDir()+"etc/ntpservers",Config::File);
34 ntpSrvs.setGroup("servers"); 34 ntpSrvs.setGroup("servers");
35 int srvCount = ntpSrvs.readNumEntry("count", 0 ); 35 int srvCount = ntpSrvs.readNumEntry("count", 0 );
36 for (int i = 0; i < srvCount; i++) 36 for (int i = 0; i < srvCount; i++)
37 { 37 {
38 ntpSrvs.setGroup(QString::number(i)); 38 ntpSrvs.setGroup(QString::number(i));
39 ComboNtpSrv->insertItem( ntpSrvs.readEntry("name") ); 39 ComboNtpSrv->insertItem( ntpSrvs.readEntry("name") );
40 } 40 }
41 if ( srvCount==0 ) ComboNtpSrv->insertItem(tr("time.fu-berlin.de")); 41 if ( srvCount==0 ) ComboNtpSrv->insertItem(tr("time.fu-berlin.de"));
42 42
43 Config cfg("ntp",Config::User); 43 Config cfg("ntp",Config::User);
44 cfg.setGroup("settings"); 44 cfg.setGroup("settings");
45 SpinBoxMinLookupDelay->setValue( cfg.readNumEntry("minLookupDiff",720) ); 45 SpinBoxMinLookupDelay->setValue( cfg.readNumEntry("minLookupDiff",720) );
46 SpinBoxNtpDelay->setValue( cfg.readNumEntry("ntpRefreshFreq",1440) ); 46 SpinBoxNtpDelay->setValue( cfg.readNumEntry("ntpRefreshFreq",1440) );
47 ComboNtpSrv->setCurrentItem( cfg.readNumEntry("ntpServer", 0) ); 47 ComboNtpSrv->setCurrentItem( cfg.readNumEntry("ntpServer", 0) );
48 48
49 //make tab order
50
51 TabWidgetMain->removePage( tabMain );
52 TabWidgetMain->removePage( tabManualSetTime );
53 TabWidgetMain->removePage( TabSettings );
54 TabWidgetMain->removePage( tabPredict );
55 TabWidgetMain->removePage( tabNtp );
56
57 TabWidgetMain->insertTab( tabMain, tr( "Main" ) );
58 TabWidgetMain->insertTab( tabManualSetTime, tr( "Manual" ) );
59 TabWidgetMain->insertTab( TabSettings, tr( "Settings" ) );
60 TabWidgetMain->insertTab( tabPredict, tr( "Predict" ) );
61 TabWidgetMain->insertTab( tabNtp, tr( "NTP" ) );
62 NtpBaseLayout->addWidget( TabWidgetMain, 0, 0 );
63
64
65
49 bool advMode = cfg.readBoolEntry("advancedFeatures", false ); 66 bool advMode = cfg.readBoolEntry("advancedFeatures", false );
50 showAdvancedFeatures(advMode); 67 showAdvancedFeatures(advMode);
51 CheckBoxAdvSettings->setChecked( advMode ); 68 CheckBoxAdvSettings->setChecked( advMode );
52 connect( CheckBoxAdvSettings, SIGNAL( toggled( bool ) ), 69 connect( CheckBoxAdvSettings, SIGNAL( toggled( bool ) ),
53 SLOT( showAdvancedFeatures( bool ) ) ); 70 SLOT( showAdvancedFeatures( bool ) ) );
54 71
55 makeChannel(); 72 makeChannel();
56 73
57 ntpTimer = new QTimer(this); 74 ntpTimer = new QTimer(this);
58 75
59 ntpProcess = new OProcess( ); 76 ntpProcess = new OProcess( );
60 connect( SpinBoxNtpDelay, SIGNAL( valueChanged(int) ), 77 connect( SpinBoxNtpDelay, SIGNAL( valueChanged(int) ),
61 SLOT(slotNtpDelayChanged(int)) ); 78 SLOT(slotNtpDelayChanged(int)) );
62 79
63 ntpSock = new QSocket( this ); 80 ntpSock = new QSocket( this );
64 connect( ntpSock, SIGNAL( error(int) ), 81 connect( ntpSock, SIGNAL( error(int) ),
65 SLOT(slotCheckNtp(int)) ); 82 SLOT(slotCheckNtp(int)) );
66 slotProbeNtpServer(); 83 slotProbeNtpServer();
67 84
68 connect ( ntpProcess, SIGNAL(receivedStdout(OProcess*,char*,int)), 85 connect ( ntpProcess, SIGNAL(receivedStdout(OProcess*,char*,int)),
69 this, SLOT(getNtpOutput(OProcess*,char*,int))); 86 this, SLOT(getNtpOutput(OProcess*,char*,int)));
70 connect ( ntpProcess, SIGNAL(processExited(OProcess*)), 87 connect ( ntpProcess, SIGNAL(processExited(OProcess*)),
71 this, SLOT(ntpFinished(OProcess*))); 88 this, SLOT(ntpFinished(OProcess*)));
72 connect(runNtp, SIGNAL(clicked()), this, SLOT(slotRunNtp())); 89 connect(runNtp, SIGNAL(clicked()), this, SLOT(slotRunNtp()));
@@ -91,93 +108,102 @@ Ntp::~Ntp()
91 cfg.setGroup("settings"); 108 cfg.setGroup("settings");
92 cfg.writeEntry("ntpServer", ComboNtpSrv->currentItem()); 109 cfg.writeEntry("ntpServer", ComboNtpSrv->currentItem());
93 cfg.writeEntry( "minLookupDiff", SpinBoxMinLookupDelay->value() ); 110 cfg.writeEntry( "minLookupDiff", SpinBoxMinLookupDelay->value() );
94 cfg.writeEntry( "ntpRefreshFreq", SpinBoxNtpDelay->value() ); 111 cfg.writeEntry( "ntpRefreshFreq", SpinBoxNtpDelay->value() );
95 cfg.writeEntry( "advancedFeatures", CheckBoxAdvSettings->isChecked() ); 112 cfg.writeEntry( "advancedFeatures", CheckBoxAdvSettings->isChecked() );
96} 113}
97 114
98bool Ntp::ntpDelayElapsed() 115bool Ntp::ntpDelayElapsed()
99{ 116{
100 Config cfg("ntp",Config::User); 117 Config cfg("ntp",Config::User);
101 cfg.setGroup("lookups"); 118 cfg.setGroup("lookups");
102 _lookupDiff = TimeConversion::toUTC(QDateTime::currentDateTime()) - cfg.readNumEntry("time",0); 119 _lookupDiff = TimeConversion::toUTC(QDateTime::currentDateTime()) - cfg.readNumEntry("time",0);
103 if (_lookupDiff < 0) return true; 120 if (_lookupDiff < 0) return true;
104 int i =_lookupDiff - (SpinBoxNtpDelay->value()*60); 121 int i =_lookupDiff - (SpinBoxNtpDelay->value()*60);
105 return i > -60; 122 return i > -60;
106} 123}
107 124
108QString Ntp::getNtpServer() 125QString Ntp::getNtpServer()
109{ 126{
110 return ComboNtpSrv->currentText(); 127 return ComboNtpSrv->currentText();
111} 128}
112 129
113void Ntp::slotRunNtp() 130void Ntp::slotRunNtp()
114{ 131{
115 if ( !ntpDelayElapsed() ) 132 if ( !ntpDelayElapsed() && CheckBoxAdvSettings->isChecked() )
116 { 133 {
117 switch ( 134 switch (
118 QMessageBox::warning(this, tr("Run NTP?"), 135 QMessageBox::warning(this, tr("Run NTP?"),
119 tr("You asked for a delay of ")+SpinBoxNtpDelay->text()+tr(" minutes, but only ")+ 136 tr("You asked for a delay of ")+SpinBoxNtpDelay->text()+tr(" minutes, but only ")+
120 QString::number(_lookupDiff/60)+tr(" minutes elapsed since last lookup.")+ 137 QString::number(_lookupDiff/60)+tr(" minutes elapsed since last lookup.")+
121 "<br>"+tr("Rerun NTP?"), 138 "<br>"+tr("Rerun NTP?"),
122 QMessageBox::Ok,QMessageBox::Cancel) 139 QMessageBox::Ok,QMessageBox::Cancel)
123 ) { 140 ) {
124 case QMessageBox::Ok: break; 141 case QMessageBox::Ok: break;
125 case QMessageBox::Cancel: return; 142 case QMessageBox::Cancel: return;
126 default: return; 143 default: return;
127 } 144 }
128 } 145 }
129 TextLabelStartTime->setText(QDateTime::currentDateTime().toString()); 146 TextLabelStartTime->setText(QDateTime::currentDateTime().toString());
130 ntpOutPut( tr("Running:")+"\nntpdate "+getNtpServer() ); 147 ntpOutPut( tr("Running:")+"\nntpdate "+getNtpServer() );
131 148
132 ntpProcess->clearArguments(); 149 ntpProcess->clearArguments();
133 *ntpProcess << "ntpdate" << getNtpServer(); 150 *ntpProcess << "ntpdate" << getNtpServer();
134 bool ret = ntpProcess->start(OProcess::NotifyOnExit,OProcess::AllOutput); 151 bool ret = ntpProcess->start(OProcess::NotifyOnExit,OProcess::AllOutput);
135 if ( !ret ) { 152 if ( !ret ) {
153 QMessageBox::critical(this, tr("ntp error"),
154 tr("Error while getting time form network!"));
136 qDebug("Error while executing ntpdate"); 155 qDebug("Error while executing ntpdate");
137 ntpOutPut( tr("Error while executing ntpdate")); 156 ntpOutPut( tr("Error while executing ntpdate"));
138 } 157 }
139} 158}
140 159
141void Ntp::getNtpOutput(OProcess *proc, char *buffer, int buflen) 160void Ntp::getNtpOutput(OProcess *proc, char *buffer, int buflen)
142{ 161{
162 if (! proc ) qDebug("Ntp::getNtpOutput OProcess is null");
143 QString lineStr, lineStrOld; 163 QString lineStr, lineStrOld;
144 lineStr = buffer; 164 lineStr = buffer;
145 lineStr=lineStr.left(buflen); 165 lineStr=lineStr.left(buflen);
146 if (lineStr!=lineStrOld) 166 if (lineStr!=lineStrOld)
147 { 167 {
148 ntpOutPut(lineStr); 168 ntpOutPut(lineStr);
149 _ntpOutput += lineStr; 169 _ntpOutput += lineStr;
150 } 170 }
151 lineStrOld = lineStr; 171 lineStrOld = lineStr;
152} 172}
153 173
154void Ntp::ntpFinished(OProcess *p) 174void Ntp::ntpFinished(OProcess *p)
155{ 175{
156 //qDebug("p->exitStatus() %i",p->exitStatus()); 176 qDebug("p->exitStatus() %i",p->exitStatus());
157 if (p->exitStatus()!=0 || !p->normalExit()) 177 if (p->exitStatus()!=0 || !p->normalExit())
158 { 178 {
159 slotProbeNtpServer(); 179 QMessageBox::critical(this, tr("ntp error"),
180 tr("Error while getting time form\n server")+
181 getNtpServer()+"\n"+
182 _ntpOutput );
183 // TabWidgetMain->setCurrentPage( 1 );
184 TabWidgetMain->showPage( tabManualSetTime );
185
160 return; 186 return;
161 } 187 }
162 188
163 Global::writeHWClock(); 189 Global::writeHWClock();
164 // since time has changed quickly load in the datebookdb 190 // since time has changed quickly load in the datebookdb
165 // to allow the alarm server to get a better grip on itself 191 // to allow the alarm server to get a better grip on itself
166 // (example re-trigger alarms for when we travel back in time) 192 // (example re-trigger alarms for when we travel back in time)
167 DateBookDB db; 193 DateBookDB db;
168 194
169 // QCopEnvelope timeApplet( "QPE/TaskBar", "reloadApplets()" ); 195 // QCopEnvelope timeApplet( "QPE/TaskBar", "reloadApplets()" );
170 // timeApplet << ""; 196 // timeApplet << "";
171 197
172 Config cfg("ntp",Config::User); 198 Config cfg("ntp",Config::User);
173 cfg.setGroup("lookups"); 199 cfg.setGroup("lookups");
174 int lastLookup = cfg.readNumEntry("time",0); 200 int lastLookup = cfg.readNumEntry("time",0);
175 int lookupCount = cfg.readNumEntry("count",0); 201 int lookupCount = cfg.readNumEntry("count",0);
176 bool lastNtp = cfg.readBoolEntry("lastNtp",false); 202 bool lastNtp = cfg.readBoolEntry("lastNtp",false);
177 int time = TimeConversion::toUTC( QDateTime::currentDateTime() ); 203 int time = TimeConversion::toUTC( QDateTime::currentDateTime() );
178 cfg.writeEntry("time", time); 204 cfg.writeEntry("time", time);
179 205
180 float timeShift = getTimeShift(); 206 float timeShift = getTimeShift();
181 if (timeShift == 0.0) return; 207 if (timeShift == 0.0) return;
182 int secsSinceLast = time - lastLookup; 208 int secsSinceLast = time - lastLookup;
183 TextLabelNewTime->setText(QDateTime::currentDateTime().toString()); 209 TextLabelNewTime->setText(QDateTime::currentDateTime().toString());
@@ -286,85 +312,87 @@ void Ntp::slotCheckNtp(int i)
286 disconnect(ntpTimer, SIGNAL( timeout() ), this, SLOT(slotRunNtp()) ); 312 disconnect(ntpTimer, SIGNAL( timeout() ), this, SLOT(slotRunNtp()) );
287 connect(ntpTimer, SIGNAL( timeout() ), SLOT(slotProbeNtpServer()) ); 313 connect(ntpTimer, SIGNAL( timeout() ), SLOT(slotProbeNtpServer()) );
288 } 314 }
289 }else{ 315 }else{
290 preditctTime(); 316 preditctTime();
291 ButtonSetTime->setText( tr("Set predicted time: ")+predictedTime.toString() ); 317 ButtonSetTime->setText( tr("Set predicted time: ")+predictedTime.toString() );
292 if (i>0)ntpOutPut(tr("Could not connect to server ")+getNtpServer()); 318 if (i>0)ntpOutPut(tr("Could not connect to server ")+getNtpServer());
293 connect( ButtonSetTime, SIGNAL(clicked()), SLOT(setPredictTime()) ); 319 connect( ButtonSetTime, SIGNAL(clicked()), SLOT(setPredictTime()) );
294 connect( ntpTimer, SIGNAL( timeout() ), SLOT(slotProbeNtpServer()) ); 320 connect( ntpTimer, SIGNAL( timeout() ), SLOT(slotProbeNtpServer()) );
295 } 321 }
296} 322}
297 323
298void Ntp::slotProbeNtpServer() 324void Ntp::slotProbeNtpServer()
299{ 325{
300 ntpSock->connectToHost( getNtpServer() ,123); 326 ntpSock->connectToHost( getNtpServer() ,123);
301} 327}
302 328
303void Ntp::slotNtpDelayChanged(int delay) 329void Ntp::slotNtpDelayChanged(int delay)
304{ 330{
305 ntpTimer->changeInterval( delay*1000*60 ); 331 ntpTimer->changeInterval( delay*1000*60 );
306} 332}
307 333
308void Ntp::ntpOutPut(QString out) 334void Ntp::ntpOutPut(QString out)
309{ 335{
336
310 MultiLineEditntpOutPut->append(out); 337 MultiLineEditntpOutPut->append(out);
311 MultiLineEditntpOutPut->setCursorPosition(MultiLineEditntpOutPut->numLines() + 1,0,FALSE); 338 MultiLineEditntpOutPut->setCursorPosition(MultiLineEditntpOutPut->numLines() + 1,0,FALSE);
312} 339}
313 340
314 341
315void Ntp::makeChannel() 342void Ntp::makeChannel()
316 { 343 {
317 channel = new QCopChannel( "QPE/Application/netsystemtime", this ); 344 channel = new QCopChannel( "QPE/Application/netsystemtime", this );
318 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), 345 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
319 this, SLOT(receive(const QCString&, const QByteArray&)) ); 346 this, SLOT(receive(const QCString&, const QByteArray&)) );
320} 347}
321 348
322 349
323 350
324void Ntp::receive(const QCString &msg, const QByteArray &arg) 351void Ntp::receive(const QCString &msg, const QByteArray &arg)
325{ 352{
326 qDebug("QCop(Ntp) "+msg+" "+QCString(arg)); 353 qDebug("QCop(Ntp) "+msg+" "+QCString(arg));
327 if ( msg == "ntpLookup(QString)" ) 354 if ( msg == "ntpLookup(QString)" )
328 { 355 {
329 slotRunNtp(); 356 slotRunNtp();
330 } 357 }
331 if ( msg == "setPredictedTime(QString)" ) 358 if ( msg == "setPredictedTime(QString)" )
332 { 359 {
333 setPredictTime(); 360 setPredictTime();
334 }else{ 361 }else{
335 qDebug("Ntp::receive: Huh what do ya want"); 362 qDebug("Ntp::receive: Huh what do ya want");
336 } 363 }
337} 364}
338 365
339void Ntp::setDocument(const QString &fileName) 366void Ntp::setDocument(const QString &fileName)
340{ 367{
341 368 qDebug("Ntp::setDocument( %s )",fileName.latin1());
342} 369}
343 370
344void Ntp::showAdvancedFeatures(bool advMode) 371void Ntp::showAdvancedFeatures(bool advMode)
345{ 372{
346 if (advMode) { 373 if (advMode) {
374
347 TabWidgetMain->addTab( tabPredict, tr( "Predict" ) ); 375 TabWidgetMain->addTab( tabPredict, tr( "Predict" ) );
348 TabWidgetMain->addTab( tabNtp, tr( "NTP" ) ); 376 TabWidgetMain->addTab( tabNtp, tr( "NTP" ) );
349 TextLabel1_2_2->show(); 377 TextLabel1_2_2->show();
350 TextLabel2_3->show(); 378 TextLabel2_3->show();
351 TextLabel3_3_2->show(); 379 TextLabel3_3_2->show();
352 TextLabel1_2->show(); 380 TextLabel1_2->show();
353 SpinBoxMinLookupDelay->show(); 381 SpinBoxMinLookupDelay->show();
354 TextLabel2->show(); 382 TextLabel2->show();
355 TextLabel3_3->show(); 383 TextLabel3_3->show();
356 SpinBoxNtpDelay->show(); 384 SpinBoxNtpDelay->show();
357 Line1->show(); 385 Line1->show();
358 }else{ 386 }else{
359 TabWidgetMain->removePage( tabPredict ); 387 TabWidgetMain->removePage( tabPredict );
360 TabWidgetMain->removePage( tabNtp ); 388 TabWidgetMain->removePage( tabNtp );
361 TextLabel1_2_2->hide(); 389 TextLabel1_2_2->hide();
362 TextLabel2_3->hide(); 390 TextLabel2_3->hide();
363 TextLabel3_3_2->hide(); 391 TextLabel3_3_2->hide();
364 TextLabel1_2->hide(); 392 TextLabel1_2->hide();
365 SpinBoxMinLookupDelay->hide(); 393 SpinBoxMinLookupDelay->hide();
366 TextLabel2->hide(); 394 TextLabel2->hide();
367 TextLabel3_3->hide(); 395 TextLabel3_3->hide();
368 SpinBoxNtpDelay->hide(); 396 SpinBoxNtpDelay->hide();
369 Line1->hide(); 397 Line1->hide();
370 }; 398 };
diff --git a/noncore/settings/netsystemtime/ntp.h b/noncore/settings/netsystemtime/ntp.h
index fe0bae6..f6694c9 100644
--- a/noncore/settings/netsystemtime/ntp.h
+++ b/noncore/settings/netsystemtime/ntp.h
diff --git a/noncore/settings/netsystemtime/ntpbase.cpp b/noncore/settings/netsystemtime/ntpbase.cpp
index 8d44f17..0a7a57e 100644
--- a/noncore/settings/netsystemtime/ntpbase.cpp
+++ b/noncore/settings/netsystemtime/ntpbase.cpp
@@ -1,136 +1,134 @@
1/**************************************************************************** 1/****************************************************************************
2** Form implementation generated from reading ui file 'ntpbase.ui' 2** Form implementation generated from reading ui file 'ntpbase.ui'
3** 3**
4** Created: Mon Oct 21 21:32:47 2002 4** Created: Sun Nov 10 17:59:14 2002
5** by: The User Interface Compiler (uic) 5** by: The User Interface Compiler (uic)
6** 6**
7** WARNING! All changes made in this file will be lost! 7** WARNING! All changes made in this file will be lost!
8****************************************************************************/ 8****************************************************************************/
9#include "ntpbase.h" 9#include "ntpbase.h"
10 10
11#include <qcheckbox.h> 11#include <qcheckbox.h>
12#include <qcombobox.h> 12#include <qcombobox.h>
13#include <qframe.h> 13#include <qframe.h>
14#include <qlabel.h> 14#include <qlabel.h>
15#include <qmultilineedit.h> 15#include <qmultilineedit.h>
16#include <qpushbutton.h> 16#include <qpushbutton.h>
17#include <qspinbox.h> 17#include <qspinbox.h>
18#include <qtable.h> 18#include <qtable.h>
19#include <qtabwidget.h> 19#include <qtabwidget.h>
20#include <qlayout.h> 20#include <qlayout.h>
21#include <qvariant.h> 21#include <qvariant.h>
22#include <qtooltip.h> 22#include <qtooltip.h>
23#include <qwhatsthis.h> 23#include <qwhatsthis.h>
24 24
25/* 25/*
26 * Constructs a NtpBase which is a child of 'parent', with the 26 * Constructs a NtpBase which is a child of 'parent', with the
27 * name 'name' and widget flags set to 'f' 27 * name 'name' and widget flags set to 'f'
28 */ 28 */
29NtpBase::NtpBase( QWidget* parent, const char* name, WFlags fl ) 29NtpBase::NtpBase( QWidget* parent, const char* name, WFlags fl )
30 : QWidget( parent, name, fl ) 30 : QWidget( parent, name, fl )
31{ 31{
32 if ( !name ) 32 if ( !name )
33 setName( "NtpBase" ); 33 setName( "NtpBase" );
34 resize( 320, 411 ); 34 resize( 317, 411 );
35 setCaption( tr( "Network Time" ) ); 35 setCaption( tr( "Network Time" ) );
36 NtpBaseLayout = new QGridLayout( this ); 36 NtpBaseLayout = new QGridLayout( this );
37 NtpBaseLayout->setSpacing( 2 ); 37 NtpBaseLayout->setSpacing( 2 );
38 NtpBaseLayout->setMargin( 2 ); 38 NtpBaseLayout->setMargin( 2 );
39 39
40 TabWidgetMain = new QTabWidget( this, "TabWidgetMain" ); 40 TabWidgetMain = new QTabWidget( this, "TabWidgetMain" );
41 41
42 tabMain = new QWidget( TabWidgetMain, "tabMain" ); 42 tabMain = new QWidget( TabWidgetMain, "tabMain" );
43 tabMainLayout = new QGridLayout( tabMain ); 43 tabMainLayout = new QGridLayout( tabMain );
44 tabMainLayout->setSpacing( 2 ); 44 tabMainLayout->setSpacing( 2 );
45 tabMainLayout->setMargin( 2 ); 45 tabMainLayout->setMargin( 2 );
46 46
47 FrameSystemTime = new QWidget( tabMain, "FrameSystemTime" ); 47 FrameSystemTime = new QFrame( tabMain, "FrameSystemTime" );
48 // FrameSystemTime->setFrameShape( QFrame::StyledPanel );
49 //FrameSystemTime->setFrameShadow( QFrame::Raised );
50 48
51 tabMainLayout->addWidget( FrameSystemTime, 0, 0 ); 49 tabMainLayout->addWidget( FrameSystemTime, 0, 0 );
50 TabWidgetMain->insertTab( tabMain, tr( "Main" ) );
52 51
53 tabNtp = new QWidget( TabWidgetMain, "tabNtp" ); 52 tabNtp = new QWidget( TabWidgetMain, "tabNtp" );
54 tabNtpLayout = new QGridLayout( tabNtp ); 53 tabNtpLayout = new QGridLayout( tabNtp );
55 tabNtpLayout->setSpacing( 2 ); 54 tabNtpLayout->setSpacing( 2 );
56 tabNtpLayout->setMargin( 1 ); 55 tabNtpLayout->setMargin( 1 );
57 56
58 runNtp = new QPushButton( tabNtp, "runNtp" ); 57 runNtp = new QPushButton( tabNtp, "runNtp" );
59 runNtp->setText( tr( "Get time from network" ) ); 58 runNtp->setText( tr( "Get time from network" ) );
60 59
61 tabNtpLayout->addWidget( runNtp, 1, 0 ); 60 tabNtpLayout->addWidget( runNtp, 1, 0 );
62 61
63 FrameNtp = new QWidget( tabNtp, "FrameNtp" ); 62 FrameNtp = new QWidget( tabNtp, "FrameNtp" );
64 // FrameNtp->setFrameShape( QFrame::StyledPanel );
65 // FrameNtp->setFrameShadow( QFrame::Raised );
66 FrameNtpLayout = new QGridLayout( FrameNtp ); 63 FrameNtpLayout = new QGridLayout( FrameNtp );
67 FrameNtpLayout->setSpacing( 2 ); 64 FrameNtpLayout->setSpacing( 2 );
68 FrameNtpLayout->setMargin( 2 ); 65 FrameNtpLayout->setMargin( 2 );
69 66
70 Layout4 = new QVBoxLayout; 67 Layout4 = new QVBoxLayout;
71 Layout4->setSpacing( 6 ); 68 Layout4->setSpacing( 6 );
72 Layout4->setMargin( 0 ); 69 Layout4->setMargin( 0 );
73 70
74 TextLabel1 = new QLabel( FrameNtp, "TextLabel1" ); 71 TextLabel1 = new QLabel( FrameNtp, "TextLabel1" );
75 TextLabel1->setAutoMask( FALSE ); 72 TextLabel1->setAutoMask( FALSE );
76 TextLabel1->setText( tr( "Start Time:" ) ); 73 TextLabel1->setText( tr( "Start Time:" ) );
77 Layout4->addWidget( TextLabel1 ); 74 Layout4->addWidget( TextLabel1 );
78 75
79 TextLabelStartTime = new QLabel( FrameNtp, "TextLabelStartTime" ); 76 TextLabelStartTime = new QLabel( FrameNtp, "TextLabelStartTime" );
80 TextLabelStartTime->setText( tr( "nan" ) ); 77 TextLabelStartTime->setText( tr( "nan" ) );
81 Layout4->addWidget( TextLabelStartTime ); 78 Layout4->addWidget( TextLabelStartTime );
82 79
83 TextLabel3 = new QLabel( FrameNtp, "TextLabel3" ); 80 TextLabel3 = new QLabel( FrameNtp, "TextLabel3" );
84 TextLabel3->setText( tr( "Time Shift:" ) ); 81 TextLabel3->setText( tr( "Time Shift:" ) );
85 Layout4->addWidget( TextLabel3 ); 82 Layout4->addWidget( TextLabel3 );
86 83
87 TextLabelTimeShift = new QLabel( FrameNtp, "TextLabelTimeShift" ); 84 TextLabelTimeShift = new QLabel( FrameNtp, "TextLabelTimeShift" );
88 TextLabelTimeShift->setText( tr( "nan" ) ); 85 TextLabelTimeShift->setText( tr( "nan" ) );
89 Layout4->addWidget( TextLabelTimeShift ); 86 Layout4->addWidget( TextLabelTimeShift );
90 87
91 TextLabel5 = new QLabel( FrameNtp, "TextLabel5" ); 88 TextLabel5 = new QLabel( FrameNtp, "TextLabel5" );
92 TextLabel5->setText( tr( "New Time:" ) ); 89 TextLabel5->setText( tr( "New Time:" ) );
93 Layout4->addWidget( TextLabel5 ); 90 Layout4->addWidget( TextLabel5 );
94 91
95 TextLabelNewTime = new QLabel( FrameNtp, "TextLabelNewTime" ); 92 TextLabelNewTime = new QLabel( FrameNtp, "TextLabelNewTime" );
96 TextLabelNewTime->setText( tr( "nan" ) ); 93 TextLabelNewTime->setText( tr( "nan" ) );
97 Layout4->addWidget( TextLabelNewTime ); 94 Layout4->addWidget( TextLabelNewTime );
98 QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); 95 QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
99 Layout4->addItem( spacer ); 96 Layout4->addItem( spacer );
100 97
101 FrameNtpLayout->addLayout( Layout4, 0, 0 ); 98 FrameNtpLayout->addLayout( Layout4, 0, 0 );
102 99
103 MultiLineEditntpOutPut = new QMultiLineEdit( FrameNtp, "MultiLineEditntpOutPut" ); 100 MultiLineEditntpOutPut = new QMultiLineEdit( FrameNtp, "MultiLineEditntpOutPut" );
104 QFont MultiLineEditntpOutPut_font( MultiLineEditntpOutPut->font() ); 101 QFont MultiLineEditntpOutPut_font( MultiLineEditntpOutPut->font() );
105 MultiLineEditntpOutPut_font.setPointSize( 7 ); 102 MultiLineEditntpOutPut_font.setPointSize( 7 );
106 MultiLineEditntpOutPut->setFont( MultiLineEditntpOutPut_font ); 103 MultiLineEditntpOutPut->setFont( MultiLineEditntpOutPut_font );
107 MultiLineEditntpOutPut->setWordWrap( QMultiLineEdit::WidgetWidth ); 104 MultiLineEditntpOutPut->setWordWrap( QMultiLineEdit::WidgetWidth );
108 MultiLineEditntpOutPut->setText( tr( "" ) ); 105 MultiLineEditntpOutPut->setText( tr( "" ) );
109 106
110 FrameNtpLayout->addWidget( MultiLineEditntpOutPut, 1, 0 ); 107 FrameNtpLayout->addWidget( MultiLineEditntpOutPut, 1, 0 );
111 108
112 tabNtpLayout->addWidget( FrameNtp, 0, 0 ); 109 tabNtpLayout->addWidget( FrameNtp, 0, 0 );
110 TabWidgetMain->insertTab( tabNtp, tr( "NTP" ) );
113 111
114 tabPredict = new QWidget( TabWidgetMain, "tabPredict" ); 112 tabPredict = new QWidget( TabWidgetMain, "tabPredict" );
115 tabPredictLayout = new QGridLayout( tabPredict ); 113 tabPredictLayout = new QGridLayout( tabPredict );
116 tabPredictLayout->setSpacing( 6 ); 114 tabPredictLayout->setSpacing( 6 );
117 tabPredictLayout->setMargin( 5 ); 115 tabPredictLayout->setMargin( 5 );
118 116
119 TableLookups = new QTable( tabPredict, "TableLookups" ); 117 TableLookups = new QTable( tabPredict, "TableLookups" );
120 QFont TableLookups_font( TableLookups->font() ); 118 QFont TableLookups_font( TableLookups->font() );
121 TableLookups_font.setPointSize( 8 ); 119 TableLookups_font.setPointSize( 8 );
122 TableLookups->setFont( TableLookups_font ); 120 TableLookups->setFont( TableLookups_font );
123 TableLookups->setNumRows( 2 ); 121 TableLookups->setNumRows( 2 );
124 TableLookups->setNumCols( 2 ); 122 TableLookups->setNumCols( 2 );
125 123
126 tabPredictLayout->addWidget( TableLookups, 0, 0 ); 124 tabPredictLayout->addWidget( TableLookups, 0, 0 );
127 125
128 Layout9 = new QGridLayout; 126 Layout9 = new QGridLayout;
129 Layout9->setSpacing( 6 ); 127 Layout9->setSpacing( 6 );
130 Layout9->setMargin( 0 ); 128 Layout9->setMargin( 0 );
131 129
132 TextLabelShift = new QLabel( tabPredict, "TextLabelShift" ); 130 TextLabelShift = new QLabel( tabPredict, "TextLabelShift" );
133 TextLabelShift->setText( tr( "nan" ) ); 131 TextLabelShift->setText( tr( "nan" ) );
134 132
135 Layout9->addWidget( TextLabelShift, 0, 1 ); 133 Layout9->addWidget( TextLabelShift, 0, 1 );
136 134
@@ -153,91 +151,90 @@ NtpBase::NtpBase( QWidget* parent, const char* name, WFlags fl )
153 Mean_shift_label->setText( tr( "Mean shift:" ) ); 151 Mean_shift_label->setText( tr( "Mean shift:" ) );
154 152
155 Layout9->addWidget( Mean_shift_label, 0, 0 ); 153 Layout9->addWidget( Mean_shift_label, 0, 0 );
156 154
157 TextLabelPredTime = new QLabel( tabPredict, "TextLabelPredTime" ); 155 TextLabelPredTime = new QLabel( tabPredict, "TextLabelPredTime" );
158 TextLabelPredTime->setText( tr( "nan" ) ); 156 TextLabelPredTime->setText( tr( "nan" ) );
159 157
160 Layout9->addWidget( TextLabelPredTime, 2, 1 ); 158 Layout9->addWidget( TextLabelPredTime, 2, 1 );
161 159
162 tabPredictLayout->addLayout( Layout9, 1, 0 ); 160 tabPredictLayout->addLayout( Layout9, 1, 0 );
163 161
164 Layout11 = new QHBoxLayout; 162 Layout11 = new QHBoxLayout;
165 Layout11->setSpacing( 6 ); 163 Layout11->setSpacing( 6 );
166 Layout11->setMargin( 0 ); 164 Layout11->setMargin( 0 );
167 165
168 PushButtonSetPredTime = new QPushButton( tabPredict, "PushButtonSetPredTime" ); 166 PushButtonSetPredTime = new QPushButton( tabPredict, "PushButtonSetPredTime" );
169 PushButtonSetPredTime->setText( tr( "Set predicted time" ) ); 167 PushButtonSetPredTime->setText( tr( "Set predicted time" ) );
170 Layout11->addWidget( PushButtonSetPredTime ); 168 Layout11->addWidget( PushButtonSetPredTime );
171 169
172 PushButtonPredict = new QPushButton( tabPredict, "PushButtonPredict" ); 170 PushButtonPredict = new QPushButton( tabPredict, "PushButtonPredict" );
173 PushButtonPredict->setText( tr( "Predict time" ) ); 171 PushButtonPredict->setText( tr( "Predict time" ) );
174 Layout11->addWidget( PushButtonPredict ); 172 Layout11->addWidget( PushButtonPredict );
175 173
176 tabPredictLayout->addLayout( Layout11, 2, 0 ); 174 tabPredictLayout->addLayout( Layout11, 2, 0 );
175 TabWidgetMain->insertTab( tabPredict, tr( "Predict" ) );
177 176
178 TabSettings = new QWidget( TabWidgetMain, "TabSettings" ); 177 TabSettings = new QWidget( TabWidgetMain, "TabSettings" );
179 TabSettingsLayout = new QGridLayout( TabSettings ); 178 TabSettingsLayout = new QGridLayout( TabSettings );
180 TabSettingsLayout->setSpacing( 2 ); 179 TabSettingsLayout->setSpacing( 2 );
181 TabSettingsLayout->setMargin( 2 ); 180 TabSettingsLayout->setMargin( 2 );
182 181
183 FrameSettings = new QWidget( TabSettings, "FrameSettings" ); 182 FrameSettings = new QWidget( TabSettings, "FrameSettings" );
184 // FrameSettings->setFrameShape( QFrame::StyledPanel );
185 // FrameSettings->setFrameShadow( QFrame::Raised );
186 FrameSettingsLayout = new QVBoxLayout( FrameSettings ); 183 FrameSettingsLayout = new QVBoxLayout( FrameSettings );
187 FrameSettingsLayout->setSpacing( 6 ); 184 FrameSettingsLayout->setSpacing( 6 );
188 FrameSettingsLayout->setMargin( 11 ); 185 FrameSettingsLayout->setMargin( 11 );
189 186
190 Layout6 = new QGridLayout; 187 Layout6 = new QGridLayout;
191 Layout6->setSpacing( 6 ); 188 Layout6->setSpacing( 6 );
192 Layout6->setMargin( 0 ); 189 Layout6->setMargin( 0 );
193 190
194 TextLabel7_2 = new QLabel( FrameSettings, "TextLabel7_2" ); 191 TextLabel7_2 = new QLabel( FrameSettings, "TextLabel7_2" );
195 TextLabel7_2->setText( tr( "Use" ) ); 192 TextLabel7_2->setText( tr( "Use" ) );
196 193
197 Layout6->addWidget( TextLabel7_2, 0, 0 ); 194 Layout6->addWidget( TextLabel7_2, 0, 0 );
198 195
199 TextLabel2_2 = new QLabel( FrameSettings, "TextLabel2_2" ); 196 TextLabel2_2 = new QLabel( FrameSettings, "TextLabel2_2" );
200 TextLabel2_2->setText( tr( "as" ) ); 197 TextLabel2_2->setText( tr( "as" ) );
201 198
202 Layout6->addWidget( TextLabel2_2, 0, 2 ); 199 Layout6->addWidget( TextLabel2_2, 0, 2 );
203 200
204 TextLabel1_3 = new QLabel( FrameSettings, "TextLabel1_3" ); 201 TextLabel1_3 = new QLabel( FrameSettings, "TextLabel1_3" );
205 TextLabel1_3->setText( tr( "NTP server to get the time from the network." ) ); 202 TextLabel1_3->setText( tr( "NTP server to get the time from the network." ) );
206 TextLabel1_3->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter | QLabel::AlignLeft ) ); 203 TextLabel1_3->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter | QLabel::AlignLeft ) );
207 204
208 Layout6->addMultiCellWidget( TextLabel1_3, 1, 1, 0, 1 ); 205 Layout6->addMultiCellWidget( TextLabel1_3, 1, 1, 0, 1 );
209 206
210 ComboNtpSrv = new QComboBox( FALSE, FrameSettings, "ComboNtpSrv" ); 207 ComboNtpSrv = new QComboBox( FALSE, FrameSettings, "ComboNtpSrv" );
211 ComboNtpSrv->setEditable( TRUE ); 208 ComboNtpSrv->setEditable( TRUE );
212 209
213 Layout6->addWidget( ComboNtpSrv, 0, 1 ); 210 Layout6->addWidget( ComboNtpSrv, 0, 1 );
214 FrameSettingsLayout->addLayout( Layout6 ); 211 FrameSettingsLayout->addLayout( Layout6 );
215 QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Minimum ); 212 QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Minimum );
216 FrameSettingsLayout->addItem( spacer_2 ); 213 FrameSettingsLayout->addItem( spacer_2 );
217 214
218 CheckBoxAdvSettings = new QCheckBox( FrameSettings, "CheckBoxAdvSettings" ); 215 CheckBoxAdvSettings = new QCheckBox( FrameSettings, "CheckBoxAdvSettings" );
219 CheckBoxAdvSettings->setText( tr( "Advanced features" ) ); 216 CheckBoxAdvSettings->setText( tr( "Advanced settings" ) );
220 FrameSettingsLayout->addWidget( CheckBoxAdvSettings ); 217 FrameSettingsLayout->addWidget( CheckBoxAdvSettings );
221 QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); 218 QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
222 FrameSettingsLayout->addItem( spacer_3 ); 219 FrameSettingsLayout->addItem( spacer_3 );
223 220
224 Line1 = new QFrame( FrameSettings, "Line1" ); 221 Line1 = new QFrame( FrameSettings, "Line1" );
225 Line1->setFrameStyle( QFrame::HLine | QFrame::Sunken ); 222 Line1->setFrameStyle( QFrame::HLine | QFrame::Sunken );
226 FrameSettingsLayout->addWidget( Line1 ); 223 FrameSettingsLayout->addWidget( Line1 );
227 224
228 Layout7_2 = new QGridLayout; 225 Layout7_2 = new QGridLayout;
229 Layout7_2->setSpacing( 6 ); 226 Layout7_2->setSpacing( 6 );
230 Layout7_2->setMargin( 0 ); 227 Layout7_2->setMargin( 0 );
231 228
232 TextLabel1_2_2 = new QLabel( FrameSettings, "TextLabel1_2_2" ); 229 TextLabel1_2_2 = new QLabel( FrameSettings, "TextLabel1_2_2" );
233 TextLabel1_2_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, TextLabel1_2_2->sizePolicy().hasHeightForWidth() ) ); 230 TextLabel1_2_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, TextLabel1_2_2->sizePolicy().hasHeightForWidth() ) );
234 TextLabel1_2_2->setText( tr( "Wait for " ) ); 231 TextLabel1_2_2->setText( tr( "Wait for " ) );
235 232
236 Layout7_2->addWidget( TextLabel1_2_2, 0, 0 ); 233 Layout7_2->addWidget( TextLabel1_2_2, 0, 0 );
237 234
238 TextLabel2_3 = new QLabel( FrameSettings, "TextLabel2_3" ); 235 TextLabel2_3 = new QLabel( FrameSettings, "TextLabel2_3" );
239 TextLabel2_3->setText( tr( "minutes until" ) ); 236 TextLabel2_3->setText( tr( "minutes until" ) );
240 237
241 Layout7_2->addWidget( TextLabel2_3, 0, 2 ); 238 Layout7_2->addWidget( TextLabel2_3, 0, 2 );
242 239
243 TextLabel3_3_2 = new QLabel( FrameSettings, "TextLabel3_3_2" ); 240 TextLabel3_3_2 = new QLabel( FrameSettings, "TextLabel3_3_2" );
@@ -264,69 +261,65 @@ NtpBase::NtpBase( QWidget* parent, const char* name, WFlags fl )
264 261
265 Layout7->addWidget( TextLabel1_2, 0, 0 ); 262 Layout7->addWidget( TextLabel1_2, 0, 0 );
266 263
267 TextLabel2 = new QLabel( FrameSettings, "TextLabel2" ); 264 TextLabel2 = new QLabel( FrameSettings, "TextLabel2" );
268 TextLabel2->setText( tr( "minutes until" ) ); 265 TextLabel2->setText( tr( "minutes until" ) );
269 266
270 Layout7->addWidget( TextLabel2, 0, 2 ); 267 Layout7->addWidget( TextLabel2, 0, 2 );
271 268
272 TextLabel3_3 = new QLabel( FrameSettings, "TextLabel3_3" ); 269 TextLabel3_3 = new QLabel( FrameSettings, "TextLabel3_3" );
273 TextLabel3_3->setText( tr( "a new NTP lookup will be used to predict the time." ) ); 270 TextLabel3_3->setText( tr( "a new NTP lookup will be used to predict the time." ) );
274 TextLabel3_3->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter | QLabel::AlignLeft ) ); 271 TextLabel3_3->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter | QLabel::AlignLeft ) );
275 272
276 Layout7->addMultiCellWidget( TextLabel3_3, 1, 1, 0, 2 ); 273 Layout7->addMultiCellWidget( TextLabel3_3, 1, 1, 0, 2 );
277 274
278 SpinBoxMinLookupDelay = new QSpinBox( FrameSettings, "SpinBoxMinLookupDelay" ); 275 SpinBoxMinLookupDelay = new QSpinBox( FrameSettings, "SpinBoxMinLookupDelay" );
279 SpinBoxMinLookupDelay->setWrapping( TRUE ); 276 SpinBoxMinLookupDelay->setWrapping( TRUE );
280 SpinBoxMinLookupDelay->setMaxValue( 9999999 ); 277 SpinBoxMinLookupDelay->setMaxValue( 9999999 );
281 SpinBoxMinLookupDelay->setMinValue( 42 ); 278 SpinBoxMinLookupDelay->setMinValue( 42 );
282 SpinBoxMinLookupDelay->setValue( 720 ); 279 SpinBoxMinLookupDelay->setValue( 720 );
283 280
284 Layout7->addWidget( SpinBoxMinLookupDelay, 0, 1 ); 281 Layout7->addWidget( SpinBoxMinLookupDelay, 0, 1 );
285 FrameSettingsLayout->addLayout( Layout7 ); 282 FrameSettingsLayout->addLayout( Layout7 );
286 283
287 TabSettingsLayout->addWidget( FrameSettings, 0, 0 ); 284 TabSettingsLayout->addWidget( FrameSettings, 0, 0 );
285 TabWidgetMain->insertTab( TabSettings, tr( "Settings" ) );
288 286
289 tabManualSetTime = new QWidget( TabWidgetMain, "tabManualSetTime" ); 287 tabManualSetTime = new QWidget( TabWidgetMain, "tabManualSetTime" );
290 tabManualSetTimeLayout = new QVBoxLayout( tabManualSetTime ); 288 tabManualSetTimeLayout = new QVBoxLayout( tabManualSetTime );
291 tabManualSetTimeLayout->setSpacing( 2 ); 289 tabManualSetTimeLayout->setSpacing( 6 );
292 tabManualSetTimeLayout->setMargin( 2 ); 290 tabManualSetTimeLayout->setMargin( 11 );
293 291
294 FrameSetTime = new QWidget( tabManualSetTime, "FrameSetTime" ); 292 FrameSetTime = new QWidget( tabManualSetTime, "FrameSetTime" );
295 // FrameSetTime->setFrameShape( QFrame::StyledPanel ); 293 FrameSetTime->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)3, FrameSetTime->sizePolicy().hasHeightForWidth() ) );
296 // FrameSetTime->setFrameShadow( QFrame::Raised );
297 tabManualSetTimeLayout->addWidget( FrameSetTime ); 294 tabManualSetTimeLayout->addWidget( FrameSetTime );
298 295
299 PushButtonSetManualTime = new QPushButton( tabManualSetTime, "PushButtonSetManualTime" ); 296 PushButtonSetManualTime = new QPushButton( tabManualSetTime, "PushButtonSetManualTime" );
300 PushButtonSetManualTime->setText( tr( "Set time" ) ); 297 PushButtonSetManualTime->setText( tr( "Set time" ) );
301 tabManualSetTimeLayout->addWidget( PushButtonSetManualTime ); 298 tabManualSetTimeLayout->addWidget( PushButtonSetManualTime );
302 299 QSpacerItem* spacer_4 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
303 300 tabManualSetTimeLayout->addItem( spacer_4 );
304 TabWidgetMain->insertTab( tabMain, tr( "Main" ) );
305 TabWidgetMain->insertTab( tabManualSetTime, tr( "Manual" ) ); 301 TabWidgetMain->insertTab( tabManualSetTime, tr( "Manual" ) );
306 TabWidgetMain->insertTab( TabSettings, tr( "Settings" ) );
307 TabWidgetMain->insertTab( tabPredict, tr( "Predict" ) );
308 TabWidgetMain->insertTab( tabNtp, tr( "NTP" ) );
309 302
310 NtpBaseLayout->addWidget( TabWidgetMain, 0, 0 ); 303 NtpBaseLayout->addWidget( TabWidgetMain, 0, 0 );
311} 304}
312 305
313/* 306/*
314 * Destroys the object and frees any allocated resources 307 * Destroys the object and frees any allocated resources
315 */ 308 */
316NtpBase::~NtpBase() 309NtpBase::~NtpBase()
317{ 310{
318 // no need to delete child widgets, Qt does it all for us 311 // no need to delete child widgets, Qt does it all for us
319} 312}
320 313
321/* 314/*
322 * Main event handler. Reimplemented to handle application 315 * Main event handler. Reimplemented to handle application
323 * font changes 316 * font changes
324 */ 317 */
325bool NtpBase::event( QEvent* ev ) 318bool NtpBase::event( QEvent* ev )
326{ 319{
327 bool ret = QWidget::event( ev ); 320 bool ret = QWidget::event( ev );
328 if ( ev->type() == QEvent::ApplicationFontChange ) { 321 if ( ev->type() == QEvent::ApplicationFontChange ) {
329 QFont MultiLineEditntpOutPut_font( MultiLineEditntpOutPut->font() ); 322 QFont MultiLineEditntpOutPut_font( MultiLineEditntpOutPut->font() );
330 MultiLineEditntpOutPut_font.setPointSize( 7 ); 323 MultiLineEditntpOutPut_font.setPointSize( 7 );
331 MultiLineEditntpOutPut->setFont( MultiLineEditntpOutPut_font ); 324 MultiLineEditntpOutPut->setFont( MultiLineEditntpOutPut_font );
332 QFont TableLookups_font( TableLookups->font() ); 325 QFont TableLookups_font( TableLookups->font() );
diff --git a/noncore/settings/netsystemtime/ntpbase.h b/noncore/settings/netsystemtime/ntpbase.h
index a443495..543cac1 100644
--- a/noncore/settings/netsystemtime/ntpbase.h
+++ b/noncore/settings/netsystemtime/ntpbase.h
@@ -1,61 +1,61 @@
1/**************************************************************************** 1/****************************************************************************
2** Form interface generated from reading ui file 'ntpbase.ui' 2** Form interface generated from reading ui file 'ntpbase.ui'
3** 3**
4** Created: Mon Oct 21 21:32:43 2002 4** Created: Sun Nov 10 17:58:48 2002
5** by: The User Interface Compiler (uic) 5** by: The User Interface Compiler (uic)
6** 6**
7** WARNING! All changes made in this file will be lost! 7** WARNING! All changes made in this file will be lost!
8****************************************************************************/ 8****************************************************************************/
9#ifndef NTPBASE_H 9#ifndef NTPBASE_H
10#define NTPBASE_H 10#define NTPBASE_H
11 11
12#include <qvariant.h> 12#include <qvariant.h>
13#include <qwidget.h> 13#include <qwidget.h>
14class QVBoxLayout; 14class QVBoxLayout;
15class QHBoxLayout; 15class QHBoxLayout;
16class QGridLayout; 16class QGridLayout;
17class QCheckBox; 17class QCheckBox;
18class QComboBox; 18class QComboBox;
19class QFrame; 19class QFrame;
20class QLabel; 20class QLabel;
21class QMultiLineEdit; 21class QMultiLineEdit;
22class QPushButton; 22class QPushButton;
23class QSpinBox; 23class QSpinBox;
24class QTabWidget; 24class QTabWidget;
25class QTable; 25class QTable;
26 26
27class NtpBase : public QWidget 27class NtpBase : public QWidget
28{ 28{
29 Q_OBJECT 29 Q_OBJECT
30 30
31public: 31public:
32 NtpBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 32 NtpBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
33 ~NtpBase(); 33 ~NtpBase();
34 34
35 QTabWidget* TabWidgetMain; 35 QTabWidget* TabWidgetMain;
36 QWidget* tabMain; 36 QWidget* tabMain;
37 QWidget* FrameSystemTime; 37 QFrame* FrameSystemTime;
38 QWidget* tabNtp; 38 QWidget* tabNtp;
39 QPushButton* runNtp; 39 QPushButton* runNtp;
40 QWidget* FrameNtp; 40 QWidget* FrameNtp;
41 QLabel* TextLabel1; 41 QLabel* TextLabel1;
42 QLabel* TextLabelStartTime; 42 QLabel* TextLabelStartTime;
43 QLabel* TextLabel3; 43 QLabel* TextLabel3;
44 QLabel* TextLabelTimeShift; 44 QLabel* TextLabelTimeShift;
45 QLabel* TextLabel5; 45 QLabel* TextLabel5;
46 QLabel* TextLabelNewTime; 46 QLabel* TextLabelNewTime;
47 QMultiLineEdit* MultiLineEditntpOutPut; 47 QMultiLineEdit* MultiLineEditntpOutPut;
48 QWidget* tabPredict; 48 QWidget* tabPredict;
49 QTable* TableLookups; 49 QTable* TableLookups;
50 QLabel* TextLabelShift; 50 QLabel* TextLabelShift;
51 QLabel* TextLabel4; 51 QLabel* TextLabel4;
52 QLabel* TextLabelEstimatedShift; 52 QLabel* TextLabelEstimatedShift;
53 QLabel* TextLabel3_2; 53 QLabel* TextLabel3_2;
54 QLabel* Mean_shift_label; 54 QLabel* Mean_shift_label;
55 QLabel* TextLabelPredTime; 55 QLabel* TextLabelPredTime;
56 QPushButton* PushButtonSetPredTime; 56 QPushButton* PushButtonSetPredTime;
57 QPushButton* PushButtonPredict; 57 QPushButton* PushButtonPredict;
58 QWidget* TabSettings; 58 QWidget* TabSettings;
59 QWidget* FrameSettings; 59 QWidget* FrameSettings;
60 QLabel* TextLabel7_2; 60 QLabel* TextLabel7_2;
61 QLabel* TextLabel2_2; 61 QLabel* TextLabel2_2;
diff --git a/noncore/settings/netsystemtime/ntpbase.ui b/noncore/settings/netsystemtime/ntpbase.ui
index 465bba0..6c38588 100644
--- a/noncore/settings/netsystemtime/ntpbase.ui
+++ b/noncore/settings/netsystemtime/ntpbase.ui
@@ -1,38 +1,38 @@
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>320</width> 14 <width>317</width>
15 <height>411</height> 15 <height>411</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>
@@ -50,103 +50,87 @@
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">
75 <name>frameShape</name>
76 <enum>StyledPanel</enum>
77 </property>
78 <property stdset="1">
79 <name>frameShadow</name>
80 <enum>Raised</enum>
81 </property>
82 </widget> 74 </widget>
83 </grid> 75 </grid>
84 </widget> 76 </widget>
85 <widget> 77 <widget>
86 <class>QWidget</class> 78 <class>QWidget</class>
87 <property stdset="1"> 79 <property stdset="1">
88 <name>name</name> 80 <name>name</name>
89 <cstring>tabNtp</cstring> 81 <cstring>tabNtp</cstring>
90 </property> 82 </property>
91 <attribute> 83 <attribute>
92 <name>title</name> 84 <name>title</name>
93 <string>NTP</string> 85 <string>NTP</string>
94 </attribute> 86 </attribute>
95 <grid> 87 <grid>
96 <property stdset="1"> 88 <property stdset="1">
97 <name>margin</name> 89 <name>margin</name>
98 <number>1</number> 90 <number>1</number>
99 </property> 91 </property>
100 <property stdset="1"> 92 <property stdset="1">
101 <name>spacing</name> 93 <name>spacing</name>
102 <number>2</number> 94 <number>2</number>
103 </property> 95 </property>
104 <widget row="1" column="0" > 96 <widget row="1" column="0" >
105 <class>QPushButton</class> 97 <class>QPushButton</class>
106 <property stdset="1"> 98 <property stdset="1">
107 <name>name</name> 99 <name>name</name>
108 <cstring>runNtp</cstring> 100 <cstring>runNtp</cstring>
109 </property> 101 </property>
110 <property stdset="1"> 102 <property stdset="1">
111 <name>text</name> 103 <name>text</name>
112 <string>Get time from network</string> 104 <string>Get time from network</string>
113 </property> 105 </property>
114 </widget> 106 </widget>
115 <widget row="0" column="0" > 107 <widget row="0" column="0" >
116 <class>QWidget</class> 108 <class>QWidget</class>
117 <property stdset="1"> 109 <property stdset="1">
118 <name>name</name> 110 <name>name</name>
119 <cstring>FrameNtp</cstring> 111 <cstring>FrameNtp</cstring>
120 </property> 112 </property>
121 <property stdset="1">
122 <name>frameShape</name>
123 <enum>StyledPanel</enum>
124 </property>
125 <property stdset="1">
126 <name>frameShadow</name>
127 <enum>Raised</enum>
128 </property>
129 <property> 113 <property>
130 <name>layoutMargin</name> 114 <name>layoutMargin</name>
131 </property> 115 </property>
132 <property> 116 <property>
133 <name>layoutSpacing</name> 117 <name>layoutSpacing</name>
134 </property> 118 </property>
135 <grid> 119 <grid>
136 <property stdset="1"> 120 <property stdset="1">
137 <name>margin</name> 121 <name>margin</name>
138 <number>2</number> 122 <number>2</number>
139 </property> 123 </property>
140 <property stdset="1"> 124 <property stdset="1">
141 <name>spacing</name> 125 <name>spacing</name>
142 <number>2</number> 126 <number>2</number>
143 </property> 127 </property>
144 <widget row="0" column="0" > 128 <widget row="0" column="0" >
145 <class>QLayoutWidget</class> 129 <class>QLayoutWidget</class>
146 <property stdset="1"> 130 <property stdset="1">
147 <name>name</name> 131 <name>name</name>
148 <cstring>Layout4</cstring> 132 <cstring>Layout4</cstring>
149 </property> 133 </property>
150 <vbox> 134 <vbox>
151 <property stdset="1"> 135 <property stdset="1">
152 <name>margin</name> 136 <name>margin</name>
@@ -442,56 +426,48 @@
442 <class>QWidget</class> 426 <class>QWidget</class>
443 <property stdset="1"> 427 <property stdset="1">
444 <name>name</name> 428 <name>name</name>
445 <cstring>TabSettings</cstring> 429 <cstring>TabSettings</cstring>
446 </property> 430 </property>
447 <attribute> 431 <attribute>
448 <name>title</name> 432 <name>title</name>
449 <string>Settings</string> 433 <string>Settings</string>
450 </attribute> 434 </attribute>
451 <grid> 435 <grid>
452 <property stdset="1"> 436 <property stdset="1">
453 <name>margin</name> 437 <name>margin</name>
454 <number>2</number> 438 <number>2</number>
455 </property> 439 </property>
456 <property stdset="1"> 440 <property stdset="1">
457 <name>spacing</name> 441 <name>spacing</name>
458 <number>2</number> 442 <number>2</number>
459 </property> 443 </property>
460 <widget row="0" column="0" > 444 <widget row="0" column="0" >
461 <class>QWidget</class> 445 <class>QWidget</class>
462 <property stdset="1"> 446 <property stdset="1">
463 <name>name</name> 447 <name>name</name>
464 <cstring>FrameSettings</cstring> 448 <cstring>FrameSettings</cstring>
465 </property> 449 </property>
466 <property stdset="1">
467 <name>frameShape</name>
468 <enum>StyledPanel</enum>
469 </property>
470 <property stdset="1">
471 <name>frameShadow</name>
472 <enum>Raised</enum>
473 </property>
474 <property> 450 <property>
475 <name>layoutMargin</name> 451 <name>layoutMargin</name>
476 </property> 452 </property>
477 <property> 453 <property>
478 <name>layoutSpacing</name> 454 <name>layoutSpacing</name>
479 </property> 455 </property>
480 <vbox> 456 <vbox>
481 <property stdset="1"> 457 <property stdset="1">
482 <name>margin</name> 458 <name>margin</name>
483 <number>11</number> 459 <number>11</number>
484 </property> 460 </property>
485 <property stdset="1"> 461 <property stdset="1">
486 <name>spacing</name> 462 <name>spacing</name>
487 <number>6</number> 463 <number>6</number>
488 </property> 464 </property>
489 <widget> 465 <widget>
490 <class>QLayoutWidget</class> 466 <class>QLayoutWidget</class>
491 <property stdset="1"> 467 <property stdset="1">
492 <name>name</name> 468 <name>name</name>
493 <cstring>Layout6</cstring> 469 <cstring>Layout6</cstring>
494 </property> 470 </property>
495 <grid> 471 <grid>
496 <property stdset="1"> 472 <property stdset="1">
497 <name>margin</name> 473 <name>margin</name>
@@ -781,62 +757,82 @@
781 <property stdset="1"> 757 <property stdset="1">
782 <name>value</name> 758 <name>value</name>
783 <number>720</number> 759 <number>720</number>
784 </property> 760 </property>
785 </widget> 761 </widget>
786 </grid> 762 </grid>
787 </widget> 763 </widget>
788 </vbox> 764 </vbox>
789 </widget> 765 </widget>
790 </grid> 766 </grid>
791 </widget> 767 </widget>
792 <widget> 768 <widget>
793 <class>QWidget</class> 769 <class>QWidget</class>
794 <property stdset="1"> 770 <property stdset="1">
795 <name>name</name> 771 <name>name</name>
796 <cstring>tabManualSetTime</cstring> 772 <cstring>tabManualSetTime</cstring>
797 </property> 773 </property>
798 <attribute> 774 <attribute>
799 <name>title</name> 775 <name>title</name>
800 <string>Manual</string> 776 <string>Manual</string>
801 </attribute> 777 </attribute>
802 <vbox> 778 <vbox>
803 <property stdset="1"> 779 <property stdset="1">
804 <name>margin</name> 780 <name>margin</name>
805 <number>2</number> 781 <number>11</number>
806 </property> 782 </property>
807 <property stdset="1"> 783 <property stdset="1">
808 <name>spacing</name> 784 <name>spacing</name>
809 <number>2</number> 785 <number>6</number>
810 </property> 786 </property>
811 <widget> 787 <widget>
812 <class>QWidget</class> 788 <class>QWidget</class>
813 <property stdset="1"> 789 <property stdset="1">
814 <name>name</name> 790 <name>name</name>
815 <cstring>FrameSetTime</cstring> 791 <cstring>FrameSetTime</cstring>
816 </property> 792 </property>
817 <property stdset="1"> 793 <property stdset="1">
818 <name>frameShape</name> 794 <name>sizePolicy</name>
819 <enum>StyledPanel</enum> 795 <sizepolicy>
820 </property> 796 <hsizetype>5</hsizetype>
821 <property stdset="1"> 797 <vsizetype>3</vsizetype>
822 <name>frameShadow</name> 798 </sizepolicy>
823 <enum>Raised</enum>
824 </property> 799 </property>
825 </widget> 800 </widget>
826 <widget> 801 <widget>
827 <class>QPushButton</class> 802 <class>QPushButton</class>
828 <property stdset="1"> 803 <property stdset="1">
829 <name>name</name> 804 <name>name</name>
830 <cstring>PushButtonSetManualTime</cstring> 805 <cstring>PushButtonSetManualTime</cstring>
831 </property> 806 </property>
832 <property stdset="1"> 807 <property stdset="1">
833 <name>text</name> 808 <name>text</name>
834 <string>Set time</string> 809 <string>Set time</string>
835 </property> 810 </property>
836 </widget> 811 </widget>
812 <spacer>
813 <property>
814 <name>name</name>
815 <cstring>Spacer4_2</cstring>
816 </property>
817 <property stdset="1">
818 <name>orientation</name>
819 <enum>Vertical</enum>
820 </property>
821 <property stdset="1">
822 <name>sizeType</name>
823 <enum>Expanding</enum>
824 </property>
825 <property>
826 <name>sizeHint</name>
827 <size>
828 <width>20</width>
829 <height>20</height>
830 </size>
831 </property>
832 </spacer>
837 </vbox> 833 </vbox>
838 </widget> 834 </widget>
839 </widget> 835 </widget>
840 </grid> 836 </grid>
841</widget> 837</widget>
842</UI> 838</UI>