Diffstat (limited to 'korganizer/koeditordetails.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | korganizer/koeditordetails.cpp | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/korganizer/koeditordetails.cpp b/korganizer/koeditordetails.cpp index 9a4b4ec..a01c838 100644 --- a/korganizer/koeditordetails.cpp +++ b/korganizer/koeditordetails.cpp | |||
@@ -1,56 +1,62 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in thse hope that it will be useful, | 10 | This program is distributed in thse hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qtooltip.h> | 24 | #include <qtooltip.h> |
25 | #include <qfiledialog.h> | 25 | #include <q3filedialog.h> |
26 | #include <qlayout.h> | 26 | #include <qlayout.h> |
27 | #include <qvbox.h> | 27 | #include <q3vbox.h> |
28 | #include <qbuttongroup.h> | 28 | #include <q3buttongroup.h> |
29 | #include <qvgroupbox.h> | 29 | #include <q3vgroupbox.h> |
30 | #include <qwidgetstack.h> | 30 | #include <q3widgetstack.h> |
31 | #include <qdatetime.h> | 31 | #include <qdatetime.h> |
32 | #include <qapp.h> | 32 | #include <qapplication.h> |
33 | #include <QDesktopWidget> | ||
34 | //Added by qt3to4: | ||
35 | #include <Q3GridLayout> | ||
36 | #include <QLabel> | ||
37 | #include <Q3PtrList> | ||
38 | #include <Q3VBoxLayout> | ||
33 | 39 | ||
34 | #include <klocale.h> | 40 | #include <klocale.h> |
35 | #include <kglobal.h> | 41 | #include <kglobal.h> |
36 | #include <kdialog.h> | 42 | #include <kdialog.h> |
37 | #include <kiconloader.h> | 43 | #include <kiconloader.h> |
38 | #include <kstandarddirs.h> | 44 | #include <kstandarddirs.h> |
39 | #include <kmessagebox.h> | 45 | #include <kmessagebox.h> |
40 | #ifndef KORG_NOKABC | 46 | #ifndef KORG_NOKABC |
41 | 47 | ||
42 | #ifdef DESKTOP_VERSION | 48 | #ifdef DESKTOP_VERSION |
43 | #include <kabc/addresseedialog.h> | 49 | #include <kabc/addresseedialog.h> |
44 | #else //DESKTOP_VERSION | 50 | #else //DESKTOP_VERSION |
45 | #include <externalapphandler.h> | 51 | #include <externalapphandler.h> |
46 | #endif //DESKTOP_VERSION | 52 | #endif //DESKTOP_VERSION |
47 | 53 | ||
48 | #endif | 54 | #endif |
49 | 55 | ||
50 | #include <libkcal/incidence.h> | 56 | #include <libkcal/incidence.h> |
51 | 57 | ||
52 | #include "koprefs.h" | 58 | #include "koprefs.h" |
53 | 59 | ||
54 | #include "koeditordetails.h" | 60 | #include "koeditordetails.h" |
55 | 61 | ||
56 | template <> | 62 | template <> |
@@ -59,109 +65,109 @@ CustomListViewItem<Attendee *>::~CustomListViewItem() | |||
59 | delete mData; | 65 | delete mData; |
60 | } | 66 | } |
61 | 67 | ||
62 | template <> | 68 | template <> |
63 | void CustomListViewItem<Attendee *>::updateItem() | 69 | void CustomListViewItem<Attendee *>::updateItem() |
64 | { | 70 | { |
65 | setText(0,mData->name()); | 71 | setText(0,mData->name()); |
66 | setText(1,mData->email()); | 72 | setText(1,mData->email()); |
67 | setText(2,mData->roleStr()); | 73 | setText(2,mData->roleStr()); |
68 | setText(3,mData->statusStr()); | 74 | setText(3,mData->statusStr()); |
69 | if (mData->RSVP() && !mData->email().isEmpty()) { | 75 | if (mData->RSVP() && !mData->email().isEmpty()) { |
70 | setPixmap(4,SmallIcon("mailappt")); | 76 | setPixmap(4,SmallIcon("mailappt")); |
71 | setSortKey(4,"j"); | 77 | setSortKey(4,"j"); |
72 | } | 78 | } |
73 | else { | 79 | else { |
74 | setPixmap(4,SmallIcon("nomailappt")); | 80 | setPixmap(4,SmallIcon("nomailappt")); |
75 | setSortKey(4,"n"); | 81 | setSortKey(4,"n"); |
76 | } | 82 | } |
77 | } | 83 | } |
78 | 84 | ||
79 | 85 | ||
80 | KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) | 86 | KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) |
81 | : QWidget( parent, name), mDisableItemUpdate( false ) | 87 | : QWidget( parent, name), mDisableItemUpdate( false ) |
82 | { | 88 | { |
83 | QGridLayout *topLayout = new QGridLayout(this); | 89 | Q3GridLayout *topLayout = new Q3GridLayout(this); |
84 | topLayout->setSpacing(spacing); | 90 | topLayout->setSpacing(spacing); |
85 | topLayout->setMargin(KDialog::marginHint()-2); | 91 | topLayout->setMargin(KDialog::marginHint()-2); |
86 | 92 | ||
87 | QString organizer = KOPrefs::instance()->email(); | 93 | QString organizer = KOPrefs::instance()->email(); |
88 | mOrganizerLabel = new QLabel(i18n("Organizer: %1").arg(organizer),this); | 94 | mOrganizerLabel = new QLabel(i18n("Organizer: %1").arg(organizer),this); |
89 | 95 | ||
90 | mListView = new KListView(this,"mListView"); | 96 | mListView = new KListView(this,"mListView"); |
91 | mListView->addColumn(i18n("Name"),180); | 97 | mListView->addColumn(i18n("Name"),180); |
92 | mListView->addColumn(i18n("Email"),180); | 98 | mListView->addColumn(i18n("Email"),180); |
93 | mListView->addColumn(i18n("Role"),60); | 99 | mListView->addColumn(i18n("Role"),60); |
94 | mListView->addColumn(i18n("Status"),100); | 100 | mListView->addColumn(i18n("Status"),100); |
95 | mListView->addColumn(i18n("RSVP"),35); | 101 | mListView->addColumn(i18n("RSVP"),35); |
96 | if ( QApplication::desktop()->width() <= 320 || QApplication::desktop()->height() <= 240) { | 102 | if ( QApplication::desktop()->width() <= 320 || QApplication::desktop()->height() <= 240) { |
97 | int hei = 80; | 103 | int hei = 80; |
98 | if ( QApplication::desktop()->height() <= 240 ) | 104 | if ( QApplication::desktop()->height() <= 240 ) |
99 | hei = 60; | 105 | hei = 60; |
100 | mListView->setFixedHeight(hei); | 106 | mListView->setFixedHeight(hei); |
101 | } | 107 | } |
102 | mListView->setAllColumnsShowFocus (true ); | 108 | mListView->setAllColumnsShowFocus (true ); |
103 | //mListView->setSingleClick( true ); | 109 | //mListView->setSingleClick( true ); |
104 | connect(mListView,SIGNAL(selectionChanged(QListViewItem *)), | 110 | connect(mListView,SIGNAL(selectionChanged(Q3ListViewItem *)), |
105 | SLOT(updateAttendeeInput())); | 111 | SLOT(updateAttendeeInput())); |
106 | 112 | ||
107 | connect(mListView,SIGNAL(executed(QListViewItem * ,const QPoint&, int )), | 113 | connect(mListView,SIGNAL(executed(Q3ListViewItem * ,const QPoint&, int )), |
108 | SLOT(itemClicked(QListViewItem * ,const QPoint& , int ))); | 114 | SLOT(itemClicked(Q3ListViewItem * ,const QPoint& , int ))); |
109 | 115 | ||
110 | mRsvpButton = new QCheckBox(this); | 116 | mRsvpButton = new QCheckBox(this); |
111 | mRsvpButton->setText(i18n("Request response")); | 117 | mRsvpButton->setText(i18n("Request response")); |
112 | mAddressBookButton = new QPushButton(i18n("Address &Book..."),this); | 118 | mAddressBookButton = new QPushButton(i18n("Address &Book..."),this); |
113 | QLabel *attendeeLabel = new QLabel(this); | 119 | QLabel *attendeeLabel = new QLabel(this); |
114 | attendeeLabel->setText(i18n("Name:")); | 120 | attendeeLabel->setText(i18n("Name:")); |
115 | attendeeLabel->setFixedSize( attendeeLabel->sizeHint() ); | 121 | attendeeLabel->setFixedSize( attendeeLabel->sizeHint() ); |
116 | mNameEdit = new QLineEdit(this); | 122 | mNameEdit = new QLineEdit(this); |
117 | connect(mNameEdit,SIGNAL(textChanged(const QString &)), | 123 | connect(mNameEdit,SIGNAL(textChanged(const QString &)), |
118 | SLOT(updateAttendeeItem())); | 124 | SLOT(updateAttendeeItem())); |
119 | 125 | ||
120 | 126 | ||
121 | QLabel *emailLabel = new QLabel(this); | 127 | QLabel *emailLabel = new QLabel(this); |
122 | emailLabel->setText(i18n("Email:")); | 128 | emailLabel->setText(i18n("Email:")); |
123 | mEmailEdit = new QLineEdit(this); | 129 | mEmailEdit = new QLineEdit(this); |
124 | connect(mEmailEdit,SIGNAL(textChanged(const QString &)), | 130 | connect(mEmailEdit,SIGNAL(textChanged(const QString &)), |
125 | SLOT(updateAttendeeItem())); | 131 | SLOT(updateAttendeeItem())); |
126 | 132 | ||
127 | QLabel *attendeeRoleLabel = new QLabel(this); | 133 | QLabel *attendeeRoleLabel = new QLabel(this); |
128 | attendeeRoleLabel->setText(i18n("Role:")); | 134 | attendeeRoleLabel->setText(i18n("Role:")); |
129 | mRoleCombo = new QComboBox(false,this); | 135 | mRoleCombo = new QComboBox(false,this); |
130 | mRoleCombo->insertStringList(Attendee::roleList()); | 136 | mRoleCombo->insertStringList(Attendee::roleList()); |
131 | connect(mRoleCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); | 137 | connect(mRoleCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); |
132 | 138 | ||
133 | QLabel *statusLabel = new QLabel(this); | 139 | QLabel *statusLabel = new QLabel(this); |
134 | statusLabel->setText( i18n("Status:") ); | 140 | statusLabel->setText( i18n("Status:") ); |
135 | 141 | ||
136 | mStatusCombo = new QComboBox(false,this); | 142 | mStatusCombo = new QComboBox(false,this); |
137 | mStatusCombo->insertStringList(Attendee::statusList()); | 143 | mStatusCombo->insertStringList(Attendee::statusList()); |
138 | connect(mStatusCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); | 144 | connect(mStatusCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); |
139 | 145 | ||
140 | 146 | ||
141 | connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem())); | 147 | connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem())); |
142 | QWidget *buttonBox = new QWidget(this); | 148 | QWidget *buttonBox = new QWidget(this); |
143 | QVBoxLayout *buttonLayout = new QVBoxLayout(buttonBox); | 149 | Q3VBoxLayout *buttonLayout = new Q3VBoxLayout(buttonBox); |
144 | 150 | ||
145 | QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox); | 151 | QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox); |
146 | buttonLayout->addWidget(newButton); | 152 | buttonLayout->addWidget(newButton); |
147 | connect(newButton,SIGNAL(clicked()),SLOT(addNewAttendee())); | 153 | connect(newButton,SIGNAL(clicked()),SLOT(addNewAttendee())); |
148 | 154 | ||
149 | mRemoveButton = new QPushButton(i18n("&Remove"),buttonBox); | 155 | mRemoveButton = new QPushButton(i18n("&Remove"),buttonBox); |
150 | buttonLayout->addWidget(mRemoveButton); | 156 | buttonLayout->addWidget(mRemoveButton); |
151 | connect(mRemoveButton, SIGNAL(clicked()),SLOT(removeAttendee())); | 157 | connect(mRemoveButton, SIGNAL(clicked()),SLOT(removeAttendee())); |
152 | 158 | ||
153 | // buttonLayout->addWidget(mAddressBookButton); | 159 | // buttonLayout->addWidget(mAddressBookButton); |
154 | connect(mAddressBookButton,SIGNAL(clicked()),SLOT(openAddressBook())); | 160 | connect(mAddressBookButton,SIGNAL(clicked()),SLOT(openAddressBook())); |
155 | //mRoleCombo->setFixedSize( mRoleCombo->sizeHint () ); | 161 | //mRoleCombo->setFixedSize( mRoleCombo->sizeHint () ); |
156 | if ( QApplication::desktop()->height() <= 240 ) { | 162 | if ( QApplication::desktop()->height() <= 240 ) { |
157 | mRoleCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Minimum ,FALSE) ); | 163 | mRoleCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Minimum ,FALSE) ); |
158 | mStatusCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Minimum ,FALSE) ); | 164 | mStatusCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Minimum ,FALSE) ); |
159 | topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,5); | 165 | topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,5); |
160 | topLayout->addMultiCellWidget(mListView,1,1,0,5); | 166 | topLayout->addMultiCellWidget(mListView,1,1,0,5); |
161 | topLayout->addWidget(attendeeLabel,3,0); | 167 | topLayout->addWidget(attendeeLabel,3,0); |
162 | topLayout->addMultiCellWidget(mNameEdit,3,3,1,4); | 168 | topLayout->addMultiCellWidget(mNameEdit,3,3,1,4); |
163 | topLayout->addWidget(emailLabel,4,0); | 169 | topLayout->addWidget(emailLabel,4,0); |
164 | topLayout->addMultiCellWidget(mEmailEdit,4,4,1,4); | 170 | topLayout->addMultiCellWidget(mEmailEdit,4,4,1,4); |
165 | topLayout->addWidget(attendeeRoleLabel,5,0); | 171 | topLayout->addWidget(attendeeRoleLabel,5,0); |
166 | topLayout->addMultiCellWidget(mRoleCombo,5,5,1,2); | 172 | topLayout->addMultiCellWidget(mRoleCombo,5,5,1,2); |
167 | topLayout->addWidget(statusLabel,5,3); | 173 | topLayout->addWidget(statusLabel,5,3); |
@@ -344,137 +350,137 @@ void KOEditorDetails::insertAttendee(Attendee *a) | |||
344 | mListView->setSelected( item, true ); | 350 | mListView->setSelected( item, true ); |
345 | } | 351 | } |
346 | 352 | ||
347 | void KOEditorDetails::setDefaults() | 353 | void KOEditorDetails::setDefaults() |
348 | { | 354 | { |
349 | mRsvpButton->setChecked(true); | 355 | mRsvpButton->setChecked(true); |
350 | mListView->clear(); | 356 | mListView->clear(); |
351 | mdelAttendees.clear(); | 357 | mdelAttendees.clear(); |
352 | clearAttendeeInput(); | 358 | clearAttendeeInput(); |
353 | mOrganizerLabel->setText(i18n("Organizer: %1").arg(KOPrefs::instance()->email())); | 359 | mOrganizerLabel->setText(i18n("Organizer: %1").arg(KOPrefs::instance()->email())); |
354 | 360 | ||
355 | mNameEdit->setText(""); | 361 | mNameEdit->setText(""); |
356 | mUidEdit = ""; | 362 | mUidEdit = ""; |
357 | mEmailEdit->setText(""); | 363 | mEmailEdit->setText(""); |
358 | mRoleCombo->setCurrentItem( 0 ); | 364 | mRoleCombo->setCurrentItem( 0 ); |
359 | mStatusCombo->setCurrentItem( 0 ); | 365 | mStatusCombo->setCurrentItem( 0 ); |
360 | 366 | ||
361 | } | 367 | } |
362 | 368 | ||
363 | void KOEditorDetails::readEvent(Incidence *event) | 369 | void KOEditorDetails::readEvent(Incidence *event) |
364 | { | 370 | { |
365 | setDefaults(); | 371 | setDefaults(); |
366 | //mListView->clear(); | 372 | //mListView->clear(); |
367 | //mdelAttendees.clear(); | 373 | //mdelAttendees.clear(); |
368 | QPtrList<Attendee> tmpAList = event->attendees(); | 374 | Q3PtrList<Attendee> tmpAList = event->attendees(); |
369 | Attendee *a; | 375 | Attendee *a; |
370 | for (a = tmpAList.first(); a; a = tmpAList.next()) | 376 | for (a = tmpAList.first(); a; a = tmpAList.next()) |
371 | insertAttendee(new Attendee(*a)); | 377 | insertAttendee(new Attendee(*a)); |
372 | 378 | ||
373 | mListView->setSelected( mListView->firstChild(), true ); | 379 | mListView->setSelected( mListView->firstChild(), true ); |
374 | mOrganizerLabel->setText(i18n("Organizer: %1").arg(event->organizer())); | 380 | mOrganizerLabel->setText(i18n("Organizer: %1").arg(event->organizer())); |
375 | } | 381 | } |
376 | 382 | ||
377 | void KOEditorDetails::writeEvent(Incidence *event) | 383 | void KOEditorDetails::writeEvent(Incidence *event) |
378 | { | 384 | { |
379 | event->clearAttendees(); | 385 | event->clearAttendees(); |
380 | QListViewItem *item; | 386 | Q3ListViewItem *item; |
381 | AttendeeListItem *a; | 387 | AttendeeListItem *a; |
382 | for (item = mListView->firstChild(); item; | 388 | for (item = mListView->firstChild(); item; |
383 | item = item->nextSibling()) { | 389 | item = item->nextSibling()) { |
384 | a = (AttendeeListItem *)item; | 390 | a = (AttendeeListItem *)item; |
385 | event->addAttendee(new Attendee(*(a->data()))); | 391 | event->addAttendee(new Attendee(*(a->data()))); |
386 | } | 392 | } |
387 | event->setOrganizer(KOPrefs::instance()->email()); | 393 | event->setOrganizer(KOPrefs::instance()->email()); |
388 | } | 394 | } |
389 | 395 | ||
390 | void KOEditorDetails::cancelAttendeeEvent(Incidence *event) | 396 | void KOEditorDetails::cancelAttendeeEvent(Incidence *event) |
391 | { | 397 | { |
392 | event->clearAttendees(); | 398 | event->clearAttendees(); |
393 | Attendee * att; | 399 | Attendee * att; |
394 | for (att=mdelAttendees.first();att;att=mdelAttendees.next()) { | 400 | for (att=mdelAttendees.first();att;att=mdelAttendees.next()) { |
395 | event->addAttendee(new Attendee(*att)); | 401 | event->addAttendee(new Attendee(*att)); |
396 | } | 402 | } |
397 | mdelAttendees.clear(); | 403 | mdelAttendees.clear(); |
398 | } | 404 | } |
399 | 405 | ||
400 | bool KOEditorDetails::validateInput() | 406 | bool KOEditorDetails::validateInput() |
401 | { | 407 | { |
402 | return true; | 408 | return true; |
403 | } | 409 | } |
404 | 410 | ||
405 | void KOEditorDetails::updateAttendeeInput() | 411 | void KOEditorDetails::updateAttendeeInput() |
406 | { | 412 | { |
407 | QListViewItem *item = mListView->selectedItem(); | 413 | Q3ListViewItem *item = mListView->selectedItem(); |
408 | AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item ); | 414 | AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item ); |
409 | if (aItem) { | 415 | if (aItem) { |
410 | fillAttendeeInput( aItem ); | 416 | fillAttendeeInput( aItem ); |
411 | } else { | 417 | } else { |
412 | clearAttendeeInput(); | 418 | clearAttendeeInput(); |
413 | } | 419 | } |
414 | } | 420 | } |
415 | 421 | ||
416 | void KOEditorDetails::clearAttendeeInput() | 422 | void KOEditorDetails::clearAttendeeInput() |
417 | { | 423 | { |
418 | mNameEdit->setText(""); | 424 | mNameEdit->setText(""); |
419 | mUidEdit = ""; | 425 | mUidEdit = ""; |
420 | mEmailEdit->setText(""); | 426 | mEmailEdit->setText(""); |
421 | mRoleCombo->setCurrentItem(0); | 427 | mRoleCombo->setCurrentItem(0); |
422 | mStatusCombo->setCurrentItem(0); | 428 | mStatusCombo->setCurrentItem(0); |
423 | mRsvpButton->setChecked(true); | 429 | mRsvpButton->setChecked(true); |
424 | setEnabledAttendeeInput( false ); | 430 | setEnabledAttendeeInput( false ); |
425 | } | 431 | } |
426 | 432 | ||
427 | void KOEditorDetails::fillAttendeeInput( AttendeeListItem *aItem ) | 433 | void KOEditorDetails::fillAttendeeInput( AttendeeListItem *aItem ) |
428 | { | 434 | { |
429 | Attendee *a = aItem->data(); | 435 | Attendee *a = aItem->data(); |
430 | mDisableItemUpdate = true; | 436 | mDisableItemUpdate = true; |
431 | mNameEdit->setText(a->name()); | 437 | mNameEdit->setText(a->name()); |
432 | mUidEdit = a->uid(); | 438 | mUidEdit = a->uid(); |
433 | mEmailEdit->setText(a->email()); | 439 | mEmailEdit->setText(a->email()); |
434 | mRoleCombo->setCurrentItem(a->role()); | 440 | mRoleCombo->setCurrentItem(a->role()); |
435 | mStatusCombo->setCurrentItem(a->status()); | 441 | mStatusCombo->setCurrentItem(a->status()); |
436 | mRsvpButton->setChecked(a->RSVP()); | 442 | mRsvpButton->setChecked(a->RSVP()); |
437 | 443 | ||
438 | mDisableItemUpdate = false; | 444 | mDisableItemUpdate = false; |
439 | 445 | ||
440 | setEnabledAttendeeInput( true ); | 446 | setEnabledAttendeeInput( true ); |
441 | } | 447 | } |
442 | 448 | ||
443 | void KOEditorDetails::setEnabledAttendeeInput( bool enabled ) | 449 | void KOEditorDetails::setEnabledAttendeeInput( bool enabled ) |
444 | { | 450 | { |
445 | mNameEdit->setEnabled( enabled ); | 451 | mNameEdit->setEnabled( enabled ); |
446 | mEmailEdit->setEnabled( enabled ); | 452 | mEmailEdit->setEnabled( enabled ); |
447 | mRoleCombo->setEnabled( enabled ); | 453 | mRoleCombo->setEnabled( enabled ); |
448 | mStatusCombo->setEnabled( enabled ); | 454 | mStatusCombo->setEnabled( enabled ); |
449 | mRsvpButton->setEnabled( enabled ); | 455 | mRsvpButton->setEnabled( enabled ); |
450 | 456 | ||
451 | mRemoveButton->setEnabled( enabled ); | 457 | mRemoveButton->setEnabled( enabled ); |
452 | } | 458 | } |
453 | 459 | ||
454 | void KOEditorDetails::itemClicked(QListViewItem * item ,const QPoint & pnt, int c ) | 460 | void KOEditorDetails::itemClicked(Q3ListViewItem * item ,const QPoint & pnt, int c ) |
455 | { | 461 | { |
456 | if ( item && c == 4 ) { | 462 | if ( item && c == 4 ) { |
457 | mRsvpButton->setChecked( !mRsvpButton->isChecked() ); | 463 | mRsvpButton->setChecked( !mRsvpButton->isChecked() ); |
458 | updateAttendeeItem(); | 464 | updateAttendeeItem(); |
459 | } | 465 | } |
460 | } | 466 | } |
461 | void KOEditorDetails::updateAttendeeItem() | 467 | void KOEditorDetails::updateAttendeeItem() |
462 | { | 468 | { |
463 | if (mDisableItemUpdate) return; | 469 | if (mDisableItemUpdate) return; |
464 | 470 | ||
465 | QListViewItem *item = mListView->selectedItem(); | 471 | Q3ListViewItem *item = mListView->selectedItem(); |
466 | AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item ); | 472 | AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item ); |
467 | if ( !aItem ) return; | 473 | if ( !aItem ) return; |
468 | 474 | ||
469 | Attendee *a = aItem->data(); | 475 | Attendee *a = aItem->data(); |
470 | 476 | ||
471 | a->setName( mNameEdit->text() ); | 477 | a->setName( mNameEdit->text() ); |
472 | a->setUid( mUidEdit ); | 478 | a->setUid( mUidEdit ); |
473 | a->setEmail( mEmailEdit->text() ); | 479 | a->setEmail( mEmailEdit->text() ); |
474 | if ( mEmailEdit->text().isEmpty() ) | 480 | if ( mEmailEdit->text().isEmpty() ) |
475 | mRsvpButton->setChecked( false ); | 481 | mRsvpButton->setChecked( false ); |
476 | a->setRSVP( mRsvpButton->isChecked() ); | 482 | a->setRSVP( mRsvpButton->isChecked() ); |
477 | a->setRole( Attendee::Role( mRoleCombo->currentItem() ) ); | 483 | a->setRole( Attendee::Role( mRoleCombo->currentItem() ) ); |
478 | a->setStatus( Attendee::PartStat( mStatusCombo->currentItem() ) ); | 484 | a->setStatus( Attendee::PartStat( mStatusCombo->currentItem() ) ); |
479 | aItem->updateItem(); | 485 | aItem->updateItem(); |
480 | } | 486 | } |