summaryrefslogtreecommitdiff
path: root/library/tzselect.cpp
Side-by-side diff
Diffstat (limited to 'library/tzselect.cpp') (more/less context) (show whitespace changes)
-rw-r--r--library/tzselect.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/library/tzselect.cpp b/library/tzselect.cpp
index 335037e..4343eab 100644
--- a/library/tzselect.cpp
+++ b/library/tzselect.cpp
@@ -23,24 +23,32 @@
#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 TimeZoneSelector
+
+ \brief The TimeZoneSelector widget allows users to configure their time zone information.
+
+ \ingroup qtopiaemb
+*/
+
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
@@ -184,69 +192,87 @@ void TZCombo::setCurrZone( const QString& id )
extras.append(id);
}
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...
cmbTz = new TZCombo( this, "timezone combo" );
cmdTz = new QToolButton( this, "timezone button" );
cmdTz->setIconSet( Resource::loadIconSet( "citytime_icon" ) );
cmdTz->setMaximumSize( cmdTz->sizeHint() );
// set up a connection to catch a newly selected item and throw our
// signal
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)
{
d->includeLocal = b;
cmbTz->updateZones();
}
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...
if (QFile::exists(QPEApplication::qpeDir()+"bin/citytime"))
Global::execute( "citytime" );
else