author | tille <tille> | 2002-11-08 13:41:22 (UTC) |
---|---|---|
committer | tille <tille> | 2002-11-08 13:41:22 (UTC) |
commit | 34dcf50ed34915b0efa54e08baca33609304c478 (patch) (side-by-side diff) | |
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 @@ -1,63 +1,65 @@ /********************************************************************** ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. ** ** This file is part of the Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #define QTOPIA_INTERNAL_TZSELECT_INC_LOCAL #include "tzselect.h" #include "resource.h" #include "global.h" #include "config.h" #include <qtoolbutton.h> #include <qfile.h> #include <stdlib.h> #include <qcopchannel_qws.h> +#include <qpe/qpeapplication.h> +#include <qmessagebox.h> class TimeZoneSelectorPrivate { public: TimeZoneSelectorPrivate() : includeLocal(FALSE) {} bool includeLocal; }; TZCombo::TZCombo( QWidget *p, const char* n ) : QComboBox( p, n ) { updateZones(); // check to see if TZ is set, if it is set the current item to that QString tz = getenv("TZ"); if (parent()->inherits("TimeZoneSelector")) { if ( ((TimeZoneSelector *)parent())->localIncluded() ) { // overide to the 'local' type. tz = "None"; } } if ( !tz.isNull() ) { int n = 0, index = 0; for ( QStringList::Iterator it=identifiers.begin(); it!=identifiers.end(); ++it) { if ( *it == tz ) index = n; n++; } setCurrentItem(index); } else { setCurrentItem(0); @@ -215,57 +217,61 @@ TimeZoneSelector::~TimeZoneSelector() { } void TimeZoneSelector::setLocalIncluded(bool b) { d->includeLocal = b; cmbTz->updateZones(); } bool TimeZoneSelector::localIncluded() const { return d->includeLocal; } QString TimeZoneSelector::currentZone() const { return cmbTz->currZone(); } void TimeZoneSelector::setCurrentZone( const QString& id ) { cmbTz->setCurrZone( id ); } void TimeZoneSelector::slotTzActive( int ) { emit signalNewTz( cmbTz->currZone() ); } void TimeZoneSelector::slotExecute( void ) { - // execute the world time application... + // execute the world time application... + if (QFile::exists(QPEApplication::qpeDir()+"bin/citytime")) Global::execute( "citytime" ); + else + QMessageBox::warning(this,tr("citytime executable not found"), + tr("In order to choose the time zones,\nplease install citytime.")); } QStringList timezoneDefaults( void ) { QStringList tzs; // load up the list just like the file format (citytime.cpp) tzs.append( "America/New_York" ); tzs.append( "New York" ); tzs.append( "America/Los_Angeles" ); tzs.append( "Los Angeles" ); tzs.append( "Australia/Brisbane" ); tzs.append( "Brisbane" ); tzs.append( "Europe/Berlin" ); tzs.append( "Berlin" ); tzs.append( "Asia/Tokyo" ); tzs.append( "Tokyo" ); tzs.append( "America/Denver" ); tzs.append( "Denver" ); return tzs; } |