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,21 +1,21 @@
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 \
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
@@ -37,24 +37,41 @@ Ntp::Ntp( QWidget* parent, const char* name, WFlags fl )
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) ),
@@ -103,69 +120,78 @@ bool Ntp::ntpDelayElapsed()
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
@@ -298,24 +324,25 @@ void Ntp::slotCheckNtp(int i)
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
@@ -329,30 +356,31 @@ void Ntp::receive(const QCString &msg, const QByteArray &arg)
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{
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,16 +1,16 @@
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>
@@ -22,56 +22,53 @@
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 );
@@ -101,24 +98,25 @@ NtpBase::NtpBase( QWidget* parent, const char* name, WFlags fl )
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 );
@@ -165,33 +163,32 @@ NtpBase::NtpBase( QWidget* parent, const char* name, WFlags fl )
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 );
@@ -207,25 +204,25 @@ NtpBase::NtpBase( QWidget* parent, const char* name, WFlags fl )
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
@@ -276,45 +273,41 @@ NtpBase::NtpBase( QWidget* parent, const char* name, WFlags fl )
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
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,16 +1,16 @@
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;
@@ -25,25 +25,25 @@ class 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;
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
@@ -2,25 +2,25 @@
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>
@@ -62,32 +62,24 @@
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>
@@ -109,32 +101,24 @@
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">
@@ -454,32 +438,24 @@
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">
@@ -793,50 +769,70 @@
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>