Diffstat (limited to 'core/settings/citytime/citytime.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/settings/citytime/citytime.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/core/settings/citytime/citytime.cpp b/core/settings/citytime/citytime.cpp index b2f9f14..f33b19f 100644 --- a/core/settings/citytime/citytime.cpp +++ b/core/settings/citytime/citytime.cpp | |||
@@ -15,31 +15,33 @@ | |||
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 | // changes by Maximilian Reiss <harlekin@handhelds.org> | ||
22 | |||
21 | #include "zonemap.h" | 23 | #include "zonemap.h" |
22 | #include "citytime.h" | 24 | #include "citytime.h" |
23 | 25 | ||
24 | #include <qpe/qpeapplication.h> | 26 | #include <qpe/qpeapplication.h> |
25 | #include <qpe/config.h> | 27 | #include <qpe/config.h> |
26 | #include <qpe/timestring.h> | 28 | #include <qpe/timestring.h> |
27 | #include <qpe/tzselect.h> | 29 | #include <qpe/tzselect.h> |
28 | #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) | 30 | #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) |
29 | #include <qpe/qcopenvelope_qws.h> | 31 | #include <qpe/qcopenvelope_qws.h> |
30 | #endif | 32 | #endif |
31 | 33 | ||
32 | |||
33 | #include <qdir.h> | 34 | #include <qdir.h> |
34 | #include <qfile.h> | 35 | #include <qfile.h> |
35 | #include <qlabel.h> | 36 | #include <qlabel.h> |
36 | #include <qmessagebox.h> | 37 | #include <qmessagebox.h> |
37 | #include <qregexp.h> | 38 | #include <qregexp.h> |
38 | #include <qtextstream.h> | 39 | #include <qtextstream.h> |
39 | #include <qtoolbutton.h> | 40 | #include <qtoolbutton.h> |
41 | #include <qlayout.h> | ||
40 | 42 | ||
41 | #include <stdlib.h> | 43 | #include <stdlib.h> |
42 | 44 | ||
43 | CityTime::CityTime( QWidget *parent, const char* name, | 45 | CityTime::CityTime( QWidget *parent, const char* name, |
44 | WFlags fl ) | 46 | WFlags fl ) |
45 | : CityTimeBase( parent, name, fl ), | 47 | : CityTimeBase( parent, name, fl ), |
@@ -74,13 +76,12 @@ CityTime::CityTime( QWidget *parent, const char* name, | |||
74 | 76 | ||
75 | // kludgy way of getting the screen size so we don't have to depend | 77 | // kludgy way of getting the screen size so we don't have to depend |
76 | // on a resize event... | 78 | // on a resize event... |
77 | QWidget *d = QApplication::desktop(); | 79 | QWidget *d = QApplication::desktop(); |
78 | if ( d->width() < d->height() ) { | 80 | if ( d->width() < d->height() ) { |
79 | // append for that 4 down look | 81 | // append for that 4 down look |
80 | |||
81 | listCities.append( cmdCity4 ); | 82 | listCities.append( cmdCity4 ); |
82 | listCities.append( cmdCity5 ); | 83 | listCities.append( cmdCity5 ); |
83 | listCities.append( cmdCity6 ); | 84 | listCities.append( cmdCity6 ); |
84 | listTimes.append( lblCTime4 ); | 85 | listTimes.append( lblCTime4 ); |
85 | listTimes.append( lblCTime5 ); | 86 | listTimes.append( lblCTime5 ); |
86 | listTimes.append( lblCTime6 ); | 87 | listTimes.append( lblCTime6 ); |
@@ -101,17 +102,21 @@ CityTime::CityTime( QWidget *parent, const char* name, | |||
101 | lblCTime5->hide(); | 102 | lblCTime5->hide(); |
102 | lblCTime6->hide(); | 103 | lblCTime6->hide(); |
103 | cmdCity4->hide(); | 104 | cmdCity4->hide(); |
104 | cmdCity5->hide(); | 105 | cmdCity5->hide(); |
105 | cmdCity6->hide(); | 106 | cmdCity6->hide(); |
106 | } | 107 | } |
108 | |||
109 | selWidget = frmMap->selectionWidget( this ); | ||
110 | selWidget->hide(); | ||
111 | CityTimeBaseLayout->addWidget( selWidget ); | ||
107 | bAdded = true; | 112 | bAdded = true; |
108 | readInTimes(); | 113 | readInTimes(); |
109 | changed = FALSE; | 114 | changed = FALSE; |
110 | QObject::connect( qApp, SIGNAL( clockChanged(bool) ), | 115 | QObject::connect( qApp, SIGNAL( clockChanged( bool ) ), |
111 | this, SLOT( changeClock(bool) ) ); | 116 | this, SLOT( changeClock( bool ) ) ); |
112 | // now start the timer so we can update the time quickly every second | 117 | // now start the timer so we can update the time quickly every second |
113 | timerEvent( 0 ); | 118 | timerEvent( 0 ); |
114 | } | 119 | } |
115 | 120 | ||
116 | CityTime::~CityTime() | 121 | CityTime::~CityTime() |
117 | { | 122 | { |
@@ -196,13 +201,16 @@ void CityTime::showTime( void ) | |||
196 | } | 201 | } |
197 | } | 202 | } |
198 | } | 203 | } |
199 | 204 | ||
200 | void CityTime::beginNewTz() | 205 | void CityTime::beginNewTz() |
201 | { | 206 | { |
207 | buttonWidget->hide(); | ||
202 | frmMap->setFocus(); | 208 | frmMap->setFocus(); |
209 | selWidget->show(); | ||
210 | // CityTimeBaseLayout->addWidget( selWidget ); | ||
203 | } | 211 | } |
204 | 212 | ||
205 | void CityTime::slotNewTz( const QString & strNewCountry, | 213 | void CityTime::slotNewTz( const QString & strNewCountry, |
206 | const QString & strNewCity ) | 214 | const QString & strNewCity ) |
207 | { | 215 | { |
208 | // determine what to do based on what putton is pressed... | 216 | // determine what to do based on what putton is pressed... |
@@ -220,12 +228,14 @@ void CityTime::slotNewTz( const QString & strNewCountry, | |||
220 | // that is ever pressed! | 228 | // that is ever pressed! |
221 | changed = TRUE; | 229 | changed = TRUE; |
222 | break; | 230 | break; |
223 | } | 231 | } |
224 | } | 232 | } |
225 | showTime(); | 233 | showTime(); |
234 | buttonWidget->show(); | ||
235 | selWidget->hide(); | ||
226 | } | 236 | } |
227 | 237 | ||
228 | void CityTime::readInTimes( void ) | 238 | void CityTime::readInTimes( void ) |
229 | { | 239 | { |
230 | Config cfg("CityTime"); | 240 | Config cfg("CityTime"); |
231 | cfg.setGroup("TimeZones"); | 241 | cfg.setGroup("TimeZones"); |