summaryrefslogtreecommitdiff
path: root/core/pim/datebook/dateentryimpl.cpp
Unidiff
Diffstat (limited to 'core/pim/datebook/dateentryimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/dateentryimpl.cpp26
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
@@ -125,14 +125,14 @@ DateEntry::DateEntry( bool startOnMonday, const Event &event, bool whichClock,
125 if(!event.description().isEmpty()) 125 if(!event.description().isEmpty())
126 addOrPick( comboDescription, event.description() ); 126 addOrPick( comboDescription, event.description() );
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() ) {
137 rp = event.repeatPattern(); 137 rp = event.repeatPattern();
138 cmdRepeat->setText( tr("Repeat...") ); 138 cmdRepeat->setText( tr("Repeat...") );
@@ -207,23 +207,25 @@ void DateEntry::init()
207 connect( startPicker, SIGNAL( dateClicked( int, int, int ) ), 207 connect( startPicker, SIGNAL( dateClicked( int, int, int ) ),
208 this, SLOT( endDateChanged( int, int, int ) ) ); 208 this, SLOT( endDateChanged( int, int, int ) ) );
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 );
217 buttonEnd->setPopup( m2 ); 220 buttonEnd->setPopup( m2 );
218 connect( endPicker, SIGNAL( dateClicked( int, int, int ) ), 221 connect( endPicker, SIGNAL( dateClicked( int, int, int ) ),
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}
228 230
229/* 231/*
@@ -235,12 +237,28 @@ DateEntry::~DateEntry()
235 //cout << "Del: " << comboStart->currentText() << endl; 237 //cout << "Del: " << comboStart->currentText() << endl;
236} 238}
237 239
238/* 240/*
239 * public slot 241 * public slot
240 */ 242 */
243
244void 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
241void DateEntry::endDateChanged( int y, int m, int d ) 259void 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 ) {
245 endDate = startDate; 263 endDate = startDate;
246 } 264 }
@@ -452,13 +470,13 @@ Event DateEntry::event()
452 st = Event::Loud; 470 st = Event::Loud;
453 else 471 else
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;
463} 481}
464 482