Diffstat (limited to 'libopie2/opieui/otimepicker.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opieui/otimepicker.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/libopie2/opieui/otimepicker.cpp b/libopie2/opieui/otimepicker.cpp index 66f9ce0..7de0fd3 100644 --- a/libopie2/opieui/otimepicker.cpp +++ b/libopie2/opieui/otimepicker.cpp | |||
@@ -18,32 +18,36 @@ | |||
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | /* OPIE */ | ||
31 | #include <opie2/otimepicker.h> | ||
32 | |||
30 | /* QT */ | 33 | /* QT */ |
34 | #include <qgroupbox.h> | ||
31 | #include <qlayout.h> | 35 | #include <qlayout.h> |
32 | #include <qlineedit.h> | 36 | #include <qlineedit.h> |
33 | 37 | ||
34 | /* OPIE */ | ||
35 | #include <opie2/otimepicker.h> | ||
36 | 38 | ||
37 | using namespace Opie; | 39 | |
40 | namespace Opie { | ||
41 | namespace Ui { | ||
38 | 42 | ||
39 | /** | 43 | /** |
40 | * Constructs the widget | 44 | * Constructs the widget |
41 | * @param parent The parent of the OTimePicker | 45 | * @param parent The parent of the OTimePicker |
42 | * @param name The name of the object | 46 | * @param name The name of the object |
43 | * @param fl Window Flags | 47 | * @param fl Window Flags |
44 | */ | 48 | */ |
45 | OTimePicker::OTimePicker(QWidget* parent, const char* name, Qt::WFlags fl) | 49 | OTimePicker::OTimePicker(QWidget* parent, const char* name, Qt::WFlags fl) |
46 | :QWidget(parent,name,fl) | 50 | :QWidget(parent,name,fl) |
47 | { | 51 | { |
48 | QVBoxLayout *vbox=new QVBoxLayout(this); | 52 | QVBoxLayout *vbox=new QVBoxLayout(this); |
49 | 53 | ||
@@ -211,24 +215,26 @@ void OTimePicker::setHour(int h) | |||
211 | 215 | ||
212 | 216 | ||
213 | /** | 217 | /** |
214 | * This is a modal Dialog. | 218 | * This is a modal Dialog. |
215 | * | 219 | * |
216 | * @param parent The parent widget | 220 | * @param parent The parent widget |
217 | * @param name The name of the object | 221 | * @param name The name of the object |
218 | * @param fl Possible window flags | 222 | * @param fl Possible window flags |
219 | */ | 223 | */ |
220 | OTimePickerDialog::OTimePickerDialog ( QWidget* parent, const char* name, WFlags fl ) | 224 | OTimePickerDialog::OTimePickerDialog ( QWidget* parent, const char* name, WFlags fl ) |
221 | : OTimePickerDialogBase (parent , name, true , fl) | 225 | : OTimePickerDialogBase (parent , name, true , fl) |
222 | { | 226 | { |
227 | m_timePicker = new OTimePicker( GroupBox1, "m_timePicker" ); | ||
228 | GroupBox1Layout->addWidget( m_timePicker, 0, 0 ); | ||
223 | 229 | ||
224 | connect ( m_timePicker, SIGNAL( timeChanged(const QTime&) ), | 230 | connect ( m_timePicker, SIGNAL( timeChanged(const QTime&) ), |
225 | this, SLOT( setTime(const QTime&) ) ); | 231 | this, SLOT( setTime(const QTime&) ) ); |
226 | connect ( minuteField, SIGNAL( textChanged(const QString&) ), | 232 | connect ( minuteField, SIGNAL( textChanged(const QString&) ), |
227 | this, SLOT ( setMinute(const QString&) ) ); | 233 | this, SLOT ( setMinute(const QString&) ) ); |
228 | connect ( hourField, SIGNAL( textChanged(const QString&) ), | 234 | connect ( hourField, SIGNAL( textChanged(const QString&) ), |
229 | this, SLOT ( setHour(const QString&) ) ); | 235 | this, SLOT ( setHour(const QString&) ) ); |
230 | 236 | ||
231 | } | 237 | } |
232 | 238 | ||
233 | /** | 239 | /** |
234 | * @return the time | 240 | * @return the time |
@@ -281,12 +287,15 @@ void OTimePickerDialog::setHour ( const QString& hour ) | |||
281 | * Method to set a new minute. It tries to convert the string to int and | 287 | * Method to set a new minute. It tries to convert the string to int and |
282 | * if the resulting date is valid a new date is set. | 288 | * if the resulting date is valid a new date is set. |
283 | * @see setHour | 289 | * @see setHour |
284 | */ | 290 | */ |
285 | void OTimePickerDialog::setMinute ( const QString& minute ) | 291 | void OTimePickerDialog::setMinute ( const QString& minute ) |
286 | { | 292 | { |
287 | if ( QTime::isValid ( m_time.hour(), minute.toInt(), 00 ) ) | 293 | if ( QTime::isValid ( m_time.hour(), minute.toInt(), 00 ) ) |
288 | { | 294 | { |
289 | m_time.setHMS ( m_time.hour(), minute.toInt(), 00 ); | 295 | m_time.setHMS ( m_time.hour(), minute.toInt(), 00 ); |
290 | setTime ( m_time ); | 296 | setTime ( m_time ); |
291 | } | 297 | } |
292 | } | 298 | } |
299 | |||
300 | } | ||
301 | } | ||