Diffstat (limited to 'libopie2/opieui/otimepicker.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opieui/otimepicker.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libopie2/opieui/otimepicker.cpp b/libopie2/opieui/otimepicker.cpp index d4712a4..66f9ce0 100644 --- a/libopie2/opieui/otimepicker.cpp +++ b/libopie2/opieui/otimepicker.cpp | |||
@@ -176,102 +176,102 @@ void OTimePicker::setTime( int h, int m ) | |||
176 | * @param m minutes | 176 | * @param m minutes |
177 | */ | 177 | */ |
178 | void OTimePicker::setMinute(int m) | 178 | void OTimePicker::setMinute(int m) |
179 | { | 179 | { |
180 | 180 | ||
181 | QString minute; | 181 | QString minute; |
182 | minute.sprintf("%.2d",m); | 182 | minute.sprintf("%.2d",m); |
183 | 183 | ||
184 | QValueListIterator<OClickableLabel *> it; | 184 | QValueListIterator<OClickableLabel *> it; |
185 | for (it=minuteLst.begin(); it!=minuteLst.end(); it++) | 185 | for (it=minuteLst.begin(); it!=minuteLst.end(); it++) |
186 | { | 186 | { |
187 | if ((*it)->text() == minute) (*it)->setOn(true); | 187 | if ((*it)->text() == minute) (*it)->setOn(true); |
188 | else (*it)->setOn(false); | 188 | else (*it)->setOn(false); |
189 | } | 189 | } |
190 | 190 | ||
191 | tm.setHMS(tm.hour(),m,0); | 191 | tm.setHMS(tm.hour(),m,0); |
192 | } | 192 | } |
193 | 193 | ||
194 | /** | 194 | /** |
195 | * Method to set the hour | 195 | * Method to set the hour |
196 | */ | 196 | */ |
197 | void OTimePicker::setHour(int h) | 197 | void OTimePicker::setHour(int h) |
198 | { | 198 | { |
199 | 199 | ||
200 | QString hour; | 200 | QString hour; |
201 | hour.sprintf("%.2d",h); | 201 | hour.sprintf("%.2d",h); |
202 | 202 | ||
203 | QValueListIterator<OClickableLabel *> it; | 203 | QValueListIterator<OClickableLabel *> it; |
204 | for (it=hourLst.begin(); it!=hourLst.end(); it++) | 204 | for (it=hourLst.begin(); it!=hourLst.end(); it++) |
205 | { | 205 | { |
206 | if ((*it)->text() == hour) (*it)->setOn(true); | 206 | if ((*it)->text() == hour) (*it)->setOn(true); |
207 | else (*it)->setOn(false); | 207 | else (*it)->setOn(false); |
208 | } | 208 | } |
209 | tm.setHMS(h,tm.minute(),0); | 209 | tm.setHMS(h,tm.minute(),0); |
210 | } | 210 | } |
211 | 211 | ||
212 | 212 | ||
213 | /** | 213 | /** |
214 | * This is a modal Dialog. | 214 | * This is a modal Dialog. |
215 | * | 215 | * |
216 | * @param parent The parent widget | 216 | * @param parent The parent widget |
217 | * @param name The name of the object | 217 | * @param name The name of the object |
218 | * @param fl Possible window flags | 218 | * @param fl Possible window flags |
219 | */ | 219 | */ |
220 | OTimePickerDialog::OTimePickerDialog ( QWidget* parent, const char* name, WFlags fl ) | 220 | OTimePickerDialog::OTimePickerDialog ( QWidget* parent, const char* name, WFlags fl ) |
221 | : OTimePickerDialogBase (parent , name, true , fl) | 221 | : OTimePickerDialogBase (parent , name, true , fl) |
222 | { | 222 | { |
223 | 223 | ||
224 | connect ( m_timePicker, SIGNAL( timeChanged( const QTime& ) ), | 224 | connect ( m_timePicker, SIGNAL( timeChanged(const QTime&) ), |
225 | this, SLOT( setTime ( const QTime& ) ) ); | 225 | this, SLOT( setTime(const QTime&) ) ); |
226 | connect ( minuteField, SIGNAL( textChanged ( const QString& ) ), | 226 | connect ( minuteField, SIGNAL( textChanged(const QString&) ), |
227 | this, SLOT ( setMinute ( const QString& ) ) ); | 227 | this, SLOT ( setMinute(const QString&) ) ); |
228 | connect ( hourField, SIGNAL( textChanged ( const QString& ) ), | 228 | connect ( hourField, SIGNAL( textChanged(const QString&) ), |
229 | this, SLOT ( setHour ( const QString& ) ) ); | 229 | this, SLOT ( setHour(const QString&) ) ); |
230 | 230 | ||
231 | } | 231 | } |
232 | 232 | ||
233 | /** | 233 | /** |
234 | * @return the time | 234 | * @return the time |
235 | */ | 235 | */ |
236 | QTime OTimePickerDialog::time()const | 236 | QTime OTimePickerDialog::time()const |
237 | { | 237 | { |
238 | return m_time; | 238 | return m_time; |
239 | } | 239 | } |
240 | 240 | ||
241 | /** | 241 | /** |
242 | * Set the time to time | 242 | * Set the time to time |
243 | * @param time The time to be set | 243 | * @param time The time to be set |
244 | */ | 244 | */ |
245 | void OTimePickerDialog::setTime( const QTime& time ) | 245 | void OTimePickerDialog::setTime( const QTime& time ) |
246 | { | 246 | { |
247 | m_time = time; | 247 | m_time = time; |
248 | 248 | ||
249 | m_timePicker->setHour ( time.hour() ); | 249 | m_timePicker->setHour ( time.hour() ); |
250 | m_timePicker->setMinute( time.minute() ); | 250 | m_timePicker->setMinute( time.minute() ); |
251 | 251 | ||
252 | // Set Textfields | 252 | // Set Textfields |
253 | if ( time.hour() < 10 ) | 253 | if ( time.hour() < 10 ) |
254 | hourField->setText( "0" + QString::number( time.hour() ) ); | 254 | hourField->setText( "0" + QString::number( time.hour() ) ); |
255 | else | 255 | else |
256 | hourField->setText( QString::number( time.hour() ) ); | 256 | hourField->setText( QString::number( time.hour() ) ); |
257 | 257 | ||
258 | if ( time.minute() < 10 ) | 258 | if ( time.minute() < 10 ) |
259 | minuteField->setText( "0" + QString::number( time.minute() ) ); | 259 | minuteField->setText( "0" + QString::number( time.minute() ) ); |
260 | else | 260 | else |
261 | minuteField->setText( QString::number( time.minute() ) ); | 261 | minuteField->setText( QString::number( time.minute() ) ); |
262 | 262 | ||
263 | } | 263 | } |
264 | 264 | ||
265 | /** | 265 | /** |
266 | * This method takes the current minute and tries to set hour | 266 | * This method takes the current minute and tries to set hour |
267 | * to hour. This succeeds if the resulting date is valid | 267 | * to hour. This succeeds if the resulting date is valid |
268 | * @param hour The hour as a string | 268 | * @param hour The hour as a string |
269 | */ | 269 | */ |
270 | void OTimePickerDialog::setHour ( const QString& hour ) | 270 | void OTimePickerDialog::setHour ( const QString& hour ) |
271 | { | 271 | { |
272 | if ( QTime::isValid ( hour.toInt(), m_time.minute() , 00 ) ) | 272 | if ( QTime::isValid ( hour.toInt(), m_time.minute() , 00 ) ) |
273 | { | 273 | { |
274 | m_time.setHMS ( hour.toInt(), m_time.minute() , 00 ); | 274 | m_time.setHMS ( hour.toInt(), m_time.minute() , 00 ); |
275 | setTime ( m_time ); | 275 | setTime ( m_time ); |
276 | } | 276 | } |
277 | 277 | ||