summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeditordetails.cpp10
-rw-r--r--korganizer/koeditordetails.h2
2 files changed, 5 insertions, 7 deletions
diff --git a/korganizer/koeditordetails.cpp b/korganizer/koeditordetails.cpp
index 479bd8b..b90b9eb 100644
--- a/korganizer/koeditordetails.cpp
+++ b/korganizer/koeditordetails.cpp
@@ -112,18 +112,16 @@ KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name)
112 mAddressBookButton = new QPushButton(i18n("Address &Book..."),this); 112 mAddressBookButton = new QPushButton(i18n("Address &Book..."),this);
113 QLabel *attendeeLabel = new QLabel(this); 113 QLabel *attendeeLabel = new QLabel(this);
114 attendeeLabel->setText(i18n("Name:")); 114 attendeeLabel->setText(i18n("Name:"));
115 attendeeLabel->setFixedSize( attendeeLabel->sizeHint() ); 115 attendeeLabel->setFixedSize( attendeeLabel->sizeHint() );
116 mNameEdit = new QLineEdit(this); 116 mNameEdit = new QLineEdit(this);
117 connect(mNameEdit,SIGNAL(textChanged(const QString &)), 117 connect(mNameEdit,SIGNAL(textChanged(const QString &)),
118 SLOT(updateAttendeeItem())); 118 SLOT(updateAttendeeItem()));
119 119
120 mUidEdit = new QLineEdit(0);
121 mUidEdit->setText("");
122 120
123 QLabel *emailLabel = new QLabel(this); 121 QLabel *emailLabel = new QLabel(this);
124 emailLabel->setText(i18n("Email:")); 122 emailLabel->setText(i18n("Email:"));
125 mEmailEdit = new QLineEdit(this); 123 mEmailEdit = new QLineEdit(this);
126 connect(mEmailEdit,SIGNAL(textChanged(const QString &)), 124 connect(mEmailEdit,SIGNAL(textChanged(const QString &)),
127 SLOT(updateAttendeeItem())); 125 SLOT(updateAttendeeItem()));
128 126
129 QLabel *attendeeRoleLabel = new QLabel(this); 127 QLabel *attendeeRoleLabel = new QLabel(this);
@@ -350,17 +348,17 @@ void KOEditorDetails::setDefaults()
350{ 348{
351 mRsvpButton->setChecked(true); 349 mRsvpButton->setChecked(true);
352 mListView->clear(); 350 mListView->clear();
353 mdelAttendees.clear(); 351 mdelAttendees.clear();
354 clearAttendeeInput(); 352 clearAttendeeInput();
355 mOrganizerLabel->setText(i18n("Organizer: %1").arg(KOPrefs::instance()->email())); 353 mOrganizerLabel->setText(i18n("Organizer: %1").arg(KOPrefs::instance()->email()));
356 354
357 mNameEdit->setText(""); 355 mNameEdit->setText("");
358 mUidEdit->setText(""); 356 mUidEdit = "";
359 mEmailEdit->setText(""); 357 mEmailEdit->setText("");
360 mRoleCombo->setCurrentItem( 0 ); 358 mRoleCombo->setCurrentItem( 0 );
361 mStatusCombo->setCurrentItem( 0 ); 359 mStatusCombo->setCurrentItem( 0 );
362 360
363} 361}
364 362
365void KOEditorDetails::readEvent(Incidence *event) 363void KOEditorDetails::readEvent(Incidence *event)
366{ 364{
@@ -413,30 +411,30 @@ void KOEditorDetails::updateAttendeeInput()
413 } else { 411 } else {
414 clearAttendeeInput(); 412 clearAttendeeInput();
415 } 413 }
416} 414}
417 415
418void KOEditorDetails::clearAttendeeInput() 416void KOEditorDetails::clearAttendeeInput()
419{ 417{
420 mNameEdit->setText(""); 418 mNameEdit->setText("");
421 mUidEdit->setText(""); 419 mUidEdit = "";
422 mEmailEdit->setText(""); 420 mEmailEdit->setText("");
423 mRoleCombo->setCurrentItem(0); 421 mRoleCombo->setCurrentItem(0);
424 mStatusCombo->setCurrentItem(0); 422 mStatusCombo->setCurrentItem(0);
425 mRsvpButton->setChecked(true); 423 mRsvpButton->setChecked(true);
426 setEnabledAttendeeInput( false ); 424 setEnabledAttendeeInput( false );
427} 425}
428 426
429void KOEditorDetails::fillAttendeeInput( AttendeeListItem *aItem ) 427void KOEditorDetails::fillAttendeeInput( AttendeeListItem *aItem )
430{ 428{
431 Attendee *a = aItem->data(); 429 Attendee *a = aItem->data();
432 mDisableItemUpdate = true; 430 mDisableItemUpdate = true;
433 mNameEdit->setText(a->name()); 431 mNameEdit->setText(a->name());
434 mUidEdit->setText(a->uid()); 432 mUidEdit = a->uid();
435 mEmailEdit->setText(a->email()); 433 mEmailEdit->setText(a->email());
436 mRoleCombo->setCurrentItem(a->role()); 434 mRoleCombo->setCurrentItem(a->role());
437 mStatusCombo->setCurrentItem(a->status()); 435 mStatusCombo->setCurrentItem(a->status());
438 mRsvpButton->setChecked(a->RSVP()); 436 mRsvpButton->setChecked(a->RSVP());
439 437
440 mDisableItemUpdate = false; 438 mDisableItemUpdate = false;
441 439
442 setEnabledAttendeeInput( true ); 440 setEnabledAttendeeInput( true );
@@ -466,17 +464,17 @@ void KOEditorDetails::updateAttendeeItem()
466 464
467 QListViewItem *item = mListView->selectedItem(); 465 QListViewItem *item = mListView->selectedItem();
468 AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item ); 466 AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item );
469 if ( !aItem ) return; 467 if ( !aItem ) return;
470 468
471 Attendee *a = aItem->data(); 469 Attendee *a = aItem->data();
472 470
473 a->setName( mNameEdit->text() ); 471 a->setName( mNameEdit->text() );
474 a->setUid( mUidEdit->text() ); 472 a->setUid( mUidEdit );
475 a->setEmail( mEmailEdit->text() ); 473 a->setEmail( mEmailEdit->text() );
476 if ( mEmailEdit->text().isEmpty() ) 474 if ( mEmailEdit->text().isEmpty() )
477 mRsvpButton->setChecked( false ); 475 mRsvpButton->setChecked( false );
478 a->setRSVP( mRsvpButton->isChecked() ); 476 a->setRSVP( mRsvpButton->isChecked() );
479 a->setRole( Attendee::Role( mRoleCombo->currentItem() ) ); 477 a->setRole( Attendee::Role( mRoleCombo->currentItem() ) );
480 a->setStatus( Attendee::PartStat( mStatusCombo->currentItem() ) ); 478 a->setStatus( Attendee::PartStat( mStatusCombo->currentItem() ) );
481 aItem->updateItem(); 479 aItem->updateItem();
482} 480}
diff --git a/korganizer/koeditordetails.h b/korganizer/koeditordetails.h
index a33ee82..5f8f6f2 100644
--- a/korganizer/koeditordetails.h
+++ b/korganizer/koeditordetails.h
@@ -86,17 +86,17 @@ class KOEditorDetails : public QWidget
86 void itemClicked(QListViewItem *,const QPoint & pnt, int c); 86 void itemClicked(QListViewItem *,const QPoint & pnt, int c);
87 void updateAttendeeItem(); 87 void updateAttendeeItem();
88 void setEnabledAttendeeInput(bool); 88 void setEnabledAttendeeInput(bool);
89 89
90 private: 90 private:
91 bool mDisableItemUpdate; 91 bool mDisableItemUpdate;
92 92
93 QLineEdit *mNameEdit; 93 QLineEdit *mNameEdit;
94 QLineEdit *mUidEdit; 94 QString mUidEdit;
95 QLineEdit *mEmailEdit; 95 QLineEdit *mEmailEdit;
96 KListView *mListView; 96 KListView *mListView;
97 QComboBox* mRoleCombo; 97 QComboBox* mRoleCombo;
98 QCheckBox* mRsvpButton; 98 QCheckBox* mRsvpButton;
99 QComboBox* mStatusCombo; 99 QComboBox* mStatusCombo;
100 QLabel *mOrganizerLabel; 100 QLabel *mOrganizerLabel;
101 101
102 QPushButton* mAddButton; 102 QPushButton* mAddButton;