Diffstat (limited to 'core/pim/datebook/dateentryimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/dateentryimpl.cpp | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/core/pim/datebook/dateentryimpl.cpp b/core/pim/datebook/dateentryimpl.cpp index c4f6c68..9cc5073 100644 --- a/core/pim/datebook/dateentryimpl.cpp +++ b/core/pim/datebook/dateentryimpl.cpp | |||
@@ -127,10 +127,10 @@ DateEntry::DateEntry( bool startOnMonday, const Event &event, bool whichClock, | |||
127 | if(!event.location().isEmpty()) | 127 | if(!event.location().isEmpty()) |
128 | addOrPick( comboLocation, event.location() ); | 128 | addOrPick( comboLocation, event.location() ); |
129 | checkAlarm->setChecked( event.hasAlarm() ); | 129 | checkAlarm->setChecked( event.hasAlarm() ); |
130 | checkAllDay->setChecked( event.type() == Event::AllDay ); | 130 | checkAllDay->setChecked( event.type() == Event::AllDay ); |
131 | if(!event.notes().isEmpty()) | 131 | if(!event.notes().isEmpty()) noteStr=event.notes(); |
132 | editNote->setText(event.notes()); | 132 | else noteStr=""; |
133 | spinAlarm->setValue(event.alarmTime()); | 133 | spinAlarm->setValue(event.alarmTime()); |
134 | if ( event.alarmSound() != Event::Silent ) | 134 | if ( event.alarmSound() != Event::Silent ) |
135 | comboSound->setCurrentItem( 1 ); | 135 | comboSound->setCurrentItem( 1 ); |
136 | if ( event.hasRepeat() ) { | 136 | if ( event.hasRepeat() ) { |
@@ -209,8 +209,11 @@ void DateEntry::init() | |||
209 | connect( qApp, SIGNAL( clockChanged( bool ) ), | 209 | connect( qApp, SIGNAL( clockChanged( bool ) ), |
210 | this, SLOT( slotChangeClock( bool ) ) ); | 210 | this, SLOT( slotChangeClock( bool ) ) ); |
211 | connect( qApp, SIGNAL(weekChanged(bool)), | 211 | connect( qApp, SIGNAL(weekChanged(bool)), |
212 | this, SLOT(slotChangeStartOfWeek(bool)) ); | 212 | this, SLOT(slotChangeStartOfWeek(bool)) ); |
213 | |||
214 | connect( editNote, SIGNAL(clicked()), | ||
215 | this, SLOT(slotEditNote()) ); | ||
213 | 216 | ||
214 | QPopupMenu *m2 = new QPopupMenu( this ); | 217 | QPopupMenu *m2 = new QPopupMenu( this ); |
215 | endPicker = new DateBookMonth( m2, 0, TRUE ); | 218 | endPicker = new DateBookMonth( m2, 0, TRUE ); |
216 | m2->insertItem( endPicker ); | 219 | m2->insertItem( endPicker ); |
@@ -219,9 +222,8 @@ void DateEntry::init() | |||
219 | this, SLOT( endDateChanged( int, int, int ) ) ); | 222 | this, SLOT( endDateChanged( int, int, int ) ) ); |
220 | 223 | ||
221 | connect(timePickerStart, SIGNAL( timeChanged(const QTime &) ), | 224 | connect(timePickerStart, SIGNAL( timeChanged(const QTime &) ), |
222 | this, SLOT( startTimePicked(const QTime &) )); | 225 | this, SLOT( startTimePicked(const QTime &) )); |
223 | editNote->setFixedVisibleLines(3); | ||
224 | // install eventFilters | 226 | // install eventFilters |
225 | comboEnd->installEventFilter( this ); | 227 | comboEnd->installEventFilter( this ); |
226 | comboStart->installEventFilter( this ); | 228 | comboStart->installEventFilter( this ); |
227 | } | 229 | } |
@@ -237,8 +239,24 @@ DateEntry::~DateEntry() | |||
237 | 239 | ||
238 | /* | 240 | /* |
239 | * public slot | 241 | * public slot |
240 | */ | 242 | */ |
243 | |||
244 | void DateEntry::slotEditNote() { | ||
245 | QString s; | ||
246 | s.sprintf("<B>%d/%d</B> ", startDate.day(), startDate.month()); | ||
247 | NoteEntry noteDlg(s+comboDescription->currentText(), noteStr, | ||
248 | this,0,TRUE); | ||
249 | |||
250 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) | ||
251 | noteDlg.showMaximized(); | ||
252 | #endif | ||
253 | if (noteDlg.exec() ) { | ||
254 | noteStr=noteDlg.note->text(); | ||
255 | } | ||
256 | |||
257 | } | ||
258 | |||
241 | void DateEntry::endDateChanged( int y, int m, int d ) | 259 | void DateEntry::endDateChanged( int y, int m, int d ) |
242 | { | 260 | { |
243 | endDate.setYMD( y, m, d ); | 261 | endDate.setYMD( y, m, d ); |
244 | if ( endDate < startDate ) { | 262 | if ( endDate < startDate ) { |
@@ -454,9 +472,9 @@ Event DateEntry::event() | |||
454 | st = Event::Silent; | 472 | st = Event::Silent; |
455 | ev.setAlarm( checkAlarm->isChecked(), spinAlarm->value(), st ); | 473 | ev.setAlarm( checkAlarm->isChecked(), spinAlarm->value(), st ); |
456 | if ( rp.type != Event::NoRepeat ) | 474 | if ( rp.type != Event::NoRepeat ) |
457 | ev.setRepeat( TRUE, rp ); | 475 | ev.setRepeat( TRUE, rp ); |
458 | ev.setNotes( editNote->text() ); | 476 | ev.setNotes( noteStr ); |
459 | 477 | ||
460 | //cout << "Start: " << comboStart->currentText() << endl; | 478 | //cout << "Start: " << comboStart->currentText() << endl; |
461 | 479 | ||
462 | return ev; | 480 | return ev; |