author | tille <tille> | 2002-11-08 13:41:22 (UTC) |
---|---|---|
committer | tille <tille> | 2002-11-08 13:41:22 (UTC) |
commit | 34dcf50ed34915b0efa54e08baca33609304c478 (patch) (unidiff) | |
tree | 9a63caea3174b79c36a95bfdb0bd54e29de08d1e | |
parent | 2aa75fdaeb219fffef86af1a2ca0aac0ac6731ce (diff) | |
download | opie-34dcf50ed34915b0efa54e08baca33609304c478.zip opie-34dcf50ed34915b0efa54e08baca33609304c478.tar.gz opie-34dcf50ed34915b0efa54e08baca33609304c478.tar.bz2 |
added messagebox that informs the user to install citytime
possibility to install automaticly would be nice...
-rw-r--r-- | library/tzselect.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/library/tzselect.cpp b/library/tzselect.cpp index 2e5a433..335037e 100644 --- a/library/tzselect.cpp +++ b/library/tzselect.cpp | |||
@@ -16,32 +16,34 @@ | |||
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 | #define QTOPIA_INTERNAL_TZSELECT_INC_LOCAL | 21 | #define QTOPIA_INTERNAL_TZSELECT_INC_LOCAL |
22 | 22 | ||
23 | #include "tzselect.h" | 23 | #include "tzselect.h" |
24 | #include "resource.h" | 24 | #include "resource.h" |
25 | #include "global.h" | 25 | #include "global.h" |
26 | #include "config.h" | 26 | #include "config.h" |
27 | #include <qtoolbutton.h> | 27 | #include <qtoolbutton.h> |
28 | #include <qfile.h> | 28 | #include <qfile.h> |
29 | #include <stdlib.h> | 29 | #include <stdlib.h> |
30 | 30 | ||
31 | #include <qcopchannel_qws.h> | 31 | #include <qcopchannel_qws.h> |
32 | #include <qpe/qpeapplication.h> | ||
33 | #include <qmessagebox.h> | ||
32 | 34 | ||
33 | class TimeZoneSelectorPrivate | 35 | class TimeZoneSelectorPrivate |
34 | { | 36 | { |
35 | public: | 37 | public: |
36 | TimeZoneSelectorPrivate() : includeLocal(FALSE) {} | 38 | TimeZoneSelectorPrivate() : includeLocal(FALSE) {} |
37 | bool includeLocal; | 39 | bool includeLocal; |
38 | }; | 40 | }; |
39 | 41 | ||
40 | TZCombo::TZCombo( QWidget *p, const char* n ) | 42 | TZCombo::TZCombo( QWidget *p, const char* n ) |
41 | : QComboBox( p, n ) | 43 | : QComboBox( p, n ) |
42 | { | 44 | { |
43 | updateZones(); | 45 | updateZones(); |
44 | // check to see if TZ is set, if it is set the current item to that | 46 | // check to see if TZ is set, if it is set the current item to that |
45 | QString tz = getenv("TZ"); | 47 | QString tz = getenv("TZ"); |
46 | if (parent()->inherits("TimeZoneSelector")) { | 48 | if (parent()->inherits("TimeZoneSelector")) { |
47 | if ( ((TimeZoneSelector *)parent())->localIncluded() ) { | 49 | if ( ((TimeZoneSelector *)parent())->localIncluded() ) { |
@@ -231,34 +233,38 @@ QString TimeZoneSelector::currentZone() const | |||
231 | { | 233 | { |
232 | return cmbTz->currZone(); | 234 | return cmbTz->currZone(); |
233 | } | 235 | } |
234 | 236 | ||
235 | void TimeZoneSelector::setCurrentZone( const QString& id ) | 237 | void TimeZoneSelector::setCurrentZone( const QString& id ) |
236 | { | 238 | { |
237 | cmbTz->setCurrZone( id ); | 239 | cmbTz->setCurrZone( id ); |
238 | } | 240 | } |
239 | 241 | ||
240 | void TimeZoneSelector::slotTzActive( int ) | 242 | void TimeZoneSelector::slotTzActive( int ) |
241 | { | 243 | { |
242 | emit signalNewTz( cmbTz->currZone() ); | 244 | emit signalNewTz( cmbTz->currZone() ); |
243 | } | 245 | } |
244 | 246 | ||
245 | void TimeZoneSelector::slotExecute( void ) | 247 | void TimeZoneSelector::slotExecute( void ) |
246 | { | 248 | { |
247 | // execute the world time application... | 249 | // execute the world time application... |
250 | if (QFile::exists(QPEApplication::qpeDir()+"bin/citytime")) | ||
248 | Global::execute( "citytime" ); | 251 | Global::execute( "citytime" ); |
252 | else | ||
253 | QMessageBox::warning(this,tr("citytime executable not found"), | ||
254 | tr("In order to choose the time zones,\nplease install citytime.")); | ||
249 | } | 255 | } |
250 | 256 | ||
251 | QStringList timezoneDefaults( void ) | 257 | QStringList timezoneDefaults( void ) |
252 | { | 258 | { |
253 | QStringList tzs; | 259 | QStringList tzs; |
254 | // load up the list just like the file format (citytime.cpp) | 260 | // load up the list just like the file format (citytime.cpp) |
255 | tzs.append( "America/New_York" ); | 261 | tzs.append( "America/New_York" ); |
256 | tzs.append( "New York" ); | 262 | tzs.append( "New York" ); |
257 | tzs.append( "America/Los_Angeles" ); | 263 | tzs.append( "America/Los_Angeles" ); |
258 | tzs.append( "Los Angeles" ); | 264 | tzs.append( "Los Angeles" ); |
259 | tzs.append( "Australia/Brisbane" ); | 265 | tzs.append( "Australia/Brisbane" ); |
260 | tzs.append( "Brisbane" ); | 266 | tzs.append( "Brisbane" ); |
261 | tzs.append( "Europe/Berlin" ); | 267 | tzs.append( "Europe/Berlin" ); |
262 | tzs.append( "Berlin" ); | 268 | tzs.append( "Berlin" ); |
263 | tzs.append( "Asia/Tokyo" ); | 269 | tzs.append( "Asia/Tokyo" ); |
264 | tzs.append( "Tokyo" ); | 270 | tzs.append( "Tokyo" ); |