-rw-r--r-- | korganizer/koeditordetails.cpp | 39 | ||||
-rw-r--r-- | korganizer/koeditordetails.h | 7 |
2 files changed, 43 insertions, 3 deletions
diff --git a/korganizer/koeditordetails.cpp b/korganizer/koeditordetails.cpp index c0e7bdd..8e2fabe 100644 --- a/korganizer/koeditordetails.cpp +++ b/korganizer/koeditordetails.cpp | |||
@@ -38,5 +38,11 @@ | |||
38 | #include <kmessagebox.h> | 38 | #include <kmessagebox.h> |
39 | #ifndef KORG_NOKABC | 39 | #ifndef KORG_NOKABC |
40 | |||
41 | #ifdef DESKTOP_VERSION | ||
40 | #include <kabc/addresseedialog.h> | 42 | #include <kabc/addresseedialog.h> |
43 | #else //DESKTOP_VERSION | ||
44 | #include <externalapphandler.h> | ||
45 | #endif //DESKTOP_VERSION | ||
46 | |||
41 | #endif | 47 | #endif |
42 | 48 | ||
@@ -85,5 +91,5 @@ KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) | |||
85 | //mListView->setFixedHeight(78); | 91 | //mListView->setFixedHeight(78); |
86 | } | 92 | } |
87 | 93 | ||
88 | connect(mListView,SIGNAL(selectionChanged(QListViewItem *)), | 94 | connect(mListView,SIGNAL(selectionChanged(QListViewItem *)), |
89 | SLOT(updateAttendeeInput())); | 95 | SLOT(updateAttendeeInput())); |
@@ -196,4 +202,9 @@ KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) | |||
196 | 202 | ||
197 | updateAttendeeInput(); | 203 | updateAttendeeInput(); |
204 | |||
205 | //US listen for arriving address resultsets | ||
206 | connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), | ||
207 | this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); | ||
208 | |||
198 | } | 209 | } |
199 | 210 | ||
@@ -222,4 +233,5 @@ void KOEditorDetails::openAddressBook() | |||
222 | #ifndef KORG_NOKABC | 233 | #ifndef KORG_NOKABC |
223 | 234 | ||
235 | #ifdef DESKTOP_VERSION | ||
224 | KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); | 236 | KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); |
225 | uint i=0; | 237 | uint i=0; |
@@ -227,5 +239,10 @@ void KOEditorDetails::openAddressBook() | |||
227 | insertAttendee( new Attendee( list[i].realName(), list[i].preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,list[i].uid()) ); | 239 | insertAttendee( new Attendee( list[i].realName(), list[i].preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,list[i].uid()) ); |
228 | } | 240 | } |
229 | 241 | #else | |
242 | bool res = ExternalAppHandler::instance()->requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); | ||
243 | // the result should now arrive through method insertAttendees | ||
244 | #endif | ||
245 | |||
246 | |||
230 | #if 0 | 247 | #if 0 |
231 | KABC::Addressee a = KABC::AddresseeDialog::getAddressee(this); | 248 | KABC::Addressee a = KABC::AddresseeDialog::getAddressee(this); |
@@ -264,4 +281,22 @@ void KOEditorDetails::addNewAttendee() | |||
264 | } | 281 | } |
265 | 282 | ||
283 | //the map includes name/email pairs, that comes from Ka/Pi | ||
284 | void KOEditorDetails::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList) | ||
285 | { | ||
286 | if (uid == this->name()) | ||
287 | { | ||
288 | for ( int i = 0; i < nameList.count(); i++) | ||
289 | { | ||
290 | QString _name = nameList[i]; | ||
291 | QString _email = emailList[i]; | ||
292 | QString _uid = uidList[i]; | ||
293 | |||
294 | Attendee *a = new Attendee(_name,_email,false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant, _uid); | ||
295 | insertAttendee(a); | ||
296 | } | ||
297 | } | ||
298 | |||
299 | } | ||
300 | |||
266 | 301 | ||
267 | void KOEditorDetails::insertAttendee(Attendee *a) | 302 | void KOEditorDetails::insertAttendee(Attendee *a) |
diff --git a/korganizer/koeditordetails.h b/korganizer/koeditordetails.h index 930b296..0cc807f 100644 --- a/korganizer/koeditordetails.h +++ b/korganizer/koeditordetails.h | |||
@@ -24,4 +24,5 @@ | |||
24 | #define _KOEDITORDETAILS_H | 24 | #define _KOEDITORDETAILS_H |
25 | 25 | ||
26 | #include <qmap.h> | ||
26 | #include <qframe.h> | 27 | #include <qframe.h> |
27 | #include <qlabel.h> | 28 | #include <qlabel.h> |
@@ -71,4 +72,8 @@ class KOEditorDetails : public QWidget | |||
71 | public slots: | 72 | public slots: |
72 | void insertAttendee(Attendee *); | 73 | void insertAttendee(Attendee *); |
74 | // called when the app recieves a list of name/email/uid (=addresses) from another app. Usually Ka/Pi | ||
75 | // The first parameter is a uniqueid. It can be used to identify if event | ||
76 | void insertAttendees(const QString&, const QStringList& namelist, const QStringList& emaillist, const QStringList& uidlist); | ||
77 | |||
73 | 78 | ||
74 | protected slots: | 79 | protected slots: |
@@ -97,5 +102,5 @@ class KOEditorDetails : public QWidget | |||
97 | QPushButton* mRemoveButton; | 102 | QPushButton* mRemoveButton; |
98 | QPushButton* mAddressBookButton; | 103 | QPushButton* mAddressBookButton; |
99 | 104 | ||
100 | QPtrList<Attendee> mdelAttendees; | 105 | QPtrList<Attendee> mdelAttendees; |
101 | }; | 106 | }; |