Diffstat (limited to 'core/pim/datebook/dateentryimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/dateentryimpl.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/pim/datebook/dateentryimpl.cpp b/core/pim/datebook/dateentryimpl.cpp index 1122f79..b2e3e3a 100644 --- a/core/pim/datebook/dateentryimpl.cpp +++ b/core/pim/datebook/dateentryimpl.cpp | |||
@@ -32,41 +32,44 @@ | |||
32 | #include <qcheckbox.h> | 32 | #include <qcheckbox.h> |
33 | #include <qcombobox.h> | 33 | #include <qcombobox.h> |
34 | #include <qlayout.h> | 34 | #include <qlayout.h> |
35 | #include <qlineedit.h> | 35 | #include <qlineedit.h> |
36 | #include <qmultilineedit.h> | 36 | #include <qmultilineedit.h> |
37 | #include <qpopupmenu.h> | 37 | #include <qpopupmenu.h> |
38 | #include <qscrollview.h> | 38 | #include <qscrollview.h> |
39 | #include <qspinbox.h> | 39 | #include <qspinbox.h> |
40 | #include <qtoolbutton.h> | 40 | #include <qtoolbutton.h> |
41 | 41 | ||
42 | #include <stdlib.h> | 42 | #include <stdlib.h> |
43 | 43 | ||
44 | #include <stdiostream.h> | ||
45 | |||
44 | /* | 46 | /* |
45 | * Constructs a DateEntry which is a child of 'parent', with the | 47 | * Constructs a DateEntry which is a child of 'parent', with the |
46 | * name 'name' and widget flags set to 'f' | 48 | * name 'name' and widget flags set to 'f' |
47 | * | 49 | * |
48 | * The dialog will by default be modeless, unless you set 'modal' to | 50 | * The dialog will by default be modeless, unless you set 'modal' to |
49 | * TRUE to construct a modal dialog. | 51 | * TRUE to construct a modal dialog. |
50 | */ | 52 | */ |
51 | 53 | ||
52 | DateEntry::DateEntry( bool startOnMonday, const QDateTime &start, | 54 | DateEntry::DateEntry( bool startOnMonday, const QDateTime &start, |
53 | const QDateTime &end, bool whichClock, QWidget* parent, | 55 | const QDateTime &end, bool whichClock, QWidget* parent, |
54 | const char* name ) | 56 | const char* name ) |
55 | : DateEntryBase( parent, name ), | 57 | : DateEntryBase( parent, name ), |
56 | ampm( whichClock ), | 58 | ampm( whichClock ), |
57 | startWeekOnMonday( startOnMonday ) | 59 | startWeekOnMonday( startOnMonday ) |
58 | { | 60 | { |
59 | init(); | 61 | init(); |
60 | setDates(start,end); | 62 | setDates(start,end); |
63 | setFocusProxy(comboDescription); | ||
61 | } | 64 | } |
62 | 65 | ||
63 | static void addOrPick( QComboBox* combo, const QString& t ) | 66 | static void addOrPick( QComboBox* combo, const QString& t ) |
64 | { | 67 | { |
65 | for (int i=0; i<combo->count(); i++) { | 68 | for (int i=0; i<combo->count(); i++) { |
66 | if ( combo->text(i) == t ) { | 69 | if ( combo->text(i) == t ) { |
67 | combo->setCurrentItem(i); | 70 | combo->setCurrentItem(i); |
68 | return; | 71 | return; |
69 | } | 72 | } |
70 | } | 73 | } |
71 | combo->setEditText(t); | 74 | combo->setEditText(t); |
72 | } | 75 | } |
@@ -167,24 +170,25 @@ void DateEntry::init() | |||
167 | m2->insertItem( endPicker ); | 170 | m2->insertItem( endPicker ); |
168 | buttonEnd->setPopup( m2 ); | 171 | buttonEnd->setPopup( m2 ); |
169 | connect( endPicker, SIGNAL( dateClicked( int, int, int ) ), | 172 | connect( endPicker, SIGNAL( dateClicked( int, int, int ) ), |
170 | this, SLOT( endDateChanged( int, int, int ) ) ); | 173 | this, SLOT( endDateChanged( int, int, int ) ) ); |
171 | } | 174 | } |
172 | 175 | ||
173 | /* | 176 | /* |
174 | * Destroys the object and frees any allocated resources | 177 | * Destroys the object and frees any allocated resources |
175 | */ | 178 | */ |
176 | DateEntry::~DateEntry() | 179 | DateEntry::~DateEntry() |
177 | { | 180 | { |
178 | // no need to delete child widgets, Qt does it all for us | 181 | // no need to delete child widgets, Qt does it all for us |
182 | //cout << "Del: " << comboStart->currentText() << endl; | ||
179 | } | 183 | } |
180 | 184 | ||
181 | /* | 185 | /* |
182 | * public slot | 186 | * public slot |
183 | */ | 187 | */ |
184 | void DateEntry::endDateChanged( int y, int m, int d ) | 188 | void DateEntry::endDateChanged( int y, int m, int d ) |
185 | { | 189 | { |
186 | endDate.setYMD( y, m, d ); | 190 | endDate.setYMD( y, m, d ); |
187 | if ( endDate < startDate ) { | 191 | if ( endDate < startDate ) { |
188 | endDate = startDate; | 192 | endDate = startDate; |
189 | } | 193 | } |
190 | 194 | ||
@@ -261,24 +265,25 @@ void DateEntry::startDateChanged( int y, int m, int d ) | |||
261 | // our pickers must be reset... | 265 | // our pickers must be reset... |
262 | startPicker->setDate( y, m, d ); | 266 | startPicker->setDate( y, m, d ); |
263 | endPicker->setDate( y, m, d ); | 267 | endPicker->setDate( y, m, d ); |
264 | } | 268 | } |
265 | 269 | ||
266 | /* | 270 | /* |
267 | * public slot | 271 | * public slot |
268 | */ | 272 | */ |
269 | void DateEntry::startTimeChanged( int index ) | 273 | void DateEntry::startTimeChanged( int index ) |
270 | { | 274 | { |
271 | startTime = parseTime(comboStart->text(index),ampm); | 275 | startTime = parseTime(comboStart->text(index),ampm); |
272 | changeEndCombo( index ); | 276 | changeEndCombo( index ); |
277 | //cout << "Start: " << comboStart->currentText() << endl; | ||
273 | } | 278 | } |
274 | /* | 279 | /* |
275 | * public slot | 280 | * public slot |
276 | */ | 281 | */ |
277 | void DateEntry::typeChanged( const QString &s ) | 282 | void DateEntry::typeChanged( const QString &s ) |
278 | { | 283 | { |
279 | bool b = s != "All Day"; | 284 | bool b = s != "All Day"; |
280 | buttonStart->setEnabled( b ); | 285 | buttonStart->setEnabled( b ); |
281 | comboStart->setEnabled( b ); | 286 | comboStart->setEnabled( b ); |
282 | comboEnd->setEnabled( b ); | 287 | comboEnd->setEnabled( b ); |
283 | } | 288 | } |
284 | /* | 289 | /* |
@@ -373,24 +378,27 @@ Event DateEntry::event() | |||
373 | ev.setStart( TimeConversion::fromUTC( start_utc ) ); | 378 | ev.setStart( TimeConversion::fromUTC( start_utc ) ); |
374 | ev.setEnd( TimeConversion::fromUTC( end_utc ) ); | 379 | ev.setEnd( TimeConversion::fromUTC( end_utc ) ); |
375 | 380 | ||
376 | // we only have one type of sound at the moment... LOUD!!! | 381 | // we only have one type of sound at the moment... LOUD!!! |
377 | if ( comboSound->currentItem() != 0 ) | 382 | if ( comboSound->currentItem() != 0 ) |
378 | st = Event::Loud; | 383 | st = Event::Loud; |
379 | else | 384 | else |
380 | st = Event::Silent; | 385 | st = Event::Silent; |
381 | ev.setAlarm( checkAlarm->isChecked(), spinAlarm->value(), st ); | 386 | ev.setAlarm( checkAlarm->isChecked(), spinAlarm->value(), st ); |
382 | if ( rp.type != Event::NoRepeat ) | 387 | if ( rp.type != Event::NoRepeat ) |
383 | ev.setRepeat( TRUE, rp ); | 388 | ev.setRepeat( TRUE, rp ); |
384 | ev.setNotes( editNote->text() ); | 389 | ev.setNotes( editNote->text() ); |
390 | |||
391 | //cout << "Start: " << comboStart->currentText() << endl; | ||
392 | |||
385 | return ev; | 393 | return ev; |
386 | } | 394 | } |
387 | 395 | ||
388 | void DateEntry::setRepeatLabel() | 396 | void DateEntry::setRepeatLabel() |
389 | { | 397 | { |
390 | 398 | ||
391 | switch( rp.type ) { | 399 | switch( rp.type ) { |
392 | case Event::Daily: | 400 | case Event::Daily: |
393 | cmdRepeat->setText( tr("Daily...") ); | 401 | cmdRepeat->setText( tr("Daily...") ); |
394 | break; | 402 | break; |
395 | case Event::Weekly: | 403 | case Event::Weekly: |
396 | cmdRepeat->setText( tr("Weekly...") ); | 404 | cmdRepeat->setText( tr("Weekly...") ); |