summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt3
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt5
-rw-r--r--kaddressbook/kabcore.cpp2
-rw-r--r--kmicromail/composemail.cpp14
-rw-r--r--kmicromail/opiemail.cpp33
-rw-r--r--kmicromail/opiemail.h5
-rw-r--r--korganizer/koeventviewer.cpp56
-rw-r--r--korganizer/koeventviewer.h3
-rw-r--r--libkdepim/externalapphandler.cpp1
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,201 +1,204 @@
Info about the changes in new versions of KDE-Pim/Pi
********** VERSION 2.0.3 ************
KO/Pi:
Added feature for changing alarm settings for many items at once:
Open list view (or search dialog), select the desired items and choose in
the popup menu: Set alarm for selected...
+Added to the event/todo viewer the option to send an email to
+all attendees or all selected (with RSVP) attendees.
+
********** VERSION 2.0.2 ************
KO/Pi:
Fixed the layout problem of the day label buttons
of the agenda view introduced in version 2.0.1.
Added WhatsThis support for the todo view and the list view.
Added a quite useful feature to the montview.
Just click on the week numbers on the left.
And in the top right corner of month view/agenda view
there is now a "week number quick selector".
(Click on the black triangle).
Made the quite difficult timezone change in KO/Pi easy.
OM/Pi:
Fixed too small icons on desktop.
Fixed non visible icons in mainwindow on Z with fastload enabled.
Added signature file setting to smtp account config.
And the signature can be edited and saved in the edit mail dialog.
That does mean:
Simply edit the signature for the selected smtp account in the
edit new mail dialog and press the "save signature" button there.
Then the signature is saved to the file specified in the smtp account settings.
If there is no file specified, it is saved automatically to the file
kdepim/apps/kopiemail/<accountname>.sig.
********** VERSION 2.0.1 ************
Oooops ... I forgot to test on the Zaurus 5500 ...
Fixed many problems of new (english) strings (and german translations)
introduced in the latest versions, where the text was not fitting on the
240x320 display of the Zaurus 5500.
KO/Pi:
Added a popup menu ( press pen and hold to get popup ) to the agenda view
with many useful items (add event/todo, show next week, two weeks, month, journal).
Added items to the todolist popup menu for:
Display all opened, all closed or all todos flat.
The "flat" view makes is possible to sort all todos after ,e.g., prio or date.
Made the reparenting of todos on the desktop possible via Drag&Drop.
Fixed several bugs in setting the completed datetime for todos.
Added info about completed datetime of todos to the todo viewer.
Now displaying a completed todo (with completed datetime set) in the agenda view
at the time of the completion. Such that now it is possible to see in the agenda view
when what todo was completed.
Fixed behaviour of automatic setting completion of todos with sub-todos/parent todos.
Now the behaviour is:
Setting a parent to complete sets all (sub)childs to complete.
Setting a parent to uncomplete does not change the childs.
Setting a child to uncomplete sets all parent to uncomplete.
Setting a child to complete does not change the parents.
Smart updating and double buffering of the daymatrix.
Showing holidays in the day matrix.
Many other small performance updates.
Made day labels in agenda clickable. By clicking a label, the day is displayed in single day mode.
Now the translation file usertranslation.txt is supposed to be in utf8 format.
If you want to translate a language from western europe, just change the germantranslation.txt file. Please read the updated Usertranslation HowTo in KO/Pi Help menu.
********** VERSION 2.0.0 ************
Stable release 2.0.0!
KO/Pi:
Fixed problem in edit dialog recreation at startup.
Made "toggle view*" menu items enabled context sensitive.
Changed agenda size menu to items 1-10.
Made it possible to change agenda size quickly by pressing mouse on timelabels in agenda view and move mouse up/down.
Usebility enhancements in the KO/Pi menus.
Birthday import now adds year to summary.
What's Next view shows age in years for birthday.
OM/Pi:
Added three info lines to display subject, from and to of selected mails.
KA/Pi:
Fixed jump bar behaviour on Zaurus.
Now KA/Pi search field supports searching for a range of starting characters.
E.g. to search for all contact beginning with b to n, type
b-n
in the search field.
********** VERSION 1.9.20 ************
KO/Pi:
Added for the "dislplay one day" agenda mode
info in the caption and in the day lables:
Now it is displayed, if the selected day is from "day before yesterday"
to "day after tomorrow".
Made it possible to delete a Todo, which has sub-todos.
Fixed two small problems in the todo view.
Added missing German translation for filter edit and print dialog.
Made search dialog closeable by cancel key.
Made it possible to select in the date picker the (ligt grey )
dates of the prev./next month with the mouse.
OM/Pi:
"Delete mail" icon in main window now deletes all selected mails.
Fixed the problem, that the state flag of imap mails was ignored.
Now mails with "FLAG_SEEN" on the imap server get no icon in the list view
to indecate that they are already seen.
Fixed the problem that the body of some mails was not displayed in the
mail viewer when fetching them from the imap server directly to read them.
Made it (configurable) possible to show the "To:" field in the list view.
Added to the mail viewer the option "View Source" to make it possible to see the raw mail data.
Added a "Download Mail" button to the mail viewer to quickly download the viewed mail to the
local storage folder (specified in account settings) of the account of the mail.
Removed some memory leaks in OM/Pi.
********** VERSION 1.9.19 ************
Added a lot of missing translations to KA/Pi,
Added some missing translations to KO/Pi and OM/Pi.
Fixed some minor problems in KA/Pi + KO/Pi.
Fixed a crash when closing PwM/Pi.
Added German translation for PwM/Pi.
Made view change and Month View update faster in KO/Pi.
********** VERSION 1.9.18 ************
FYI: The VERSION 1.9.17 was a testing release only.
Please read the changelog of VERSION 1.9.17 as well.
Cleaned up the syncing config dialog.
Added sync config options for date range for events.
Added sync config options for filters on incoming data.
Added sync config options for filters on outgoing data.
Please read the updated SyncHowTo about the new filter settings.
These filter settings make it now possible to sync with shared
calendars without writing back private or confidential data
(via the outgoing filters).
To sync only with particular parts of a shared calendar,
the incoming filter settings can be used.
An example can be found in the SyncHowTo.
Same for shared addressbooks.
Added a setting for the global kdepim data storage.
Usually the data is stored in (yourhomedir/kdepim).
Now you can set in the Global config dialog TAB, subTAB "Data storage path"
a directory where all the kdepim data is stored.
That makes it easy to save all kdepim data on a SD card on the Z, for example.
KO/Pi:
The timeedit input has a pulldown list for times.
If opened, this pulldown list should now has the right time highlighted.
Added the possibility to exclude events/todos/journals in a filter.
You should exclude journals, if you do not want them to sync with a public calendar.
KA/Pi:
Added the possibility to in/exclude public/private/confidential contacts to a filter.
If you have already defined filterrules in KA/Pi you have to adjust them all by setting the "include public/private/confidential" property manually. Sorry for that ...
Added printing of card view and details view on desktop.
Printing of list view is not working...
Added button for removing pictures in contact editor.
Parsing data fix of KA/Pi version 1.9.17.
Fixed the "parse name automatically" problem of KA/Pi version 1.9.17.
Fixed some syncing merging problems.
********** VERSION 1.9.17 ************
KO/Pi:
Fixed that tooltips were not updated after moving an item in agenda view.
Fixed a bug in sorting start date for recurring events in list view.
Changed the left button in todo viewer from "Agenda" to "Set completed".
This makes it possible to change a todo in the What's Next View quickly to the completed state without leaving the What's Next View.
Added more info in the todo viewer: Startdate, parent/sub todos.
KA/Pi:
All fields search does now actually search all the (possible) fields,
not only those listed in the contact list.
Made is possible to inline a picture in a vcard on the Z.
This was only possible on the desktop, now is it possible on the Z as well.
Fixed of missing save settings after filter configuration.
Made saving of addressbook much faster.
Fixed extension widget layout problem.
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
@@ -1022,199 +1022,204 @@
{ "<p><b>C</b>: Show current time in agenda view</p>\n","<p><b>C</b>: Zeige aktuelle Zeit in Agenda Ansicht</p>\n" },
{ "<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n","<p><b>+,-</b> : Zoom rein/raus Agenda | <b>A</b>: Wechsle Ganztag Agenda Höhe</p>\n" },
{ "<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n","<p><b>S+ctrl</b>: Füge Sub-Todo hinzu | <b>X</b>: Zeige/verstecke Datenavigator</p>\n" },
{ "<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n","<p><b>T</b>: Gehe zu Heute | <b>T+ctrl</b>: Neues Todo</p>\n" },
{ "<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n","<p><b>E</b>: Editiere selektiertes Item |<b> E+ctrl</b>: Neuer Termin</p>\n" },
{ "<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n","<p><b>D</b>: Ein-Tages Ansicht | <b>M</b>: Monats Ansicht</p>\n" },
{ "<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n","<p><b>Z,Y</b>: Arbeitswochen Ansicht | <b>U</b>: Wochen Ansicht</p>\n" },
{ "<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n","<p><b>V</b>: Todo Ansicht | <b>L</b>: Termin Listen Ansicht</p>\n" },
{ "<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ","<p><b>N</b>: Nächste-Tage Ansicht days view| <b>W</b>: What's next Ansicht\n " },
{ "<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n","<p><b>1-0</b> (+<b>ctrl</b>): Selektiere Filter 1-10 (11-20)</p>\n" },
{ "<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n","<p><b>O</b>: Filter An/Aus | <b>J</b>: Journal Ansicht</p>\n" },
{ "<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n","<p><b>F</b>: Zeige/verstecke Filter Ansicht |<b>F+ctrl</b>: Editiere Filter </p>\n" },
{ "<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n","<p><b>Space</b>: Zeige fullscreen | <b>P</b>: Datums Picker</p>\n" },
{ "<p><b>I</b>: Show info for selected event/todo</p>\n","<p><b>I</b>: Zeige Info (Details) für selektiertes Item</p>\n" },
{ "<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n","<p><b>H</b>: Dieser Hilfe Dialog | <b>S</b>: Such Dialog</p>\n" },
{ "<p><h2>KO/Pi key shortcuts:</h2></p>\n","<p><h2>KO/Pi Tastatur Kurzbefehle:</h2></p>\n" },
{ "After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n","Nachdem etwas geändert wurde, werden die\nDaten automatisch in die Datei abgespeichert\n~/kdepim/apps/korganizer/mycalendar.ics\nnach (konfigurierbar) drei Minuten.\nAus Sicherheitsgründen wird noch einmal\nnach 10 Min. abgespeichert, wenn keine\nÄnderungen vorgenommen wurden. Die \nDaten werden automatisch gespeichert,\nwenn KO/Pi beendet wird.\nSie können eine Backup-Datei erstellen im\nMenu: Datei - Speichere Kalender Backup\n" },
{ "Auto Saving in KOrganizer/Pi","Auto Speichern in KOrganizer/Pi" },
{ "\nhttp://sourceforge.net/projects/kdepimpi\n","\nhttp://sourceforge.net/projects/kdepimpi\n" },
{ "\nor report them in the bugtracker on\n","\noder trage sie in dem Bugtracker ein auf\n" },
{ "\nPlease report unexpected behaviour to\nlutz@pi-sync.net\n","\nBitte melde fehlerhaftes Verhalten an\nlutz@pi-sync.net\n" },
{ "2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n","2) Ein Audio Alarm Daemon\nfür den Zaurus ist verfügbar\nals zusätzliche Anwendung\n" },
{ "1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n","1) Importieren von *.vcs oder *.ics Dateien von\nanderen Anwendungen kann möglicherweise\n nicht richtig funktionieren,\nwenn die Termine Eigenschaften haben,\ndie KO/Pi nicht unterstützt.\n" },
{ "Known Problems in KOrganizer/Pi","Bekannte Probleme in KOrganizer/Pi" },
{ "KO/Pi FAQ","KO/Pi FAQ" },
{ "(c) 2004 Lutz Rogowski\nEmail:lutz@pi-sync.net\nKO/Pi is based on KOrganizer\n(c) 2002,2003 Cornelius Schumacher\nEmail: schumacher@kde.org\nKOrganizer/Pi is licensed\nunder the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.korganizer.org\nwww.pi-sync.net\n","(c) 2004 Lutz Rogowski\nEmail:lutz@pi-sync.net\nKO/Pi basiert auf KOrganizer\n(c) 2002,2003 Cornelius Schumacher\nEmail: schumacher@kde.org\nKOrganizer/Pi ist lizensiert unter der GPL.\nKO/Pi kann kompiliert werden für\nLinux, Zaurus-PDA und Windows\nwww.korganizer.org\nwww.pi-sync.net\n" },
{ "PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n","PDA-Edition\nfür: Zaurus 5x00 / 7x0 / 8x0\n" },
{ "KOrganizer/Platform-independent\n","KOrganizer/Platform-independent\n" },
{ "About KOrganizer/Pi","Über KOrganizer/Pi" },
{ "From: ","Von: " },
{ "Remove sync info","Entferne Sync Info" },
{ "For all profiles","Für alle Profile" },
{ "Hide not Running","Verstecke nicht Laufende" },
{ "ME","ME" },
{ "Toolbar","Toolbar" },
{ "Undo Delete...","Löschen rückgängig machen..." },
{ "Undo Delete","Löschen rückgängig machen" },
{ "KDE Sync HowTo...","KDE Sync HowTo..." },
{ "Multi Sync HowTo...","Multi Sync HowTo..." },
{ "Januar","Januar" },
{ "KO/Pi Keys + Colors","KO/Pi Tasten + Farben" },
{ "No Filter","Kein Filter" },
{ "Multiple Sync options","Multi Sync Optionen" },
{ "Sync algo options","Sync Ablauf Optionen" },
{ "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" },
{ "Incoming calendar filter:","Eingehender Kalender Filter:" },
{ "Incoming addressbook filter:","Eingehender Adressbuch Filter:" },
{ "Write back options","Optionen zum Zurückschreiben" },
{ "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" },
{ "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" },
{ "Outgoing calendar filter:","Ausgehender Kalender Filter:" },
{ "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" },
{ "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" },
{ "Time period","Zeitspanne" },
{ "From ","Von " },
{ " weeks in the past to "," Wochen in der Vergangenheit bis zu " },
{ " weeks in the future "," Wochen in der Zukunft " },
{ "Profile kind specific settings","Profil Art abhängige Einstellungen" },
{ "Local temp file:","Lokale temp Datei:" },
{ "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" },
{ "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" },
{ "Language","Sprache" },
{ "Time Format","Zeit Format" },
{ "Time Zone","Zeit Zone" },
{ "%1 groups subscribed","%1 Guppen abboniert" },
{ "Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail","Aktuelles Speicherverzeichnis ist:\n%1\nIhre Mail wird gespeichert in:\n(speicherverz.)/apps/kopiemail/localmail" },
{ "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" },
{ "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" },
{ "Save settings","Speichere Einstellungen" },
{ "Save standard","Speichere Standard" },
{ "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" },
{ "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" },
{ "Data storage path","Daten Speicherpfad" },
{ "Language","Sprache" },
{ "Show time in agenda items","Zeige Zeit in Agenda Items" },
{ "Color for Sundays + category "Holiday"","Farbe für Sonntags + Kategorie "Feiertag"" },
{ "Show events, that are done in \nWhat's Next view","Zeige abgelaufene Termine in\nWhat's Next Ansicht" },
{ "Hide not running Todos in To-do view","Verstecke nicht laufende Todos" },
{ "+01:00 Europe/Oslo(CET)","+01:00 Europe/Oslo(CET)" },
{ "KO/Pi","KO/Pi" },
{ "There is nothing to undo!","Es gibt nichts zum\nRückgängigmachen!" },
{ "Recreating edit dialog. Please wait...","Recreating edit dialog. Please wait..." },
{ "Sound.Al.: ","Sound.Al.: " },
{ "From: %1 To: %2 %3","Von: %1 Bis: %2 %3" },
{ "Restore","Wiederherstellen" },
{ "\nAre you sure you want\nto restore this?","\nMöchten Sie das wirklicht\nwiederherstellen?" },
{ "% completed","% komplett" },
{ "%d item(s) found.","%d Item(s) gefunden." },
{ "Set complete","Setze auf erledigt" },
{ "(cancelled)","(gecancelt)" },
{ "Click on the week number to\nshow week in agenda view","Klicke auf die Wochennummer\num die Woche in der Agenda anzuzeigen" },
{ " Local time "," Locale Zeit " },
{ "Form2","Form2" },
{ "Filter enabled","Filter angeschaltet" },
{ "Edit Filters","Ändere Filter" },
{ "Print What's Next View...","Drucke What's Next Ansicht..." },
{ "Agenda","Agenda" },
{ " ("," (" },
{ "<p><b>Due on:</b> %1</p>","<p><b>Fällig am:</b> %1</p>" },
{ "Print","Print" },
{ "&Setup Printer...","Drucker &Setup..." },
{ "View Type","Zeige Typ" },
{ "Page &orientation:","Seiten Ausrichtung:" },
{ "Use Default of Selected Style","Default des selektierten Stils" },
{ "Use Default Setting of Printer","Default Einstellung des Druckers" },
{ "Portrait","Portrait" },
{ "Landscape","Landschaft" },
{ "Print day","Drucke Tag" },
{ "CalPrintDay_Base","CalPrintDay_Base" },
{ "Date && Time Range","Datum && Zeitspanne" },
{ "&End date:","&Enddatum:" },
{ "&Start date:","&Startdatum:" },
{ "Start &time:","Startzeit:" },
{ "End ti&me:","Endzeit:" },
{ "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" },
{ "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" },
{ "Alt+D","Alt+D" },
{ "&Use colors","Nutze Farben" },
{ "Alt+U","Alt+U" },
{ "Print week","Drucke Woche" },
{ "CalPrintWeek_Base","CalPrintWeek_Base" },
{ "Use &colors","Nutze Farben" },
{ "Type of View","Typ der Ansicht" },
{ "Print as &Filofax page","Drucke als &Filofax Seite" },
{ "Alt+F","Alt+F" },
{ "Print as &timetable view:","Drucke als Zeittabelle:" },
{ "Alt+T","Alt+T" },
{ "Print as split week view","Drucke als gesplittete Wochenansicht" },
{ "Print month","Drucke Monat" },
{ "CalPrintMonth_Base","CalPrintMonth_Base" },
{ "&Start month:","&Startmonat:" },
{ "&End month:","&Endmonat:" },
{ "Print week &numbers","Drucke Wochen Nummer(n)" },
{ "Print todos","Drucke Todos" },
{ "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" },
{ "Include &description of the item","Inclusive Itembeschreibung" },
{ "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" },
{ "Include &priority of the item","Inclusive Priorität des Items" },
{ "Items to Print","Zu druckende Items" },
{ "&From:","Von:" },
{ "&To:","Bis:" },
{ "Print &all todo items","Drucke alle Todo Items" },
{ "Print only &uncompleted items","Drucke nur nicht erledigte Todos" },
{ "Only items due in the &range:","Nur Items in dem Zeitraum:" },
{ "Todo List","Todo Liste" },
{ "&Title:","&Titel:" },
{ "Co&nnect subtodos with its parent","Verbinde Unter-Todos mit ihren Ober-Todos" },
{ "Todo list","Todo Liste" },
{ "&Print...","Drucke..." },
{ "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" },
{ "[Unconfigured]","[Unkonfiguriert]" },
{ "OK","OK" },
{ "FilterEditor","FilterEditor" },
{ "Include","Inclusive" },
{ "Exclude","Exclusive" },
{ "Edit Selection...","Editiere Auswahl" },
{ "recurring events","wiederholende Termine" },
{ "recurr. events","wiederh.Termine" },
{ "completed to-dos","erledigte Todos" },
{ "events","Termine" },
{ "todos","Todos" },
{ "journals","Journale" },
{ "public","öffentl." },
{ "private","privat" },
{ "confidential","vertraul." },
{ "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Unter-Todos.\nAlle erledigten Unter-Todos\nwerden auch gelöscht!" },
{ "Yesterday","Gestern" },
{ "Day after tomorrow","Übermorgen" },
{ "Tomorrow","Morgen" },
{ "Day before yesterday","Vorgestern" },
{ "Size %1","Größe %1" },
{ "New Agendasize: %1","Neue Agendagröße: %1" },
{ " (%1 y.)"," (%1 J.)" },
{ "Allday:","Ganztägig:" },
{ "compl.todos","erled.Todos" },
{ "Day view","Tagesansicht" },
{ "Next days","Nächste Tage" },
{ "Next week","Nächste Woche" },
{ "Next two weeks","Nächste zwei Wochen" },
{ "Next month","Nächster Monat" },
{ "Journal view","Journal" },
{ "Display all opened","Zeige alle geöffnet" },
{ "Display all closed","Zeige alle geschlossen" },
{ "Display all flat","Zeige alle flach" },
{ "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" },
{ "Default todo done color:","Standard Todo erledigt Farbe" },
{ "Select week %1-%2","Selektiere Woche %1-%2" },
{ "Select Week","Selektiere Woche" },
{ "Set alarm for selected...","Setze Alarm für Selekt..." },
{ "Set reminder offset to:","Setze Alarm Offset auf:" },
{ "Set Alarm!","Setze Alarm!" },
{ "Canged alarm for %1 items","Alarm für %1 Items geändert" },
+{ " and "," und " },
+{ "<IMG src="%1"> only )","nur <IMG src="%1"> )" },
+{ "Mail to selected","Mail an Ausgewählte" },
+{ "Mail to all","Mail an Alle" },
+{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 702eaa3..a8e4de5 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -2308,385 +2308,385 @@ void KABCore::manageCategories( )
if ( !cp->exec() ) {
delete cp;
return;
}
int count = 0;
int cc = 0;
message( i18n("Please wait, processing categories..."));
if ( cp->addCat() ) {
KABC::AddressBook::Iterator it;
QStringList catList = KABPrefs::instance()->mCustomCategories;
for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
++cc;
if ( cc %10 == 0)
message(i18n("Processing contact #%1").arg(cc));
QStringList catIncList = (*it).categories();
int i;
for( i = 0; i< catIncList.count(); ++i ) {
if ( !catList.contains (catIncList[i])) {
catList.append( catIncList[i] );
//qDebug("add cat %s ", catIncList[i].latin1());
++count;
}
}
}
catList.sort();
KABPrefs::instance()->mCustomCategories = catList;
KABPrefs::instance()->writeConfig();
message(QString::number( count )+ i18n(" categories added to list! "));
} else {
QStringList catList = KABPrefs::instance()->mCustomCategories;
QStringList catIncList;
QStringList newCatList;
KABC::AddressBook::Iterator it;
for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
++cc;
if ( cc %10 == 0)
message(i18n("Processing contact #%1").arg(cc));
QStringList catIncList = (*it).categories();
int i;
if ( catIncList.count() ) {
newCatList.clear();
for( i = 0; i< catIncList.count(); ++i ) {
if ( catList.contains (catIncList[i])) {
newCatList.append( catIncList[i] );
}
}
newCatList.sort();
(*it).setCategories( newCatList );
mAddressBook->insertAddressee( (*it) );
}
}
setModified( true );
mViewManager->refreshView();
message( i18n("Removing categories done!"));
}
delete cp;
}
void KABCore::removeVoice()
{
if ( KMessageBox::questionYesNo( this, i18n("After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as \"other\".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?") ) == KMessageBox::No )
return;
XXPortSelectDialog dlg( this, false, this );
if ( !dlg.exec() )
return;
mAddressBook->setUntagged();
dlg.tagSelected();
message(i18n("Removing voice..."), false );
KABC::AddressBook::Iterator it;
for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
if ( (*it).tagged() ) {
(*it).removeVoice();
}
}
message(i18n("Refreshing view...") );
qApp->processEvents();
mViewManager->refreshView( "" );
Addressee add;
mDetails->setAddressee( add );
message(i18n("Remove voice completed!") );
}
void KABCore::setFormattedName()
{
KABFormatPrefs setpref;
if ( !setpref.exec() ) {
return;
}
XXPortSelectDialog dlg( this, false, this );
if ( !dlg.exec() )
return;
mAddressBook->setUntagged();
dlg.tagSelected();
int count = 0;
KABC::AddressBook::Iterator it;
for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
if ( (*it).tagged() ) {
++count;
if ( count %10 == 0 )
message(i18n("Changing contact #%1").arg( count ) );
qApp->processEvents();
QString fName;
if ( setpref.simple->isChecked() )
fName = NameEditDialog::formattedName( (*it), NameEditDialog::SimpleName );
else if ( setpref.full->isChecked() )
fName = NameEditDialog::formattedName( (*it), NameEditDialog::FullName );
else if ( setpref.reverse->isChecked() )
fName = NameEditDialog::formattedName( (*it), NameEditDialog::ReverseName );
else
fName = (*it).organization();
if ( setpref.setCompany->isChecked() )
if ( fName.isEmpty() || fName =="," )
fName = (*it).organization();
(*it).setFormattedName( fName );
}
}
message(i18n("Refreshing view...") );
qApp->processEvents();
mViewManager->refreshView( "" );
Addressee add;
mDetails->setAddressee( add );
message(i18n("Setting formatted name completed!") );
}
void KABCore::clipboardDataChanged()
{
if ( mReadWrite )
mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() );
}
void KABCore::updateActionMenu()
{
UndoStack *undo = UndoStack::instance();
RedoStack *redo = RedoStack::instance();
if ( undo->isEmpty() )
mActionUndo->setText( i18n( "Undo" ) );
else
mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) );
mActionUndo->setEnabled( !undo->isEmpty() );
if ( !redo->top() )
mActionRedo->setText( i18n( "Redo" ) );
else
mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) );
mActionRedo->setEnabled( !redo->isEmpty() );
}
void KABCore::configureKeyBindings()
{
#ifndef KAB_EMBEDDED
KKeyDialog::configure( actionCollection(), true );
#else //KAB_EMBEDDED
qDebug("KABCore::configureKeyBindings() not implemented");
#endif //KAB_EMBEDDED
}
#ifdef KAB_EMBEDDED
void KABCore::configureResources()
{
KRES::KCMKResources dlg( this, "" , 0 );
if ( !dlg.exec() )
return;
KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") );
}
#endif //KAB_EMBEDDED
/* this method will be called through the QCop interface from Ko/Pi to select addresses
* for the attendees list of an event.
*/
void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid)
{
QStringList nameList;
QStringList emailList;
QStringList uidList;
KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this);
uint i=0;
for (i=0; i < list.count(); i++)
{
nameList.append(list[i].realName());
emailList.append(list[i].preferredEmail());
uidList.append(list[i].uid());
}
-
+ //qDebug("%s %s ", sourceChannel.latin1(), uid.latin1());
bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList);
}
/* this method will be called through the QCop interface from Ko/Pi to select birthdays
* to put them into the calendar.
*/
void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid)
{
// qDebug("KABCore::requestForBirthdayList");
QStringList birthdayList;
QStringList anniversaryList;
QStringList realNameList;
QStringList preferredEmailList;
QStringList assembledNameList;
QStringList uidList;
KABC::AddressBook::Iterator it;
int count = 0;
for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
++count;
}
QProgressBar bar(count,0 );
int w = 300;
if ( QApplication::desktop()->width() < 320 )
w = 220;
int h = bar.sizeHint().height() ;
int dw = QApplication::desktop()->width();
int dh = QApplication::desktop()->height();
bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
bar.show();
bar.setCaption (i18n("Collecting birthdays - close to abort!") );
qApp->processEvents();
QDate bday;
QString anni;
QString formattedbday;
for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it )
{
if ( ! bar.isVisible() )
return;
bar.setProgress( count++ );
qApp->processEvents();
bday = (*it).birthday().date();
anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" );
if ( bday.isValid() || !anni.isEmpty())
{
if (bday.isValid())
formattedbday = KGlobal::locale()->formatDate(bday, true, KLocale::ISODate);
else
formattedbday = "NOTVALID";
if (anni.isEmpty())
anni = "INVALID";
birthdayList.append(formattedbday);
anniversaryList.append(anni); //should be ISODate
realNameList.append((*it).realName());
preferredEmailList.append((*it).preferredEmail());
assembledNameList.append((*it).assembledName());
uidList.append((*it).uid());
//qDebug("found birthday in KA/Pi: %s,%s,%s,%s: %s, %s", (*it).realName().latin1(), (*it).preferredEmail().latin1(), (*it).assembledName().latin1(), (*it).uid().latin1(), formattedbday.latin1(), anni.latin1() );
}
}
bool res = ExternalAppHandler::instance()->returnBirthdayListFromKAPI(sourceChannel, uid, birthdayList, anniversaryList, realNameList, preferredEmailList, assembledNameList, uidList);
}
/* this method will be called through the QCop interface from other apps to show details of a contact.
*/
void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid)
{
//qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1());
QString foundUid = QString::null;
if ( ! uid.isEmpty() ) {
Addressee adrr = mAddressBook->findByUid( uid );
if ( !adrr.isEmpty() ) {
foundUid = uid;
}
if ( email == "sendbacklist" ) {
//qDebug("ssssssssssssssssssssssend ");
QStringList nameList;
QStringList emailList;
QStringList uidList;
nameList.append(adrr.realName());
emailList = adrr.emails();
uidList.append( adrr.preferredEmail());
bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList);
return;
}
}
if ( email == "sendbacklist" )
return;
if (foundUid.isEmpty())
{
//find the uid of the person first
Addressee::List namelist;
Addressee::List emaillist;
if (!name.isEmpty())
namelist = mAddressBook->findByName( name );
if (!email.isEmpty())
emaillist = mAddressBook->findByEmail( email );
//qDebug("count %d %d ", namelist.count(),emaillist.count() );
//check if we have a match in Namelist and Emaillist
if ((namelist.count() == 0) && (emaillist.count() > 0)) {
foundUid = emaillist[0].uid();
}
else if ((namelist.count() > 0) && (emaillist.count() == 0))
foundUid = namelist[0].uid();
else
{
for (int i = 0; i < namelist.count(); i++)
{
for (int j = 0; j < emaillist.count(); j++)
{
if (namelist[i] == emaillist[j])
{
foundUid = namelist[i].uid();
}
}
}
}
}
else
{
foundUid = uid;
}
if (!foundUid.isEmpty())
{
// raise Ka/Pi if it is in the background
#ifndef DESKTOP_VERSION
#ifndef KORG_NODCOP
//QCopEnvelope e("QPE/Application/kapi", "raise()");
#endif
#endif
mMainWindow->showMaximized();
mMainWindow-> raise();
mViewManager->setSelected( "", false);
mViewManager->refreshView( "" );
mViewManager->setSelected( foundUid, true );
mViewManager->refreshView( foundUid );
if ( !mMultipleViewsAtOnce )
{
setDetailsVisible( true );
mActionDetails->setChecked(true);
}
}
}
void KABCore::whatsnew()
{
KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" );
}
void KABCore::synchowto()
{
KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" );
}
void KABCore::kdesynchowto()
{
KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" );
}
void KABCore::multisynchowto()
{
KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" );
}
void KABCore::faq()
{
KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" );
}
#include <libkcal/syncdefines.h>
KABC::Addressee KABCore::getLastSyncAddressee()
{
Addressee lse;
QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice();
//qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() );
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp
index ed8a2ee..3231b45 100644
--- a/kmicromail/composemail.cpp
+++ b/kmicromail/composemail.cpp
@@ -1,476 +1,484 @@
// CHANGED 2004-08-06 Lutz Rogowski
#ifdef DESKTOP_VERSION
#include <qapplication.h>
#include <kabc/addresseedialog.h>
#include <kabc/stdaddressbook.h>
#include <kabc/addressee.h>
#else
#include <qpe/qpeapplication.h>
#endif //DESKTOP_VERSION
#include <libkdepim/externalapphandler.h>
#include "koprefs.h"
#include <klocale.h>
#include <kglobal.h>
#ifdef MINIKDE_KDIALOG_H
#undef MINIKDE_KDIALOG_H
#endif
#include "composemail.h"
#include <libmailwrapper/smtpwrapper.h>
#include <libmailwrapper/storemail.h>
#include <libmailwrapper/abstractmail.h>
#include <libmailwrapper/mailtypes.h>
/* OPIE */
//#include <opie2/ofiledialog.h>
//#include <opie2/odebug.h>
#include <kfiledialog.h>
//#include <qpe/resource.h>
#include <qpe/global.h>
//#include <qpe/contact.h>
#include <qcombobox.h>
#include <qcheckbox.h>
#include <qiconset.h>
#include <qtimer.h>
#include <qmessagebox.h>
#include <qpushbutton.h>
#include <qmultilineedit.h>
#include <qlabel.h>
#include <qtabwidget.h>
#include <qlistview.h>
//using namespace Opie::Core;
//using namespace Opie::Ui;
ComposeMail::ComposeMail( Settings *sett, QWidget *parent, const char *name, bool modal )
: ComposeMailUI( parent, name, modal )
{
mPickLineEdit = 0;
mEncoding = KOPrefs::instance()->mCurrentCodeName;
- connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)),
- this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&)));
+ //managed from opiemail now
+ //connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)),
+ // this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&)));
settings = sett;
m_replyid = "";
if ( KOPrefs::instance()->mUseKapi) {
KConfig config( locateLocal("config", "kabcrc") );
config.setGroup( "General" );
QString whoami_uid = config.readEntry( "WhoAmI" );
if ( whoami_uid.isEmpty() ) {
QMessageBox::information( 0, i18n( "Hint" ),
i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ),
i18n( "Ok" ) );
fillSettings();
} else
ExternalAppHandler::instance()->requestDetailsFromKAPI("", "sendbacklist", whoami_uid);
#ifdef DESKTOP_VERSION
KABC::Addressee con = KABC::StdAddressBook::self()->whoAmI( );
QStringList mails = con.emails();
QString defmail = con.preferredEmail();
if ( mails.count() == 0)
QMessageBox::information( 0, i18n( "Hint" ),
i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ),
i18n( "Ok" ) );
if (defmail.length()!=0) {
fromBox->insertItem(defmail);
}
QStringList::ConstIterator sit = mails.begin();
for (;sit!=mails.end();++sit) {
if ( (*sit)==defmail)
continue;
fromBox->insertItem((*sit));
}
senderNameEdit->setText(con.formattedName());
#endif
} else {
fillSettings();
}
checkBoxLater->setChecked( KOPrefs::instance()->mSendLater );
attList->addColumn( i18n( "Name" ) );
attList->addColumn( i18n( "Size" ) );
QList<Account> accounts = settings->getAccounts();
if ( QApplication::desktop()->width() < 320 )
smtpAccountBox->setMaximumWidth( 80 );
Account *it;
for ( it = accounts.first(); it; it = accounts.next() ) {
if ( it->getType()==MAILLIB::A_SMTP ) {
SMTPaccount *smtp = static_cast<SMTPaccount *>(it);
smtpAccountBox->insertItem( smtp->getAccountName() );
smtpAccounts.append( smtp );
}
}
connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) );
connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) );
connect( bccButton, SIGNAL( clicked() ), SLOT( pickAddressBCC() ) );
connect( replyButton, SIGNAL( clicked() ), SLOT( pickAddressReply() ) );
connect( addButton, SIGNAL( clicked() ), SLOT( addAttachment() ) );
connect( deleteButton, SIGNAL( clicked() ), SLOT( removeAttachment() ) );
connect( SaveButton, SIGNAL( clicked() ), SLOT( saveAsDraft()) );
mMail = 0;
warnAttach = true;
QIconSet icon;
//icon = SmallIcon("fileexport");
icon = SmallIcon("filesave");
SaveButton->setIconSet (icon ) ;
if ( QApplication::desktop()->width() < 320 ) {
SaveButton->setText ("") ;
SaveButton->setMaximumSize ( SaveButton->sizeHint().height(),SaveButton->sizeHint().height()) ;
}
else
SaveButton->setText (i18n("Save"));
#ifndef DESKTOP_VERSION
QPEApplication::setStylusOperation( message, QPEApplication::RightOnHold );
QPEApplication::setStylusOperation( senderNameEdit, QPEApplication::RightOnHold );
QPEApplication::setStylusOperation( subjectLine, QPEApplication::RightOnHold );
#endif
message->setFont ( KOPrefs::instance()->mComposeFont );
message->setWordWrap (QMultiLineEdit::WidgetWidth);
if ( smtpAccounts.count() > 0 ) {
fillValues( smtpAccountBox->currentItem() );
} else {
QMessageBox::information( 0, i18n( "Problem" ),
i18n( "Please create an\nSMTP account first.\nThe SMTP is needed\nfor sending mail.\n" ),
i18n( "Ok" ) );
return;
}
connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) );
connect( SaveSigButton, SIGNAL( clicked() ), SLOT( saveSig()) );
if ( smtpAccountBox->count())
fillValues(0);
}
void ComposeMail::fillSettings()
{
if ( QApplication::desktop()->width() < 320 )
fromBox->setMaximumWidth( 100 );
QStringList mailList = QStringList::split(";",KOPrefs::instance()->mEmail);
QStringList::ConstIterator sit = mailList.begin();
int pref = 0;
for (;sit!=mailList.end();++sit) {
fromBox->insertItem((*sit));
}
senderNameEdit->setText(KOPrefs::instance()->mName);
}
void ComposeMail::saveSig()
{
if ( smtpAccountBox->count()) {
int cur = smtpAccountBox->currentItem ();
SMTPaccount *smtp = smtpAccounts.at( cur );
if ( smtp )
smtp->setSignature( sigMultiLine->text());
}
}
void ComposeMail::saveAsDraft()
{
Opie::Core::OSmartPointer<Mail> mail= new Mail();
mail->setMail(fromBox->currentText());
mail->setTo( toLine->text() );
mail->setName(senderNameEdit->text());
mail->setCC( ccLine->text() );
mail->setBCC( bccLine->text() );
mail->setReply( replyLine->text() );
mail->setSubject( subjectLine->text() );
if (!m_replyid.isEmpty()) {
QStringList ids;
ids.append(m_replyid);
mail->setInreply(ids);
}
QString txt = message->text();
if ( !sigMultiLine->text().isEmpty() ) {
txt.append( "\n--\n" );
txt.append( sigMultiLine->text() );
}
mail->setMessage( txt );
mail->setCharset (mEncoding);
/* only use the default drafts folder name! */
Storemail wrapper(AbstractMail::draftFolder());
wrapper.storeMail(mail);
AttachViewItem *it = (AttachViewItem *) attList->firstChild();
/* attachments we will ignore! */
if ( it != 0 ) {
if ( warnAttach )
QMessageBox::warning(0,i18n("Store message"),
i18n("<center>Attachments will not be stored in \"Draft\" folder</center>"));
warnAttach = false;
}
setStatus( i18n("Mail saved as draft!") );
}
void ComposeMail::clearStatus()
{
topLevelWidget()->setCaption( i18n("Compose mail") );
}
void ComposeMail::setStatus( QString status )
{
topLevelWidget()->setCaption( status );
QTimer::singleShot ( 10000, this, SLOT( clearStatus() ) ) ;
}
void ComposeMail::pickAddress( )
{
QLineEdit *line = mPickLineEdit;
if ( line == 0 )
return;
#ifdef DESKTOP_VERSION
//qDebug(" ComposeMail::pickAddress ");
QString names ;//= AddressPicker::getNames();
KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this);
uint i=0;
for (i=0; i < list.count(); i++) {
if ( !list[i].preferredEmail().isEmpty()) {
if ( ! names.isEmpty() )
names+= ",";
names+= "\""+list[i].realName() +"\"<" +list[i].preferredEmail() +">";
}
}
if ( line->text().isEmpty() ) {
line->setText( names );
} else if ( !names.isEmpty() ) {
line->setText( line->text() + ", " + names );
}
#else
bool res = ExternalAppHandler::instance()->requestNameEmailUidListFromKAPI("QPE/Application/ompi", this->name() /* name is here the unique uid*/);
// the result should now arrive through method insertAttendees
#endif
}
//the map includes name/email pairs, that comes from Ka/Pi
void ComposeMail::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList)
{
//qDebug("ComposeMail::insertAttendees ");
raise();
+ QString UID = uid;
+ if ( uid.left( 18 ) == (this->name() +QString("pick2")) ) {
+ mPickLineEdit = toLine;
+ UID = this->name();
+ subjectLine->setText( uid.mid( 18 ) );
+ }
+ //qDebug("ccc %s %s ", uid.latin1(), this->name());
if ( mPickLineEdit == 0 ) { //whoami received
QString defmail = uidList[0];
if ( emailList.count() == 0 )
QMessageBox::information( 0, i18n( "Hint" ),
i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ),
i18n( "Ok" ) );
if (defmail.length()!=0) {
fromBox->insertItem(defmail);
}
QStringList::ConstIterator sit = emailList.begin();
int pref = 0;
for (;sit!=emailList.end();++sit) {
if ( (*sit)==defmail)
continue;
fromBox->insertItem((*sit));
}
senderNameEdit->setText(nameList[0]);
return;
}
QString names ;
QLineEdit *line = mPickLineEdit;
- if (uid == this->name())
+ if (UID == this->name())
{
for ( int i = 0; i < nameList.count(); i++)
{
QString _name = nameList[i];
QString _email = emailList[i];
QString _uid = uidList[i];
if ( ! _email.isEmpty() ) {
if ( ! names.isEmpty() )
names+= ",";
names+= "\""+_name +"\"<" +_email +">";
}
}
}
if ( line->text().isEmpty() ) {
line->setText( names );
} else if ( !names.isEmpty() ) {
line->setText( line->text() + ", " + names );
}
}
void ComposeMail::setTo( const QString & to )
{
toLine->setText( to );
}
void ComposeMail::setSubject( const QString & subject )
{
subjectLine->setText( subject );
}
void ComposeMail::setInReplyTo( const QString & messageId )
{
m_replyid = messageId;
}
void ComposeMail::setMessage( const QString & text )
{
message->setText( text );
}
void ComposeMail::pickAddressTo()
{
mPickLineEdit = toLine;
pickAddress( );
}
void ComposeMail::pickAddressCC()
{
mPickLineEdit = ccLine;
pickAddress( );
}
void ComposeMail::pickAddressBCC()
{
mPickLineEdit = bccLine;
pickAddress( );
}
void ComposeMail::pickAddressReply()
{
mPickLineEdit = replyLine;
pickAddress( );
}
void ComposeMail::fillValues( int current )
{
#if 0
SMTPaccount *smtp = smtpAccounts.at( current );
ccLine->clear();
if ( smtp->getUseCC() ) {
ccLine->setText( smtp->getCC() );
}
bccLine->clear();
if ( smtp->getUseBCC() ) {
bccLine->setText( smtp->getBCC() );
}
replyLine->clear();
if ( smtp->getUseReply() ) {
replyLine->setText( smtp->getReply() );
}
#endif
SMTPaccount *smtp = smtpAccounts.at( current );
if ( smtp )
sigMultiLine->setText( smtp->getSignature() );
}
void ComposeMail::slotAdjustColumns()
{
int currPage = tabWidget->currentPageIndex();
tabWidget->showPage( attachTab );
attList->setColumnWidth( 0, attList->visibleWidth() - 80 );
attList->setColumnWidth( 1, 80 );
tabWidget->setCurrentPage( currPage );
}
void ComposeMail::addAttachment()
{
QString lnk = KFileDialog::getOpenFileName( "", "Add Attachment", this );
if ( !lnk.isEmpty() ) {
Attachment *att = new Attachment( lnk );
(void) new AttachViewItem( attList, att );
}
}
void ComposeMail::removeAttachment()
{
if ( !attList->currentItem() ) {
QMessageBox::information( this, i18n( "Error" ),
i18n( "<p>Please select a File.</p>" ),
i18n( "Ok" ) );
} else {
attList->takeItem( attList->currentItem() );
}
}
void ComposeMail::accept()
{
if ( smtpAccountBox->count() == 0 ) {
reject();
return;
}
if (! checkBoxLater->isChecked() ) {
int yesno = QMessageBox::warning(0,i18n("Stop editing message"),
i18n("Send this message?"),
i18n("Yes"),
i18n("Cancel"));
if (yesno == 1) {
return;
}
}
#if 0
odebug << "Sending Mail with "
<< smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() << oendl;
#endif
Opie::Core::OSmartPointer<Mail> mail=new Mail;
SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() );
mail->setMail(fromBox->currentText());
if ( !toLine->text().isEmpty() ) {
mail->setTo( toLine->text() );
} else {
QMessageBox::warning(0,i18n("Sending mail"),
i18n("No Receiver spezified" ) );
return;
}
mail->setName(senderNameEdit->text());
mail->setCC( ccLine->text() );
mail->setBCC( bccLine->text() );
mail->setReply( replyLine->text() );
mail->setSubject( subjectLine->text() );
if (!m_replyid.isEmpty()) {
QStringList ids;
ids.append(m_replyid);
mail->setInreply(ids);
}
QString txt = message->text();
if ( !sigMultiLine->text().isEmpty() ) {
txt.append( "\n--\n" );
txt.append( sigMultiLine->text() );
}
mail->setMessage( txt );
mail->setCharset (mEncoding);
AttachViewItem *it = (AttachViewItem *) attList->firstChild();
while ( it != 0 ) {
mail->addAttachment( it->getAttachment() );
it = (AttachViewItem *) it->nextSibling();
}
SMTPwrapper wrapper( smtp );
if ( wrapper.sendMail( mail,checkBoxLater->isChecked() ) )
setStatus( tr ("Mail sent"));
else {
setStatus( tr ("Error: Something went wrong. Nothing sent"));
return;
}
QDialog::accept();
}
void ComposeMail::reject()
{
//qDebug("ComposeMail::reject() ");
int yesno = QMessageBox::warning(0,i18n("Store message?"),
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index f56711d..e159b73 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -1,641 +1,672 @@
// CHANGED 2004-09-31 Lutz Rogowski
// CHANGED 2004-08-06 Lutz Rogowski
#define protected public
#include <qwidget.h>
#undef protected
#include "koprefsdialog.h"
#include <kapplication.h>
#include <libkdepim/externalapphandler.h>
#include <libkdepim/kpimglobalprefs.h>
#ifdef MINIKDE_KDIALOG_H
#undef MINIKDE_KDIALOG_H
#endif
#include "settingsdialog.h"
#include "opiemail.h"
#include "editaccounts.h"
#include "composemail.h"
#include "mailistviewitem.h"
#include "viewmail.h"
#include "selectstore.h"
#include "selectsmtp.h"
#include "accountitem.h"
#include "accountview.h"
#include "klocale.h"
#include <qmessagebox.h>
#include <qtimer.h>
#include <qcursor.h>
#include <qtextbrowser.h>
#include <qregexp.h>
#include <qpe/global.h>
#ifdef DESKTOP_VERSION
#include <qapplication.h>
#else
#include <qpe/qpeapplication.h>
#endif
#include <libmailwrapper/smtpwrapper.h>
#include <libmailwrapper/mailtypes.h>
#include <libmailwrapper/abstractmail.h>
#include "koprefs.h"
//using namespace Opie::Core;
OpieMail::OpieMail( QWidget *parent, const char *name )
: MainWindow( parent, name) //, WStyle_ContextHelp )
{
+ mCurrentComposer = 0;
settings = new Settings();
tb = 0;
setIcon(SmallIcon( "kmicromail" ) );
folderView->populate( settings->getAccounts() );
-
+ connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)),
+ this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&)));
}
OpieMail::~OpieMail()
{
if (settings) delete settings;
if ( tb )
delete tb;
}
void OpieMail::appMessage(const QCString &msg, const QByteArray &data)
{
}
#include <stdlib.h>
void OpieMail::message(const QCString &msg, const QByteArray &data)
{
// copied from old mail2
static int ii = 0;
//qDebug("QCOP CALL ############################# %d ", ii);
//QString mess ( msg );
//qDebug("Message = %s ",mess.latin1());
++ii;
//qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this);
mPendingEmail = QString::null;
mPendingName = QString::null;
if (msg == "writeMail(QString,QString)")
{
//qDebug("writeMail(QString,QString) ");
QDataStream stream(data,IO_ReadOnly);
stream >> mPendingName >> mPendingEmail;
// removing the whitespaces at beginning and end is needed!
QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) );
}
else if (msg == "newMail()")
{
//qDebug("slotComposeMail() ");
// we cannot call slotComposeMail(); directly, because may be executing a QCOP call
// and a QCOP call does not like a processevents in his execution
// with the Qtimer we call slotComposeMail() after we reached the main event loop
QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) );
// slotComposeMail();
}
else if (msg == "newMail(QString)")
{
//qDebug(" newMail(QString)");
QDataStream stream(data,IO_ReadOnly);
stream >> mPendingName;
// the format is
// NAME <EMAIL>:SUBJECT
QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) );
} else {
mPendingData = data;
mPendingMessage = msg;
QTimer::singleShot ( 50, this, SLOT(slotExtAppHandler() ) );
}
//qDebug("END OpieMail::message ");
}
void OpieMail::slotExtAppHandler()
{
ExternalAppHandler::instance()->appMessage ( mPendingMessage, mPendingData );
}
void OpieMail::slotwriteMail2(const QString& namemail )
{
//qDebug("OpieMail::slotwriteMail2 ");
//qApp->processEvents();
ComposeMail compose( settings, this, 0, true );
if ( !namemail.isEmpty() ) {
QString to = namemail;
if ( namemail.find( " <") > 1 ) {
to = "\"" +to.replace( QRegExp( " <"), "\" <") ;
} else
if ( namemail.find( "<") > 1 ) {
to = "\"" +to.replace( QRegExp( "<"), "\" <") ;
}
int sub = to.find( ">:");
if ( sub > 0 ) {
compose.setTo( to.left(sub+1) );
compose.setSubject( to.mid(sub+2) );
} else
compose.setTo( to );
}
compose.slotAdjustColumns();
#ifndef DESKTOP_VERSION
compose.showMaximized();
#endif
+ mCurrentComposer = &compose;
compose.exec();
+ mCurrentComposer = 0;
raise();
//qDebug("retttich ");
}
void OpieMail::slotwriteMail(const QString&name,const QString&email)
{
// qDebug("OpieMail::slotwriteMail ");
ComposeMail compose( settings, this, 0, true );
if (!email.isEmpty())
{
if (!name.isEmpty())
{
compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">");
}
else
{
compose.setTo(email);
}
}
compose.slotAdjustColumns();
#ifndef DESKTOP_VERSION
compose.showMaximized();
#endif
+
+ mCurrentComposer = &compose;
compose.exec();
+ mCurrentComposer = 0;
raise();
}
void OpieMail::slotComposeMail()
{
if ( mPendingEmail == QString::null && mPendingName == QString::null)
slotwriteMail2( QString () );
else {
if ( mPendingEmail == QString::null )
slotwriteMail2( mPendingName );
else
slotwriteMail( mPendingName, mPendingEmail );
}
//slotwriteMail(0l,0l);
}
void OpieMail::slotSendQueued()
{
SMTPaccount *smtp = 0;
QList<Account> list = settings->getAccounts();
QList<SMTPaccount> smtpList;
smtpList.setAutoDelete(false);
Account *it;
for ( it = list.first(); it; it = list.next() )
{
if ( it->getType() == MAILLIB::A_SMTP )
{
smtp = static_cast<SMTPaccount *>(it);
smtpList.append(smtp);
}
}
if (smtpList.count()==0)
{
QMessageBox::information(0,i18n("Info"),i18n("Define a smtp account first!\n"));
return;
}
if ( QMessageBox::warning(this, i18n("Sending all mails"), i18n("Do you really want to send\nall queued mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No )
return;
if (smtpList.count()==1)
{
smtp = smtpList.at(0);
}
else
{
smtp = 0;
selectsmtp selsmtp;
selsmtp.setSelectionlist(&smtpList);
#ifndef DESKTOP_VERSION
selsmtp.showMaximized();
#endif
if ( selsmtp.exec() == QDialog::Accepted )
{
smtp = selsmtp.selected_smtp();
}
}
if (smtp)
{
Global::statusMessage("Sending mails...!");
SMTPwrapper * wrap = new SMTPwrapper(smtp);
if ( wrap->flushOutbox() )
{
Global::statusMessage("Mails sent!");
}
delete wrap;
}
// pending refresh list view, if outgoing is displayed
}
void OpieMail::slotSearchMails()
{
qDebug("OpieMail::slotSearchMails():not implemented ");
}
void OpieMail::slotEditSettings()
{
KOPrefsDialog settingsDialog( this, "koprefs", true );
#ifndef DESKTOP_VERSION
settingsDialog.showMaximized();
#endif
settingsDialog.exec();
slotSetCodec( KOPrefs::instance()->mCurrentCodec );
// KApplication::execDialog(settingsDialog);
}
void OpieMail::slotEditAccounts()
{
EditAccounts eaDialog( settings, this, 0, true );
eaDialog.slotAdjustColumns();
#ifndef DESKTOP_VERSION
eaDialog.showMaximized();
#endif
eaDialog.exec();
if ( settings ) delete settings;
settings = new Settings();
folderView->populate( settings->getAccounts() );
}
void OpieMail::replyMail()
{
QListViewItem*item = mailView->currentItem();
if (!item) return;
RecMailP mail = ((MailListViewItem*)item)->data();
RecBodyP body = folderView->fetchBody(mail);
QString rtext;
rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose
.arg( mail->getFrom())
.arg( mail->getDate());
QString text = body->Bodytext();
QStringList lines = QStringList::split(QRegExp("\\n"), text);
QStringList::Iterator it;
for (it = lines.begin(); it != lines.end(); it++)
{
rtext += "> " + *it + "\n";
}
rtext += "\n";
QString prefix;
if ( mail->getSubject().find(QRegExp("^Re: .*$")) != -1) prefix = "";
else prefix = "Re: "; // no i18n on purpose
Settings *settings = new Settings();
ComposeMail composer( settings ,this, 0, true);
if (mail->Replyto().isEmpty()) {
composer.setTo( mail->getFrom());
} else {
composer.setTo( mail->Replyto());
}
composer.setSubject( prefix + mail->getSubject());
composer.setMessage( rtext );
composer.setInReplyTo( mail->Msgid());
composer.setCharset( body->getCharset() );
+
+ mCurrentComposer = &composer;
if ( QDialog::Accepted == KApplication::execDialog( &composer ) )
{
mail->Wrapper()->answeredMail(mail);
}
+ mCurrentComposer = 0;
delete settings;
}
void OpieMail::closeViewMail(ViewMail * vm)
{
vm->hide();
}
void OpieMail::slotDownloadMail( )
{
QListViewItem*item = mailView->currentItem();
if (!item ) {
Global::statusMessage("Error: No item slected!");
return;
}
RecMailP mail = ((MailListViewItem*)item)->data();
Account * acc = mail->Wrapper()->getAccount();
if ( !acc ) {
Global::statusMessage("Mail is already stored locally!");
return;
}
QString lfName = acc->getLocalFolder();
//qDebug("local folder " + lfName );
if ( lfName.isEmpty() )
lfName = acc->getAccountName();
AbstractMail* targetMail = folderView->allAccounts()[0]->getWrapper();
//qDebug("target %d %d ",targetMail,mail->Wrapper() );
if ( targetMail == mail->Wrapper() ) {
Global::statusMessage("Mail is already locally stored!");
return;
}
if ( !targetMail->createMbox(lfName)) {
Global::statusMessage("Error creating folder!");
return;
}
Global::statusMessage("Fetching mail...please wait!");
qApp->processEvents();
encodedString*st = 0;
st = mail->Wrapper()->fetchRawBody(mail);
if ( st ) {
targetMail->storeMessage(st->Content(),st->Length(),lfName);
Global::statusMessage("Mail stored in "+ lfName);
delete st;
} else {
Global::statusMessage("Error: Cannot fetch mail!");
}
}
void OpieMail::deleteAndDisplayNextMail(ViewMail * vm)
{
QListViewItem*item = mailView->currentItem();
if (!item ) {
closeViewMail(vm);
return;
}
RecMailP mail = ((MailListViewItem*)item)->data();
mail->Wrapper()->deleteMail( mail );
item = item->itemBelow();
if (!item ) {
closeViewMail(vm);
return;
}
mailView->setCurrentItem(item);
mail = ((MailListViewItem*)item)->data();
RecBodyP body = folderView->fetchBody(mail);
vm->setBody( body );
vm->setMail( mail );
}
void OpieMail::displayNextMail(ViewMail * vm)
{
QListViewItem*item = mailView->currentItem();
if (!item) return;
( (MailListViewItem*)item )->setPixmap( 0, QPixmap() );
item = item->itemBelow();
if (!item) {
vm->setCaption(i18n("End of List" ));
return;
}
mailView->setCurrentItem(item);
RecMailP mail = ((MailListViewItem*)item)->data();
RecBodyP body = folderView->fetchBody(mail);
vm->setBody( body );
vm->setMail( mail );
}
void OpieMail::displayMail()
{
QListViewItem*item = mailView->currentItem();
if (!item) return;
RecMailP mail = ((MailListViewItem*)item)->data();
RecBodyP body = folderView->fetchBody(mail);
ViewMail readMail( this,"", Qt::WType_Modal );
readMail.setBody( body );
readMail.setMail( mail );
#ifndef DESKTOP_VERSION
readMail.showMaximized();
#else
readMail.resize( 640, 480);
#endif
connect( &readMail,SIGNAL( showNextMail(ViewMail *) ), this, SLOT( displayNextMail(ViewMail *) ) );
connect( &readMail,SIGNAL( deleteAndDisplayNextMail(ViewMail *) ), this, SLOT(deleteAndDisplayNextMail(ViewMail *) ) );
connect( &readMail,SIGNAL( signalDownloadMail() ), this, SLOT( slotDownloadMail() ) );
readMail.exec();
if ( readMail.deleted )
{
folderView->refreshCurrent();
}
else
{
QListViewItem*item = mailView->currentItem();
if (item)
( (MailListViewItem*)item )->setPixmap( 0, QPixmap() );
}
}
void OpieMail::slotGetAllMail()
{
QListViewItem * item = folderView->firstChild();
while ( item ){
((AccountViewItem *)item)->contextMenuSelected( 101 );
item = item->nextSibling ();
}
}
void OpieMail::slotGetMail()
{
QListViewItem * item = folderView->currentItem();
if ( ! item ) return;
((AccountViewItem *)item)->contextMenuSelected( 101 );
}
void OpieMail::slotDeleteMail()
{
if (!mailView->currentItem()) return;
RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data();
if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + mail->getFrom() + " - " + mail->getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
{
mail->Wrapper()->deleteMail( mail );
folderView->refreshCurrent();
}
}
void OpieMail::slotDeleteAllMail()
{
QValueList<RecMailP> t;
if ( QMessageBox::warning(this, i18n("Delete All Mails"), i18n("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
{
MailListViewItem* item = (MailListViewItem*)mailView->firstChild ();
while ( item ) {
if ( item->isSelected() ) {
t.append( item->data() );
}
item = (MailListViewItem*)item->nextSibling();
}
}
else
return;
if ( t.count() == 0 )
return;
RecMailP mail = t.first();
mail->Wrapper()->deleteMailList(t);
folderView->refreshCurrent();
}
void OpieMail::clearSelection()
{
mailView->clearSelection();
}
void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int )
{
if (!mailView->currentItem()) return;
MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType();
/* just the RIGHT button - or hold on pda */
if (button!=2) {return;}
if (!item) return;
QPopupMenu *m = new QPopupMenu(0);
if (m)
{
if (mailtype==MAILLIB::A_NNTP) {
m->insertItem(i18n("Read this posting"),this,SLOT(displayMail()));
m->insertItem(i18n("Copy this posting"),this,SLOT(slotMoveCopyMail()));
m->insertSeparator();
m->insertItem(i18n("Copy all selected postings"),this,SLOT(slotMoveCopyAllMail()));
m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection()));
} else {
if (folderView->currentisDraft()) {
m->insertItem(i18n("Edit this mail"),this,SLOT(reEditMail()));
}
m->insertItem(i18n("Reply to this mail"),this,SLOT(replyMail()));
m->insertItem(i18n("Read this mail"),this,SLOT(displayMail()));
m->insertSeparator();
m->insertItem(i18n("Move/Copy this mail"),this,SLOT(slotMoveCopyMail()));
m->insertItem(i18n("Delete this mail"),this,SLOT(slotDeleteMail()));
m->insertSeparator();
m->insertItem(i18n("Move/Copy all selected mail"),this,SLOT(slotMoveCopyAllMail()));
m->insertItem(i18n("Delete all selected mails"),this,SLOT(slotDeleteAllMail()));
m->insertSeparator();
m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection()));
}
m->setFocus();
m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) );
delete m;
}
}
void OpieMail::slotShowFolders( bool show )
{
if ( show && folderView->isHidden() )
{
folderView->show();
}
else if ( !show && !folderView->isHidden() )
{
folderView->hide();
}
}
void OpieMail::refreshMailView(const QValueList<RecMailP>&list)
{
MailListViewItem*item = 0;
mailView->clear();
QValueList<RecMailP>::ConstIterator it;
for (it = list.begin(); it != list.end();++it)
{
item = new MailListViewItem(mailView,item);
item->storeData((*it));
item->showEntry();
}
mailView->setSorting ( 4, false );
}
void OpieMail::mailLeftClicked( QListViewItem *item )
{
mailView->clearSelection();
/* just LEFT button - or tap with stylus on pda */
//if (button!=1) return;
if (!item) return;
if (folderView->currentisDraft()) {
reEditMail();
} else {
displayMail();
}
}
void OpieMail::slotMoveCopyMail()
{
if (!mailView->currentItem()) return;
RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data();
AbstractMail*targetMail = 0;
QString targetFolder = "";
Selectstore sels;
folderView->setupFolderselect(&sels);
if (!sels.exec()) return;
targetMail = sels.currentMail();
targetFolder = sels.currentFolder();
if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) ||
targetFolder.isEmpty())
{
return;
}
if (sels.newFolder() && !targetMail->createMbox(targetFolder))
{
QMessageBox::critical(0,i18n("Error creating new Folder"),
i18n("<center>Error while creating<br>new folder - breaking.</center>"));
return;
}
sels.hide();
qApp->processEvents();
// qDebug("hiding sels ");
mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails());
folderView->refreshCurrent();
}
void OpieMail::slotMoveCopyAllMail()
{
if (!mailView->currentItem()) return;
QValueList<RecMailP> t;
// if ( QMessageBox::warning(this, i18n("Move/Copy all selected mails"), i18n("Do you really want to copy/move\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
{
MailListViewItem* item = (MailListViewItem*)mailView->firstChild ();
while ( item ) {
if ( item->isSelected() ) {
t.append( item->data() );
}
item = (MailListViewItem*)item->nextSibling();
}
}
// else
// return;
if ( t.count() == 0 )
return;
RecMailP mail = t.first();
AbstractMail*targetMail = 0;
QString targetFolder = "";
Selectstore sels;
folderView->setupFolderselect(&sels);
if (!sels.exec()) return;
targetMail = sels.currentMail();
targetFolder = sels.currentFolder();
if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) ||
targetFolder.isEmpty())
{
return;
}
if (sels.newFolder() && !targetMail->createMbox(targetFolder))
{
QMessageBox::critical(0,i18n("Error creating new Folder"),
i18n("<center>Error while creating<br>new folder - breaking.</center>"));
return;
}
sels.hide();
qApp->processEvents();
//qDebug("hiding sels ");
mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails());
folderView->refreshCurrent();
}
void OpieMail::reEditMail()
{
if (!mailView->currentItem()) return;
ComposeMail compose( settings, this, 0, true );
compose.reEditMail(((MailListViewItem*)mailView->currentItem() )->data());
compose.slotAdjustColumns();
#ifndef DESKTOP_VERSION
compose.showMaximized();
#else
compose.resize(640,480);
#endif
+ mCurrentComposer = &compose;
compose.exec();
+ mCurrentComposer = 0;
+}
+
+void OpieMail::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList)
+{
+
+ if ( mCurrentComposer ) {
+ mCurrentComposer->insertAttendees(uid,nameList,emailList,uidList);
+ } else {
+ ComposeMail compose( settings, this, 0, true );
+ compose.slotAdjustColumns();
+#ifndef DESKTOP_VERSION
+ compose.showMaximized();
+#endif
+ mCurrentComposer = &compose;
+ mCurrentComposer->insertAttendees(uid,nameList,emailList,uidList);
+ compose.exec();
+ mCurrentComposer = 0;
+ raise();
+ }
}
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 @@
// CHANGED 2004-09-31 Lutz Rogowski
#ifndef OPIEMAIL_H
#define OPIEMAIL_H
#include "mainwindow.h"
#include <libmailwrapper/settings.h>
#include <opie2/osmartpointer.h>
#include <libmailwrapper/mailtypes.h>
#include <viewmail.h>
+#include <qstringlist.h>
+
+class ComposeMail;
class OpieMail : public MainWindow
{
Q_OBJECT
public:
OpieMail( QWidget *parent = 0, const char *name = 0 );
virtual ~OpieMail();
static QString appName() { return QString::fromLatin1("kopiemail"); }
public slots:
virtual void slotwriteMail(const QString&name,const QString&email);
virtual void slotwriteMail2(const QString&nameemail);
virtual void slotComposeMail();
virtual void slotExtAppHandler();
virtual void appMessage(const QCString &msg, const QByteArray &data);
virtual void message(const QCString &msg, const QByteArray &data);
+ void insertAttendees(const QString&, const QStringList& namelist, const QStringList& emaillist, const QStringList& uidlist);
protected slots:
virtual void deleteAndDisplayNextMail(ViewMail * vm);
virtual void displayNextMail(ViewMail * vm);
virtual void slotSendQueued();
virtual void slotSearchMails();
virtual void slotEditSettings();
virtual void slotEditAccounts();
virtual void displayMail();
virtual void replyMail();
virtual void slotDeleteMail();
virtual void slotGetMail();
virtual void slotGetAllMail();
virtual void slotDeleteAllMail();
virtual void mailHold(int, QListViewItem *,const QPoint&,int);
virtual void slotShowFolders( bool show );
virtual void refreshMailView(const QValueList<RecMailP>&);
virtual void mailLeftClicked( QListViewItem * );
virtual void slotMoveCopyMail();
virtual void slotMoveCopyAllMail();
virtual void reEditMail();
void clearSelection();
void slotDownloadMail();
private:
+ ComposeMail* mCurrentComposer;
void closeViewMail(ViewMail * vm);
QString mPendingEmail;
QString mPendingName;
QByteArray mPendingData;
QCString mPendingMessage;
Settings *settings;
QTextBrowser * tb;
};
#endif
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index 7dc1880..bf41edb 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -1,606 +1,658 @@
/*
This file is part of KOrganizer.
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <qcstring.h>
#include <qwhatsthis.h>
#include <qdialog.h>
#include <qapplication.h>
#include <qlabel.h>
#include <qlayout.h>
#include <klocale.h>
#include <kapplication.h>
#include <libkcal/event.h>
#include <libkcal/todo.h>
#include <kdebug.h>
#include <kiconloader.h>
#include <krun.h>
#include <kglobal.h>
#include <kprocess.h>
#include "koprefs.h"
#include <kabc/stdaddressbook.h>
#ifndef KORG_NODCOP
#include <dcopclient.h>
#include "korganizer.h"
#include "koprefs.h"
#include "actionmanager.h"
#endif
#include "koeventviewer.h"
//#ifndef KORG_NOKABC
//#include <kabc/stdaddressbook.h>
//#define size count
//#endif
#ifdef DESKTOP_VERSION
#include <kabc/addresseedialog.h>
#include <kabc/addresseeview.h>
#else //DESKTOP_VERSION
#include <externalapphandler.h>
#include <qtopia/qcopenvelope_qws.h>
#endif //DESKTOP_VERSION
KOEventViewer::KOEventViewer(QWidget *parent,const char *name)
: QTextBrowser(parent,name)
{
mSyncMode = false;
mColorMode = 0;
}
KOEventViewer::~KOEventViewer()
{
}
void KOEventViewer::setSource(const QString& n)
{
if ( n.left(3) == "uid" )
#ifdef DESKTOP_VERSION
{
KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true );
KABC::AddressBook::Iterator it;
for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
// LR I do not understand, why the uid string is different on zaurus and desktop
QString uid = "uid://"+(*it).uid();
//qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1());
if (n == uid ) {
//qDebug("found %s ",(*it).mobileHomePhone().latin1() );
QDialog dia( this,"dia123", true );
dia.setCaption( i18n("Details of attendee") );
QVBoxLayout lay ( &dia );
KABC::AddresseeView av ( &dia );
av.setAddressee( (*it) );
lay.addWidget( &av );
if ( QApplication::desktop()->width() < 480 )
dia.resize( 220, 240);
else {
dia.resize( 400,400);
}
dia.exec();
break;
}
}
return;
}
#else
{
if ( "uid:organizer" == n ) {
ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),"");
return;
}
QPtrList<Attendee> attendees = mCurrentIncidence->attendees();
if (attendees.count()) {
Attendee *a;
for(a=attendees.first();a;a=attendees.next()) {
if ( "uid:"+a->uid() == n ) {
bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), a->uid());
return;
}
}
}
return;
}
//requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/);
// the result should now arrive through method insertAttendees
//QString uid = "uid:"+(*it).uid();
#endif
if ( n.left(6) == "mailto" ) {
// qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1());
#ifndef DESKTOP_VERSION
+ if ( n.mid(7,3) == "ALL" ) {
+ qDebug("all ");
+ mailToAttendees( true );
+ } else if ( n.mid(7,4) == "RSVP" ) {
+ mailToAttendees( false );
+ qDebug("rsvp ");
+ } else {
QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" );
e << n.mid(7);
+ }
#endif
}
#ifndef KORG_NODCOP
kdDebug() << "KOEventViewer::setSource(): " << n << endl;
QString tmpStr;
if (n.startsWith("mailto:")) {
KApplication::kApplication()->invokeMailer(n.mid(7),QString::null);
//emit showIncidence(n);
return;
} else if (n.startsWith("uid:")) {
DCOPClient *client = KApplication::kApplication()->dcopClient();
const QByteArray noParamData;
const QByteArray paramData;
QByteArray replyData;
QCString replyTypeStr;
#define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData))
bool foundAbbrowser = PING_ABBROWSER;
if (foundAbbrowser) {
//KAddressbook is already running, so just DCOP to it to bring up the contact editor
//client->send("kaddressbook","KAddressBookIface",
QDataStream arg(paramData, IO_WriteOnly);
arg << n.mid(6);
client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData);
return;
} else {
/*
KaddressBook is not already running. Pass it the UID of the contact via the command line while starting it - its neater.
We start it without its main interface
*/
KIconLoader* iconLoader = new KIconLoader();
QString iconPath = iconLoader->iconPath("go",KIcon::Small);
ActionManager::setStartedKAddressBook(true);
tmpStr = "kaddressbook --editor-only --uid ";
tmpStr += KProcess::quote(n.mid(6));
KRun::runCommand(tmpStr,"KAddressBook",iconPath);
return;
}
} else {
//QTextBrowser::setSource(n);
}
#endif
}
+void KOEventViewer::mailToAttendees( bool all )
+{
+ QPtrList<Attendee> attendees = mCurrentIncidence->attendees();
+ if (attendees.count() == 0) return;
+ QStringList nameList;
+ QStringList emailList;
+ QStringList uidList;
+ Attendee* a;
+ for(a=attendees.first();a;a=attendees.next()) {
+ if ( !all && !a->RSVP() ) continue;
+ if (!a->email().isEmpty()) {
+ nameList.append (a->name() );
+ emailList.append (a->email() );
+ uidList.append (a->uid() );
+ }
+ }
+ QString uid = "ComposeMailUIpick2"+mMailSubject;
+ bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList);
+}
void KOEventViewer::addTag(const QString & tag,const QString & text)
{
int number=text.contains("\n");
QString str = "<" + tag + ">";
QString tmpText=text;
QString tmpStr=str;
if(number !=-1)
{
if (number > 0) {
int pos=0;
QString tmp;
for(int i=0;i<=number;i++) {
pos=tmpText.find("\n");
tmp=tmpText.left(pos);
tmpText=tmpText.right(tmpText.length()-pos-1);
tmpStr+=tmp+"<br>";
}
}
else tmpStr += tmpText;
tmpStr+="</" + tag + ">";
mText.append(tmpStr);
}
else
{
str += text + "</" + tag + ">";
mText.append(str);
}
}
void KOEventViewer::setColorMode( int m )
{
mColorMode = m;
}
void KOEventViewer::appendEvent(Event *event, int mode )
{
mMailSubject = "";
mCurrentIncidence = event;
bool shortDate = KOPrefs::instance()->mShortDateInViewer;
topLevelWidget()->setCaption(i18n("Event Viewer"));
if ( mode == 0 ) {
addTag("h2",event->summary());
}
else {
if ( mColorMode == 1 ) {
mText +="<font color=\"#00A000\">";
}
if ( mColorMode == 2 ) {
mText +="<font color=\"#C00000\">";
}
// mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>";
if ( mode == 1 ) {
addTag("h2",i18n( "Local: " ) +event->summary());
} else {
addTag("h2",i18n( "Remote: " ) +event->summary());
}
addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) );
if ( mColorMode )
mText += "</font>";
}
mMailSubject += i18n( "Meeting " )+ event->summary();
if (event->cancelled ()) {
mText +="<font color=\"#B00000\">";
addTag("i",i18n("This event has been cancelled!"));
mText.append("<br>");
mText += "</font>";
mMailSubject += i18n("(cancelled)");
}
if (!event->location().isEmpty()) {
addTag("b",i18n("Location: "));
mText.append(event->location()+"<br>");
mMailSubject += i18n(" at ") + event->location();
}
if (event->doesFloat()) {
if (event->isMultiDay()) {
mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>")
.arg(event->dtStartDateStr(shortDate))
.arg(event->dtEndDateStr(shortDate)));
} else {
mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate )));
}
} else {
if (event->isMultiDay()) {
mText.append(i18n("<p><b>From:</b> %1</p> ")
.arg(event->dtStartStr( shortDate)));
mText.append(i18n("<p><b>To:</b> %1</p>")
.arg(event->dtEndStr(shortDate)));
} else {
mText.append(i18n("<p><b>On:</b> %1</p> ")
.arg(event->dtStartDateStr( shortDate )));
mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>")
.arg(event->dtStartTimeStr())
.arg(event->dtEndTimeStr()));
}
}
if (event->recurrence()->doesRecur()) {
QString recurText = event->recurrence()->recurrenceText();
addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>");
bool last;
QDate start = QDate::currentDate();
QDate next;
next = event->recurrence()->getPreviousDate( start , &last );
if ( !last ) {
next = event->recurrence()->getNextDate( start.addDays( - 1 ) );
addTag("p",i18n("<b>Next recurrence is on:</b>") );
addTag("p", KGlobal::locale()->formatDate( next, shortDate ));
QDateTime nextdt = QDateTime( next, event->dtStart().time());
mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( nextdt, true );
} else {
addTag("p",i18n("<b>Last recurrence was on:</b>") );
addTag("p", KGlobal::locale()->formatDate( next, shortDate ));
}
} else {
mMailSubject += i18n(" - " )+event->dtStartStr( true );
}
if (event->isAlarmEnabled()) {
Alarm *alarm =event->alarms().first() ;
QDateTime t = alarm->time();
int min = t.secsTo( event->dtStart() )/60;
QString s =i18n("( %1 min before )").arg( min );
addTag("p",i18n("<b>Alarm on: ") + s +" </b>");
addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
//addTag("p",s);
}
addTag("b",i18n("Access: "));
mText.append(event->secrecyStr()+"<br>");
if (!event->description().isEmpty()) {
addTag("p",i18n("<b>Details: </b>"));
addTag("p",event->description());
}
formatCategories(event);
formatReadOnly(event);
formatAttendees(event);
setText(mText);
//QWhatsThis::add(this,mText);
}
void KOEventViewer::appendTodo(Todo *event, int mode )
{
mMailSubject = "";
mCurrentIncidence = event;
topLevelWidget()->setCaption(i18n("Todo Viewer"));
bool shortDate = KOPrefs::instance()->mShortDateInViewer;
if (mode == 0 )
addTag("h2",event->summary());
else {
if ( mColorMode == 1 ) {
mText +="<font color=\"#00A000\">";
}
if ( mColorMode == 2 ) {
mText +="<font color=\"#B00000\">";
}
if ( mode == 1 ) {
addTag("h2",i18n( "Local: " ) +event->summary());
} else {
addTag("h2",i18n( "Remote: " ) +event->summary());
}
addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) );
if ( mColorMode )
mText += "</font>";
}
mMailSubject += i18n( "Todo " )+ event->summary();
if ( event->percentComplete() == 100 && event->hasCompletedDate() ) {
mText +="<font color=\"#B00000\">";
addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(KOPrefs::instance()->mShortDateInViewer) ) );
mText += "</font>";
} else {
mText.append(i18n("<p><i>%1 % completed</i></p>")
.arg(event->percentComplete()));
}
if (event->cancelled ()) {
mText +="<font color=\"#B00000\">";
addTag("i",i18n("This todo has been cancelled!"));
mText.append("<br>");
mText += "</font>";
mMailSubject += i18n("(cancelled)");
}
if (!event->location().isEmpty()) {
addTag("b",i18n("Location: "));
mText.append(event->location()+"<br>");
mMailSubject += i18n(" at ") + event->location();
}
if (event->hasStartDate()) {
mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer)));
}
if (event->hasDueDate()) {
mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer)));
mMailSubject += i18n(" - " )+event->dtDueStr( true );
}
addTag("b",i18n("Access: "));
mText.append(event->secrecyStr()+"<br>");
if (!event->description().isEmpty()) {
addTag("p",i18n("<b>Details: </b>"));
addTag("p",event->description());
}
formatCategories(event);
mText.append(i18n("<p><b>Priority:</b> %2</p>")
.arg(QString::number(event->priority())));
formatReadOnly(event);
formatAttendees(event);
if ( event->relatedTo() ) {
addTag("b",i18n("Parent todo: "));
mText.append(event->relatedTo()->summary()+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>");
}
QPtrList<Incidence> Relations = event->relations();
Incidence *to;
if ( Relations.first() )
addTag("b",i18n("Sub todos:<br>"));
for (to=Relations.first();to;to=Relations.next()) {
mText.append( to->summary()+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>");
}
setText(mText);
}
void KOEventViewer::formatCategories(Incidence *event)
{
if (!event->categoriesStr().isEmpty()) {
if (event->categories().count() == 1) {
addTag("h3",i18n("Category"));
} else {
addTag("h3",i18n("Categories"));
}
addTag("p",event->categoriesStr());
}
}
void KOEventViewer::formatAttendees(Incidence *event)
{
QPtrList<Attendee> attendees = event->attendees();
if (attendees.count()) {
QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small);
QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small);
addTag("h3",i18n("Organizer"));
mText.append("<ul><li>");
#ifndef KORG_NOKABC
#ifdef DESKTOP_VERSION
KABC::AddressBook *add_book = KABC::StdAddressBook::self();
KABC::Addressee::List addressList;
addressList = add_book->findByEmail(event->organizer());
KABC::Addressee o = addressList.first();
if (!o.isEmpty() && addressList.size()<2) {
mText += "<a href=\"uid:" + o.uid() + "\">";
mText += o.formattedName();
mText += "</a>\n";
} else {
mText.append(event->organizer());
}
#else //DESKTOP_VERSION
mText += "<a href=\"uid:organizer\">";
mText += event->organizer();
mText += "</a>\n";
#endif //DESKTOP_VERSION
#else
mText.append(event->organizer());
#endif
if (iconPath) {
mText += " <a href=\"mailto:" + event->organizer() + "\">";
mText += "<IMG src=\"" + iconPath + "\">";
mText += "</a>\n";
}
mText.append("</li></ul>");
addTag("h3",i18n("Attendees"));
Attendee *a;
mText.append("<ul>");
+ int a_count = 0;
+ int a_count_nr = 0;
+
for(a=attendees.first();a;a=attendees.next()) {
#ifndef KORG_NOKABC
#ifdef DESKTOP_VERSION
if (a->name().isEmpty()) {
addressList = add_book->findByEmail(a->email());
KABC::Addressee o = addressList.first();
if (!o.isEmpty() && addressList.size()<2) {
mText += "<a href=\"uid:" + o.uid() + "\">";
mText += o.formattedName();
mText += "</a>\n";
} else {
mText += "<li>";
mText.append(a->email());
mText += "\n";
}
} else {
mText += "<li><a href=\"uid:" + a->uid() + "\">";
if (!a->name().isEmpty()) mText += a->name();
else mText += a->email();
mText += "</a>\n";
}
#else //DESKTOP_VERSION
mText += "<li><a href=\"uid:" + a->uid() + "\">";
if (!a->name().isEmpty()) mText += a->name();
else mText += a->email();
mText += "</a>\n";
#endif //DESKTOP_VERSION
#else
//qDebug("nokabc ");
mText += "<li><a href=\"uid:" + a->uid() + "\">";
if (!a->name().isEmpty()) mText += a->name();
else mText += a->email();
mText += "</a>\n";
#endif
if (!a->email().isEmpty()) {
if (iconPath) {
mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">";
- if ( a->RSVP() )
+ if ( a->RSVP() ) {
+ ++a_count;
mText += "<IMG src=\"" + iconPath + "\">";
- else
+ }
+ else {
+ ++a_count_nr;
mText += "<IMG src=\"" + NOiconPath + "\">";
+ }
mText += "</a>\n";
}
}
if (a->status() != Attendee::NeedsAction )
mText +="[" + a->statusStr() + "] ";
if (a->role() == Attendee::Chair )
mText +="(" + a->roleStr().left(1) + ".)";
}
mText.append("</li></ul>");
+ if ( a_count > 1 ) {
+ mText += "<a href=\"mailto:ALL\">";
+ mText += i18n( "Mail to all" );
+ mText += "</a> ( ";
+ mText += "<IMG src=\"" + iconPath + "\">";
+ mText += i18n( " and " );
+ mText += "<IMG src=\"" + NOiconPath + "\"> )";
+ mText += "<br>\n";
+
+
+ }
+ if ( a_count_nr > 1 ) {
+ mText += "<a href=\"mailto:RSVP\">";
+ mText += i18n( "Mail to selected" );
+ mText += "</a> ( ";
+ mText += i18n( "<IMG src=\"%1\"> only )").arg ( iconPath );
+ mText += "\n";
+ }
}
}
void KOEventViewer::appendJournal(Journal *jour, int mode )
{
bool shortDate = KOPrefs::instance()->mShortDateInViewer;
if (mode == 0 ) {
addTag("h2",i18n("Journal from: "));
}
else {
if ( mode == 1 ) {
addTag("h2",i18n( "Local: " ) +i18n("Journal from: "));
} else {
addTag("h2",i18n( "Remote: " ) +i18n("Journal from: "));
}
}
topLevelWidget()->setCaption("Journal Viewer");
mText.append(i18n("<h3> %1 </h3> ").arg(jour->dtStartDateStr(KOPrefs::instance()->mShortDateInViewer)));
addTag("b",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(jour->lastModified(),shortDate ) );
if (!jour->description().isEmpty()) {
addTag("p",jour->description());
}
setText(mText);
}
void KOEventViewer::formatReadOnly(Incidence *event)
{
if (event->isReadOnly()) {
addTag("p","<em>(" + i18n("read-only") + ")</em>");
}
}
void KOEventViewer::setSyncMode( bool b )
{
mSyncMode = b;
}
void KOEventViewer::setTodo(Todo *event, bool clearV )
{
if ( clearV )
clearEvents();
if ( mSyncMode ) {
if ( clearV )
appendTodo(event,1 );
else
appendTodo(event,2);
} else
appendTodo(event);
}
void KOEventViewer::setJournal(Journal *event, bool clearV )
{
if ( clearV )
clearEvents();
if ( mSyncMode ) {
if ( clearV )
appendJournal(event, 1);
else
appendJournal(event, 2);
} else
appendJournal(event);
}
void KOEventViewer::setEvent(Event *event)
{
clearEvents();
if ( mSyncMode )
appendEvent(event, 1);
else
appendEvent(event);
}
void KOEventViewer::addEvent(Event *event)
{
if ( mSyncMode )
appendEvent(event, 2);
else
appendEvent(event);
}
void KOEventViewer::clearEvents(bool now)
{
mText = "";
if (now) setText(mText);
}
void KOEventViewer::addText(QString text)
{
mText.append(text);
setText(mText);
}
diff --git a/korganizer/koeventviewer.h b/korganizer/koeventviewer.h
index 0cd3f33..cf44284 100644
--- a/korganizer/koeventviewer.h
+++ b/korganizer/koeventviewer.h
@@ -1,74 +1,75 @@
/*
This file is part of KOrganizer.
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef KOEVENTVIEWER_H
#define KOEVENTVIEWER_H
//
// Viewer widget for events.
//
#include <qtextbrowser.h>
#include <libkcal/event.h>
#include <libkcal/journal.h>
using namespace KCal;
class KOEventViewer : public QTextBrowser {
Q_OBJECT
public:
KOEventViewer(QWidget *parent=0,const char *name=0);
virtual ~KOEventViewer();
void setSource(const QString &);
void setEvent(Event *event);
void addEvent(Event *event);
void setTodo(Todo *event, bool clearV = true );
void setJournal(Journal *jour, bool clearV = true );
void appendEvent(Event *event, int mode = 0 );
void appendTodo(Todo *event, int mode = 0 );
void appendJournal(Journal *jour, int mode = 0 );
void clearEvents(bool now=false);
void addText(QString text);
void setSyncMode( bool );
void setColorMode( int );
+ void mailToAttendees( bool all );
protected:
int mColorMode;
void addTag(const QString & tag,const QString & text);
void formatCategories(Incidence *event);
void formatAttendees(Incidence *event);
void formatReadOnly(Incidence *event);
private:
QTextBrowser *mEventTextView;
bool mSyncMode;
QString mText;
QString mMailSubject;
- Incidence* mCurrentIncidence;
+ Incidence* mCurrentIncidence;
signals:
void launchaddressbook(QString uid);
};
#endif
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp
index 3079141..7200da9 100644
--- a/libkdepim/externalapphandler.cpp
+++ b/libkdepim/externalapphandler.cpp
@@ -942,259 +942,260 @@ bool ExternalAppHandler::callByPager( const QString& pagernumber )
return true;
}
/**************************************************************************
*
**************************************************************************/
//calls the faxapplication with the number
bool ExternalAppHandler::callByFax( const QString& faxnumber )
{
#ifndef DESKTOP_VERSION
QString channel;
QString message;
QString parameters;
int client = KPimGlobalPrefs::instance()->mFaxClient;
if (client == KPimGlobalPrefs::OTHER_FAC)
{
channel = KPimGlobalPrefs::instance()->mFaxOtherChannel;
message = KPimGlobalPrefs::instance()->mFaxOtherMessage;
parameters = KPimGlobalPrefs::instance()->mFaxOtherMessageParameters;
}
else
{
DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(FAX, client);
if (!dai)
{
qDebug("could not find configured fax application.");
return false;
}
channel = dai->_channel;
message = dai->_message;
parameters = dai->_parameters;
}
//first check if one of the mailers need the emails right in the message.
message = translateMessage(message, faxnumber, "");
#ifdef DEBUG_EXT_APP_HANDLER
qDebug("9Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1());
qDebug("passing faxnumber(%s) as parameter in the form %s to QCopEnvelope", faxnumber.latin1(), parameters.latin1());
#endif
QCopEnvelope e(channel.latin1(), message.latin1());
//US we need no names in the To field. The emailadresses are enough
passParameters(&e, parameters, faxnumber, "");
#else
KMessageBox::sorry( 0, i18n( "This version does not support the sending of faxes." ) );
#endif
return true;
}
/**************************************************************************
*
**************************************************************************/
//calls the sipapplication with the number
bool ExternalAppHandler::callBySIP( const QString& sipnumber )
{
#ifndef DESKTOP_VERSION
QString channel;
QString message;
QString parameters;
int client = KPimGlobalPrefs::instance()->mSipClient;
if (client == KPimGlobalPrefs::OTHER_SIC)
{
channel = KPimGlobalPrefs::instance()->mSipOtherChannel;
message = KPimGlobalPrefs::instance()->mSipOtherMessage;
parameters = KPimGlobalPrefs::instance()->mSipOtherMessageParameters;
}
else
{
DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(SIP, client);
if (!dai)
{
qDebug("could not find configured sip application.");
return false;
}
channel = dai->_channel;
message = dai->_message;
parameters = dai->_parameters;
}
//first check if one of the sip apps need the emails right in the message.
message = translateMessage(message, sipnumber, "");
#ifdef DEBUG_EXT_APP_HANDLER
qDebug("10Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1());
qDebug("passing sipnumber(%s) as parameter in the form %s to QCopEnvelope", sipnumber.latin1(), parameters.latin1());
#endif
QCopEnvelope e(channel.latin1(), message.latin1());
//US we need no names in the To field. The emailadresses are enough
passParameters(&e, parameters, sipnumber, "");
#else
KMessageBox::sorry( 0, i18n( "This version does not support sip." ) );
#endif
return true;
}
/**************************************************************************
*
**************************************************************************/
QString& ExternalAppHandler::translateMessage(QString& message, const QString& param1, const QString& param2 ) const
{
message = message.replace( QRegExp("%1"), param1 );
return message.replace( QRegExp("%2"), param2 );
}
/**************************************************************************
*
**************************************************************************/
void ExternalAppHandler::passParameters(QCopEnvelope* e, const QString& parameters, const QString& param1 , const QString& param2) const
{
#ifndef DESKTOP_VERSION
QMap<QString, QString> valmap;
bool useValMap = false;
// first extract all parts of the parameters.
QStringList paramlist = QStringList::split(";", parameters);
//Now check how many parts we have.
//=0 :no params to pass
//>0 :parameters to pass
for ( QStringList::Iterator it = paramlist.begin(); it != paramlist.end(); ++it )
{
QString param = (*it);
QStringList keyvallist = QStringList::split("=", param);
//if we have keyvalue pairs, we assume that we pass a map to the envelope
QStringList::Iterator it2 = keyvallist.begin();
QString key = (*it2);
key = key.replace( QRegExp("%1"), param1 );
key = key.replace( QRegExp("%2"), param2 );
++it2;
if(it2 != keyvallist.end())
{
QString value = (*it2);
value = value.replace( QRegExp("%1"), param1 );
value = value.replace( QRegExp("%2"), param2 );
valmap.insert(key, value);
useValMap = true;
}
else
{
// qDebug("pass parameter << %s", key.latin1());
(*e) << key;
}
}
if (useValMap == true)
(*e) << valmap;
#endif
}
/**************************************************************************
*
**************************************************************************/
void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data )
{
if ( cmsg == "nextView()" ) {
+ qDebug("nextView()");
emit nextView();
return;
}
bool res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data );
if (!res)
res = mBirthdayListFromKAPITransfer->appMessage( cmsg, data );
if (!res)
res = mDisplayDetails->appMessage( cmsg, data );
// if (!res)
// res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data );
}
bool ExternalAppHandler::requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid)
{
mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel);
return mNameEmailUidListFromKAPITransfer->sendMessageToTarget(sessionuid);
}
bool ExternalAppHandler::returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3)
{
QStringList list4, list5, list6;
mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel);
return mNameEmailUidListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6);
}
bool ExternalAppHandler::requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& email)
{
mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel);
return mFindByEmailFromKAPITransfer->sendMessageToTarget(sessionuid, email);
}
bool ExternalAppHandler::returnFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3)
{
QStringList list4, list5, list6;
mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel);
return mFindByEmailFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6);
}
bool ExternalAppHandler::requestDetailsFromKAPI(const QString& name, const QString& email, const QString& uid)
{
mDisplayDetails->setSourceChannel("");
return mDisplayDetails->sendMessageToTarget("", name, email, uid);
}
bool ExternalAppHandler::requestBirthdayListFromKAPI(const QString& sourceChannel, const QString& sessionuid)
{
mBirthdayListFromKAPITransfer->setSourceChannel(sourceChannel);
return mBirthdayListFromKAPITransfer->sendMessageToTarget(sessionuid);
}
bool ExternalAppHandler::returnBirthdayListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4, const QStringList& list5, const QStringList& list6)
{
mBirthdayListFromKAPITransfer->setSourceChannel(sourceChannel);
return mBirthdayListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6);
}