-rw-r--r-- | library/tzselect.cpp | 28 |
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 | |||
@@ -29,12 +29,20 @@ | |||
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> | 32 | #include <qpe/qpeapplication.h> |
33 | #include <qmessagebox.h> | 33 | #include <qmessagebox.h> |
34 | 34 | ||
35 | /*! | ||
36 | \class TimeZoneSelector | ||
37 | |||
38 | \brief The TimeZoneSelector widget allows users to configure their time zone information. | ||
39 | |||
40 | \ingroup qtopiaemb | ||
41 | */ | ||
42 | |||
35 | class TimeZoneSelectorPrivate | 43 | class TimeZoneSelectorPrivate |
36 | { | 44 | { |
37 | public: | 45 | public: |
38 | TimeZoneSelectorPrivate() : includeLocal(FALSE) {} | 46 | TimeZoneSelectorPrivate() : includeLocal(FALSE) {} |
39 | bool includeLocal; | 47 | bool includeLocal; |
40 | }; | 48 | }; |
@@ -190,12 +198,16 @@ void TZCombo::handleSystemChannel(const QCString&msg, const QByteArray&) | |||
190 | { | 198 | { |
191 | if ( msg == "timeZoneListChange()" ) { | 199 | if ( msg == "timeZoneListChange()" ) { |
192 | updateZones(); | 200 | updateZones(); |
193 | } | 201 | } |
194 | } | 202 | } |
195 | 203 | ||
204 | /*! | ||
205 | Creates a new TimeZoneSelector with parent \a p and name \a n. The combobox will be | ||
206 | populated with the available timezones. | ||
207 | */ | ||
196 | 208 | ||
197 | TimeZoneSelector::TimeZoneSelector(QWidget* p, const char* n) : | 209 | TimeZoneSelector::TimeZoneSelector(QWidget* p, const char* n) : |
198 | QHBox(p,n) | 210 | QHBox(p,n) |
199 | { | 211 | { |
200 | d = new TimeZoneSelectorPrivate(); | 212 | d = new TimeZoneSelectorPrivate(); |
201 | // build the combobox before we do any updates... | 213 | // build the combobox before we do any updates... |
@@ -210,12 +222,15 @@ TimeZoneSelector::TimeZoneSelector(QWidget* p, const char* n) : | |||
210 | QObject::connect( cmbTz, SIGNAL( activated( int ) ), | 222 | QObject::connect( cmbTz, SIGNAL( activated( int ) ), |
211 | this, SLOT( slotTzActive( int ) ) ); | 223 | this, SLOT( slotTzActive( int ) ) ); |
212 | QObject::connect( cmdTz, SIGNAL( clicked() ), | 224 | QObject::connect( cmdTz, SIGNAL( clicked() ), |
213 | this, SLOT( slotExecute() ) ); | 225 | this, SLOT( slotExecute() ) ); |
214 | } | 226 | } |
215 | 227 | ||
228 | /*! | ||
229 | Destroys a TimeZoneSelector. | ||
230 | */ | ||
216 | TimeZoneSelector::~TimeZoneSelector() | 231 | TimeZoneSelector::~TimeZoneSelector() |
217 | { | 232 | { |
218 | } | 233 | } |
219 | 234 | ||
220 | void TimeZoneSelector::setLocalIncluded(bool b) | 235 | void TimeZoneSelector::setLocalIncluded(bool b) |
221 | { | 236 | { |
@@ -225,22 +240,33 @@ void TimeZoneSelector::setLocalIncluded(bool b) | |||
225 | 240 | ||
226 | bool TimeZoneSelector::localIncluded() const | 241 | bool TimeZoneSelector::localIncluded() const |
227 | { | 242 | { |
228 | return d->includeLocal; | 243 | return d->includeLocal; |
229 | } | 244 | } |
230 | 245 | ||
231 | 246 | /*! | |
247 | Returns the currently selected timezone as a string in location format, e.g. | ||
248 | \code Australia/Brisbane \endcode | ||
249 | */ | ||
232 | QString TimeZoneSelector::currentZone() const | 250 | QString TimeZoneSelector::currentZone() const |
233 | { | 251 | { |
234 | return cmbTz->currZone(); | 252 | return cmbTz->currZone(); |
235 | } | 253 | } |
236 | 254 | ||
255 | /*! | ||
256 | Sets the current timezone to \a id. | ||
257 | */ | ||
237 | void TimeZoneSelector::setCurrentZone( const QString& id ) | 258 | void TimeZoneSelector::setCurrentZone( const QString& id ) |
238 | { | 259 | { |
239 | cmbTz->setCurrZone( id ); | 260 | cmbTz->setCurrZone( id ); |
240 | } | 261 | } |
262 | /*! \fn void TimeZoneSelector::signalNewTz( const QString& id ) | ||
263 | This signal is emitted when a timezone has been selected by the user. The id | ||
264 | is a \l QString in location format, eg \code Australia/Brisbane \endcode | ||
265 | */ | ||
266 | |||
241 | 267 | ||
242 | void TimeZoneSelector::slotTzActive( int ) | 268 | void TimeZoneSelector::slotTzActive( int ) |
243 | { | 269 | { |
244 | emit signalNewTz( cmbTz->currZone() ); | 270 | emit signalNewTz( cmbTz->currZone() ); |
245 | } | 271 | } |
246 | 272 | ||