summaryrefslogtreecommitdiff
authortille <tille>2002-11-16 17:42:37 (UTC)
committer tille <tille>2002-11-16 17:42:37 (UTC)
commit0861a25d4f28be8a3ba794eafca9f29eac3cc7c1 (patch) (unidiff)
tree0e78a2019fa62f803f6d61683b0daaeb4e810fd7
parent55f437bb3caaeec328bce4e2d00818780f1b4aa2 (diff)
downloadopie-0861a25d4f28be8a3ba794eafca9f29eac3cc7c1.zip
opie-0861a25d4f28be8a3ba794eafca9f29eac3cc7c1.tar.gz
opie-0861a25d4f28be8a3ba794eafca9f29eac3cc7c1.tar.bz2
first try to revert timezones on reject...
... not working i am too stupid ;)
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
@@ -416,5 +416,5 @@ void Ntp::showAdvancedFeatures(bool advMode)
416 416
417void Ntp::accept( ){ 417void Ntp::accept( ){
418 qDebug("accepted"); 418 qDebug("saving");
419 //SetTimeDate 419 //SetTimeDate
420 commitTime(); 420 commitTime();
@@ -424,3 +424,12 @@ void Ntp::accept( ){
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
@@ -22,4 +22,5 @@ public slots:
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();
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
@@ -57,5 +57,5 @@ SetDateTime::SetDateTime(QWidget *parent, const char *name, WFlags 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
@@ -319,12 +319,11 @@ void 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 );
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
@@ -88,4 +88,5 @@ protected:
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;
@@ -93,5 +94,4 @@ protected:
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];