author | zautrix <zautrix> | 2005-02-04 10:23:55 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-04 10:23:55 (UTC) |
commit | 83256090c493dab56f1afba4829e864598bf70d2 (patch) (unidiff) | |
tree | 8d5b7ee0c6fe42f0f14c53b80c924ccddd5a1599 | |
parent | a96872e5ecff3a8fb1785aff71f5f7f150ef8604 (diff) | |
download | kdepimpi-83256090c493dab56f1afba4829e864598bf70d2.zip kdepimpi-83256090c493dab56f1afba4829e864598bf70d2.tar.gz kdepimpi-83256090c493dab56f1afba4829e864598bf70d2.tar.bz2 |
mail send
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 3 | ||||
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 5 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 2 | ||||
-rw-r--r-- | kmicromail/composemail.cpp | 14 | ||||
-rw-r--r-- | kmicromail/opiemail.cpp | 33 | ||||
-rw-r--r-- | kmicromail/opiemail.h | 5 | ||||
-rw-r--r-- | korganizer/koeventviewer.cpp | 56 | ||||
-rw-r--r-- | korganizer/koeventviewer.h | 3 | ||||
-rw-r--r-- | libkdepim/externalapphandler.cpp | 1 |
9 files changed, 114 insertions, 8 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 8af7da2..e24ee43 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,57 +1,60 @@ | |||
1 | Info about the changes in new versions of KDE-Pim/Pi | 1 | Info about the changes in new versions of KDE-Pim/Pi |
2 | 2 | ||
3 | ********** VERSION 2.0.3 ************ | 3 | ********** VERSION 2.0.3 ************ |
4 | 4 | ||
5 | KO/Pi: | 5 | KO/Pi: |
6 | Added feature for changing alarm settings for many items at once: | 6 | Added feature for changing alarm settings for many items at once: |
7 | Open list view (or search dialog), select the desired items and choose in | 7 | Open list view (or search dialog), select the desired items and choose in |
8 | the popup menu: Set alarm for selected... | 8 | the popup menu: Set alarm for selected... |
9 | 9 | ||
10 | Added to the event/todo viewer the option to send an email to | ||
11 | all attendees or all selected (with RSVP) attendees. | ||
12 | |||
10 | ********** VERSION 2.0.2 ************ | 13 | ********** VERSION 2.0.2 ************ |
11 | 14 | ||
12 | KO/Pi: | 15 | KO/Pi: |
13 | Fixed the layout problem of the day label buttons | 16 | Fixed the layout problem of the day label buttons |
14 | of the agenda view introduced in version 2.0.1. | 17 | of the agenda view introduced in version 2.0.1. |
15 | 18 | ||
16 | Added WhatsThis support for the todo view and the list view. | 19 | Added WhatsThis support for the todo view and the list view. |
17 | 20 | ||
18 | Added a quite useful feature to the montview. | 21 | Added a quite useful feature to the montview. |
19 | Just click on the week numbers on the left. | 22 | Just click on the week numbers on the left. |
20 | And in the top right corner of month view/agenda view | 23 | And in the top right corner of month view/agenda view |
21 | there is now a "week number quick selector". | 24 | there is now a "week number quick selector". |
22 | (Click on the black triangle). | 25 | (Click on the black triangle). |
23 | 26 | ||
24 | Made the quite difficult timezone change in KO/Pi easy. | 27 | Made the quite difficult timezone change in KO/Pi easy. |
25 | 28 | ||
26 | OM/Pi: | 29 | OM/Pi: |
27 | Fixed too small icons on desktop. | 30 | Fixed too small icons on desktop. |
28 | Fixed non visible icons in mainwindow on Z with fastload enabled. | 31 | Fixed non visible icons in mainwindow on Z with fastload enabled. |
29 | Added signature file setting to smtp account config. | 32 | Added signature file setting to smtp account config. |
30 | And the signature can be edited and saved in the edit mail dialog. | 33 | And the signature can be edited and saved in the edit mail dialog. |
31 | That does mean: | 34 | That does mean: |
32 | Simply edit the signature for the selected smtp account in the | 35 | Simply edit the signature for the selected smtp account in the |
33 | edit new mail dialog and press the "save signature" button there. | 36 | edit new mail dialog and press the "save signature" button there. |
34 | Then the signature is saved to the file specified in the smtp account settings. | 37 | Then the signature is saved to the file specified in the smtp account settings. |
35 | If there is no file specified, it is saved automatically to the file | 38 | If there is no file specified, it is saved automatically to the file |
36 | kdepim/apps/kopiemail/<accountname>.sig. | 39 | kdepim/apps/kopiemail/<accountname>.sig. |
37 | 40 | ||
38 | 41 | ||
39 | 42 | ||
40 | ********** VERSION 2.0.1 ************ | 43 | ********** VERSION 2.0.1 ************ |
41 | 44 | ||
42 | Oooops ... I forgot to test on the Zaurus 5500 ... | 45 | Oooops ... I forgot to test on the Zaurus 5500 ... |
43 | 46 | ||
44 | Fixed many problems of new (english) strings (and german translations) | 47 | Fixed many problems of new (english) strings (and german translations) |
45 | introduced in the latest versions, where the text was not fitting on the | 48 | introduced in the latest versions, where the text was not fitting on the |
46 | 240x320 display of the Zaurus 5500. | 49 | 240x320 display of the Zaurus 5500. |
47 | 50 | ||
48 | KO/Pi: | 51 | KO/Pi: |
49 | Added a popup menu ( press pen and hold to get popup ) to the agenda view | 52 | Added a popup menu ( press pen and hold to get popup ) to the agenda view |
50 | with many useful items (add event/todo, show next week, two weeks, month, journal). | 53 | with many useful items (add event/todo, show next week, two weeks, month, journal). |
51 | 54 | ||
52 | Added items to the todolist popup menu for: | 55 | Added items to the todolist popup menu for: |
53 | Display all opened, all closed or all todos flat. | 56 | Display all opened, all closed or all todos flat. |
54 | The "flat" view makes is possible to sort all todos after ,e.g., prio or date. | 57 | The "flat" view makes is possible to sort all todos after ,e.g., prio or date. |
55 | Made the reparenting of todos on the desktop possible via Drag&Drop. | 58 | Made the reparenting of todos on the desktop possible via Drag&Drop. |
56 | Fixed several bugs in setting the completed datetime for todos. | 59 | Fixed several bugs in setting the completed datetime for todos. |
57 | Added info about completed datetime of todos to the todo viewer. | 60 | Added info about completed datetime of todos to the todo viewer. |
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 12b70a0..8c3b1e4 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1166,55 +1166,60 @@ | |||
1166 | { "Todo List","Todo Liste" }, | 1166 | { "Todo List","Todo Liste" }, |
1167 | { "&Title:","&Titel:" }, | 1167 | { "&Title:","&Titel:" }, |
1168 | { "Co&nnect subtodos with its parent","Verbinde Unter-Todos mit ihren Ober-Todos" }, | 1168 | { "Co&nnect subtodos with its parent","Verbinde Unter-Todos mit ihren Ober-Todos" }, |
1169 | { "Todo list","Todo Liste" }, | 1169 | { "Todo list","Todo Liste" }, |
1170 | { "&Print...","Drucke..." }, | 1170 | { "&Print...","Drucke..." }, |
1171 | { "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" }, | 1171 | { "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" }, |
1172 | { "[Unconfigured]","[Unkonfiguriert]" }, | 1172 | { "[Unconfigured]","[Unkonfiguriert]" }, |
1173 | { "OK","OK" }, | 1173 | { "OK","OK" }, |
1174 | { "FilterEditor","FilterEditor" }, | 1174 | { "FilterEditor","FilterEditor" }, |
1175 | { "Include","Inclusive" }, | 1175 | { "Include","Inclusive" }, |
1176 | { "Exclude","Exclusive" }, | 1176 | { "Exclude","Exclusive" }, |
1177 | { "Edit Selection...","Editiere Auswahl" }, | 1177 | { "Edit Selection...","Editiere Auswahl" }, |
1178 | { "recurring events","wiederholende Termine" }, | 1178 | { "recurring events","wiederholende Termine" }, |
1179 | { "recurr. events","wiederh.Termine" }, | 1179 | { "recurr. events","wiederh.Termine" }, |
1180 | { "completed to-dos","erledigte Todos" }, | 1180 | { "completed to-dos","erledigte Todos" }, |
1181 | { "events","Termine" }, | 1181 | { "events","Termine" }, |
1182 | { "todos","Todos" }, | 1182 | { "todos","Todos" }, |
1183 | { "journals","Journale" }, | 1183 | { "journals","Journale" }, |
1184 | { "public","öffentl." }, | 1184 | { "public","öffentl." }, |
1185 | { "private","privat" }, | 1185 | { "private","privat" }, |
1186 | { "confidential","vertraul." }, | 1186 | { "confidential","vertraul." }, |
1187 | { "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Unter-Todos.\nAlle erledigten Unter-Todos\nwerden auch gelöscht!" }, | 1187 | { "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Unter-Todos.\nAlle erledigten Unter-Todos\nwerden auch gelöscht!" }, |
1188 | { "Yesterday","Gestern" }, | 1188 | { "Yesterday","Gestern" }, |
1189 | { "Day after tomorrow","Übermorgen" }, | 1189 | { "Day after tomorrow","Übermorgen" }, |
1190 | { "Tomorrow","Morgen" }, | 1190 | { "Tomorrow","Morgen" }, |
1191 | { "Day before yesterday","Vorgestern" }, | 1191 | { "Day before yesterday","Vorgestern" }, |
1192 | { "Size %1","Größe %1" }, | 1192 | { "Size %1","Größe %1" }, |
1193 | { "New Agendasize: %1","Neue Agendagröße: %1" }, | 1193 | { "New Agendasize: %1","Neue Agendagröße: %1" }, |
1194 | { " (%1 y.)"," (%1 J.)" }, | 1194 | { " (%1 y.)"," (%1 J.)" }, |
1195 | { "Allday:","Ganztägig:" }, | 1195 | { "Allday:","Ganztägig:" }, |
1196 | { "compl.todos","erled.Todos" }, | 1196 | { "compl.todos","erled.Todos" }, |
1197 | { "Day view","Tagesansicht" }, | 1197 | { "Day view","Tagesansicht" }, |
1198 | { "Next days","Nächste Tage" }, | 1198 | { "Next days","Nächste Tage" }, |
1199 | { "Next week","Nächste Woche" }, | 1199 | { "Next week","Nächste Woche" }, |
1200 | { "Next two weeks","Nächste zwei Wochen" }, | 1200 | { "Next two weeks","Nächste zwei Wochen" }, |
1201 | { "Next month","Nächster Monat" }, | 1201 | { "Next month","Nächster Monat" }, |
1202 | { "Journal view","Journal" }, | 1202 | { "Journal view","Journal" }, |
1203 | { "Display all opened","Zeige alle geöffnet" }, | 1203 | { "Display all opened","Zeige alle geöffnet" }, |
1204 | { "Display all closed","Zeige alle geschlossen" }, | 1204 | { "Display all closed","Zeige alle geschlossen" }, |
1205 | { "Display all flat","Zeige alle flach" }, | 1205 | { "Display all flat","Zeige alle flach" }, |
1206 | { "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" }, | 1206 | { "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" }, |
1207 | { "Default todo done color:","Standard Todo erledigt Farbe" }, | 1207 | { "Default todo done color:","Standard Todo erledigt Farbe" }, |
1208 | { "Select week %1-%2","Selektiere Woche %1-%2" }, | 1208 | { "Select week %1-%2","Selektiere Woche %1-%2" }, |
1209 | { "Select Week","Selektiere Woche" }, | 1209 | { "Select Week","Selektiere Woche" }, |
1210 | { "Set alarm for selected...","Setze Alarm für Selekt..." }, | 1210 | { "Set alarm for selected...","Setze Alarm für Selekt..." }, |
1211 | { "Set reminder offset to:","Setze Alarm Offset auf:" }, | 1211 | { "Set reminder offset to:","Setze Alarm Offset auf:" }, |
1212 | { "Set Alarm!","Setze Alarm!" }, | 1212 | { "Set Alarm!","Setze Alarm!" }, |
1213 | { "Canged alarm for %1 items","Alarm für %1 Items geändert" }, | 1213 | { "Canged alarm for %1 items","Alarm für %1 Items geändert" }, |
1214 | { " and "," und " }, | ||
1215 | { "<IMG src="%1"> only )","nur <IMG src="%1"> )" }, | ||
1216 | { "Mail to selected","Mail an Ausgewählte" }, | ||
1217 | { "Mail to all","Mail an Alle" }, | ||
1218 | { "","" }, | ||
1214 | { "","" }, | 1219 | { "","" }, |
1215 | { "","" }, | 1220 | { "","" }, |
1216 | { "","" }, | 1221 | { "","" }, |
1217 | { "","" }, | 1222 | { "","" }, |
1218 | { "","" }, | 1223 | { "","" }, |
1219 | { "","" }, | 1224 | { "","" }, |
1220 | { "","" }, | 1225 | { "","" }, |
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 702eaa3..a8e4de5 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -2452,97 +2452,97 @@ void KABCore::updateActionMenu() | |||
2452 | mActionUndo->setEnabled( !undo->isEmpty() ); | 2452 | mActionUndo->setEnabled( !undo->isEmpty() ); |
2453 | 2453 | ||
2454 | if ( !redo->top() ) | 2454 | if ( !redo->top() ) |
2455 | mActionRedo->setText( i18n( "Redo" ) ); | 2455 | mActionRedo->setText( i18n( "Redo" ) ); |
2456 | else | 2456 | else |
2457 | mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); | 2457 | mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); |
2458 | 2458 | ||
2459 | mActionRedo->setEnabled( !redo->isEmpty() ); | 2459 | mActionRedo->setEnabled( !redo->isEmpty() ); |
2460 | } | 2460 | } |
2461 | 2461 | ||
2462 | void KABCore::configureKeyBindings() | 2462 | void KABCore::configureKeyBindings() |
2463 | { | 2463 | { |
2464 | #ifndef KAB_EMBEDDED | 2464 | #ifndef KAB_EMBEDDED |
2465 | KKeyDialog::configure( actionCollection(), true ); | 2465 | KKeyDialog::configure( actionCollection(), true ); |
2466 | #else //KAB_EMBEDDED | 2466 | #else //KAB_EMBEDDED |
2467 | qDebug("KABCore::configureKeyBindings() not implemented"); | 2467 | qDebug("KABCore::configureKeyBindings() not implemented"); |
2468 | #endif //KAB_EMBEDDED | 2468 | #endif //KAB_EMBEDDED |
2469 | } | 2469 | } |
2470 | 2470 | ||
2471 | #ifdef KAB_EMBEDDED | 2471 | #ifdef KAB_EMBEDDED |
2472 | void KABCore::configureResources() | 2472 | void KABCore::configureResources() |
2473 | { | 2473 | { |
2474 | KRES::KCMKResources dlg( this, "" , 0 ); | 2474 | KRES::KCMKResources dlg( this, "" , 0 ); |
2475 | 2475 | ||
2476 | if ( !dlg.exec() ) | 2476 | if ( !dlg.exec() ) |
2477 | return; | 2477 | return; |
2478 | KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); | 2478 | KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); |
2479 | } | 2479 | } |
2480 | #endif //KAB_EMBEDDED | 2480 | #endif //KAB_EMBEDDED |
2481 | 2481 | ||
2482 | 2482 | ||
2483 | /* this method will be called through the QCop interface from Ko/Pi to select addresses | 2483 | /* this method will be called through the QCop interface from Ko/Pi to select addresses |
2484 | * for the attendees list of an event. | 2484 | * for the attendees list of an event. |
2485 | */ | 2485 | */ |
2486 | void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) | 2486 | void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) |
2487 | { | 2487 | { |
2488 | QStringList nameList; | 2488 | QStringList nameList; |
2489 | QStringList emailList; | 2489 | QStringList emailList; |
2490 | QStringList uidList; | 2490 | QStringList uidList; |
2491 | 2491 | ||
2492 | KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); | 2492 | KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); |
2493 | uint i=0; | 2493 | uint i=0; |
2494 | for (i=0; i < list.count(); i++) | 2494 | for (i=0; i < list.count(); i++) |
2495 | { | 2495 | { |
2496 | nameList.append(list[i].realName()); | 2496 | nameList.append(list[i].realName()); |
2497 | emailList.append(list[i].preferredEmail()); | 2497 | emailList.append(list[i].preferredEmail()); |
2498 | uidList.append(list[i].uid()); | 2498 | uidList.append(list[i].uid()); |
2499 | } | 2499 | } |
2500 | 2500 | //qDebug("%s %s ", sourceChannel.latin1(), uid.latin1()); | |
2501 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList); | 2501 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList); |
2502 | 2502 | ||
2503 | } | 2503 | } |
2504 | 2504 | ||
2505 | /* this method will be called through the QCop interface from Ko/Pi to select birthdays | 2505 | /* this method will be called through the QCop interface from Ko/Pi to select birthdays |
2506 | * to put them into the calendar. | 2506 | * to put them into the calendar. |
2507 | */ | 2507 | */ |
2508 | void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid) | 2508 | void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid) |
2509 | { | 2509 | { |
2510 | // qDebug("KABCore::requestForBirthdayList"); | 2510 | // qDebug("KABCore::requestForBirthdayList"); |
2511 | QStringList birthdayList; | 2511 | QStringList birthdayList; |
2512 | QStringList anniversaryList; | 2512 | QStringList anniversaryList; |
2513 | QStringList realNameList; | 2513 | QStringList realNameList; |
2514 | QStringList preferredEmailList; | 2514 | QStringList preferredEmailList; |
2515 | QStringList assembledNameList; | 2515 | QStringList assembledNameList; |
2516 | QStringList uidList; | 2516 | QStringList uidList; |
2517 | 2517 | ||
2518 | KABC::AddressBook::Iterator it; | 2518 | KABC::AddressBook::Iterator it; |
2519 | 2519 | ||
2520 | int count = 0; | 2520 | int count = 0; |
2521 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { | 2521 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { |
2522 | ++count; | 2522 | ++count; |
2523 | } | 2523 | } |
2524 | QProgressBar bar(count,0 ); | 2524 | QProgressBar bar(count,0 ); |
2525 | int w = 300; | 2525 | int w = 300; |
2526 | if ( QApplication::desktop()->width() < 320 ) | 2526 | if ( QApplication::desktop()->width() < 320 ) |
2527 | w = 220; | 2527 | w = 220; |
2528 | int h = bar.sizeHint().height() ; | 2528 | int h = bar.sizeHint().height() ; |
2529 | int dw = QApplication::desktop()->width(); | 2529 | int dw = QApplication::desktop()->width(); |
2530 | int dh = QApplication::desktop()->height(); | 2530 | int dh = QApplication::desktop()->height(); |
2531 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2531 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2532 | bar.show(); | 2532 | bar.show(); |
2533 | bar.setCaption (i18n("Collecting birthdays - close to abort!") ); | 2533 | bar.setCaption (i18n("Collecting birthdays - close to abort!") ); |
2534 | qApp->processEvents(); | 2534 | qApp->processEvents(); |
2535 | 2535 | ||
2536 | QDate bday; | 2536 | QDate bday; |
2537 | QString anni; | 2537 | QString anni; |
2538 | QString formattedbday; | 2538 | QString formattedbday; |
2539 | 2539 | ||
2540 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) | 2540 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) |
2541 | { | 2541 | { |
2542 | if ( ! bar.isVisible() ) | 2542 | if ( ! bar.isVisible() ) |
2543 | return; | 2543 | return; |
2544 | bar.setProgress( count++ ); | 2544 | bar.setProgress( count++ ); |
2545 | qApp->processEvents(); | 2545 | qApp->processEvents(); |
2546 | bday = (*it).birthday().date(); | 2546 | bday = (*it).birthday().date(); |
2547 | anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" ); | 2547 | anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" ); |
2548 | 2548 | ||
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp index ed8a2ee..3231b45 100644 --- a/kmicromail/composemail.cpp +++ b/kmicromail/composemail.cpp | |||
@@ -10,98 +10,99 @@ | |||
10 | #include <qpe/qpeapplication.h> | 10 | #include <qpe/qpeapplication.h> |
11 | #endif //DESKTOP_VERSION | 11 | #endif //DESKTOP_VERSION |
12 | #include <libkdepim/externalapphandler.h> | 12 | #include <libkdepim/externalapphandler.h> |
13 | 13 | ||
14 | #include "koprefs.h" | 14 | #include "koprefs.h" |
15 | #include <klocale.h> | 15 | #include <klocale.h> |
16 | #include <kglobal.h> | 16 | #include <kglobal.h> |
17 | 17 | ||
18 | #ifdef MINIKDE_KDIALOG_H | 18 | #ifdef MINIKDE_KDIALOG_H |
19 | #undef MINIKDE_KDIALOG_H | 19 | #undef MINIKDE_KDIALOG_H |
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | 22 | ||
23 | #include "composemail.h" | 23 | #include "composemail.h" |
24 | 24 | ||
25 | #include <libmailwrapper/smtpwrapper.h> | 25 | #include <libmailwrapper/smtpwrapper.h> |
26 | #include <libmailwrapper/storemail.h> | 26 | #include <libmailwrapper/storemail.h> |
27 | #include <libmailwrapper/abstractmail.h> | 27 | #include <libmailwrapper/abstractmail.h> |
28 | #include <libmailwrapper/mailtypes.h> | 28 | #include <libmailwrapper/mailtypes.h> |
29 | 29 | ||
30 | /* OPIE */ | 30 | /* OPIE */ |
31 | //#include <opie2/ofiledialog.h> | 31 | //#include <opie2/ofiledialog.h> |
32 | //#include <opie2/odebug.h> | 32 | //#include <opie2/odebug.h> |
33 | #include <kfiledialog.h> | 33 | #include <kfiledialog.h> |
34 | //#include <qpe/resource.h> | 34 | //#include <qpe/resource.h> |
35 | #include <qpe/global.h> | 35 | #include <qpe/global.h> |
36 | //#include <qpe/contact.h> | 36 | //#include <qpe/contact.h> |
37 | 37 | ||
38 | 38 | ||
39 | #include <qcombobox.h> | 39 | #include <qcombobox.h> |
40 | #include <qcheckbox.h> | 40 | #include <qcheckbox.h> |
41 | #include <qiconset.h> | 41 | #include <qiconset.h> |
42 | #include <qtimer.h> | 42 | #include <qtimer.h> |
43 | #include <qmessagebox.h> | 43 | #include <qmessagebox.h> |
44 | #include <qpushbutton.h> | 44 | #include <qpushbutton.h> |
45 | #include <qmultilineedit.h> | 45 | #include <qmultilineedit.h> |
46 | #include <qlabel.h> | 46 | #include <qlabel.h> |
47 | #include <qtabwidget.h> | 47 | #include <qtabwidget.h> |
48 | #include <qlistview.h> | 48 | #include <qlistview.h> |
49 | 49 | ||
50 | //using namespace Opie::Core; | 50 | //using namespace Opie::Core; |
51 | //using namespace Opie::Ui; | 51 | //using namespace Opie::Ui; |
52 | ComposeMail::ComposeMail( Settings *sett, QWidget *parent, const char *name, bool modal ) | 52 | ComposeMail::ComposeMail( Settings *sett, QWidget *parent, const char *name, bool modal ) |
53 | : ComposeMailUI( parent, name, modal ) | 53 | : ComposeMailUI( parent, name, modal ) |
54 | { | 54 | { |
55 | 55 | ||
56 | mPickLineEdit = 0; | 56 | mPickLineEdit = 0; |
57 | mEncoding = KOPrefs::instance()->mCurrentCodeName; | 57 | mEncoding = KOPrefs::instance()->mCurrentCodeName; |
58 | connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), | 58 | //managed from opiemail now |
59 | this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); | 59 | //connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), |
60 | // this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); | ||
60 | settings = sett; | 61 | settings = sett; |
61 | m_replyid = ""; | 62 | m_replyid = ""; |
62 | if ( KOPrefs::instance()->mUseKapi) { | 63 | if ( KOPrefs::instance()->mUseKapi) { |
63 | KConfig config( locateLocal("config", "kabcrc") ); | 64 | KConfig config( locateLocal("config", "kabcrc") ); |
64 | config.setGroup( "General" ); | 65 | config.setGroup( "General" ); |
65 | QString whoami_uid = config.readEntry( "WhoAmI" ); | 66 | QString whoami_uid = config.readEntry( "WhoAmI" ); |
66 | 67 | ||
67 | if ( whoami_uid.isEmpty() ) { | 68 | if ( whoami_uid.isEmpty() ) { |
68 | QMessageBox::information( 0, i18n( "Hint" ), | 69 | QMessageBox::information( 0, i18n( "Hint" ), |
69 | i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), | 70 | i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), |
70 | i18n( "Ok" ) ); | 71 | i18n( "Ok" ) ); |
71 | 72 | ||
72 | 73 | ||
73 | fillSettings(); | 74 | fillSettings(); |
74 | } else | 75 | } else |
75 | ExternalAppHandler::instance()->requestDetailsFromKAPI("", "sendbacklist", whoami_uid); | 76 | ExternalAppHandler::instance()->requestDetailsFromKAPI("", "sendbacklist", whoami_uid); |
76 | 77 | ||
77 | 78 | ||
78 | #ifdef DESKTOP_VERSION | 79 | #ifdef DESKTOP_VERSION |
79 | KABC::Addressee con = KABC::StdAddressBook::self()->whoAmI( ); | 80 | KABC::Addressee con = KABC::StdAddressBook::self()->whoAmI( ); |
80 | QStringList mails = con.emails(); | 81 | QStringList mails = con.emails(); |
81 | QString defmail = con.preferredEmail(); | 82 | QString defmail = con.preferredEmail(); |
82 | if ( mails.count() == 0) | 83 | if ( mails.count() == 0) |
83 | QMessageBox::information( 0, i18n( "Hint" ), | 84 | QMessageBox::information( 0, i18n( "Hint" ), |
84 | i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), | 85 | i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), |
85 | i18n( "Ok" ) ); | 86 | i18n( "Ok" ) ); |
86 | if (defmail.length()!=0) { | 87 | if (defmail.length()!=0) { |
87 | fromBox->insertItem(defmail); | 88 | fromBox->insertItem(defmail); |
88 | } | 89 | } |
89 | QStringList::ConstIterator sit = mails.begin(); | 90 | QStringList::ConstIterator sit = mails.begin(); |
90 | for (;sit!=mails.end();++sit) { | 91 | for (;sit!=mails.end();++sit) { |
91 | if ( (*sit)==defmail) | 92 | if ( (*sit)==defmail) |
92 | continue; | 93 | continue; |
93 | fromBox->insertItem((*sit)); | 94 | fromBox->insertItem((*sit)); |
94 | } | 95 | } |
95 | senderNameEdit->setText(con.formattedName()); | 96 | senderNameEdit->setText(con.formattedName()); |
96 | #endif | 97 | #endif |
97 | 98 | ||
98 | } else { | 99 | } else { |
99 | fillSettings(); | 100 | fillSettings(); |
100 | } | 101 | } |
101 | checkBoxLater->setChecked( KOPrefs::instance()->mSendLater ); | 102 | checkBoxLater->setChecked( KOPrefs::instance()->mSendLater ); |
102 | 103 | ||
103 | attList->addColumn( i18n( "Name" ) ); | 104 | attList->addColumn( i18n( "Name" ) ); |
104 | attList->addColumn( i18n( "Size" ) ); | 105 | attList->addColumn( i18n( "Size" ) ); |
105 | QList<Account> accounts = settings->getAccounts(); | 106 | QList<Account> accounts = settings->getAccounts(); |
106 | 107 | ||
107 | if ( QApplication::desktop()->width() < 320 ) | 108 | if ( QApplication::desktop()->width() < 320 ) |
@@ -215,118 +216,125 @@ void ComposeMail::saveAsDraft() | |||
215 | } | 216 | } |
216 | void ComposeMail::clearStatus() | 217 | void ComposeMail::clearStatus() |
217 | { | 218 | { |
218 | topLevelWidget()->setCaption( i18n("Compose mail") ); | 219 | topLevelWidget()->setCaption( i18n("Compose mail") ); |
219 | } | 220 | } |
220 | void ComposeMail::setStatus( QString status ) | 221 | void ComposeMail::setStatus( QString status ) |
221 | { | 222 | { |
222 | topLevelWidget()->setCaption( status ); | 223 | topLevelWidget()->setCaption( status ); |
223 | QTimer::singleShot ( 10000, this, SLOT( clearStatus() ) ) ; | 224 | QTimer::singleShot ( 10000, this, SLOT( clearStatus() ) ) ; |
224 | } | 225 | } |
225 | void ComposeMail::pickAddress( ) | 226 | void ComposeMail::pickAddress( ) |
226 | { | 227 | { |
227 | 228 | ||
228 | QLineEdit *line = mPickLineEdit; | 229 | QLineEdit *line = mPickLineEdit; |
229 | if ( line == 0 ) | 230 | if ( line == 0 ) |
230 | return; | 231 | return; |
231 | #ifdef DESKTOP_VERSION | 232 | #ifdef DESKTOP_VERSION |
232 | //qDebug(" ComposeMail::pickAddress "); | 233 | //qDebug(" ComposeMail::pickAddress "); |
233 | QString names ;//= AddressPicker::getNames(); | 234 | QString names ;//= AddressPicker::getNames(); |
234 | 235 | ||
235 | KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); | 236 | KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); |
236 | uint i=0; | 237 | uint i=0; |
237 | for (i=0; i < list.count(); i++) { | 238 | for (i=0; i < list.count(); i++) { |
238 | if ( !list[i].preferredEmail().isEmpty()) { | 239 | if ( !list[i].preferredEmail().isEmpty()) { |
239 | if ( ! names.isEmpty() ) | 240 | if ( ! names.isEmpty() ) |
240 | names+= ","; | 241 | names+= ","; |
241 | names+= "\""+list[i].realName() +"\"<" +list[i].preferredEmail() +">"; | 242 | names+= "\""+list[i].realName() +"\"<" +list[i].preferredEmail() +">"; |
242 | 243 | ||
243 | } | 244 | } |
244 | } | 245 | } |
245 | 246 | ||
246 | 247 | ||
247 | if ( line->text().isEmpty() ) { | 248 | if ( line->text().isEmpty() ) { |
248 | line->setText( names ); | 249 | line->setText( names ); |
249 | } else if ( !names.isEmpty() ) { | 250 | } else if ( !names.isEmpty() ) { |
250 | line->setText( line->text() + ", " + names ); | 251 | line->setText( line->text() + ", " + names ); |
251 | } | 252 | } |
252 | #else | 253 | #else |
253 | bool res = ExternalAppHandler::instance()->requestNameEmailUidListFromKAPI("QPE/Application/ompi", this->name() /* name is here the unique uid*/); | 254 | bool res = ExternalAppHandler::instance()->requestNameEmailUidListFromKAPI("QPE/Application/ompi", this->name() /* name is here the unique uid*/); |
254 | // the result should now arrive through method insertAttendees | 255 | // the result should now arrive through method insertAttendees |
255 | #endif | 256 | #endif |
256 | } | 257 | } |
257 | //the map includes name/email pairs, that comes from Ka/Pi | 258 | //the map includes name/email pairs, that comes from Ka/Pi |
258 | void ComposeMail::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList) | 259 | void ComposeMail::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList) |
259 | { | 260 | { |
260 | //qDebug("ComposeMail::insertAttendees "); | 261 | //qDebug("ComposeMail::insertAttendees "); |
261 | raise(); | 262 | raise(); |
262 | 263 | ||
264 | QString UID = uid; | ||
265 | if ( uid.left( 18 ) == (this->name() +QString("pick2")) ) { | ||
266 | mPickLineEdit = toLine; | ||
267 | UID = this->name(); | ||
268 | subjectLine->setText( uid.mid( 18 ) ); | ||
269 | } | ||
270 | //qDebug("ccc %s %s ", uid.latin1(), this->name()); | ||
263 | if ( mPickLineEdit == 0 ) { //whoami received | 271 | if ( mPickLineEdit == 0 ) { //whoami received |
264 | QString defmail = uidList[0]; | 272 | QString defmail = uidList[0]; |
265 | if ( emailList.count() == 0 ) | 273 | if ( emailList.count() == 0 ) |
266 | QMessageBox::information( 0, i18n( "Hint" ), | 274 | QMessageBox::information( 0, i18n( "Hint" ), |
267 | i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), | 275 | i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), |
268 | i18n( "Ok" ) ); | 276 | i18n( "Ok" ) ); |
269 | if (defmail.length()!=0) { | 277 | if (defmail.length()!=0) { |
270 | fromBox->insertItem(defmail); | 278 | fromBox->insertItem(defmail); |
271 | } | 279 | } |
272 | QStringList::ConstIterator sit = emailList.begin(); | 280 | QStringList::ConstIterator sit = emailList.begin(); |
273 | int pref = 0; | 281 | int pref = 0; |
274 | for (;sit!=emailList.end();++sit) { | 282 | for (;sit!=emailList.end();++sit) { |
275 | if ( (*sit)==defmail) | 283 | if ( (*sit)==defmail) |
276 | continue; | 284 | continue; |
277 | fromBox->insertItem((*sit)); | 285 | fromBox->insertItem((*sit)); |
278 | } | 286 | } |
279 | senderNameEdit->setText(nameList[0]); | 287 | senderNameEdit->setText(nameList[0]); |
280 | return; | 288 | return; |
281 | } | 289 | } |
282 | QString names ; | 290 | QString names ; |
283 | QLineEdit *line = mPickLineEdit; | 291 | QLineEdit *line = mPickLineEdit; |
284 | if (uid == this->name()) | 292 | if (UID == this->name()) |
285 | { | 293 | { |
286 | for ( int i = 0; i < nameList.count(); i++) | 294 | for ( int i = 0; i < nameList.count(); i++) |
287 | { | 295 | { |
288 | QString _name = nameList[i]; | 296 | QString _name = nameList[i]; |
289 | QString _email = emailList[i]; | 297 | QString _email = emailList[i]; |
290 | QString _uid = uidList[i]; | 298 | QString _uid = uidList[i]; |
291 | if ( ! _email.isEmpty() ) { | 299 | if ( ! _email.isEmpty() ) { |
292 | if ( ! names.isEmpty() ) | 300 | if ( ! names.isEmpty() ) |
293 | names+= ","; | 301 | names+= ","; |
294 | names+= "\""+_name +"\"<" +_email +">"; | 302 | names+= "\""+_name +"\"<" +_email +">"; |
295 | } | 303 | } |
296 | } | 304 | } |
297 | } | 305 | } |
298 | if ( line->text().isEmpty() ) { | 306 | if ( line->text().isEmpty() ) { |
299 | line->setText( names ); | 307 | line->setText( names ); |
300 | } else if ( !names.isEmpty() ) { | 308 | } else if ( !names.isEmpty() ) { |
301 | line->setText( line->text() + ", " + names ); | 309 | line->setText( line->text() + ", " + names ); |
302 | } | 310 | } |
303 | } | 311 | } |
304 | 312 | ||
305 | void ComposeMail::setTo( const QString & to ) | 313 | void ComposeMail::setTo( const QString & to ) |
306 | { | 314 | { |
307 | toLine->setText( to ); | 315 | toLine->setText( to ); |
308 | } | 316 | } |
309 | 317 | ||
310 | void ComposeMail::setSubject( const QString & subject ) | 318 | void ComposeMail::setSubject( const QString & subject ) |
311 | { | 319 | { |
312 | subjectLine->setText( subject ); | 320 | subjectLine->setText( subject ); |
313 | } | 321 | } |
314 | 322 | ||
315 | void ComposeMail::setInReplyTo( const QString & messageId ) | 323 | void ComposeMail::setInReplyTo( const QString & messageId ) |
316 | { | 324 | { |
317 | m_replyid = messageId; | 325 | m_replyid = messageId; |
318 | } | 326 | } |
319 | 327 | ||
320 | void ComposeMail::setMessage( const QString & text ) | 328 | void ComposeMail::setMessage( const QString & text ) |
321 | { | 329 | { |
322 | message->setText( text ); | 330 | message->setText( text ); |
323 | } | 331 | } |
324 | 332 | ||
325 | 333 | ||
326 | void ComposeMail::pickAddressTo() | 334 | void ComposeMail::pickAddressTo() |
327 | { | 335 | { |
328 | mPickLineEdit = toLine; | 336 | mPickLineEdit = toLine; |
329 | pickAddress( ); | 337 | pickAddress( ); |
330 | } | 338 | } |
331 | 339 | ||
332 | void ComposeMail::pickAddressCC() | 340 | void ComposeMail::pickAddressCC() |
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index f56711d..e159b73 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp | |||
@@ -1,212 +1,219 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | 1 | // CHANGED 2004-09-31 Lutz Rogowski |
2 | // CHANGED 2004-08-06 Lutz Rogowski | 2 | // CHANGED 2004-08-06 Lutz Rogowski |
3 | 3 | ||
4 | 4 | ||
5 | #define protected public | 5 | #define protected public |
6 | #include <qwidget.h> | 6 | #include <qwidget.h> |
7 | #undef protected | 7 | #undef protected |
8 | #include "koprefsdialog.h" | 8 | #include "koprefsdialog.h" |
9 | #include <kapplication.h> | 9 | #include <kapplication.h> |
10 | #include <libkdepim/externalapphandler.h> | 10 | #include <libkdepim/externalapphandler.h> |
11 | #include <libkdepim/kpimglobalprefs.h> | 11 | #include <libkdepim/kpimglobalprefs.h> |
12 | #ifdef MINIKDE_KDIALOG_H | 12 | #ifdef MINIKDE_KDIALOG_H |
13 | #undef MINIKDE_KDIALOG_H | 13 | #undef MINIKDE_KDIALOG_H |
14 | #endif | 14 | #endif |
15 | #include "settingsdialog.h" | 15 | #include "settingsdialog.h" |
16 | #include "opiemail.h" | 16 | #include "opiemail.h" |
17 | #include "editaccounts.h" | 17 | #include "editaccounts.h" |
18 | #include "composemail.h" | 18 | #include "composemail.h" |
19 | #include "mailistviewitem.h" | 19 | #include "mailistviewitem.h" |
20 | #include "viewmail.h" | 20 | #include "viewmail.h" |
21 | #include "selectstore.h" | 21 | #include "selectstore.h" |
22 | #include "selectsmtp.h" | 22 | #include "selectsmtp.h" |
23 | #include "accountitem.h" | 23 | #include "accountitem.h" |
24 | #include "accountview.h" | 24 | #include "accountview.h" |
25 | #include "klocale.h" | 25 | #include "klocale.h" |
26 | 26 | ||
27 | #include <qmessagebox.h> | 27 | #include <qmessagebox.h> |
28 | #include <qtimer.h> | 28 | #include <qtimer.h> |
29 | #include <qcursor.h> | 29 | #include <qcursor.h> |
30 | #include <qtextbrowser.h> | 30 | #include <qtextbrowser.h> |
31 | #include <qregexp.h> | 31 | #include <qregexp.h> |
32 | #include <qpe/global.h> | 32 | #include <qpe/global.h> |
33 | 33 | ||
34 | #ifdef DESKTOP_VERSION | 34 | #ifdef DESKTOP_VERSION |
35 | #include <qapplication.h> | 35 | #include <qapplication.h> |
36 | #else | 36 | #else |
37 | #include <qpe/qpeapplication.h> | 37 | #include <qpe/qpeapplication.h> |
38 | #endif | 38 | #endif |
39 | #include <libmailwrapper/smtpwrapper.h> | 39 | #include <libmailwrapper/smtpwrapper.h> |
40 | #include <libmailwrapper/mailtypes.h> | 40 | #include <libmailwrapper/mailtypes.h> |
41 | #include <libmailwrapper/abstractmail.h> | 41 | #include <libmailwrapper/abstractmail.h> |
42 | #include "koprefs.h" | 42 | #include "koprefs.h" |
43 | 43 | ||
44 | //using namespace Opie::Core; | 44 | //using namespace Opie::Core; |
45 | 45 | ||
46 | OpieMail::OpieMail( QWidget *parent, const char *name ) | 46 | OpieMail::OpieMail( QWidget *parent, const char *name ) |
47 | : MainWindow( parent, name) //, WStyle_ContextHelp ) | 47 | : MainWindow( parent, name) //, WStyle_ContextHelp ) |
48 | { | 48 | { |
49 | mCurrentComposer = 0; | ||
49 | settings = new Settings(); | 50 | settings = new Settings(); |
50 | tb = 0; | 51 | tb = 0; |
51 | setIcon(SmallIcon( "kmicromail" ) ); | 52 | setIcon(SmallIcon( "kmicromail" ) ); |
52 | folderView->populate( settings->getAccounts() ); | 53 | folderView->populate( settings->getAccounts() ); |
53 | 54 | connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), | |
55 | this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); | ||
54 | } | 56 | } |
55 | 57 | ||
56 | OpieMail::~OpieMail() | 58 | OpieMail::~OpieMail() |
57 | { | 59 | { |
58 | if (settings) delete settings; | 60 | if (settings) delete settings; |
59 | if ( tb ) | 61 | if ( tb ) |
60 | delete tb; | 62 | delete tb; |
61 | } | 63 | } |
62 | 64 | ||
63 | void OpieMail::appMessage(const QCString &msg, const QByteArray &data) | 65 | void OpieMail::appMessage(const QCString &msg, const QByteArray &data) |
64 | { | 66 | { |
65 | 67 | ||
66 | } | 68 | } |
67 | #include <stdlib.h> | 69 | #include <stdlib.h> |
68 | void OpieMail::message(const QCString &msg, const QByteArray &data) | 70 | void OpieMail::message(const QCString &msg, const QByteArray &data) |
69 | { | 71 | { |
70 | // copied from old mail2 | 72 | // copied from old mail2 |
71 | static int ii = 0; | 73 | static int ii = 0; |
72 | //qDebug("QCOP CALL ############################# %d ", ii); | 74 | //qDebug("QCOP CALL ############################# %d ", ii); |
73 | //QString mess ( msg ); | 75 | //QString mess ( msg ); |
74 | //qDebug("Message = %s ",mess.latin1()); | 76 | //qDebug("Message = %s ",mess.latin1()); |
75 | ++ii; | 77 | ++ii; |
76 | //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this); | 78 | //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this); |
77 | 79 | ||
78 | mPendingEmail = QString::null; | 80 | mPendingEmail = QString::null; |
79 | mPendingName = QString::null; | 81 | mPendingName = QString::null; |
80 | if (msg == "writeMail(QString,QString)") | 82 | if (msg == "writeMail(QString,QString)") |
81 | { | 83 | { |
82 | //qDebug("writeMail(QString,QString) "); | 84 | //qDebug("writeMail(QString,QString) "); |
83 | QDataStream stream(data,IO_ReadOnly); | 85 | QDataStream stream(data,IO_ReadOnly); |
84 | stream >> mPendingName >> mPendingEmail; | 86 | stream >> mPendingName >> mPendingEmail; |
85 | // removing the whitespaces at beginning and end is needed! | 87 | // removing the whitespaces at beginning and end is needed! |
86 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); | 88 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); |
87 | } | 89 | } |
88 | else if (msg == "newMail()") | 90 | else if (msg == "newMail()") |
89 | { | 91 | { |
90 | //qDebug("slotComposeMail() "); | 92 | //qDebug("slotComposeMail() "); |
91 | // we cannot call slotComposeMail(); directly, because may be executing a QCOP call | 93 | // we cannot call slotComposeMail(); directly, because may be executing a QCOP call |
92 | // and a QCOP call does not like a processevents in his execution | 94 | // and a QCOP call does not like a processevents in his execution |
93 | // with the Qtimer we call slotComposeMail() after we reached the main event loop | 95 | // with the Qtimer we call slotComposeMail() after we reached the main event loop |
94 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); | 96 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); |
95 | // slotComposeMail(); | 97 | // slotComposeMail(); |
96 | } | 98 | } |
97 | else if (msg == "newMail(QString)") | 99 | else if (msg == "newMail(QString)") |
98 | { | 100 | { |
99 | //qDebug(" newMail(QString)"); | 101 | //qDebug(" newMail(QString)"); |
100 | QDataStream stream(data,IO_ReadOnly); | 102 | QDataStream stream(data,IO_ReadOnly); |
101 | stream >> mPendingName; | 103 | stream >> mPendingName; |
102 | // the format is | 104 | // the format is |
103 | // NAME <EMAIL>:SUBJECT | 105 | // NAME <EMAIL>:SUBJECT |
104 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); | 106 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); |
105 | } else { | 107 | } else { |
106 | mPendingData = data; | 108 | mPendingData = data; |
107 | mPendingMessage = msg; | 109 | mPendingMessage = msg; |
108 | QTimer::singleShot ( 50, this, SLOT(slotExtAppHandler() ) ); | 110 | QTimer::singleShot ( 50, this, SLOT(slotExtAppHandler() ) ); |
109 | } | 111 | } |
110 | 112 | ||
111 | //qDebug("END OpieMail::message "); | 113 | //qDebug("END OpieMail::message "); |
112 | } | 114 | } |
113 | void OpieMail::slotExtAppHandler() | 115 | void OpieMail::slotExtAppHandler() |
114 | { | 116 | { |
115 | ExternalAppHandler::instance()->appMessage ( mPendingMessage, mPendingData ); | 117 | ExternalAppHandler::instance()->appMessage ( mPendingMessage, mPendingData ); |
116 | } | 118 | } |
117 | void OpieMail::slotwriteMail2(const QString& namemail ) | 119 | void OpieMail::slotwriteMail2(const QString& namemail ) |
118 | { | 120 | { |
119 | //qDebug("OpieMail::slotwriteMail2 "); | 121 | //qDebug("OpieMail::slotwriteMail2 "); |
120 | //qApp->processEvents(); | 122 | //qApp->processEvents(); |
121 | ComposeMail compose( settings, this, 0, true ); | 123 | ComposeMail compose( settings, this, 0, true ); |
122 | if ( !namemail.isEmpty() ) { | 124 | if ( !namemail.isEmpty() ) { |
123 | QString to = namemail; | 125 | QString to = namemail; |
124 | if ( namemail.find( " <") > 1 ) { | 126 | if ( namemail.find( " <") > 1 ) { |
125 | to = "\"" +to.replace( QRegExp( " <"), "\" <") ; | 127 | to = "\"" +to.replace( QRegExp( " <"), "\" <") ; |
126 | } else | 128 | } else |
127 | if ( namemail.find( "<") > 1 ) { | 129 | if ( namemail.find( "<") > 1 ) { |
128 | to = "\"" +to.replace( QRegExp( "<"), "\" <") ; | 130 | to = "\"" +to.replace( QRegExp( "<"), "\" <") ; |
129 | } | 131 | } |
130 | int sub = to.find( ">:"); | 132 | int sub = to.find( ">:"); |
131 | if ( sub > 0 ) { | 133 | if ( sub > 0 ) { |
132 | compose.setTo( to.left(sub+1) ); | 134 | compose.setTo( to.left(sub+1) ); |
133 | compose.setSubject( to.mid(sub+2) ); | 135 | compose.setSubject( to.mid(sub+2) ); |
134 | } else | 136 | } else |
135 | compose.setTo( to ); | 137 | compose.setTo( to ); |
136 | } | 138 | } |
137 | compose.slotAdjustColumns(); | 139 | compose.slotAdjustColumns(); |
138 | #ifndef DESKTOP_VERSION | 140 | #ifndef DESKTOP_VERSION |
139 | compose.showMaximized(); | 141 | compose.showMaximized(); |
140 | #endif | 142 | #endif |
143 | mCurrentComposer = &compose; | ||
141 | compose.exec(); | 144 | compose.exec(); |
145 | mCurrentComposer = 0; | ||
142 | raise(); | 146 | raise(); |
143 | //qDebug("retttich "); | 147 | //qDebug("retttich "); |
144 | } | 148 | } |
145 | void OpieMail::slotwriteMail(const QString&name,const QString&email) | 149 | void OpieMail::slotwriteMail(const QString&name,const QString&email) |
146 | { | 150 | { |
147 | // qDebug("OpieMail::slotwriteMail "); | 151 | // qDebug("OpieMail::slotwriteMail "); |
148 | ComposeMail compose( settings, this, 0, true ); | 152 | ComposeMail compose( settings, this, 0, true ); |
149 | if (!email.isEmpty()) | 153 | if (!email.isEmpty()) |
150 | { | 154 | { |
151 | if (!name.isEmpty()) | 155 | if (!name.isEmpty()) |
152 | { | 156 | { |
153 | compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">"); | 157 | compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">"); |
154 | } | 158 | } |
155 | else | 159 | else |
156 | { | 160 | { |
157 | compose.setTo(email); | 161 | compose.setTo(email); |
158 | } | 162 | } |
159 | } | 163 | } |
160 | compose.slotAdjustColumns(); | 164 | compose.slotAdjustColumns(); |
161 | #ifndef DESKTOP_VERSION | 165 | #ifndef DESKTOP_VERSION |
162 | compose.showMaximized(); | 166 | compose.showMaximized(); |
163 | #endif | 167 | #endif |
168 | |||
169 | mCurrentComposer = &compose; | ||
164 | compose.exec(); | 170 | compose.exec(); |
171 | mCurrentComposer = 0; | ||
165 | raise(); | 172 | raise(); |
166 | } | 173 | } |
167 | 174 | ||
168 | void OpieMail::slotComposeMail() | 175 | void OpieMail::slotComposeMail() |
169 | { | 176 | { |
170 | if ( mPendingEmail == QString::null && mPendingName == QString::null) | 177 | if ( mPendingEmail == QString::null && mPendingName == QString::null) |
171 | slotwriteMail2( QString () ); | 178 | slotwriteMail2( QString () ); |
172 | else { | 179 | else { |
173 | if ( mPendingEmail == QString::null ) | 180 | if ( mPendingEmail == QString::null ) |
174 | slotwriteMail2( mPendingName ); | 181 | slotwriteMail2( mPendingName ); |
175 | else | 182 | else |
176 | slotwriteMail( mPendingName, mPendingEmail ); | 183 | slotwriteMail( mPendingName, mPendingEmail ); |
177 | } | 184 | } |
178 | //slotwriteMail(0l,0l); | 185 | //slotwriteMail(0l,0l); |
179 | } | 186 | } |
180 | 187 | ||
181 | void OpieMail::slotSendQueued() | 188 | void OpieMail::slotSendQueued() |
182 | { | 189 | { |
183 | SMTPaccount *smtp = 0; | 190 | SMTPaccount *smtp = 0; |
184 | 191 | ||
185 | QList<Account> list = settings->getAccounts(); | 192 | QList<Account> list = settings->getAccounts(); |
186 | QList<SMTPaccount> smtpList; | 193 | QList<SMTPaccount> smtpList; |
187 | smtpList.setAutoDelete(false); | 194 | smtpList.setAutoDelete(false); |
188 | Account *it; | 195 | Account *it; |
189 | for ( it = list.first(); it; it = list.next() ) | 196 | for ( it = list.first(); it; it = list.next() ) |
190 | { | 197 | { |
191 | if ( it->getType() == MAILLIB::A_SMTP ) | 198 | if ( it->getType() == MAILLIB::A_SMTP ) |
192 | { | 199 | { |
193 | smtp = static_cast<SMTPaccount *>(it); | 200 | smtp = static_cast<SMTPaccount *>(it); |
194 | smtpList.append(smtp); | 201 | smtpList.append(smtp); |
195 | } | 202 | } |
196 | } | 203 | } |
197 | if (smtpList.count()==0) | 204 | if (smtpList.count()==0) |
198 | { | 205 | { |
199 | QMessageBox::information(0,i18n("Info"),i18n("Define a smtp account first!\n")); | 206 | QMessageBox::information(0,i18n("Info"),i18n("Define a smtp account first!\n")); |
200 | return; | 207 | return; |
201 | } | 208 | } |
202 | if ( QMessageBox::warning(this, i18n("Sending all mails"), i18n("Do you really want to send\nall queued mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No ) | 209 | if ( QMessageBox::warning(this, i18n("Sending all mails"), i18n("Do you really want to send\nall queued mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No ) |
203 | return; | 210 | return; |
204 | if (smtpList.count()==1) | 211 | if (smtpList.count()==1) |
205 | { | 212 | { |
206 | smtp = smtpList.at(0); | 213 | smtp = smtpList.at(0); |
207 | } | 214 | } |
208 | else | 215 | else |
209 | { | 216 | { |
210 | smtp = 0; | 217 | smtp = 0; |
211 | selectsmtp selsmtp; | 218 | selectsmtp selsmtp; |
212 | selsmtp.setSelectionlist(&smtpList); | 219 | selsmtp.setSelectionlist(&smtpList); |
@@ -255,100 +262,103 @@ void OpieMail::slotEditAccounts() | |||
255 | EditAccounts eaDialog( settings, this, 0, true ); | 262 | EditAccounts eaDialog( settings, this, 0, true ); |
256 | eaDialog.slotAdjustColumns(); | 263 | eaDialog.slotAdjustColumns(); |
257 | #ifndef DESKTOP_VERSION | 264 | #ifndef DESKTOP_VERSION |
258 | eaDialog.showMaximized(); | 265 | eaDialog.showMaximized(); |
259 | #endif | 266 | #endif |
260 | eaDialog.exec(); | 267 | eaDialog.exec(); |
261 | if ( settings ) delete settings; | 268 | if ( settings ) delete settings; |
262 | settings = new Settings(); | 269 | settings = new Settings(); |
263 | 270 | ||
264 | folderView->populate( settings->getAccounts() ); | 271 | folderView->populate( settings->getAccounts() ); |
265 | } | 272 | } |
266 | void OpieMail::replyMail() | 273 | void OpieMail::replyMail() |
267 | { | 274 | { |
268 | 275 | ||
269 | QListViewItem*item = mailView->currentItem(); | 276 | QListViewItem*item = mailView->currentItem(); |
270 | if (!item) return; | 277 | if (!item) return; |
271 | RecMailP mail = ((MailListViewItem*)item)->data(); | 278 | RecMailP mail = ((MailListViewItem*)item)->data(); |
272 | RecBodyP body = folderView->fetchBody(mail); | 279 | RecBodyP body = folderView->fetchBody(mail); |
273 | 280 | ||
274 | QString rtext; | 281 | QString rtext; |
275 | rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose | 282 | rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose |
276 | .arg( mail->getFrom()) | 283 | .arg( mail->getFrom()) |
277 | .arg( mail->getDate()); | 284 | .arg( mail->getDate()); |
278 | 285 | ||
279 | QString text = body->Bodytext(); | 286 | QString text = body->Bodytext(); |
280 | QStringList lines = QStringList::split(QRegExp("\\n"), text); | 287 | QStringList lines = QStringList::split(QRegExp("\\n"), text); |
281 | QStringList::Iterator it; | 288 | QStringList::Iterator it; |
282 | for (it = lines.begin(); it != lines.end(); it++) | 289 | for (it = lines.begin(); it != lines.end(); it++) |
283 | { | 290 | { |
284 | rtext += "> " + *it + "\n"; | 291 | rtext += "> " + *it + "\n"; |
285 | } | 292 | } |
286 | rtext += "\n"; | 293 | rtext += "\n"; |
287 | 294 | ||
288 | QString prefix; | 295 | QString prefix; |
289 | if ( mail->getSubject().find(QRegExp("^Re: .*$")) != -1) prefix = ""; | 296 | if ( mail->getSubject().find(QRegExp("^Re: .*$")) != -1) prefix = ""; |
290 | else prefix = "Re: "; // no i18n on purpose | 297 | else prefix = "Re: "; // no i18n on purpose |
291 | 298 | ||
292 | Settings *settings = new Settings(); | 299 | Settings *settings = new Settings(); |
293 | ComposeMail composer( settings ,this, 0, true); | 300 | ComposeMail composer( settings ,this, 0, true); |
294 | if (mail->Replyto().isEmpty()) { | 301 | if (mail->Replyto().isEmpty()) { |
295 | composer.setTo( mail->getFrom()); | 302 | composer.setTo( mail->getFrom()); |
296 | } else { | 303 | } else { |
297 | composer.setTo( mail->Replyto()); | 304 | composer.setTo( mail->Replyto()); |
298 | } | 305 | } |
299 | composer.setSubject( prefix + mail->getSubject()); | 306 | composer.setSubject( prefix + mail->getSubject()); |
300 | composer.setMessage( rtext ); | 307 | composer.setMessage( rtext ); |
301 | composer.setInReplyTo( mail->Msgid()); | 308 | composer.setInReplyTo( mail->Msgid()); |
302 | composer.setCharset( body->getCharset() ); | 309 | composer.setCharset( body->getCharset() ); |
310 | |||
311 | mCurrentComposer = &composer; | ||
303 | if ( QDialog::Accepted == KApplication::execDialog( &composer ) ) | 312 | if ( QDialog::Accepted == KApplication::execDialog( &composer ) ) |
304 | { | 313 | { |
305 | mail->Wrapper()->answeredMail(mail); | 314 | mail->Wrapper()->answeredMail(mail); |
306 | } | 315 | } |
316 | mCurrentComposer = 0; | ||
307 | delete settings; | 317 | delete settings; |
308 | 318 | ||
309 | } | 319 | } |
310 | void OpieMail::closeViewMail(ViewMail * vm) | 320 | void OpieMail::closeViewMail(ViewMail * vm) |
311 | { | 321 | { |
312 | vm->hide(); | 322 | vm->hide(); |
313 | } | 323 | } |
314 | 324 | ||
315 | void OpieMail::slotDownloadMail( ) | 325 | void OpieMail::slotDownloadMail( ) |
316 | { | 326 | { |
317 | QListViewItem*item = mailView->currentItem(); | 327 | QListViewItem*item = mailView->currentItem(); |
318 | if (!item ) { | 328 | if (!item ) { |
319 | Global::statusMessage("Error: No item slected!"); | 329 | Global::statusMessage("Error: No item slected!"); |
320 | return; | 330 | return; |
321 | } | 331 | } |
322 | RecMailP mail = ((MailListViewItem*)item)->data(); | 332 | RecMailP mail = ((MailListViewItem*)item)->data(); |
323 | Account * acc = mail->Wrapper()->getAccount(); | 333 | Account * acc = mail->Wrapper()->getAccount(); |
324 | if ( !acc ) { | 334 | if ( !acc ) { |
325 | Global::statusMessage("Mail is already stored locally!"); | 335 | Global::statusMessage("Mail is already stored locally!"); |
326 | return; | 336 | return; |
327 | } | 337 | } |
328 | QString lfName = acc->getLocalFolder(); | 338 | QString lfName = acc->getLocalFolder(); |
329 | //qDebug("local folder " + lfName ); | 339 | //qDebug("local folder " + lfName ); |
330 | if ( lfName.isEmpty() ) | 340 | if ( lfName.isEmpty() ) |
331 | lfName = acc->getAccountName(); | 341 | lfName = acc->getAccountName(); |
332 | AbstractMail* targetMail = folderView->allAccounts()[0]->getWrapper(); | 342 | AbstractMail* targetMail = folderView->allAccounts()[0]->getWrapper(); |
333 | //qDebug("target %d %d ",targetMail,mail->Wrapper() ); | 343 | //qDebug("target %d %d ",targetMail,mail->Wrapper() ); |
334 | if ( targetMail == mail->Wrapper() ) { | 344 | if ( targetMail == mail->Wrapper() ) { |
335 | Global::statusMessage("Mail is already locally stored!"); | 345 | Global::statusMessage("Mail is already locally stored!"); |
336 | return; | 346 | return; |
337 | } | 347 | } |
338 | if ( !targetMail->createMbox(lfName)) { | 348 | if ( !targetMail->createMbox(lfName)) { |
339 | Global::statusMessage("Error creating folder!"); | 349 | Global::statusMessage("Error creating folder!"); |
340 | return; | 350 | return; |
341 | } | 351 | } |
342 | Global::statusMessage("Fetching mail...please wait!"); | 352 | Global::statusMessage("Fetching mail...please wait!"); |
343 | qApp->processEvents(); | 353 | qApp->processEvents(); |
344 | encodedString*st = 0; | 354 | encodedString*st = 0; |
345 | st = mail->Wrapper()->fetchRawBody(mail); | 355 | st = mail->Wrapper()->fetchRawBody(mail); |
346 | if ( st ) { | 356 | if ( st ) { |
347 | targetMail->storeMessage(st->Content(),st->Length(),lfName); | 357 | targetMail->storeMessage(st->Content(),st->Length(),lfName); |
348 | Global::statusMessage("Mail stored in "+ lfName); | 358 | Global::statusMessage("Mail stored in "+ lfName); |
349 | delete st; | 359 | delete st; |
350 | } else { | 360 | } else { |
351 | Global::statusMessage("Error: Cannot fetch mail!"); | 361 | Global::statusMessage("Error: Cannot fetch mail!"); |
352 | } | 362 | } |
353 | } | 363 | } |
354 | 364 | ||
@@ -592,50 +602,71 @@ void OpieMail::slotMoveCopyAllMail() | |||
592 | if ( item->isSelected() ) { | 602 | if ( item->isSelected() ) { |
593 | t.append( item->data() ); | 603 | t.append( item->data() ); |
594 | } | 604 | } |
595 | item = (MailListViewItem*)item->nextSibling(); | 605 | item = (MailListViewItem*)item->nextSibling(); |
596 | } | 606 | } |
597 | } | 607 | } |
598 | // else | 608 | // else |
599 | // return; | 609 | // return; |
600 | if ( t.count() == 0 ) | 610 | if ( t.count() == 0 ) |
601 | return; | 611 | return; |
602 | RecMailP mail = t.first(); | 612 | RecMailP mail = t.first(); |
603 | AbstractMail*targetMail = 0; | 613 | AbstractMail*targetMail = 0; |
604 | QString targetFolder = ""; | 614 | QString targetFolder = ""; |
605 | Selectstore sels; | 615 | Selectstore sels; |
606 | folderView->setupFolderselect(&sels); | 616 | folderView->setupFolderselect(&sels); |
607 | if (!sels.exec()) return; | 617 | if (!sels.exec()) return; |
608 | targetMail = sels.currentMail(); | 618 | targetMail = sels.currentMail(); |
609 | targetFolder = sels.currentFolder(); | 619 | targetFolder = sels.currentFolder(); |
610 | if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || | 620 | if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || |
611 | targetFolder.isEmpty()) | 621 | targetFolder.isEmpty()) |
612 | { | 622 | { |
613 | return; | 623 | return; |
614 | } | 624 | } |
615 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) | 625 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) |
616 | { | 626 | { |
617 | QMessageBox::critical(0,i18n("Error creating new Folder"), | 627 | QMessageBox::critical(0,i18n("Error creating new Folder"), |
618 | i18n("<center>Error while creating<br>new folder - breaking.</center>")); | 628 | i18n("<center>Error while creating<br>new folder - breaking.</center>")); |
619 | return; | 629 | return; |
620 | } | 630 | } |
621 | sels.hide(); | 631 | sels.hide(); |
622 | qApp->processEvents(); | 632 | qApp->processEvents(); |
623 | //qDebug("hiding sels "); | 633 | //qDebug("hiding sels "); |
624 | mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails()); | 634 | mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails()); |
625 | folderView->refreshCurrent(); | 635 | folderView->refreshCurrent(); |
626 | } | 636 | } |
627 | 637 | ||
628 | void OpieMail::reEditMail() | 638 | void OpieMail::reEditMail() |
629 | { | 639 | { |
630 | if (!mailView->currentItem()) return; | 640 | if (!mailView->currentItem()) return; |
631 | 641 | ||
632 | ComposeMail compose( settings, this, 0, true ); | 642 | ComposeMail compose( settings, this, 0, true ); |
633 | compose.reEditMail(((MailListViewItem*)mailView->currentItem() )->data()); | 643 | compose.reEditMail(((MailListViewItem*)mailView->currentItem() )->data()); |
634 | compose.slotAdjustColumns(); | 644 | compose.slotAdjustColumns(); |
635 | #ifndef DESKTOP_VERSION | 645 | #ifndef DESKTOP_VERSION |
636 | compose.showMaximized(); | 646 | compose.showMaximized(); |
637 | #else | 647 | #else |
638 | compose.resize(640,480); | 648 | compose.resize(640,480); |
639 | #endif | 649 | #endif |
650 | mCurrentComposer = &compose; | ||
640 | compose.exec(); | 651 | compose.exec(); |
652 | mCurrentComposer = 0; | ||
653 | } | ||
654 | |||
655 | void OpieMail::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList) | ||
656 | { | ||
657 | |||
658 | if ( mCurrentComposer ) { | ||
659 | mCurrentComposer->insertAttendees(uid,nameList,emailList,uidList); | ||
660 | } else { | ||
661 | ComposeMail compose( settings, this, 0, true ); | ||
662 | compose.slotAdjustColumns(); | ||
663 | #ifndef DESKTOP_VERSION | ||
664 | compose.showMaximized(); | ||
665 | #endif | ||
666 | mCurrentComposer = &compose; | ||
667 | mCurrentComposer->insertAttendees(uid,nameList,emailList,uidList); | ||
668 | compose.exec(); | ||
669 | mCurrentComposer = 0; | ||
670 | raise(); | ||
671 | } | ||
641 | } | 672 | } |
diff --git a/kmicromail/opiemail.h b/kmicromail/opiemail.h index b8a527f..4f75b3f 100644 --- a/kmicromail/opiemail.h +++ b/kmicromail/opiemail.h | |||
@@ -1,61 +1,66 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | 1 | // CHANGED 2004-09-31 Lutz Rogowski |
2 | #ifndef OPIEMAIL_H | 2 | #ifndef OPIEMAIL_H |
3 | #define OPIEMAIL_H | 3 | #define OPIEMAIL_H |
4 | 4 | ||
5 | #include "mainwindow.h" | 5 | #include "mainwindow.h" |
6 | #include <libmailwrapper/settings.h> | 6 | #include <libmailwrapper/settings.h> |
7 | 7 | ||
8 | #include <opie2/osmartpointer.h> | 8 | #include <opie2/osmartpointer.h> |
9 | #include <libmailwrapper/mailtypes.h> | 9 | #include <libmailwrapper/mailtypes.h> |
10 | #include <viewmail.h> | 10 | #include <viewmail.h> |
11 | #include <qstringlist.h> | ||
12 | |||
13 | class ComposeMail; | ||
11 | 14 | ||
12 | class OpieMail : public MainWindow | 15 | class OpieMail : public MainWindow |
13 | { | 16 | { |
14 | Q_OBJECT | 17 | Q_OBJECT |
15 | 18 | ||
16 | public: | 19 | public: |
17 | OpieMail( QWidget *parent = 0, const char *name = 0 ); | 20 | OpieMail( QWidget *parent = 0, const char *name = 0 ); |
18 | virtual ~OpieMail(); | 21 | virtual ~OpieMail(); |
19 | static QString appName() { return QString::fromLatin1("kopiemail"); } | 22 | static QString appName() { return QString::fromLatin1("kopiemail"); } |
20 | 23 | ||
21 | public slots: | 24 | public slots: |
22 | virtual void slotwriteMail(const QString&name,const QString&email); | 25 | virtual void slotwriteMail(const QString&name,const QString&email); |
23 | virtual void slotwriteMail2(const QString&nameemail); | 26 | virtual void slotwriteMail2(const QString&nameemail); |
24 | virtual void slotComposeMail(); | 27 | virtual void slotComposeMail(); |
25 | virtual void slotExtAppHandler(); | 28 | virtual void slotExtAppHandler(); |
26 | virtual void appMessage(const QCString &msg, const QByteArray &data); | 29 | virtual void appMessage(const QCString &msg, const QByteArray &data); |
27 | virtual void message(const QCString &msg, const QByteArray &data); | 30 | virtual void message(const QCString &msg, const QByteArray &data); |
31 | void insertAttendees(const QString&, const QStringList& namelist, const QStringList& emaillist, const QStringList& uidlist); | ||
28 | protected slots: | 32 | protected slots: |
29 | virtual void deleteAndDisplayNextMail(ViewMail * vm); | 33 | virtual void deleteAndDisplayNextMail(ViewMail * vm); |
30 | virtual void displayNextMail(ViewMail * vm); | 34 | virtual void displayNextMail(ViewMail * vm); |
31 | virtual void slotSendQueued(); | 35 | virtual void slotSendQueued(); |
32 | virtual void slotSearchMails(); | 36 | virtual void slotSearchMails(); |
33 | virtual void slotEditSettings(); | 37 | virtual void slotEditSettings(); |
34 | virtual void slotEditAccounts(); | 38 | virtual void slotEditAccounts(); |
35 | virtual void displayMail(); | 39 | virtual void displayMail(); |
36 | virtual void replyMail(); | 40 | virtual void replyMail(); |
37 | virtual void slotDeleteMail(); | 41 | virtual void slotDeleteMail(); |
38 | virtual void slotGetMail(); | 42 | virtual void slotGetMail(); |
39 | virtual void slotGetAllMail(); | 43 | virtual void slotGetAllMail(); |
40 | virtual void slotDeleteAllMail(); | 44 | virtual void slotDeleteAllMail(); |
41 | virtual void mailHold(int, QListViewItem *,const QPoint&,int); | 45 | virtual void mailHold(int, QListViewItem *,const QPoint&,int); |
42 | virtual void slotShowFolders( bool show ); | 46 | virtual void slotShowFolders( bool show ); |
43 | virtual void refreshMailView(const QValueList<RecMailP>&); | 47 | virtual void refreshMailView(const QValueList<RecMailP>&); |
44 | virtual void mailLeftClicked( QListViewItem * ); | 48 | virtual void mailLeftClicked( QListViewItem * ); |
45 | virtual void slotMoveCopyMail(); | 49 | virtual void slotMoveCopyMail(); |
46 | virtual void slotMoveCopyAllMail(); | 50 | virtual void slotMoveCopyAllMail(); |
47 | virtual void reEditMail(); | 51 | virtual void reEditMail(); |
48 | void clearSelection(); | 52 | void clearSelection(); |
49 | void slotDownloadMail(); | 53 | void slotDownloadMail(); |
50 | private: | 54 | private: |
55 | ComposeMail* mCurrentComposer; | ||
51 | void closeViewMail(ViewMail * vm); | 56 | void closeViewMail(ViewMail * vm); |
52 | QString mPendingEmail; | 57 | QString mPendingEmail; |
53 | QString mPendingName; | 58 | QString mPendingName; |
54 | QByteArray mPendingData; | 59 | QByteArray mPendingData; |
55 | QCString mPendingMessage; | 60 | QCString mPendingMessage; |
56 | Settings *settings; | 61 | Settings *settings; |
57 | QTextBrowser * tb; | 62 | QTextBrowser * tb; |
58 | 63 | ||
59 | }; | 64 | }; |
60 | 65 | ||
61 | #endif | 66 | #endif |
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index 7dc1880..bf41edb 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp | |||
@@ -81,145 +81,172 @@ void KOEventViewer::setSource(const QString& n) | |||
81 | // LR I do not understand, why the uid string is different on zaurus and desktop | 81 | // LR I do not understand, why the uid string is different on zaurus and desktop |
82 | QString uid = "uid://"+(*it).uid(); | 82 | QString uid = "uid://"+(*it).uid(); |
83 | 83 | ||
84 | //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1()); | 84 | //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1()); |
85 | if (n == uid ) { | 85 | if (n == uid ) { |
86 | //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); | 86 | //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); |
87 | QDialog dia( this,"dia123", true ); | 87 | QDialog dia( this,"dia123", true ); |
88 | dia.setCaption( i18n("Details of attendee") ); | 88 | dia.setCaption( i18n("Details of attendee") ); |
89 | QVBoxLayout lay ( &dia ); | 89 | QVBoxLayout lay ( &dia ); |
90 | KABC::AddresseeView av ( &dia ); | 90 | KABC::AddresseeView av ( &dia ); |
91 | av.setAddressee( (*it) ); | 91 | av.setAddressee( (*it) ); |
92 | lay.addWidget( &av ); | 92 | lay.addWidget( &av ); |
93 | if ( QApplication::desktop()->width() < 480 ) | 93 | if ( QApplication::desktop()->width() < 480 ) |
94 | dia.resize( 220, 240); | 94 | dia.resize( 220, 240); |
95 | else { | 95 | else { |
96 | dia.resize( 400,400); | 96 | dia.resize( 400,400); |
97 | } | 97 | } |
98 | dia.exec(); | 98 | dia.exec(); |
99 | break; | 99 | break; |
100 | } | 100 | } |
101 | } | 101 | } |
102 | return; | 102 | return; |
103 | } | 103 | } |
104 | #else | 104 | #else |
105 | { | 105 | { |
106 | if ( "uid:organizer" == n ) { | 106 | if ( "uid:organizer" == n ) { |
107 | ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),""); | 107 | ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),""); |
108 | return; | 108 | return; |
109 | } | 109 | } |
110 | QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); | 110 | QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); |
111 | if (attendees.count()) { | 111 | if (attendees.count()) { |
112 | Attendee *a; | 112 | Attendee *a; |
113 | for(a=attendees.first();a;a=attendees.next()) { | 113 | for(a=attendees.first();a;a=attendees.next()) { |
114 | if ( "uid:"+a->uid() == n ) { | 114 | if ( "uid:"+a->uid() == n ) { |
115 | bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), a->uid()); | 115 | bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), a->uid()); |
116 | return; | 116 | return; |
117 | } | 117 | } |
118 | } | 118 | } |
119 | } | 119 | } |
120 | return; | 120 | return; |
121 | } | 121 | } |
122 | //requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); | 122 | //requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); |
123 | // the result should now arrive through method insertAttendees | 123 | // the result should now arrive through method insertAttendees |
124 | //QString uid = "uid:"+(*it).uid(); | 124 | //QString uid = "uid:"+(*it).uid(); |
125 | #endif | 125 | #endif |
126 | if ( n.left(6) == "mailto" ) { | 126 | if ( n.left(6) == "mailto" ) { |
127 | // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1()); | 127 | // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1()); |
128 | #ifndef DESKTOP_VERSION | 128 | #ifndef DESKTOP_VERSION |
129 | if ( n.mid(7,3) == "ALL" ) { | ||
130 | qDebug("all "); | ||
131 | mailToAttendees( true ); | ||
132 | } else if ( n.mid(7,4) == "RSVP" ) { | ||
133 | mailToAttendees( false ); | ||
134 | qDebug("rsvp "); | ||
135 | } else { | ||
129 | QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" ); | 136 | QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" ); |
130 | e << n.mid(7); | 137 | e << n.mid(7); |
138 | } | ||
131 | #endif | 139 | #endif |
132 | 140 | ||
133 | } | 141 | } |
134 | 142 | ||
135 | 143 | ||
136 | #ifndef KORG_NODCOP | 144 | #ifndef KORG_NODCOP |
137 | kdDebug() << "KOEventViewer::setSource(): " << n << endl; | 145 | kdDebug() << "KOEventViewer::setSource(): " << n << endl; |
138 | QString tmpStr; | 146 | QString tmpStr; |
139 | if (n.startsWith("mailto:")) { | 147 | if (n.startsWith("mailto:")) { |
140 | KApplication::kApplication()->invokeMailer(n.mid(7),QString::null); | 148 | KApplication::kApplication()->invokeMailer(n.mid(7),QString::null); |
141 | //emit showIncidence(n); | 149 | //emit showIncidence(n); |
142 | return; | 150 | return; |
143 | } else if (n.startsWith("uid:")) { | 151 | } else if (n.startsWith("uid:")) { |
144 | DCOPClient *client = KApplication::kApplication()->dcopClient(); | 152 | DCOPClient *client = KApplication::kApplication()->dcopClient(); |
145 | const QByteArray noParamData; | 153 | const QByteArray noParamData; |
146 | const QByteArray paramData; | 154 | const QByteArray paramData; |
147 | QByteArray replyData; | 155 | QByteArray replyData; |
148 | QCString replyTypeStr; | 156 | QCString replyTypeStr; |
149 | #define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData)) | 157 | #define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData)) |
150 | bool foundAbbrowser = PING_ABBROWSER; | 158 | bool foundAbbrowser = PING_ABBROWSER; |
151 | 159 | ||
152 | if (foundAbbrowser) { | 160 | if (foundAbbrowser) { |
153 | //KAddressbook is already running, so just DCOP to it to bring up the contact editor | 161 | //KAddressbook is already running, so just DCOP to it to bring up the contact editor |
154 | //client->send("kaddressbook","KAddressBookIface", | 162 | //client->send("kaddressbook","KAddressBookIface", |
155 | QDataStream arg(paramData, IO_WriteOnly); | 163 | QDataStream arg(paramData, IO_WriteOnly); |
156 | arg << n.mid(6); | 164 | arg << n.mid(6); |
157 | client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData); | 165 | client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData); |
158 | return; | 166 | return; |
159 | } else { | 167 | } else { |
160 | /* | 168 | /* |
161 | KaddressBook is not already running. Pass it the UID of the contact via the command line while starting it - its neater. | 169 | KaddressBook is not already running. Pass it the UID of the contact via the command line while starting it - its neater. |
162 | We start it without its main interface | 170 | We start it without its main interface |
163 | */ | 171 | */ |
164 | KIconLoader* iconLoader = new KIconLoader(); | 172 | KIconLoader* iconLoader = new KIconLoader(); |
165 | QString iconPath = iconLoader->iconPath("go",KIcon::Small); | 173 | QString iconPath = iconLoader->iconPath("go",KIcon::Small); |
166 | ActionManager::setStartedKAddressBook(true); | 174 | ActionManager::setStartedKAddressBook(true); |
167 | tmpStr = "kaddressbook --editor-only --uid "; | 175 | tmpStr = "kaddressbook --editor-only --uid "; |
168 | tmpStr += KProcess::quote(n.mid(6)); | 176 | tmpStr += KProcess::quote(n.mid(6)); |
169 | KRun::runCommand(tmpStr,"KAddressBook",iconPath); | 177 | KRun::runCommand(tmpStr,"KAddressBook",iconPath); |
170 | return; | 178 | return; |
171 | } | 179 | } |
172 | } else { | 180 | } else { |
173 | //QTextBrowser::setSource(n); | 181 | //QTextBrowser::setSource(n); |
174 | } | 182 | } |
175 | #endif | 183 | #endif |
176 | } | 184 | } |
185 | void KOEventViewer::mailToAttendees( bool all ) | ||
186 | { | ||
187 | QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); | ||
188 | if (attendees.count() == 0) return; | ||
189 | QStringList nameList; | ||
190 | QStringList emailList; | ||
191 | QStringList uidList; | ||
192 | Attendee* a; | ||
193 | for(a=attendees.first();a;a=attendees.next()) { | ||
194 | if ( !all && !a->RSVP() ) continue; | ||
195 | if (!a->email().isEmpty()) { | ||
196 | nameList.append (a->name() ); | ||
197 | emailList.append (a->email() ); | ||
198 | uidList.append (a->uid() ); | ||
199 | } | ||
200 | } | ||
201 | QString uid = "ComposeMailUIpick2"+mMailSubject; | ||
202 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); | ||
177 | 203 | ||
204 | } | ||
178 | void KOEventViewer::addTag(const QString & tag,const QString & text) | 205 | void KOEventViewer::addTag(const QString & tag,const QString & text) |
179 | { | 206 | { |
180 | int number=text.contains("\n"); | 207 | int number=text.contains("\n"); |
181 | QString str = "<" + tag + ">"; | 208 | QString str = "<" + tag + ">"; |
182 | QString tmpText=text; | 209 | QString tmpText=text; |
183 | QString tmpStr=str; | 210 | QString tmpStr=str; |
184 | if(number !=-1) | 211 | if(number !=-1) |
185 | { | 212 | { |
186 | if (number > 0) { | 213 | if (number > 0) { |
187 | int pos=0; | 214 | int pos=0; |
188 | QString tmp; | 215 | QString tmp; |
189 | for(int i=0;i<=number;i++) { | 216 | for(int i=0;i<=number;i++) { |
190 | pos=tmpText.find("\n"); | 217 | pos=tmpText.find("\n"); |
191 | tmp=tmpText.left(pos); | 218 | tmp=tmpText.left(pos); |
192 | tmpText=tmpText.right(tmpText.length()-pos-1); | 219 | tmpText=tmpText.right(tmpText.length()-pos-1); |
193 | tmpStr+=tmp+"<br>"; | 220 | tmpStr+=tmp+"<br>"; |
194 | } | 221 | } |
195 | } | 222 | } |
196 | else tmpStr += tmpText; | 223 | else tmpStr += tmpText; |
197 | tmpStr+="</" + tag + ">"; | 224 | tmpStr+="</" + tag + ">"; |
198 | mText.append(tmpStr); | 225 | mText.append(tmpStr); |
199 | } | 226 | } |
200 | else | 227 | else |
201 | { | 228 | { |
202 | str += text + "</" + tag + ">"; | 229 | str += text + "</" + tag + ">"; |
203 | mText.append(str); | 230 | mText.append(str); |
204 | } | 231 | } |
205 | } | 232 | } |
206 | 233 | ||
207 | void KOEventViewer::setColorMode( int m ) | 234 | void KOEventViewer::setColorMode( int m ) |
208 | { | 235 | { |
209 | mColorMode = m; | 236 | mColorMode = m; |
210 | } | 237 | } |
211 | void KOEventViewer::appendEvent(Event *event, int mode ) | 238 | void KOEventViewer::appendEvent(Event *event, int mode ) |
212 | { | 239 | { |
213 | mMailSubject = ""; | 240 | mMailSubject = ""; |
214 | mCurrentIncidence = event; | 241 | mCurrentIncidence = event; |
215 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; | 242 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; |
216 | topLevelWidget()->setCaption(i18n("Event Viewer")); | 243 | topLevelWidget()->setCaption(i18n("Event Viewer")); |
217 | if ( mode == 0 ) { | 244 | if ( mode == 0 ) { |
218 | addTag("h2",event->summary()); | 245 | addTag("h2",event->summary()); |
219 | } | 246 | } |
220 | else { | 247 | else { |
221 | if ( mColorMode == 1 ) { | 248 | if ( mColorMode == 1 ) { |
222 | mText +="<font color=\"#00A000\">"; | 249 | mText +="<font color=\"#00A000\">"; |
223 | } | 250 | } |
224 | if ( mColorMode == 2 ) { | 251 | if ( mColorMode == 2 ) { |
225 | mText +="<font color=\"#C00000\">"; | 252 | mText +="<font color=\"#C00000\">"; |
@@ -417,148 +444,173 @@ void KOEventViewer::formatCategories(Incidence *event) | |||
417 | addTag("p",event->categoriesStr()); | 444 | addTag("p",event->categoriesStr()); |
418 | } | 445 | } |
419 | } | 446 | } |
420 | void KOEventViewer::formatAttendees(Incidence *event) | 447 | void KOEventViewer::formatAttendees(Incidence *event) |
421 | { | 448 | { |
422 | QPtrList<Attendee> attendees = event->attendees(); | 449 | QPtrList<Attendee> attendees = event->attendees(); |
423 | if (attendees.count()) { | 450 | if (attendees.count()) { |
424 | 451 | ||
425 | 452 | ||
426 | QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); | 453 | QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); |
427 | QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small); | 454 | QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small); |
428 | addTag("h3",i18n("Organizer")); | 455 | addTag("h3",i18n("Organizer")); |
429 | mText.append("<ul><li>"); | 456 | mText.append("<ul><li>"); |
430 | #ifndef KORG_NOKABC | 457 | #ifndef KORG_NOKABC |
431 | 458 | ||
432 | #ifdef DESKTOP_VERSION | 459 | #ifdef DESKTOP_VERSION |
433 | KABC::AddressBook *add_book = KABC::StdAddressBook::self(); | 460 | KABC::AddressBook *add_book = KABC::StdAddressBook::self(); |
434 | KABC::Addressee::List addressList; | 461 | KABC::Addressee::List addressList; |
435 | addressList = add_book->findByEmail(event->organizer()); | 462 | addressList = add_book->findByEmail(event->organizer()); |
436 | KABC::Addressee o = addressList.first(); | 463 | KABC::Addressee o = addressList.first(); |
437 | if (!o.isEmpty() && addressList.size()<2) { | 464 | if (!o.isEmpty() && addressList.size()<2) { |
438 | mText += "<a href=\"uid:" + o.uid() + "\">"; | 465 | mText += "<a href=\"uid:" + o.uid() + "\">"; |
439 | mText += o.formattedName(); | 466 | mText += o.formattedName(); |
440 | mText += "</a>\n"; | 467 | mText += "</a>\n"; |
441 | } else { | 468 | } else { |
442 | mText.append(event->organizer()); | 469 | mText.append(event->organizer()); |
443 | } | 470 | } |
444 | #else //DESKTOP_VERSION | 471 | #else //DESKTOP_VERSION |
445 | mText += "<a href=\"uid:organizer\">"; | 472 | mText += "<a href=\"uid:organizer\">"; |
446 | mText += event->organizer(); | 473 | mText += event->organizer(); |
447 | mText += "</a>\n"; | 474 | mText += "</a>\n"; |
448 | #endif //DESKTOP_VERSION | 475 | #endif //DESKTOP_VERSION |
449 | 476 | ||
450 | 477 | ||
451 | #else | 478 | #else |
452 | mText.append(event->organizer()); | 479 | mText.append(event->organizer()); |
453 | #endif | 480 | #endif |
454 | 481 | ||
455 | if (iconPath) { | 482 | if (iconPath) { |
456 | mText += " <a href=\"mailto:" + event->organizer() + "\">"; | 483 | mText += " <a href=\"mailto:" + event->organizer() + "\">"; |
457 | mText += "<IMG src=\"" + iconPath + "\">"; | 484 | mText += "<IMG src=\"" + iconPath + "\">"; |
458 | mText += "</a>\n"; | 485 | mText += "</a>\n"; |
459 | } | 486 | } |
460 | mText.append("</li></ul>"); | 487 | mText.append("</li></ul>"); |
461 | 488 | ||
462 | addTag("h3",i18n("Attendees")); | 489 | addTag("h3",i18n("Attendees")); |
463 | Attendee *a; | 490 | Attendee *a; |
464 | mText.append("<ul>"); | 491 | mText.append("<ul>"); |
492 | int a_count = 0; | ||
493 | int a_count_nr = 0; | ||
494 | |||
465 | for(a=attendees.first();a;a=attendees.next()) { | 495 | for(a=attendees.first();a;a=attendees.next()) { |
466 | #ifndef KORG_NOKABC | 496 | #ifndef KORG_NOKABC |
467 | #ifdef DESKTOP_VERSION | 497 | #ifdef DESKTOP_VERSION |
468 | if (a->name().isEmpty()) { | 498 | if (a->name().isEmpty()) { |
469 | addressList = add_book->findByEmail(a->email()); | 499 | addressList = add_book->findByEmail(a->email()); |
470 | KABC::Addressee o = addressList.first(); | 500 | KABC::Addressee o = addressList.first(); |
471 | if (!o.isEmpty() && addressList.size()<2) { | 501 | if (!o.isEmpty() && addressList.size()<2) { |
472 | mText += "<a href=\"uid:" + o.uid() + "\">"; | 502 | mText += "<a href=\"uid:" + o.uid() + "\">"; |
473 | mText += o.formattedName(); | 503 | mText += o.formattedName(); |
474 | mText += "</a>\n"; | 504 | mText += "</a>\n"; |
475 | } else { | 505 | } else { |
476 | mText += "<li>"; | 506 | mText += "<li>"; |
477 | mText.append(a->email()); | 507 | mText.append(a->email()); |
478 | mText += "\n"; | 508 | mText += "\n"; |
479 | } | 509 | } |
480 | } else { | 510 | } else { |
481 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; | 511 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; |
482 | if (!a->name().isEmpty()) mText += a->name(); | 512 | if (!a->name().isEmpty()) mText += a->name(); |
483 | else mText += a->email(); | 513 | else mText += a->email(); |
484 | mText += "</a>\n"; | 514 | mText += "</a>\n"; |
485 | } | 515 | } |
486 | #else //DESKTOP_VERSION | 516 | #else //DESKTOP_VERSION |
487 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; | 517 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; |
488 | if (!a->name().isEmpty()) mText += a->name(); | 518 | if (!a->name().isEmpty()) mText += a->name(); |
489 | else mText += a->email(); | 519 | else mText += a->email(); |
490 | mText += "</a>\n"; | 520 | mText += "</a>\n"; |
491 | #endif //DESKTOP_VERSION | 521 | #endif //DESKTOP_VERSION |
492 | #else | 522 | #else |
493 | //qDebug("nokabc "); | 523 | //qDebug("nokabc "); |
494 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; | 524 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; |
495 | if (!a->name().isEmpty()) mText += a->name(); | 525 | if (!a->name().isEmpty()) mText += a->name(); |
496 | else mText += a->email(); | 526 | else mText += a->email(); |
497 | mText += "</a>\n"; | 527 | mText += "</a>\n"; |
498 | #endif | 528 | #endif |
499 | 529 | ||
500 | 530 | ||
501 | if (!a->email().isEmpty()) { | 531 | if (!a->email().isEmpty()) { |
502 | if (iconPath) { | 532 | if (iconPath) { |
503 | mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">"; | 533 | mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">"; |
504 | if ( a->RSVP() ) | 534 | if ( a->RSVP() ) { |
535 | ++a_count; | ||
505 | mText += "<IMG src=\"" + iconPath + "\">"; | 536 | mText += "<IMG src=\"" + iconPath + "\">"; |
506 | else | 537 | } |
538 | else { | ||
539 | ++a_count_nr; | ||
507 | mText += "<IMG src=\"" + NOiconPath + "\">"; | 540 | mText += "<IMG src=\"" + NOiconPath + "\">"; |
541 | } | ||
508 | mText += "</a>\n"; | 542 | mText += "</a>\n"; |
509 | } | 543 | } |
510 | } | 544 | } |
511 | if (a->status() != Attendee::NeedsAction ) | 545 | if (a->status() != Attendee::NeedsAction ) |
512 | mText +="[" + a->statusStr() + "] "; | 546 | mText +="[" + a->statusStr() + "] "; |
513 | if (a->role() == Attendee::Chair ) | 547 | if (a->role() == Attendee::Chair ) |
514 | mText +="(" + a->roleStr().left(1) + ".)"; | 548 | mText +="(" + a->roleStr().left(1) + ".)"; |
515 | } | 549 | } |
516 | mText.append("</li></ul>"); | 550 | mText.append("</li></ul>"); |
551 | if ( a_count > 1 ) { | ||
552 | mText += "<a href=\"mailto:ALL\">"; | ||
553 | mText += i18n( "Mail to all" ); | ||
554 | mText += "</a> ( "; | ||
555 | mText += "<IMG src=\"" + iconPath + "\">"; | ||
556 | mText += i18n( " and " ); | ||
557 | mText += "<IMG src=\"" + NOiconPath + "\"> )"; | ||
558 | mText += "<br>\n"; | ||
559 | |||
560 | |||
561 | } | ||
562 | if ( a_count_nr > 1 ) { | ||
563 | mText += "<a href=\"mailto:RSVP\">"; | ||
564 | mText += i18n( "Mail to selected" ); | ||
565 | mText += "</a> ( "; | ||
566 | mText += i18n( "<IMG src=\"%1\"> only )").arg ( iconPath ); | ||
567 | mText += "\n"; | ||
568 | } | ||
517 | } | 569 | } |
518 | 570 | ||
519 | } | 571 | } |
520 | void KOEventViewer::appendJournal(Journal *jour, int mode ) | 572 | void KOEventViewer::appendJournal(Journal *jour, int mode ) |
521 | { | 573 | { |
522 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; | 574 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; |
523 | if (mode == 0 ) { | 575 | if (mode == 0 ) { |
524 | addTag("h2",i18n("Journal from: ")); | 576 | addTag("h2",i18n("Journal from: ")); |
525 | } | 577 | } |
526 | else { | 578 | else { |
527 | if ( mode == 1 ) { | 579 | if ( mode == 1 ) { |
528 | addTag("h2",i18n( "Local: " ) +i18n("Journal from: ")); | 580 | addTag("h2",i18n( "Local: " ) +i18n("Journal from: ")); |
529 | } else { | 581 | } else { |
530 | addTag("h2",i18n( "Remote: " ) +i18n("Journal from: ")); | 582 | addTag("h2",i18n( "Remote: " ) +i18n("Journal from: ")); |
531 | } | 583 | } |
532 | } | 584 | } |
533 | topLevelWidget()->setCaption("Journal Viewer"); | 585 | topLevelWidget()->setCaption("Journal Viewer"); |
534 | mText.append(i18n("<h3> %1 </h3> ").arg(jour->dtStartDateStr(KOPrefs::instance()->mShortDateInViewer))); | 586 | mText.append(i18n("<h3> %1 </h3> ").arg(jour->dtStartDateStr(KOPrefs::instance()->mShortDateInViewer))); |
535 | addTag("b",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(jour->lastModified(),shortDate ) ); | 587 | addTag("b",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(jour->lastModified(),shortDate ) ); |
536 | if (!jour->description().isEmpty()) { | 588 | if (!jour->description().isEmpty()) { |
537 | addTag("p",jour->description()); | 589 | addTag("p",jour->description()); |
538 | } | 590 | } |
539 | setText(mText); | 591 | setText(mText); |
540 | } | 592 | } |
541 | 593 | ||
542 | void KOEventViewer::formatReadOnly(Incidence *event) | 594 | void KOEventViewer::formatReadOnly(Incidence *event) |
543 | { | 595 | { |
544 | if (event->isReadOnly()) { | 596 | if (event->isReadOnly()) { |
545 | addTag("p","<em>(" + i18n("read-only") + ")</em>"); | 597 | addTag("p","<em>(" + i18n("read-only") + ")</em>"); |
546 | } | 598 | } |
547 | } | 599 | } |
548 | void KOEventViewer::setSyncMode( bool b ) | 600 | void KOEventViewer::setSyncMode( bool b ) |
549 | { | 601 | { |
550 | mSyncMode = b; | 602 | mSyncMode = b; |
551 | } | 603 | } |
552 | 604 | ||
553 | 605 | ||
554 | void KOEventViewer::setTodo(Todo *event, bool clearV ) | 606 | void KOEventViewer::setTodo(Todo *event, bool clearV ) |
555 | { | 607 | { |
556 | if ( clearV ) | 608 | if ( clearV ) |
557 | clearEvents(); | 609 | clearEvents(); |
558 | if ( mSyncMode ) { | 610 | if ( mSyncMode ) { |
559 | if ( clearV ) | 611 | if ( clearV ) |
560 | appendTodo(event,1 ); | 612 | appendTodo(event,1 ); |
561 | else | 613 | else |
562 | appendTodo(event,2); | 614 | appendTodo(event,2); |
563 | } else | 615 | } else |
564 | appendTodo(event); | 616 | appendTodo(event); |
diff --git a/korganizer/koeventviewer.h b/korganizer/koeventviewer.h index 0cd3f33..cf44284 100644 --- a/korganizer/koeventviewer.h +++ b/korganizer/koeventviewer.h | |||
@@ -6,69 +6,70 @@ | |||
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 the hope that it will be useful, | 10 | This program is distributed in the 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 | #ifndef KOEVENTVIEWER_H | 19 | #ifndef KOEVENTVIEWER_H |
20 | #define KOEVENTVIEWER_H | 20 | #define KOEVENTVIEWER_H |
21 | // | 21 | // |
22 | // Viewer widget for events. | 22 | // Viewer widget for events. |
23 | // | 23 | // |
24 | 24 | ||
25 | #include <qtextbrowser.h> | 25 | #include <qtextbrowser.h> |
26 | 26 | ||
27 | #include <libkcal/event.h> | 27 | #include <libkcal/event.h> |
28 | #include <libkcal/journal.h> | 28 | #include <libkcal/journal.h> |
29 | 29 | ||
30 | 30 | ||
31 | using namespace KCal; | 31 | using namespace KCal; |
32 | 32 | ||
33 | class KOEventViewer : public QTextBrowser { | 33 | class KOEventViewer : public QTextBrowser { |
34 | Q_OBJECT | 34 | Q_OBJECT |
35 | public: | 35 | public: |
36 | KOEventViewer(QWidget *parent=0,const char *name=0); | 36 | KOEventViewer(QWidget *parent=0,const char *name=0); |
37 | virtual ~KOEventViewer(); | 37 | virtual ~KOEventViewer(); |
38 | 38 | ||
39 | void setSource(const QString &); | 39 | void setSource(const QString &); |
40 | void setEvent(Event *event); | 40 | void setEvent(Event *event); |
41 | void addEvent(Event *event); | 41 | void addEvent(Event *event); |
42 | void setTodo(Todo *event, bool clearV = true ); | 42 | void setTodo(Todo *event, bool clearV = true ); |
43 | void setJournal(Journal *jour, bool clearV = true ); | 43 | void setJournal(Journal *jour, bool clearV = true ); |
44 | 44 | ||
45 | void appendEvent(Event *event, int mode = 0 ); | 45 | void appendEvent(Event *event, int mode = 0 ); |
46 | void appendTodo(Todo *event, int mode = 0 ); | 46 | void appendTodo(Todo *event, int mode = 0 ); |
47 | void appendJournal(Journal *jour, int mode = 0 ); | 47 | void appendJournal(Journal *jour, int mode = 0 ); |
48 | 48 | ||
49 | void clearEvents(bool now=false); | 49 | void clearEvents(bool now=false); |
50 | 50 | ||
51 | void addText(QString text); | 51 | void addText(QString text); |
52 | void setSyncMode( bool ); | 52 | void setSyncMode( bool ); |
53 | void setColorMode( int ); | 53 | void setColorMode( int ); |
54 | void mailToAttendees( bool all ); | ||
54 | 55 | ||
55 | protected: | 56 | protected: |
56 | int mColorMode; | 57 | int mColorMode; |
57 | void addTag(const QString & tag,const QString & text); | 58 | void addTag(const QString & tag,const QString & text); |
58 | 59 | ||
59 | void formatCategories(Incidence *event); | 60 | void formatCategories(Incidence *event); |
60 | void formatAttendees(Incidence *event); | 61 | void formatAttendees(Incidence *event); |
61 | void formatReadOnly(Incidence *event); | 62 | void formatReadOnly(Incidence *event); |
62 | 63 | ||
63 | private: | 64 | private: |
64 | QTextBrowser *mEventTextView; | 65 | QTextBrowser *mEventTextView; |
65 | bool mSyncMode; | 66 | bool mSyncMode; |
66 | 67 | ||
67 | QString mText; | 68 | QString mText; |
68 | QString mMailSubject; | 69 | QString mMailSubject; |
69 | Incidence* mCurrentIncidence; | 70 | Incidence* mCurrentIncidence; |
70 | signals: | 71 | signals: |
71 | void launchaddressbook(QString uid); | 72 | void launchaddressbook(QString uid); |
72 | }; | 73 | }; |
73 | 74 | ||
74 | #endif | 75 | #endif |
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp index 3079141..7200da9 100644 --- a/libkdepim/externalapphandler.cpp +++ b/libkdepim/externalapphandler.cpp | |||
@@ -1086,96 +1086,97 @@ void ExternalAppHandler::passParameters(QCopEnvelope* e, const QString& paramete | |||
1086 | //Now check how many parts we have. | 1086 | //Now check how many parts we have. |
1087 | //=0 :no params to pass | 1087 | //=0 :no params to pass |
1088 | //>0 :parameters to pass | 1088 | //>0 :parameters to pass |
1089 | for ( QStringList::Iterator it = paramlist.begin(); it != paramlist.end(); ++it ) | 1089 | for ( QStringList::Iterator it = paramlist.begin(); it != paramlist.end(); ++it ) |
1090 | { | 1090 | { |
1091 | QString param = (*it); | 1091 | QString param = (*it); |
1092 | QStringList keyvallist = QStringList::split("=", param); | 1092 | QStringList keyvallist = QStringList::split("=", param); |
1093 | 1093 | ||
1094 | //if we have keyvalue pairs, we assume that we pass a map to the envelope | 1094 | //if we have keyvalue pairs, we assume that we pass a map to the envelope |
1095 | QStringList::Iterator it2 = keyvallist.begin(); | 1095 | QStringList::Iterator it2 = keyvallist.begin(); |
1096 | QString key = (*it2); | 1096 | QString key = (*it2); |
1097 | key = key.replace( QRegExp("%1"), param1 ); | 1097 | key = key.replace( QRegExp("%1"), param1 ); |
1098 | key = key.replace( QRegExp("%2"), param2 ); | 1098 | key = key.replace( QRegExp("%2"), param2 ); |
1099 | ++it2; | 1099 | ++it2; |
1100 | 1100 | ||
1101 | if(it2 != keyvallist.end()) | 1101 | if(it2 != keyvallist.end()) |
1102 | { | 1102 | { |
1103 | QString value = (*it2); | 1103 | QString value = (*it2); |
1104 | value = value.replace( QRegExp("%1"), param1 ); | 1104 | value = value.replace( QRegExp("%1"), param1 ); |
1105 | value = value.replace( QRegExp("%2"), param2 ); | 1105 | value = value.replace( QRegExp("%2"), param2 ); |
1106 | 1106 | ||
1107 | valmap.insert(key, value); | 1107 | valmap.insert(key, value); |
1108 | useValMap = true; | 1108 | useValMap = true; |
1109 | } | 1109 | } |
1110 | else | 1110 | else |
1111 | { | 1111 | { |
1112 | // qDebug("pass parameter << %s", key.latin1()); | 1112 | // qDebug("pass parameter << %s", key.latin1()); |
1113 | (*e) << key; | 1113 | (*e) << key; |
1114 | } | 1114 | } |
1115 | } | 1115 | } |
1116 | 1116 | ||
1117 | if (useValMap == true) | 1117 | if (useValMap == true) |
1118 | (*e) << valmap; | 1118 | (*e) << valmap; |
1119 | 1119 | ||
1120 | #endif | 1120 | #endif |
1121 | 1121 | ||
1122 | } | 1122 | } |
1123 | 1123 | ||
1124 | 1124 | ||
1125 | 1125 | ||
1126 | /************************************************************************** | 1126 | /************************************************************************** |
1127 | * | 1127 | * |
1128 | **************************************************************************/ | 1128 | **************************************************************************/ |
1129 | 1129 | ||
1130 | void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data ) | 1130 | void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data ) |
1131 | { | 1131 | { |
1132 | 1132 | ||
1133 | if ( cmsg == "nextView()" ) { | 1133 | if ( cmsg == "nextView()" ) { |
1134 | qDebug("nextView()"); | ||
1134 | emit nextView(); | 1135 | emit nextView(); |
1135 | return; | 1136 | return; |
1136 | } | 1137 | } |
1137 | 1138 | ||
1138 | bool res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); | 1139 | bool res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); |
1139 | if (!res) | 1140 | if (!res) |
1140 | res = mBirthdayListFromKAPITransfer->appMessage( cmsg, data ); | 1141 | res = mBirthdayListFromKAPITransfer->appMessage( cmsg, data ); |
1141 | 1142 | ||
1142 | if (!res) | 1143 | if (!res) |
1143 | res = mDisplayDetails->appMessage( cmsg, data ); | 1144 | res = mDisplayDetails->appMessage( cmsg, data ); |
1144 | 1145 | ||
1145 | // if (!res) | 1146 | // if (!res) |
1146 | // res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); | 1147 | // res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); |
1147 | } | 1148 | } |
1148 | 1149 | ||
1149 | 1150 | ||
1150 | 1151 | ||
1151 | bool ExternalAppHandler::requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid) | 1152 | bool ExternalAppHandler::requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid) |
1152 | { | 1153 | { |
1153 | mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); | 1154 | mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); |
1154 | return mNameEmailUidListFromKAPITransfer->sendMessageToTarget(sessionuid); | 1155 | return mNameEmailUidListFromKAPITransfer->sendMessageToTarget(sessionuid); |
1155 | } | 1156 | } |
1156 | 1157 | ||
1157 | bool ExternalAppHandler::returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3) | 1158 | bool ExternalAppHandler::returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3) |
1158 | { | 1159 | { |
1159 | QStringList list4, list5, list6; | 1160 | QStringList list4, list5, list6; |
1160 | 1161 | ||
1161 | mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); | 1162 | mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); |
1162 | return mNameEmailUidListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6); | 1163 | return mNameEmailUidListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6); |
1163 | } | 1164 | } |
1164 | 1165 | ||
1165 | bool ExternalAppHandler::requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& email) | 1166 | bool ExternalAppHandler::requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& email) |
1166 | { | 1167 | { |
1167 | mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel); | 1168 | mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel); |
1168 | return mFindByEmailFromKAPITransfer->sendMessageToTarget(sessionuid, email); | 1169 | return mFindByEmailFromKAPITransfer->sendMessageToTarget(sessionuid, email); |
1169 | } | 1170 | } |
1170 | 1171 | ||
1171 | bool ExternalAppHandler::returnFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3) | 1172 | bool ExternalAppHandler::returnFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3) |
1172 | { | 1173 | { |
1173 | QStringList list4, list5, list6; | 1174 | QStringList list4, list5, list6; |
1174 | 1175 | ||
1175 | mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel); | 1176 | mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel); |
1176 | return mFindByEmailFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6); | 1177 | return mFindByEmailFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6); |
1177 | } | 1178 | } |
1178 | 1179 | ||
1179 | bool ExternalAppHandler::requestDetailsFromKAPI(const QString& name, const QString& email, const QString& uid) | 1180 | bool ExternalAppHandler::requestDetailsFromKAPI(const QString& name, const QString& email, const QString& uid) |
1180 | { | 1181 | { |
1181 | mDisplayDetails->setSourceChannel(""); | 1182 | mDisplayDetails->setSourceChannel(""); |