Diffstat (limited to 'korganizer/koeditordetails.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | korganizer/koeditordetails.cpp | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/korganizer/koeditordetails.cpp b/korganizer/koeditordetails.cpp index 802261c..bdfc637 100644 --- a/korganizer/koeditordetails.cpp +++ b/korganizer/koeditordetails.cpp | |||
@@ -67,50 +67,52 @@ void CustomListViewItem<class Attendee *>::updateItem() | |||
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 ( QApplication::desktop()->width() <= 320 ) { | 90 | if ( QApplication::desktop()->width() <= 320 ) { |
91 | //mListView->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding) ); | 91 | int hei = 80; |
92 | mListView->setFixedHeight(80); | 92 | if ( QApplication::desktop()->height() <= 240 ) |
93 | hei = 60; | ||
94 | mListView->setFixedHeight(hei); | ||
93 | } | 95 | } |
94 | mListView->setAllColumnsShowFocus (true ); | 96 | mListView->setAllColumnsShowFocus (true ); |
95 | //mListView->setSingleClick( true ); | 97 | //mListView->setSingleClick( true ); |
96 | connect(mListView,SIGNAL(selectionChanged(QListViewItem *)), | 98 | connect(mListView,SIGNAL(selectionChanged(QListViewItem *)), |
97 | SLOT(updateAttendeeInput())); | 99 | SLOT(updateAttendeeInput())); |
98 | 100 | ||
99 | connect(mListView,SIGNAL(executed(QListViewItem * ,const QPoint&, int )), | 101 | connect(mListView,SIGNAL(executed(QListViewItem * ,const QPoint&, int )), |
100 | SLOT(itemClicked(QListViewItem * ,const QPoint& , int ))); | 102 | SLOT(itemClicked(QListViewItem * ,const QPoint& , int ))); |
101 | 103 | ||
102 | mRsvpButton = new QCheckBox(this); | 104 | mRsvpButton = new QCheckBox(this); |
103 | mRsvpButton->setText(i18n("Request response")); | 105 | mRsvpButton->setText(i18n("Request response")); |
104 | mAddressBookButton = new QPushButton(i18n("Address &Book..."),this); | 106 | mAddressBookButton = new QPushButton(i18n("Address &Book..."),this); |
105 | QLabel *attendeeLabel = new QLabel(this); | 107 | QLabel *attendeeLabel = new QLabel(this); |
106 | attendeeLabel->setText(i18n("Name:")); | 108 | attendeeLabel->setText(i18n("Name:")); |
107 | attendeeLabel->setFixedSize( attendeeLabel->sizeHint() ); | 109 | attendeeLabel->setFixedSize( attendeeLabel->sizeHint() ); |
108 | mNameEdit = new QLineEdit(this); | 110 | mNameEdit = new QLineEdit(this); |
109 | connect(mNameEdit,SIGNAL(textChanged(const QString &)), | 111 | connect(mNameEdit,SIGNAL(textChanged(const QString &)), |
110 | SLOT(updateAttendeeItem())); | 112 | SLOT(updateAttendeeItem())); |
111 | 113 | ||
112 | mUidEdit = new QLineEdit(0); | 114 | mUidEdit = new QLineEdit(0); |
113 | mUidEdit->setText(""); | 115 | mUidEdit->setText(""); |
114 | 116 | ||
115 | QLabel *emailLabel = new QLabel(this); | 117 | QLabel *emailLabel = new QLabel(this); |
116 | emailLabel->setText(i18n("Email:")); | 118 | emailLabel->setText(i18n("Email:")); |
@@ -126,89 +128,107 @@ KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) | |||
126 | 128 | ||
127 | QLabel *statusLabel = new QLabel(this); | 129 | QLabel *statusLabel = new QLabel(this); |
128 | statusLabel->setText( i18n("Status:") ); | 130 | statusLabel->setText( i18n("Status:") ); |
129 | 131 | ||
130 | mStatusCombo = new QComboBox(false,this); | 132 | mStatusCombo = new QComboBox(false,this); |
131 | mStatusCombo->insertStringList(Attendee::statusList()); | 133 | mStatusCombo->insertStringList(Attendee::statusList()); |
132 | connect(mStatusCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); | 134 | connect(mStatusCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); |
133 | 135 | ||
134 | 136 | ||
135 | connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem())); | 137 | connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem())); |
136 | QWidget *buttonBox = new QWidget(this); | 138 | QWidget *buttonBox = new QWidget(this); |
137 | QVBoxLayout *buttonLayout = new QVBoxLayout(buttonBox); | 139 | QVBoxLayout *buttonLayout = new QVBoxLayout(buttonBox); |
138 | 140 | ||
139 | QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox); | 141 | QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox); |
140 | buttonLayout->addWidget(newButton); | 142 | buttonLayout->addWidget(newButton); |
141 | connect(newButton,SIGNAL(clicked()),SLOT(addNewAttendee())); | 143 | connect(newButton,SIGNAL(clicked()),SLOT(addNewAttendee())); |
142 | 144 | ||
143 | mRemoveButton = new QPushButton(i18n("&Remove"),buttonBox); | 145 | mRemoveButton = new QPushButton(i18n("&Remove"),buttonBox); |
144 | buttonLayout->addWidget(mRemoveButton); | 146 | buttonLayout->addWidget(mRemoveButton); |
145 | connect(mRemoveButton, SIGNAL(clicked()),SLOT(removeAttendee())); | 147 | connect(mRemoveButton, SIGNAL(clicked()),SLOT(removeAttendee())); |
146 | 148 | ||
147 | // buttonLayout->addWidget(mAddressBookButton); | 149 | // buttonLayout->addWidget(mAddressBookButton); |
148 | connect(mAddressBookButton,SIGNAL(clicked()),SLOT(openAddressBook())); | 150 | connect(mAddressBookButton,SIGNAL(clicked()),SLOT(openAddressBook())); |
149 | //mRoleCombo->setFixedSize( mRoleCombo->sizeHint () ); | 151 | //mRoleCombo->setFixedSize( mRoleCombo->sizeHint () ); |
150 | 152 | if ( QApplication::desktop()->height() <= 240 ) { | |
153 | mRoleCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Minimum ,FALSE) ); | ||
154 | mStatusCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Minimum ,FALSE) ); | ||
155 | topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,5); | ||
156 | topLayout->addMultiCellWidget(mListView,1,1,0,5); | ||
157 | topLayout->addWidget(attendeeLabel,3,0); | ||
158 | topLayout->addMultiCellWidget(mNameEdit,3,3,1,4); | ||
159 | topLayout->addWidget(emailLabel,4,0); | ||
160 | topLayout->addMultiCellWidget(mEmailEdit,4,4,1,4); | ||
161 | topLayout->addWidget(attendeeRoleLabel,5,0); | ||
162 | topLayout->addMultiCellWidget(mRoleCombo,5,5,1,2); | ||
163 | topLayout->addWidget(statusLabel,5,3); | ||
164 | topLayout->addMultiCellWidget(mStatusCombo,5,5,4,5); | ||
165 | topLayout->addMultiCellWidget(mAddressBookButton,2,2,2,5); | ||
166 | topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1); | ||
167 | topLayout->addMultiCellWidget(buttonBox,3,4,5,5); | ||
168 | topLayout->setRowStretch(1,5); | ||
169 | topLayout->setColStretch(0,0); | ||
170 | } else { | ||
151 | if (qApp->desktop()->width() < 640 ) { | 171 | if (qApp->desktop()->width() < 640 ) { |
152 | if ( qApp->desktop()->width() < 300 ) | 172 | if ( qApp->desktop()->width() < 300 ) |
153 | topLayout->setSpacing(1); | 173 | topLayout->setSpacing(1); |
154 | ;//mListView->setFixedHeight(80); | 174 | ;//mListView->setFixedHeight(80); |
155 | topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,3); | 175 | topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,3); |
156 | topLayout->addMultiCellWidget(mListView,1,1,0,3); | 176 | topLayout->addMultiCellWidget(mListView,1,1,0,3); |
157 | topLayout->addWidget(attendeeLabel,3,0); | 177 | topLayout->addWidget(attendeeLabel,3,0); |
158 | topLayout->addMultiCellWidget(mNameEdit,3,3,1,2); | 178 | topLayout->addMultiCellWidget(mNameEdit,3,3,1,2); |
159 | topLayout->addWidget(emailLabel,4,0); | 179 | topLayout->addWidget(emailLabel,4,0); |
160 | topLayout->addMultiCellWidget(mEmailEdit,4,4,1,2); | 180 | topLayout->addMultiCellWidget(mEmailEdit,4,4,1,2); |
161 | topLayout->addWidget(attendeeRoleLabel,5,0); | 181 | topLayout->addWidget(attendeeRoleLabel,5,0); |
162 | topLayout->addMultiCellWidget(mRoleCombo,5,5,1,3); | 182 | topLayout->addMultiCellWidget(mRoleCombo,5,5,1,3); |
163 | topLayout->addWidget(statusLabel,6,0); | 183 | topLayout->addWidget(statusLabel,6,0); |
164 | topLayout->addMultiCellWidget(mStatusCombo,6,6,1,3); | 184 | topLayout->addMultiCellWidget(mStatusCombo,6,6,1,3); |
165 | topLayout->addMultiCellWidget(mAddressBookButton,2,2,2,3); | 185 | topLayout->addMultiCellWidget(mAddressBookButton,2,2,2,3); |
166 | topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1); | 186 | topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1); |
167 | topLayout->addMultiCellWidget(buttonBox,3,4,3,3); | 187 | topLayout->addMultiCellWidget(buttonBox,3,4,3,3); |
168 | topLayout->setRowStretch(1,2); | 188 | topLayout->setRowStretch(1,2); |
169 | topLayout->setColStretch(0,0); | 189 | topLayout->setColStretch(0,0); |
170 | topLayout->setColStretch(1,2); | 190 | topLayout->setColStretch(1,2); |
171 | topLayout->setColStretch(2,1); | 191 | topLayout->setColStretch(2,1); |
172 | topLayout->setColStretch(3,1); | 192 | topLayout->setColStretch(3,1); |
173 | |||
174 | } else { | 193 | } else { |
175 | topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,5); | 194 | topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,5); |
176 | topLayout->addMultiCellWidget(mListView,1,1,0,5); | 195 | topLayout->addMultiCellWidget(mListView,1,1,0,5); |
177 | topLayout->addWidget(attendeeLabel,3,0); | 196 | topLayout->addWidget(attendeeLabel,3,0); |
178 | topLayout->addMultiCellWidget(mNameEdit,3,3,1,4); | 197 | topLayout->addMultiCellWidget(mNameEdit,3,3,1,4); |
179 | topLayout->addWidget(emailLabel,4,0); | 198 | topLayout->addWidget(emailLabel,4,0); |
180 | topLayout->addMultiCellWidget(mEmailEdit,4,4,1,4); | 199 | topLayout->addMultiCellWidget(mEmailEdit,4,4,1,4); |
181 | topLayout->addWidget(attendeeRoleLabel,5,0); | 200 | topLayout->addWidget(attendeeRoleLabel,5,0); |
182 | topLayout->addMultiCellWidget(mRoleCombo,5,5,1,2); | 201 | topLayout->addMultiCellWidget(mRoleCombo,5,5,1,2); |
183 | topLayout->addWidget(statusLabel,5,3); | 202 | topLayout->addWidget(statusLabel,5,3); |
184 | topLayout->addMultiCellWidget(mStatusCombo,5,5,4,5); | 203 | topLayout->addMultiCellWidget(mStatusCombo,5,5,4,5); |
185 | topLayout->addMultiCellWidget(mAddressBookButton,2,2,4,5); | 204 | topLayout->addMultiCellWidget(mAddressBookButton,2,2,4,5); |
186 | topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1); | 205 | topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1); |
187 | topLayout->addMultiCellWidget(buttonBox,3,4,5,5); | 206 | topLayout->addMultiCellWidget(buttonBox,3,4,5,5); |
188 | topLayout->setRowStretch(1,5); | 207 | topLayout->setRowStretch(1,5); |
189 | topLayout->setColStretch(0,0); | 208 | topLayout->setColStretch(0,0); |
190 | } | 209 | } |
210 | } | ||
191 | // #if 0 | 211 | // #if 0 |
192 | // topLayout->setColStretch(2,1); | 212 | // topLayout->setColStretch(2,1); |
193 | // topLayout->addWidget(statusLabel,3,3); | 213 | // topLayout->addWidget(statusLabel,3,3); |
194 | // topLayout->addWidget(mStatusCombo,3,4); | 214 | // topLayout->addWidget(mStatusCombo,3,4); |
195 | // #else | 215 | // #else |
196 | // topLayout->addWidget(statusLabel,4,3); | 216 | // topLayout->addWidget(statusLabel,4,3); |
197 | // // topLayout->addWidget(mStatusCombo,4,3); | 217 | // // topLayout->addWidget(mStatusCombo,4,3); |
198 | // topLayout->addMultiCellWidget(mStatusCombo,4,4,4,5); | 218 | // topLayout->addMultiCellWidget(mStatusCombo,4,4,4,5); |
199 | 219 | ||
200 | // #endif | 220 | // #endif |
201 | // // topLayout->setRowStretch(5,1); | 221 | // // topLayout->setRowStretch(5,1); |
202 | // topLayout->addMultiCellWidget(mRsvpButton,5,5,0,1); | 222 | // topLayout->addMultiCellWidget(mRsvpButton,5,5,0,1); |
203 | // topLayout->addMultiCellWidget(buttonBox,2,3,5,5); | 223 | // topLayout->addMultiCellWidget(buttonBox,2,3,5,5); |
204 | // topLayout->setRowStretch(1,5); | 224 | // topLayout->setRowStretch(1,5); |
205 | // topLayout->setColStretch(0,0); | 225 | // topLayout->setColStretch(0,0); |
206 | 226 | ||
207 | #ifdef KORG_NOKABC | 227 | #ifdef KORG_NOKABC |
208 | mAddressBookButton->hide(); | 228 | mAddressBookButton->hide(); |
209 | #endif | 229 | #endif |
210 | 230 | ||
211 | updateAttendeeInput(); | 231 | updateAttendeeInput(); |
212 | #ifndef DESKTOP_VERSION | 232 | #ifndef DESKTOP_VERSION |
213 | //US listen for arriving address resultsets | 233 | //US listen for arriving address resultsets |
214 | connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), | 234 | connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), |