author | zautrix <zautrix> | 2005-04-01 18:10:09 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-01 18:10:09 (UTC) |
commit | edc032c21ae3788d02a632ea8066e4ac5a4feedb (patch) (unidiff) | |
tree | 8e59c8dcf1cc3021694025627d36e152f7adc389 /korganizer/koeditordetails.cpp | |
parent | 5d88f92b76a760f100384ea5fa6ed143088d19bb (diff) | |
download | kdepimpi-edc032c21ae3788d02a632ea8066e4ac5a4feedb.zip kdepimpi-edc032c21ae3788d02a632ea8066e4ac5a4feedb.tar.gz kdepimpi-edc032c21ae3788d02a632ea8066e4ac5a4feedb.tar.bz2 |
fixes
Diffstat (limited to 'korganizer/koeditordetails.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | korganizer/koeditordetails.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/korganizer/koeditordetails.cpp b/korganizer/koeditordetails.cpp index 2fd13bd..802261c 100644 --- a/korganizer/koeditordetails.cpp +++ b/korganizer/koeditordetails.cpp | |||
@@ -1,187 +1,188 @@ | |||
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 <qfiledialog.h> |
26 | #include <qlayout.h> | 26 | #include <qlayout.h> |
27 | #include <qvbox.h> | 27 | #include <qvbox.h> |
28 | #include <qbuttongroup.h> | 28 | #include <qbuttongroup.h> |
29 | #include <qvgroupbox.h> | 29 | #include <qvgroupbox.h> |
30 | #include <qwidgetstack.h> | 30 | #include <qwidgetstack.h> |
31 | #include <qdatetime.h> | 31 | #include <qdatetime.h> |
32 | #include <qapp.h> | 32 | #include <qapp.h> |
33 | 33 | ||
34 | #include <klocale.h> | 34 | #include <klocale.h> |
35 | #include <kglobal.h> | 35 | #include <kglobal.h> |
36 | #include <kiconloader.h> | 36 | #include <kiconloader.h> |
37 | #include <kstandarddirs.h> | 37 | #include <kstandarddirs.h> |
38 | #include <kmessagebox.h> | 38 | #include <kmessagebox.h> |
39 | #ifndef KORG_NOKABC | 39 | #ifndef KORG_NOKABC |
40 | 40 | ||
41 | #ifdef DESKTOP_VERSION | 41 | #ifdef DESKTOP_VERSION |
42 | #include <kabc/addresseedialog.h> | 42 | #include <kabc/addresseedialog.h> |
43 | #else //DESKTOP_VERSION | 43 | #else //DESKTOP_VERSION |
44 | #include <externalapphandler.h> | 44 | #include <externalapphandler.h> |
45 | #endif //DESKTOP_VERSION | 45 | #endif //DESKTOP_VERSION |
46 | 46 | ||
47 | #endif | 47 | #endif |
48 | 48 | ||
49 | #include <libkcal/incidence.h> | 49 | #include <libkcal/incidence.h> |
50 | 50 | ||
51 | #include "koprefs.h" | 51 | #include "koprefs.h" |
52 | 52 | ||
53 | #include "koeditordetails.h" | 53 | #include "koeditordetails.h" |
54 | 54 | ||
55 | template <> | 55 | template <> |
56 | CustomListViewItem<class Attendee *>::~CustomListViewItem() | 56 | CustomListViewItem<class Attendee *>::~CustomListViewItem() |
57 | { | 57 | { |
58 | delete mData; | 58 | delete mData; |
59 | } | 59 | } |
60 | 60 | ||
61 | template <> | 61 | template <> |
62 | void CustomListViewItem<class Attendee *>::updateItem() | 62 | void CustomListViewItem<class Attendee *>::updateItem() |
63 | { | 63 | { |
64 | setText(0,mData->name()); | 64 | setText(0,mData->name()); |
65 | setText(1,mData->email()); | 65 | setText(1,mData->email()); |
66 | setText(2,mData->roleStr()); | 66 | setText(2,mData->roleStr()); |
67 | setText(3,mData->statusStr()); | 67 | setText(3,mData->statusStr()); |
68 | if (mData->RSVP() && !mData->email().isEmpty()) | 68 | if (mData->RSVP() && !mData->email().isEmpty()) |
69 | setPixmap(4,SmallIcon("mailappt")); | 69 | setPixmap(4,SmallIcon("mailappt")); |
70 | else | 70 | else |
71 | setPixmap(4,SmallIcon("nomailappt")); | 71 | setPixmap(4,SmallIcon("nomailappt")); |
72 | } | 72 | } |
73 | 73 | ||
74 | 74 | ||
75 | KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) | 75 | KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) |
76 | : QWidget( parent, name), mDisableItemUpdate( false ) | 76 | : QWidget( parent, name), mDisableItemUpdate( false ) |
77 | { | 77 | { |
78 | QGridLayout *topLayout = new QGridLayout(this); | 78 | QGridLayout *topLayout = new QGridLayout(this); |
79 | topLayout->setSpacing(spacing); | 79 | topLayout->setSpacing(spacing); |
80 | 80 | ||
81 | QString organizer = KOPrefs::instance()->email(); | 81 | QString organizer = KOPrefs::instance()->email(); |
82 | mOrganizerLabel = new QLabel(i18n("Organizer: %1").arg(organizer),this); | 82 | mOrganizerLabel = new QLabel(i18n("Organizer: %1").arg(organizer),this); |
83 | 83 | ||
84 | mListView = new KListView(this,"mListView"); | 84 | mListView = new KListView(this,"mListView"); |
85 | mListView->addColumn(i18n("Name"),180); | 85 | mListView->addColumn(i18n("Name"),180); |
86 | mListView->addColumn(i18n("Email"),180); | 86 | mListView->addColumn(i18n("Email"),180); |
87 | mListView->addColumn(i18n("Role"),60); | 87 | mListView->addColumn(i18n("Role"),60); |
88 | mListView->addColumn(i18n("Status"),100); | 88 | mListView->addColumn(i18n("Status"),100); |
89 | mListView->addColumn(i18n("RSVP"),35); | 89 | mListView->addColumn(i18n("RSVP"),35); |
90 | if ( KOPrefs::instance()->mCompactDialogs ) { | 90 | if ( QApplication::desktop()->width() <= 320 ) { |
91 | //mListView->setFixedHeight(78); | 91 | //mListView->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding) ); |
92 | mListView->setFixedHeight(80); | ||
92 | } | 93 | } |
93 | mListView->setAllColumnsShowFocus (true ); | 94 | mListView->setAllColumnsShowFocus (true ); |
94 | //mListView->setSingleClick( true ); | 95 | //mListView->setSingleClick( true ); |
95 | connect(mListView,SIGNAL(selectionChanged(QListViewItem *)), | 96 | connect(mListView,SIGNAL(selectionChanged(QListViewItem *)), |
96 | SLOT(updateAttendeeInput())); | 97 | SLOT(updateAttendeeInput())); |
97 | 98 | ||
98 | connect(mListView,SIGNAL(executed(QListViewItem * ,const QPoint&, int )), | 99 | connect(mListView,SIGNAL(executed(QListViewItem * ,const QPoint&, int )), |
99 | SLOT(itemClicked(QListViewItem * ,const QPoint& , int ))); | 100 | SLOT(itemClicked(QListViewItem * ,const QPoint& , int ))); |
100 | 101 | ||
101 | mRsvpButton = new QCheckBox(this); | 102 | mRsvpButton = new QCheckBox(this); |
102 | mRsvpButton->setText(i18n("Request response")); | 103 | mRsvpButton->setText(i18n("Request response")); |
103 | mAddressBookButton = new QPushButton(i18n("Address &Book..."),this); | 104 | mAddressBookButton = new QPushButton(i18n("Address &Book..."),this); |
104 | QLabel *attendeeLabel = new QLabel(this); | 105 | QLabel *attendeeLabel = new QLabel(this); |
105 | attendeeLabel->setText(i18n("Name:")); | 106 | attendeeLabel->setText(i18n("Name:")); |
106 | attendeeLabel->setFixedSize( attendeeLabel->sizeHint() ); | 107 | attendeeLabel->setFixedSize( attendeeLabel->sizeHint() ); |
107 | mNameEdit = new QLineEdit(this); | 108 | mNameEdit = new QLineEdit(this); |
108 | connect(mNameEdit,SIGNAL(textChanged(const QString &)), | 109 | connect(mNameEdit,SIGNAL(textChanged(const QString &)), |
109 | SLOT(updateAttendeeItem())); | 110 | SLOT(updateAttendeeItem())); |
110 | 111 | ||
111 | mUidEdit = new QLineEdit(0); | 112 | mUidEdit = new QLineEdit(0); |
112 | mUidEdit->setText(""); | 113 | mUidEdit->setText(""); |
113 | 114 | ||
114 | QLabel *emailLabel = new QLabel(this); | 115 | QLabel *emailLabel = new QLabel(this); |
115 | emailLabel->setText(i18n("Email:")); | 116 | emailLabel->setText(i18n("Email:")); |
116 | mEmailEdit = new QLineEdit(this); | 117 | mEmailEdit = new QLineEdit(this); |
117 | connect(mEmailEdit,SIGNAL(textChanged(const QString &)), | 118 | connect(mEmailEdit,SIGNAL(textChanged(const QString &)), |
118 | SLOT(updateAttendeeItem())); | 119 | SLOT(updateAttendeeItem())); |
119 | 120 | ||
120 | QLabel *attendeeRoleLabel = new QLabel(this); | 121 | QLabel *attendeeRoleLabel = new QLabel(this); |
121 | attendeeRoleLabel->setText(i18n("Role:")); | 122 | attendeeRoleLabel->setText(i18n("Role:")); |
122 | mRoleCombo = new QComboBox(false,this); | 123 | mRoleCombo = new QComboBox(false,this); |
123 | mRoleCombo->insertStringList(Attendee::roleList()); | 124 | mRoleCombo->insertStringList(Attendee::roleList()); |
124 | connect(mRoleCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); | 125 | connect(mRoleCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); |
125 | 126 | ||
126 | QLabel *statusLabel = new QLabel(this); | 127 | QLabel *statusLabel = new QLabel(this); |
127 | statusLabel->setText( i18n("Status:") ); | 128 | statusLabel->setText( i18n("Status:") ); |
128 | 129 | ||
129 | mStatusCombo = new QComboBox(false,this); | 130 | mStatusCombo = new QComboBox(false,this); |
130 | mStatusCombo->insertStringList(Attendee::statusList()); | 131 | mStatusCombo->insertStringList(Attendee::statusList()); |
131 | connect(mStatusCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); | 132 | connect(mStatusCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); |
132 | 133 | ||
133 | 134 | ||
134 | connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem())); | 135 | connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem())); |
135 | QWidget *buttonBox = new QWidget(this); | 136 | QWidget *buttonBox = new QWidget(this); |
136 | QVBoxLayout *buttonLayout = new QVBoxLayout(buttonBox); | 137 | QVBoxLayout *buttonLayout = new QVBoxLayout(buttonBox); |
137 | 138 | ||
138 | QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox); | 139 | QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox); |
139 | buttonLayout->addWidget(newButton); | 140 | buttonLayout->addWidget(newButton); |
140 | connect(newButton,SIGNAL(clicked()),SLOT(addNewAttendee())); | 141 | connect(newButton,SIGNAL(clicked()),SLOT(addNewAttendee())); |
141 | 142 | ||
142 | mRemoveButton = new QPushButton(i18n("&Remove"),buttonBox); | 143 | mRemoveButton = new QPushButton(i18n("&Remove"),buttonBox); |
143 | buttonLayout->addWidget(mRemoveButton); | 144 | buttonLayout->addWidget(mRemoveButton); |
144 | connect(mRemoveButton, SIGNAL(clicked()),SLOT(removeAttendee())); | 145 | connect(mRemoveButton, SIGNAL(clicked()),SLOT(removeAttendee())); |
145 | 146 | ||
146 | // buttonLayout->addWidget(mAddressBookButton); | 147 | // buttonLayout->addWidget(mAddressBookButton); |
147 | connect(mAddressBookButton,SIGNAL(clicked()),SLOT(openAddressBook())); | 148 | connect(mAddressBookButton,SIGNAL(clicked()),SLOT(openAddressBook())); |
148 | //mRoleCombo->setFixedSize( mRoleCombo->sizeHint () ); | 149 | //mRoleCombo->setFixedSize( mRoleCombo->sizeHint () ); |
149 | 150 | ||
150 | if (qApp->desktop()->width() < 640 ) { | 151 | if (qApp->desktop()->width() < 640 ) { |
151 | if ( qApp->desktop()->width() < 300 ) | 152 | if ( qApp->desktop()->width() < 300 ) |
152 | topLayout->setSpacing(1); | 153 | topLayout->setSpacing(1); |
153 | ;//mListView->setFixedHeight(80); | 154 | ;//mListView->setFixedHeight(80); |
154 | topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,3); | 155 | topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,3); |
155 | topLayout->addMultiCellWidget(mListView,1,1,0,3); | 156 | topLayout->addMultiCellWidget(mListView,1,1,0,3); |
156 | topLayout->addWidget(attendeeLabel,3,0); | 157 | topLayout->addWidget(attendeeLabel,3,0); |
157 | topLayout->addMultiCellWidget(mNameEdit,3,3,1,2); | 158 | topLayout->addMultiCellWidget(mNameEdit,3,3,1,2); |
158 | topLayout->addWidget(emailLabel,4,0); | 159 | topLayout->addWidget(emailLabel,4,0); |
159 | topLayout->addMultiCellWidget(mEmailEdit,4,4,1,2); | 160 | topLayout->addMultiCellWidget(mEmailEdit,4,4,1,2); |
160 | topLayout->addWidget(attendeeRoleLabel,5,0); | 161 | topLayout->addWidget(attendeeRoleLabel,5,0); |
161 | topLayout->addMultiCellWidget(mRoleCombo,5,5,1,3); | 162 | topLayout->addMultiCellWidget(mRoleCombo,5,5,1,3); |
162 | topLayout->addWidget(statusLabel,6,0); | 163 | topLayout->addWidget(statusLabel,6,0); |
163 | topLayout->addMultiCellWidget(mStatusCombo,6,6,1,3); | 164 | topLayout->addMultiCellWidget(mStatusCombo,6,6,1,3); |
164 | topLayout->addMultiCellWidget(mAddressBookButton,2,2,2,3); | 165 | topLayout->addMultiCellWidget(mAddressBookButton,2,2,2,3); |
165 | topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1); | 166 | topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1); |
166 | topLayout->addMultiCellWidget(buttonBox,3,4,3,3); | 167 | topLayout->addMultiCellWidget(buttonBox,3,4,3,3); |
167 | topLayout->setRowStretch(1,2); | 168 | topLayout->setRowStretch(1,2); |
168 | topLayout->setColStretch(0,0); | 169 | topLayout->setColStretch(0,0); |
169 | topLayout->setColStretch(1,2); | 170 | topLayout->setColStretch(1,2); |
170 | topLayout->setColStretch(2,1); | 171 | topLayout->setColStretch(2,1); |
171 | topLayout->setColStretch(3,1); | 172 | topLayout->setColStretch(3,1); |
172 | 173 | ||
173 | } else { | 174 | } else { |
174 | topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,5); | 175 | topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,5); |
175 | topLayout->addMultiCellWidget(mListView,1,1,0,5); | 176 | topLayout->addMultiCellWidget(mListView,1,1,0,5); |
176 | topLayout->addWidget(attendeeLabel,3,0); | 177 | topLayout->addWidget(attendeeLabel,3,0); |
177 | topLayout->addMultiCellWidget(mNameEdit,3,3,1,4); | 178 | topLayout->addMultiCellWidget(mNameEdit,3,3,1,4); |
178 | topLayout->addWidget(emailLabel,4,0); | 179 | topLayout->addWidget(emailLabel,4,0); |
179 | topLayout->addMultiCellWidget(mEmailEdit,4,4,1,4); | 180 | topLayout->addMultiCellWidget(mEmailEdit,4,4,1,4); |
180 | topLayout->addWidget(attendeeRoleLabel,5,0); | 181 | topLayout->addWidget(attendeeRoleLabel,5,0); |
181 | topLayout->addMultiCellWidget(mRoleCombo,5,5,1,2); | 182 | topLayout->addMultiCellWidget(mRoleCombo,5,5,1,2); |
182 | topLayout->addWidget(statusLabel,5,3); | 183 | topLayout->addWidget(statusLabel,5,3); |
183 | topLayout->addMultiCellWidget(mStatusCombo,5,5,4,5); | 184 | topLayout->addMultiCellWidget(mStatusCombo,5,5,4,5); |
184 | topLayout->addMultiCellWidget(mAddressBookButton,2,2,4,5); | 185 | topLayout->addMultiCellWidget(mAddressBookButton,2,2,4,5); |
185 | topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1); | 186 | topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1); |
186 | topLayout->addMultiCellWidget(buttonBox,3,4,5,5); | 187 | topLayout->addMultiCellWidget(buttonBox,3,4,5,5); |
187 | topLayout->setRowStretch(1,5); | 188 | topLayout->setRowStretch(1,5); |