author | eilers <eilers> | 2003-08-08 14:45:49 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-08-08 14:45:49 (UTC) |
commit | 14d394e6c107b037a09a31a92605034fe50f7813 (patch) (side-by-side diff) | |
tree | 800699cf4dc9681c3eb023340634dd6a15fd04c8 /library/tzselect.cpp | |
parent | dbc6ea35f5535a1f69deb7ebbafc0f721721dbf2 (diff) | |
download | opie-14d394e6c107b037a09a31a92605034fe50f7813.zip opie-14d394e6c107b037a09a31a92605034fe50f7813.tar.gz opie-14d394e6c107b037a09a31a92605034fe50f7813.tar.bz2 |
Merged branches from BRANCH_1_0
-rw-r--r-- | library/tzselect.cpp | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/library/tzselect.cpp b/library/tzselect.cpp index 335037e..4343eab 100644 --- a/library/tzselect.cpp +++ b/library/tzselect.cpp @@ -29,12 +29,20 @@ #include <stdlib.h> #include <qcopchannel_qws.h> #include <qpe/qpeapplication.h> #include <qmessagebox.h> +/*! + \class TimeZoneSelector + + \brief The TimeZoneSelector widget allows users to configure their time zone information. + + \ingroup qtopiaemb +*/ + class TimeZoneSelectorPrivate { public: TimeZoneSelectorPrivate() : includeLocal(FALSE) {} bool includeLocal; }; @@ -190,12 +198,16 @@ void TZCombo::handleSystemChannel(const QCString&msg, const QByteArray&) { if ( msg == "timeZoneListChange()" ) { updateZones(); } } +/*! + Creates a new TimeZoneSelector with parent \a p and name \a n. The combobox will be + populated with the available timezones. +*/ TimeZoneSelector::TimeZoneSelector(QWidget* p, const char* n) : QHBox(p,n) { d = new TimeZoneSelectorPrivate(); // build the combobox before we do any updates... @@ -210,12 +222,15 @@ TimeZoneSelector::TimeZoneSelector(QWidget* p, const char* n) : QObject::connect( cmbTz, SIGNAL( activated( int ) ), this, SLOT( slotTzActive( int ) ) ); QObject::connect( cmdTz, SIGNAL( clicked() ), this, SLOT( slotExecute() ) ); } +/*! + Destroys a TimeZoneSelector. +*/ TimeZoneSelector::~TimeZoneSelector() { } void TimeZoneSelector::setLocalIncluded(bool b) { @@ -225,31 +240,42 @@ void TimeZoneSelector::setLocalIncluded(bool b) bool TimeZoneSelector::localIncluded() const { return d->includeLocal; } - +/*! + Returns the currently selected timezone as a string in location format, e.g. + \code Australia/Brisbane \endcode +*/ QString TimeZoneSelector::currentZone() const { return cmbTz->currZone(); } +/*! + Sets the current timezone to \a id. +*/ void TimeZoneSelector::setCurrentZone( const QString& id ) { cmbTz->setCurrZone( id ); } +/*! \fn void TimeZoneSelector::signalNewTz( const QString& id ) + This signal is emitted when a timezone has been selected by the user. The id + is a \l QString in location format, eg \code Australia/Brisbane \endcode +*/ + 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.")); } @@ -267,11 +293,11 @@ QStringList timezoneDefaults( void ) tzs.append( "Europe/Berlin" ); tzs.append( "Berlin" ); tzs.append( "Asia/Tokyo" ); tzs.append( "Tokyo" ); tzs.append( "America/Denver" ); tzs.append( "Denver" ); - + return tzs; } |