summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/netsystemtime/TODO1
-rw-r--r--noncore/settings/netsystemtime/ntp.cpp11
-rw-r--r--noncore/settings/netsystemtime/ntp.h1
-rw-r--r--noncore/settings/netsystemtime/settime.cpp9
-rw-r--r--noncore/settings/netsystemtime/settime.h2
5 files changed, 16 insertions, 8 deletions
diff --git a/noncore/settings/netsystemtime/TODO b/noncore/settings/netsystemtime/TODO
index fb003a2..c6106c3 100644
--- a/noncore/settings/netsystemtime/TODO
+++ b/noncore/settings/netsystemtime/TODO
@@ -1,3 +1,2 @@
1- handle hour > 24 in SetTime::slotClockTick
2- improve tz setting 1- improve tz setting
3 atm the tz gets written to the system as soon as changed... 2 atm the tz gets written to the system as soon as changed...
diff --git a/noncore/settings/netsystemtime/ntp.cpp b/noncore/settings/netsystemtime/ntp.cpp
index 53dbe46..551cedc 100644
--- a/noncore/settings/netsystemtime/ntp.cpp
+++ b/noncore/settings/netsystemtime/ntp.cpp
@@ -370,57 +370,66 @@ void Ntp::receive(const QCString &msg, const QByteArray &arg)
370 slotRunNtp(); 370 slotRunNtp();
371 } 371 }
372 if ( msg == "setPredictedTime(QString)" ) 372 if ( msg == "setPredictedTime(QString)" )
373 { 373 {
374 setPredictTime(); 374 setPredictTime();
375 }else{ 375 }else{
376 qDebug("Ntp::receive: Huh what do ya want"); 376 qDebug("Ntp::receive: Huh what do ya want");
377 } 377 }
378} 378}
379 379
380void Ntp::setDocument(const QString &fileName) 380void Ntp::setDocument(const QString &fileName)
381{ 381{
382 qDebug("Ntp::setDocument( %s )",fileName.latin1()); 382 qDebug("Ntp::setDocument( %s )",fileName.latin1());
383} 383}
384 384
385void Ntp::showAdvancedFeatures(bool advMode) 385void Ntp::showAdvancedFeatures(bool advMode)
386{ 386{
387 if (advMode) { 387 if (advMode) {
388 388
389 TabWidgetMain->addTab( tabPredict, tr( "Predict" ) ); 389 TabWidgetMain->addTab( tabPredict, tr( "Predict" ) );
390 TabWidgetMain->addTab( tabNtp, tr( "NTP" ) ); 390 TabWidgetMain->addTab( tabNtp, tr( "NTP" ) );
391 TextLabel1_2_2->show(); 391 TextLabel1_2_2->show();
392 TextLabel2_3->show(); 392 TextLabel2_3->show();
393 TextLabel3_3_2->show(); 393 TextLabel3_3_2->show();
394 TextLabel1_2->show(); 394 TextLabel1_2->show();
395 SpinBoxMinLookupDelay->show(); 395 SpinBoxMinLookupDelay->show();
396 TextLabel2->show(); 396 TextLabel2->show();
397 TextLabel3_3->show(); 397 TextLabel3_3->show();
398 SpinBoxNtpDelay->show(); 398 SpinBoxNtpDelay->show();
399 Line1->show(); 399 Line1->show();
400 }else{ 400 }else{
401 TabWidgetMain->removePage( tabPredict ); 401 TabWidgetMain->removePage( tabPredict );
402 TabWidgetMain->removePage( tabNtp ); 402 TabWidgetMain->removePage( tabNtp );
403 TextLabel1_2_2->hide(); 403 TextLabel1_2_2->hide();
404 TextLabel2_3->hide(); 404 TextLabel2_3->hide();
405 TextLabel3_3_2->hide(); 405 TextLabel3_3_2->hide();
406 TextLabel1_2->hide(); 406 TextLabel1_2->hide();
407 SpinBoxMinLookupDelay->hide(); 407 SpinBoxMinLookupDelay->hide();
408 TextLabel2->hide(); 408 TextLabel2->hide();
409 TextLabel3_3->hide(); 409 TextLabel3_3->hide();
410 SpinBoxNtpDelay->hide(); 410 SpinBoxNtpDelay->hide();
411 Line1->hide(); 411 Line1->hide();
412 }; 412 };
413 TabWidgetMain->show(); 413 TabWidgetMain->show();
414} 414}
415 415
416 416
417void Ntp::accept( ){ 417void Ntp::accept( ){
418 qDebug("accepted"); 418 qDebug("saving");
419 //SetTimeDate 419 //SetTimeDate
420 commitTime(); 420 commitTime();
421 writeSettings(); 421 writeSettings();
422 updateSystem(); 422 updateSystem();
423 // Ntp 423 // Ntp
424 saveConfig(); 424 saveConfig();
425 qApp->quit(); 425 qApp->quit();
426}
427
428void Ntp::reject( ){
429 qDebug("_oldTimeZone %s",_oldTimeZone.latin1());
430 if (!_oldTimeZone.isEmpty()){
431 qDebug("reverting timezone");
432 tzChange(_oldTimeZone);
433 commitTime();
434 }
426} \ No newline at end of file 435} \ No newline at end of file
diff --git a/noncore/settings/netsystemtime/ntp.h b/noncore/settings/netsystemtime/ntp.h
index a4573f8..150140e 100644
--- a/noncore/settings/netsystemtime/ntp.h
+++ b/noncore/settings/netsystemtime/ntp.h
@@ -1,57 +1,58 @@
1#ifndef NTP_H 1#ifndef NTP_H
2#define NTP_H 2#define NTP_H
3#include "settime.h" 3#include "settime.h"
4#include <qdatetime.h> 4#include <qdatetime.h>
5 5
6class OProcess; 6class OProcess;
7class QString; 7class QString;
8class QTimer; 8class QTimer;
9class QSocket; 9class QSocket;
10class QCopChannel; 10class QCopChannel;
11 11
12class Ntp : public SetDateTime 12class Ntp : public SetDateTime
13{ 13{
14 Q_OBJECT 14 Q_OBJECT
15 15
16public: 16public:
17 Ntp( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 17 Ntp( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
18 ~Ntp(); 18 ~Ntp();
19 19
20public slots: 20public slots:
21 void setDocument (const QString &); 21 void setDocument (const QString &);
22protected: 22protected:
23 virtual void accept( ); 23 virtual void accept( );
24 virtual void reject( );
24 QDateTime predictedTime; 25 QDateTime predictedTime;
25 void makeChannel(); 26 void makeChannel();
26protected slots: 27protected slots:
27 void receive(const QCString &msg, const QByteArray &arg); 28 void receive(const QCString &msg, const QByteArray &arg);
28private: 29private:
29 QString _ntpOutput; 30 QString _ntpOutput;
30 float _shiftPerSec; 31 float _shiftPerSec;
31 int _lookupDiff; 32 int _lookupDiff;
32 OProcess *ntpProcess; 33 OProcess *ntpProcess;
33 QTimer *ntpTimer; 34 QTimer *ntpTimer;
34 QSocket *ntpSock; 35 QSocket *ntpSock;
35 QCopChannel *channel; 36 QCopChannel *channel;
36 bool _interactive; 37 bool _interactive;
37 float getTimeShift(); 38 float getTimeShift();
38 void readLookups(); 39 void readLookups();
39 void ntpOutPut(QString); 40 void ntpOutPut(QString);
40 bool ntpDelayElapsed(); 41 bool ntpDelayElapsed();
41 QString getNtpServer(); 42 QString getNtpServer();
42 void saveConfig(); 43 void saveConfig();
43private slots: 44private slots:
44 void slotTimerRunNtp(); 45 void slotTimerRunNtp();
45 void slotButtonRunNtp(); 46 void slotButtonRunNtp();
46 void slotRunNtp(); 47 void slotRunNtp();
47 void getNtpOutput(OProcess *proc, char *buffer, int buflen); 48 void getNtpOutput(OProcess *proc, char *buffer, int buflen);
48 void ntpFinished(OProcess*); 49 void ntpFinished(OProcess*);
49 void preditctTime(); 50 void preditctTime();
50 void slotCheckNtp(int); 51 void slotCheckNtp(int);
51 void setPredictTime(); 52 void setPredictTime();
52 void showAdvancedFeatures(bool); 53 void showAdvancedFeatures(bool);
53 void slotProbeNtpServer(); 54 void slotProbeNtpServer();
54 void slotNtpDelayChanged(int); 55 void slotNtpDelayChanged(int);
55}; 56};
56 57
57#endif 58#endif
diff --git a/noncore/settings/netsystemtime/settime.cpp b/noncore/settings/netsystemtime/settime.cpp
index 36166ae..6a28989 100644
--- a/noncore/settings/netsystemtime/settime.cpp
+++ b/noncore/settings/netsystemtime/settime.cpp
@@ -11,97 +11,97 @@
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "settime.h" 21#include "settime.h"
22 22
23#include <qpe/alarmserver.h> 23#include <qpe/alarmserver.h>
24#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
25#include <qpe/config.h> 25#include <qpe/config.h>
26#include <qpe/datebookdb.h> 26#include <qpe/datebookdb.h>
27#include <qpe/datebookmonth.h> 27#include <qpe/datebookmonth.h>
28#include <qpe/global.h> 28#include <qpe/global.h>
29#include <qpe/resource.h> 29#include <qpe/resource.h>
30#include <qpe/timeconversion.h> 30#include <qpe/timeconversion.h>
31#include <qpe/tzselect.h> 31#include <qpe/tzselect.h>
32#include <qpe/timestring.h> 32#include <qpe/timestring.h>
33#include <qpe/qpedialog.h> 33#include <qpe/qpedialog.h>
34#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) 34#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP)
35#include <qpe/qcopenvelope_qws.h> 35#include <qpe/qcopenvelope_qws.h>
36#endif 36#endif
37 37
38#include <qtimer.h> 38#include <qtimer.h>
39#include <qbuttongroup.h> 39#include <qbuttongroup.h>
40#include <qcheckbox.h> 40#include <qcheckbox.h>
41#include <qlabel.h> 41#include <qlabel.h>
42#include <qlayout.h> 42#include <qlayout.h>
43#include <qradiobutton.h> 43#include <qradiobutton.h>
44#include <qspinbox.h> 44#include <qspinbox.h>
45#include <qtoolbutton.h> 45#include <qtoolbutton.h>
46#include <qwindowsystem_qws.h> 46#include <qwindowsystem_qws.h>
47#include <qcombobox.h> 47#include <qcombobox.h>
48 48
49#include <sys/time.h> 49#include <sys/time.h>
50#include <time.h> 50#include <time.h>
51#include <stdlib.h> 51#include <stdlib.h>
52#include <stdio.h> 52#include <stdio.h>
53 53
54 54
55SetDateTime::SetDateTime(QWidget *parent, const char *name, WFlags f ) 55SetDateTime::SetDateTime(QWidget *parent, const char *name, WFlags f )
56 : NtpBase( parent, name, true, f ) 56 : NtpBase( parent, name, true, f )
57{ 57{
58 setCaption( tr("System Time") ); 58 setCaption( tr("System Time") );
59 59 _oldTimeZone="";
60 QVBoxLayout *vb = new QVBoxLayout( FrameSystemTime, 5 ); 60 QVBoxLayout *vb = new QVBoxLayout( FrameSystemTime, 5 );
61 61
62// TextLabelMainPredTime = new QLabel( FrameSystemTime ); 62// TextLabelMainPredTime = new QLabel( FrameSystemTime );
63// vb->addWidget( TextLabelMainPredTime, 1, 0 ); 63// vb->addWidget( TextLabelMainPredTime, 1, 0 );
64 64
65 timeButton = new SetTime( FrameSystemTime ); 65 timeButton = new SetTime( FrameSystemTime );
66 vb->addWidget( timeButton ); 66 vb->addWidget( timeButton );
67 67
68 QHBoxLayout *db = new QHBoxLayout( vb ); 68 QHBoxLayout *db = new QHBoxLayout( vb );
69 QLabel *dateLabel = new QLabel( tr("Date"), FrameSystemTime ); 69 QLabel *dateLabel = new QLabel( tr("Date"), FrameSystemTime );
70 db->addWidget( dateLabel, 1 ); 70 db->addWidget( dateLabel, 1 );
71 dateButton = new DateButton( TRUE, FrameSystemTime ); 71 dateButton = new DateButton( TRUE, FrameSystemTime );
72 db->addWidget( dateButton, 2 ); 72 db->addWidget( dateButton, 2 );
73 73
74 ButtonSetTime = new QPushButton( FrameSystemTime ); 74 ButtonSetTime = new QPushButton( FrameSystemTime );
75 vb->addWidget( ButtonSetTime, 1, 0 ); 75 vb->addWidget( ButtonSetTime, 1, 0 );
76 76
77 QFrame *hline = new QFrame( FrameSystemTime ); 77 QFrame *hline = new QFrame( FrameSystemTime );
78 hline->setFrameStyle( QFrame::HLine | QFrame::Sunken ); 78 hline->setFrameStyle( QFrame::HLine | QFrame::Sunken );
79 vb->addWidget( hline ); 79 vb->addWidget( hline );
80 80
81 QHBoxLayout *hb = new QHBoxLayout( vb, -1, "timezone layout" ); 81 QHBoxLayout *hb = new QHBoxLayout( vb, -1, "timezone layout" );
82 82
83 QLabel *lblZone = new QLabel( tr( "Time Zone" ), FrameSystemTime, "timezone label" ); 83 QLabel *lblZone = new QLabel( tr( "Time Zone" ), FrameSystemTime, "timezone label" );
84 lblZone->setMaximumSize( lblZone->sizeHint() ); 84 lblZone->setMaximumSize( lblZone->sizeHint() );
85 hb->addWidget( lblZone ); 85 hb->addWidget( lblZone );
86 86
87 tz = new TimeZoneSelector( FrameSystemTime, "Timezone choices" ); 87 tz = new TimeZoneSelector( FrameSystemTime, "Timezone choices" );
88 tz->setMinimumSize( tz->sizeHint() ); 88 tz->setMinimumSize( tz->sizeHint() );
89 hb->addWidget( tz ); 89 hb->addWidget( tz );
90 90
91 hline = new QFrame( FrameSystemTime ); 91 hline = new QFrame( FrameSystemTime );
92 hline->setFrameStyle( QFrame::HLine | QFrame::Sunken ); 92 hline->setFrameStyle( QFrame::HLine | QFrame::Sunken );
93 vb->addWidget( hline ); 93 vb->addWidget( hline );
94 94
95 QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); 95 QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
96 vb->addItem( spacer ); 96 vb->addItem( spacer );
97 97
98 Config config("qpe"); 98 Config config("qpe");
99 config.setGroup( "Time" ); 99 config.setGroup( "Time" );
100 100
101 QHBoxLayout *hb1 = new QHBoxLayout( vb ); 101 QHBoxLayout *hb1 = new QHBoxLayout( vb );
102 102
103 QLabel *l = new QLabel( tr("Time format"), FrameSystemTime ); 103 QLabel *l = new QLabel( tr("Time format"), FrameSystemTime );
104 hb1->addWidget( l, 1 ); 104 hb1->addWidget( l, 1 );
105 105
106 106
107 ampmCombo = new QComboBox( FrameSystemTime ); 107 ampmCombo = new QComboBox( FrameSystemTime );
@@ -273,104 +273,103 @@ void SetDateTime::setTime(QDateTime dt)
273 DateBookDB db; 273 DateBookDB db;
274 //QCopEnvelope timeApplet( "QPE/TaskBar", "reloadApplets()" ); 274 //QCopEnvelope timeApplet( "QPE/TaskBar", "reloadApplets()" );
275 //timeApplet << ""; 275 //timeApplet << "";
276 // Restore screensaver 276 // Restore screensaver
277 QCopEnvelope enableScreenSaver( "QPE/System", "setScreenSaverIntervals(int,int,int)" ); 277 QCopEnvelope enableScreenSaver( "QPE/System", "setScreenSaverIntervals(int,int,int)" );
278 enableScreenSaver << -1 << -1 << -1; 278 enableScreenSaver << -1 << -1 << -1;
279} 279}
280 280
281void SetDateTime::updateSystem() 281void SetDateTime::updateSystem()
282{ 282{
283 // really turn off the screensaver before doing anything 283 // really turn off the screensaver before doing anything
284 { 284 {
285 // Needs to be encased in { } so that it deconstructs and sends 285 // Needs to be encased in { } so that it deconstructs and sends
286 QCopEnvelope disableScreenSaver( "QPE/System", "setScreenSaverIntervals(int,int,int)" ); 286 QCopEnvelope disableScreenSaver( "QPE/System", "setScreenSaverIntervals(int,int,int)" );
287 disableScreenSaver << 0 << 0 << 0; 287 disableScreenSaver << 0 << 0 << 0;
288 } 288 }
289 qDebug("SetDateTime::updateSystem()"); 289 qDebug("SetDateTime::updateSystem()");
290 writeSettings(); 290 writeSettings();
291 291
292 // set the timezone for everyone else... 292 // set the timezone for everyone else...
293 QCopEnvelope setTimeZone( "QPE/System", "timeChange(QString)" ); 293 QCopEnvelope setTimeZone( "QPE/System", "timeChange(QString)" );
294 setTimeZone << tz->currentZone(); 294 setTimeZone << tz->currentZone();
295 295
296 // AM/PM setting and notify time changed 296 // AM/PM setting and notify time changed
297 QCopEnvelope setClock( "QPE/System", "clockChange(bool)" ); 297 QCopEnvelope setClock( "QPE/System", "clockChange(bool)" );
298 setClock << ampmCombo->currentItem(); 298 setClock << ampmCombo->currentItem();
299 299
300 // Notify everyone what day we prefer to start the week on. 300 // Notify everyone what day we prefer to start the week on.
301 QCopEnvelope setWeek( "QPE/System", "weekChange(bool)" ); 301 QCopEnvelope setWeek( "QPE/System", "weekChange(bool)" );
302 setWeek << weekStartCombo->currentItem(); 302 setWeek << weekStartCombo->currentItem();
303 303
304 // Notify everyone what date format to use 304 // Notify everyone what date format to use
305 QCopEnvelope setDateFormat( "QPE/System", "setDateFormat(DateFormat)" ); 305 QCopEnvelope setDateFormat( "QPE/System", "setDateFormat(DateFormat)" );
306 setDateFormat << date_formats[dateFormatCombo->currentItem()]; 306 setDateFormat << date_formats[dateFormatCombo->currentItem()];
307 307
308 // Restore screensaver 308 // Restore screensaver
309 QCopEnvelope enableScreenSaver( "QPE/System", "setScreenSaverIntervals(int,int,int)" ); 309 QCopEnvelope enableScreenSaver( "QPE/System", "setScreenSaverIntervals(int,int,int)" );
310 enableScreenSaver << -1 << -1 << -1; 310 enableScreenSaver << -1 << -1 << -1;
311 // since time has changed quickly load in the datebookdb 311 // since time has changed quickly load in the datebookdb
312 // to allow the alarm server to get a better grip on itself 312 // to allow the alarm server to get a better grip on itself
313 // (example re-trigger alarms for when we travel back in time) 313 // (example re-trigger alarms for when we travel back in time)
314 DateBookDB db; 314 DateBookDB db;
315 315
316} 316}
317 317
318void SetDateTime::tzChange( const QString &tz ) 318void SetDateTime::tzChange( const QString &tz )
319{ 319{
320 // set the TZ get the time and leave gracefully... 320 // set the TZ get the time and leave gracefully...
321 QString strSave; 321 _oldTimeZone = getenv( "TZ" );
322 strSave = getenv( "TZ" );
323 setenv( "TZ", tz, 1 ); 322 setenv( "TZ", tz, 1 );
324 323
325 QDate d = QDate::currentDate(); 324 QDate d = QDate::currentDate();
326 // reset the time. 325 // reset the time.
327 if ( !strSave.isNull() ) { 326 if ( !_oldTimeZone.isNull() ) {
328 setenv( "TZ", strSave, 1 ); 327 setenv( "TZ", _oldTimeZone, 1 );
329 } 328 }
330 dateButton->setDate( d ); 329 dateButton->setDate( d );
331 updateSystem(); 330 updateSystem();
332} 331}
333 332
334void SetDateTime::formatChanged(int i) 333void SetDateTime::formatChanged(int i)
335{ 334{
336 dateButton->setDateFormat(date_formats[i]); 335 dateButton->setDateFormat(date_formats[i]);
337} 336}
338 337
339static const int ValueAM = 0; 338static const int ValueAM = 0;
340static const int ValuePM = 1; 339static const int ValuePM = 1;
341 340
342 341
343 342
344SetTime::SetTime( QWidget *parent, const char *name ) 343SetTime::SetTime( QWidget *parent, const char *name )
345 : QWidget( parent, name ) 344 : QWidget( parent, name )
346{ 345{
347 clock = new QTimer(this, "clock" ); 346 clock = new QTimer(this, "clock" );
348 connect(clock, SIGNAL( timeout() ), SLOT(slotClockTick()) ); 347 connect(clock, SIGNAL( timeout() ), SLOT(slotClockTick()) );
349 clock->start( 1000 * 60 ); 348 clock->start( 1000 * 60 );
350 349
351 use12hourTime = FALSE; 350 use12hourTime = FALSE;
352 351
353 _time = QDateTime::currentDateTime(); 352 _time = QDateTime::currentDateTime();
354 hour = _time.time().hour(); 353 hour = _time.time().hour();
355 minute = _time.time().minute(); 354 minute = _time.time().minute();
356 355
357 QHBoxLayout *hb2 = new QHBoxLayout( this ); 356 QHBoxLayout *hb2 = new QHBoxLayout( this );
358 hb2->setSpacing( 3 ); 357 hb2->setSpacing( 3 );
359 358
360 QLabel *l = new QLabel( tr("Hour"), this ); 359 QLabel *l = new QLabel( tr("Hour"), this );
361 // l->setAlignment( AlignRight | AlignVCenter ); 360 // l->setAlignment( AlignRight | AlignVCenter );
362 hb2->addWidget( l ); 361 hb2->addWidget( l );
363 362
364 sbHour = new QSpinBox( this ); 363 sbHour = new QSpinBox( this );
365 sbHour->setMinimumWidth( 30 ); 364 sbHour->setMinimumWidth( 30 );
366 if(use12hourTime) { 365 if(use12hourTime) {
367 sbHour->setMinValue(1); 366 sbHour->setMinValue(1);
368 sbHour->setMaxValue( 12 ); 367 sbHour->setMaxValue( 12 );
369 int show_hour = hour; 368 int show_hour = hour;
370 if (hour > 12) 369 if (hour > 12)
371 show_hour -= 12; 370 show_hour -= 12;
372 if (show_hour == 0) 371 if (show_hour == 0)
373 show_hour = 12; 372 show_hour = 12;
374 373
375 sbHour->setValue( show_hour ); 374 sbHour->setValue( show_hour );
376 } else { 375 } else {
diff --git a/noncore/settings/netsystemtime/settime.h b/noncore/settings/netsystemtime/settime.h
index 3c3a162..58d1006 100644
--- a/noncore/settings/netsystemtime/settime.h
+++ b/noncore/settings/netsystemtime/settime.h
@@ -42,61 +42,61 @@ public:
42 42
43 QTime time() const; 43 QTime time() const;
44 void setTime( QDateTime ); 44 void setTime( QDateTime );
45 45
46public slots: 46public slots:
47 void slotTzChange( const QString& tz ); 47 void slotTzChange( const QString& tz );
48 void show12hourTime( int ); 48 void show12hourTime( int );
49 49
50protected slots: 50protected slots:
51 void slotClockTick(); 51 void slotClockTick();
52 void hourChanged( int value ); 52 void hourChanged( int value );
53 void minuteChanged( int value ); 53 void minuteChanged( int value );
54 54
55 void checkedPM( int ); 55 void checkedPM( int );
56 56
57protected: 57protected:
58 int hour; 58 int hour;
59 int minute; 59 int minute;
60 bool use12hourTime; 60 bool use12hourTime;
61 QDateTime _time; 61 QDateTime _time;
62 QTimer *clock; 62 QTimer *clock;
63 QComboBox *ampm; 63 QComboBox *ampm;
64 QSpinBox *sbHour; 64 QSpinBox *sbHour;
65 QSpinBox *sbMin; 65 QSpinBox *sbMin;
66}; 66};
67 67
68class DateButton; 68class DateButton;
69 69
70class SetDateTime : public NtpBase 70class SetDateTime : public NtpBase
71{ 71{
72 Q_OBJECT 72 Q_OBJECT
73public: 73public:
74 SetDateTime( QWidget *parent=0, const char *name=0, WFlags f=0 ); 74 SetDateTime( QWidget *parent=0, const char *name=0, WFlags f=0 );
75 ~SetDateTime(); 75 ~SetDateTime();
76 76
77protected slots: 77protected slots:
78 void commitTime(); 78 void commitTime();
79 void tzChange( const QString &tz ); 79 void tzChange( const QString &tz );
80 void formatChanged(int); 80 void formatChanged(int);
81 void updateSystem(); 81 void updateSystem();
82 82
83protected: 83protected:
84 void setTime(QDateTime dt); 84 void setTime(QDateTime dt);
85 void writeSettings(); 85 void writeSettings();
86 86
87 SetTime *timeButton; 87 SetTime *timeButton;
88 DateButton *dateButton; 88 DateButton *dateButton;
89 TimeZoneSelector *tz; 89 TimeZoneSelector *tz;
90 QString _oldTimeZone;
90 QComboBox *weekStartCombo; 91 QComboBox *weekStartCombo;
91 QComboBox *ampmCombo; 92 QComboBox *ampmCombo;
92 QComboBox *dateFormatCombo; 93 QComboBox *dateFormatCombo;
93 QComboBox *clockAppletCombo; 94 QComboBox *clockAppletCombo;
94 QPushButton *ButtonSetTime; 95 QPushButton *ButtonSetTime;
95 // QLabel *TextLabelMainPredTime;
96 96
97 DateFormat date_formats[4]; 97 DateFormat date_formats[4];
98}; 98};
99 99
100 100
101#endif 101#endif
102 102