-rw-r--r-- | bin/kdepim/kopiemail/germantranslation.txt | 11 | ||||
-rw-r--r-- | kmicromail/accountitem.cpp | 4 | ||||
-rw-r--r-- | kmicromail/accountview.cpp | 15 | ||||
-rw-r--r-- | kmicromail/mainwindow.cpp | 24 | ||||
-rw-r--r-- | kmicromail/mainwindow.h | 1 | ||||
-rw-r--r-- | kmicromail/opiemail.cpp | 4 |
6 files changed, 49 insertions, 10 deletions
diff --git a/bin/kdepim/kopiemail/germantranslation.txt b/bin/kdepim/kopiemail/germantranslation.txt index 14e5c0b..f8fd0a8 100644 --- a/bin/kdepim/kopiemail/germantranslation.txt +++ b/bin/kdepim/kopiemail/germantranslation.txt | |||
@@ -1,282 +1,291 @@ | |||
1 | { " Local Time"," Locale Zeit" }, | 1 | { " Local Time"," Locale Zeit" }, |
2 | { "Preferences","Vorlieben" }, | 2 | { "Preferences","Vorlieben" }, |
3 | { "Ok","Ok" }, | 3 | { "Ok","Ok" }, |
4 | { "Default","Standard" }, | 4 | { "Default","Standard" }, |
5 | { "Cancel","Abbrechen" }, | 5 | { "Cancel","Abbrechen" }, |
6 | { "Global","Global" }, | 6 | { "Global","Global" }, |
7 | { "Email","Email" }, | 7 | { "Email","Email" }, |
8 | { "Phone","Phone" }, | 8 | { "Phone","Phone" }, |
9 | { "SMS","SMS" }, | 9 | { "SMS","SMS" }, |
10 | { "Fax","Fax" }, | 10 | { "Fax","Fax" }, |
11 | { "Pager","Pager" }, | 11 | { "Pager","Pager" }, |
12 | { "SIP","SIP" }, | 12 | { "SIP","SIP" }, |
13 | { "Language:(needs restart)","Sprache (Neustart!)" }, | 13 | { "Language:(needs restart)","Sprache (Neustart!)" }, |
14 | { "English","Englisch" }, | 14 | { "English","Englisch" }, |
15 | { "German","Deutsch" }, | 15 | { "German","Deutsch" }, |
16 | { "French","Französich" }, | 16 | { "French","Französich" }, |
17 | { "Italian","Italienisch" }, | 17 | { "Italian","Italienisch" }, |
18 | { "User defined (usertranslation.txt)","Benutzerdef.(usertranslation.txt)" }, | 18 | { "User defined (usertranslation.txt)","Benutzerdef.(usertranslation.txt)" }, |
19 | { "Time Format(nr):","Zeit Format(Neustart!)" }, | 19 | { "Time Format(nr):","Zeit Format(Neustart!)" }, |
20 | { "24:00","24:00" }, | 20 | { "24:00","24:00" }, |
21 | { "12:00am","12:00am" }, | 21 | { "12:00am","12:00am" }, |
22 | { "Week starts on Sunday","Woche beginnt Sonntags" }, | 22 | { "Week starts on Sunday","Woche beginnt Sonntags" }, |
23 | { "Locale","Localisation" }, | 23 | { "Locale","Localisation" }, |
24 | { "Date Format:","Datums Format:" }, | 24 | { "Date Format:","Datums Format:" }, |
25 | { "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" }, | 25 | { "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" }, |
26 | { "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" }, | 26 | { "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" }, |
27 | { "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" }, | 27 | { "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" }, |
28 | { "User defined","Benutzerdefiniert" }, | 28 | { "User defined","Benutzerdefiniert" }, |
29 | { "User long date:","Format langes Datum:" }, | 29 | { "User long date:","Format langes Datum:" }, |
30 | { "User short date:","Format kurzes Datum:" }, | 30 | { "User short date:","Format kurzes Datum:" }, |
31 | { "Monday 19 April 2004: %A %d %B %Y","Montag 19 April 2004: %A %d %B %Y" }, | 31 | { "Monday 19 April 2004: %A %d %B %Y","Montag 19 April 2004: %A %d %B %Y" }, |
32 | { "Mon 19.04.04: %a %d.%m.%y","Mon 19.04.04: %a %d.%m.%y" }, | 32 | { "Mon 19.04.04: %a %d.%m.%y","Mon 19.04.04: %a %d.%m.%y" }, |
33 | { "Mon, 19.Apr.04: %a, %d.%b.%y","Mon, 19.Apr.04: %a, %d.%b.%y" }, | 33 | { "Mon, 19.Apr.04: %a, %d.%b.%y","Mon, 19.Apr.04: %a, %d.%b.%y" }, |
34 | { "Date Format","Datums Format" }, | 34 | { "Date Format","Datums Format" }, |
35 | { "Timezone:","Zeitzone:" }, | 35 | { "Timezone:","Zeitzone:" }, |
36 | { "Add 30 min to selected Timezone","Addiere 30 min zur Zeitzone" }, | 36 | { "Add 30 min to selected Timezone","Addiere 30 min zur Zeitzone" }, |
37 | { "Timezone has daylight saving","Zeitzone hat Sommerzeit" }, | 37 | { "Timezone has daylight saving","Zeitzone hat Sommerzeit" }, |
38 | { "Actual start and end is the\nsunday before this date.","Tatsächlicher Beginn/Ende ist der\nSonntag vor diesem Datum!" }, | 38 | { "Actual start and end is the\nsunday before this date.","Tatsächlicher Beginn/Ende ist der\nSonntag vor diesem Datum!" }, |
39 | { "The year in the date is ignored.","Das Jahr vom Datum wird ignoriert." }, | 39 | { "The year in the date is ignored.","Das Jahr vom Datum wird ignoriert." }, |
40 | { "Daylight start:","Sommerzeit Start:" }, | 40 | { "Daylight start:","Sommerzeit Start:" }, |
41 | { "Mon","Mo" }, | 41 | { "Mon","Mo" }, |
42 | { "Tue","Di" }, | 42 | { "Tue","Di" }, |
43 | { "Wed","Mi" }, | 43 | { "Wed","Mi" }, |
44 | { "Thu","Do" }, | 44 | { "Thu","Do" }, |
45 | { "Fri","Fr" }, | 45 | { "Fri","Fr" }, |
46 | { "Sat","Sa" }, | 46 | { "Sat","Sa" }, |
47 | { "Sun","So" }, | 47 | { "Sun","So" }, |
48 | { "January","Januar" }, | 48 | { "January","Januar" }, |
49 | { "February","Februar" }, | 49 | { "February","Februar" }, |
50 | { "March","März" }, | 50 | { "March","März" }, |
51 | { "April","April" }, | 51 | { "April","April" }, |
52 | { "May","Mai" }, | 52 | { "May","Mai" }, |
53 | { "June","Juni" }, | 53 | { "June","Juni" }, |
54 | { "July","Juli" }, | 54 | { "July","Juli" }, |
55 | { "August","August" }, | 55 | { "August","August" }, |
56 | { "September","September" }, | 56 | { "September","September" }, |
57 | { "October","Oktober" }, | 57 | { "October","Oktober" }, |
58 | { "November","November" }, | 58 | { "November","November" }, |
59 | { "December","Dezember" }, | 59 | { "December","Dezember" }, |
60 | { "tomorrow","morgen" }, | 60 | { "tomorrow","morgen" }, |
61 | { "today","heute" }, | 61 | { "today","heute" }, |
62 | { "yesterday","gestern" }, | 62 | { "yesterday","gestern" }, |
63 | { "Monday","Montag" }, | 63 | { "Monday","Montag" }, |
64 | { "Tuesday","Dienstag" }, | 64 | { "Tuesday","Dienstag" }, |
65 | { "Wednesday","Mittwoch" }, | 65 | { "Wednesday","Mittwoch" }, |
66 | { "Thursday","Donnerstag" }, | 66 | { "Thursday","Donnerstag" }, |
67 | { "Friday","Freitag" }, | 67 | { "Friday","Freitag" }, |
68 | { "Saturday","Samstag" }, | 68 | { "Saturday","Samstag" }, |
69 | { "Sunday","Sonntag" }, | 69 | { "Sunday","Sonntag" }, |
70 | { "Daylight end:","Sommerzeit Ende:" }, | 70 | { "Daylight end:","Sommerzeit Ende:" }, |
71 | { "Time Zone","Zeitzone" }, | 71 | { "Time Zone","Zeitzone" }, |
72 | { "Used Mail Client","Benutzter Mail Client" }, | 72 | { "Used Mail Client","Benutzter Mail Client" }, |
73 | { "Channel:","Channel:" }, | 73 | { "Channel:","Channel:" }, |
74 | { "Message:","Message:" }, | 74 | { "Message:","Message:" }, |
75 | { "Parameters:","Parameter:" }, | 75 | { "Parameters:","Parameter:" }, |
76 | { "HINT: Delimiter=; Name=%1,Email=%2","Hinweis: Begrenzer=; Name=%1,Email=%2" }, | 76 | { "HINT: Delimiter=; Name=%1,Email=%2","Hinweis: Begrenzer=; Name=%1,Email=%2" }, |
77 | { "extra Message:","extra Message:" }, | 77 | { "extra Message:","extra Message:" }, |
78 | { "extra Parameters:","extra Parameter:" }, | 78 | { "extra Parameters:","extra Parameter:" }, |
79 | { "HINT: Emails=%1,Attachments=%2","Hinweis: Emails=%1,Attachments=%2" }, | 79 | { "HINT: Emails=%1,Attachments=%2","Hinweis: Emails=%1,Attachments=%2" }, |
80 | { "External Apps.","Externe Appl." }, | 80 | { "External Apps.","Externe Appl." }, |
81 | { "General","Allgemein" }, | 81 | { "General","Allgemein" }, |
82 | { "Full &name:","Vor- und &Nachname:" }, | 82 | { "Full &name:","Vor- und &Nachname:" }, |
83 | { "E&mail address:","E&mail Adresse:" }, | 83 | { "E&mail address:","E&mail Adresse:" }, |
84 | { "Fonts","Schriftart" }, | 84 | { "Fonts","Schriftart" }, |
85 | { "Choose...","Wähle..." }, | 85 | { "Choose...","Wähle..." }, |
86 | { "Used %1 Client","Benutzter %1 Client" }, | 86 | { "Used %1 Client","Benutzter %1 Client" }, |
87 | { "No email client installed","Kein Email Klient installiert" }, | 87 | { "No email client installed","Kein Email Klient installiert" }, |
88 | { "Userdefined email client","Benutzerdef. Email Klient" }, | 88 | { "Userdefined email client","Benutzerdef. Email Klient" }, |
89 | { "OM/Pi email client","OM/Pi Email Klient" }, | 89 | { "OM/Pi email client","OM/Pi Email Klient" }, |
90 | { "Delete","Löschen" }, | 90 | { "Delete","Löschen" }, |
91 | { "New","Neu" }, | 91 | { "New","Neu" }, |
92 | { "Edit","Bearbeite" }, | 92 | { "Edit","Bearbeite" }, |
93 | { "Close","Schließen" }, | 93 | { "Close","Schließen" }, |
94 | { "Size","Größe" }, | 94 | { "Size","Größe" }, |
95 | { "Date","Datum" }, | 95 | { "Date","Datum" }, |
96 | { "Please set at","Bitte einstellen in" }, | 96 | { "Please set at","Bitte einstellen in" }, |
97 | { "Settings@General TAB","Einstellungen@Allgemein TAB" }, | 97 | { "Settings@General TAB","Einstellungen@Allgemein TAB" }, |
98 | { "KOpieMail/Pi","KOpieMail/Pi" }, | 98 | { "KOpieMail/Pi","KOpieMail/Pi" }, |
99 | { "Mail","Mail" }, | 99 | { "Mail","Mail" }, |
100 | { "Settings","Konfig" }, | 100 | { "Settings","Konfig" }, |
101 | { "Get all new mails","Hole alle neuen Mails" }, | 101 | { "Get all new mails","Hole alle neuen Mails" }, |
102 | { "Get new messages","Hole neue mails" }, | 102 | { "Get new messages","Hole neue mails" }, |
103 | { "Compose new mail","Schreibe neue Mail" }, | 103 | { "Compose new mail","Schreibe neue Mail" }, |
104 | { "Send queued mails","Sende gespeicherte Mails" }, | 104 | { "Send queued mails","Sende gespeicherte Mails" }, |
105 | { "Show/Hide folders","Zeige Verzeichnisse" }, | 105 | { "Show/Hide folders","Zeige Verzeichnisse" }, |
106 | { "Delete Mail","Lösche Mail" }, | 106 | { "Delete Mail","Lösche Mail" }, |
107 | { "Edit settings","Ändere Einstellungen" }, | 107 | { "Edit settings","Ändere Einstellungen" }, |
108 | { "Configure accounts","Konfiguriere Zugänge" }, | 108 | { "Configure accounts","Konfiguriere Zugänge" }, |
109 | { "Mailbox","Mailbox" }, | 109 | { "Mailbox","Mailbox" }, |
110 | { "Subject","Betreff" }, | 110 | { "Subject","Betreff" }, |
111 | { "Sender","Sender" }, | 111 | { "Sender","Sender" }, |
112 | { "Size","Größe" }, | 112 | { "Size","Größe" }, |
113 | { "Date","Datum" }, | 113 | { "Date","Datum" }, |
114 | { "Close","Schliessen" }, | 114 | { "Close","Schliessen" }, |
115 | { "Help","Hilfe" }, | 115 | { "Help","Hilfe" }, |
116 | { "About","Über" }, | 116 | { "About","Über" }, |
117 | { "Licence","Lizenz" }, | 117 | { "Licence","Lizenz" }, |
118 | { "LibEtPan Licence","LibEtPan Lizenz" }, | 118 | { "LibEtPan Licence","LibEtPan Lizenz" }, |
119 | { "Settings - some need a restart (nr)","Einstellungen - manche benötigen einen Neustart (nr)" }, | 119 | { "Settings - some need a restart (nr)","Einstellungen - manche benötigen einen Neustart (nr)" }, |
120 | { "HINT: Separate multiple\neMail addresses by ";"","Hinweis:Trenne mehrere\nAddressen mit einem ";"" }, | 120 | { "HINT: Separate multiple\neMail addresses by ";"","Hinweis:Trenne mehrere\nAddressen mit einem ";"" }, |
121 | { "Ignore above settings and\nuse KA/Pi "Who am I" instead!","Ignoriere obige Einstellungen und\nbenutze KA/Pi "Wer bin ich"\nstattdessen!" }, | 121 | { "Ignore above settings and\nuse KA/Pi "Who am I" instead!","Ignoriere obige Einstellungen und\nbenutze KA/Pi "Wer bin ich"\nstattdessen!" }, |
122 | { "View mail as html","Zeige Mails als html" }, | 122 | { "View mail as html","Zeige Mails als html" }, |
123 | { "Send mails later","Sende Mails später" }, | 123 | { "Send mails later","Sende Mails später" }, |
124 | { "Application(nr)","Applikation(nr)" }, | 124 | { "Application(nr)","Applikation(nr)" }, |
125 | { "OK","OK" }, | 125 | { "OK","OK" }, |
126 | { "Compose mail:","Verfasse Mail:" }, | 126 | { "Compose mail:","Verfasse Mail:" }, |
127 | { "Dear Mr.","Hallo Herr" }, | 127 | { "Dear Mr.","Hallo Herr" }, |
128 | { "Read mail:","Lese Mail:" }, | 128 | { "Read mail:","Lese Mail:" }, |
129 | { "Hello","Hallo" }, | 129 | { "Hello","Hallo" }, |
130 | { "Configure Accounts","Konfigure Zugänge" }, | 130 | { "Configure Accounts","Konfigure Zugänge" }, |
131 | { "Name of the Account","Name des Zugangs" }, | 131 | { "Name of the Account","Name des Zugangs" }, |
132 | { "News","News" }, | 132 | { "News","News" }, |
133 | { "Account","Zugang" }, | 133 | { "Account","Zugang" }, |
134 | { "Type","Typ" }, | 134 | { "Type","Typ" }, |
135 | { "<p>Please select an account.</p>","<p>Bitte wähle einen Zugang.</p>" }, | 135 | { "<p>Please select an account.</p>","<p>Bitte wähle einen Zugang.</p>" }, |
136 | { "Error","Fehler" }, | 136 | { "Error","Fehler" }, |
137 | { "Configure NNTP","Konfiguriere News" }, | 137 | { "Configure NNTP","Konfiguriere News" }, |
138 | { "Port","Port" }, | 138 | { "Port","Port" }, |
139 | { "Server","Server" }, | 139 | { "Server","Server" }, |
140 | { "Use SSL","Benutze SSL" }, | 140 | { "Use SSL","Benutze SSL" }, |
141 | { "User","Benutzer" }, | 141 | { "User","Benutzer" }, |
142 | { "Password","Passwort" }, | 142 | { "Password","Passwort" }, |
143 | { "Use Login","Benutze Login" }, | 143 | { "Use Login","Benutze Login" }, |
144 | { "Newsgroup","Newsgroup" }, | 144 | { "Newsgroup","Newsgroup" }, |
145 | { "Get newsgroup list from server","Hole Newsgroup Liste vom Server" }, | 145 | { "Get newsgroup list from server","Hole Newsgroup Liste vom Server" }, |
146 | { "Filter:","Filter:" }, | 146 | { "Filter:","Filter:" }, |
147 | { "Show subscribed","Zeige abbonnierte" }, | 147 | { "Show subscribed","Zeige abbonnierte" }, |
148 | { "Groups","NewsGroups" }, | 148 | { "Groups","NewsGroups" }, |
149 | { "Configure IMAP","Konfiguriere IMAP" }, | 149 | { "Configure IMAP","Konfiguriere IMAP" }, |
150 | { "Use secure sockets:","Benutze sichere Verbindung:" }, | 150 | { "Use secure sockets:","Benutze sichere Verbindung:" }, |
151 | { "ssh $SERVER exec","ssh $SERVER exec" }, | 151 | { "ssh $SERVER exec","ssh $SERVER exec" }, |
152 | { "Prefix","Prefix" }, | 152 | { "Prefix","Prefix" }, |
153 | { "Local storage folder:","Lokales Verzeichnis:" }, | 153 | { "Local storage folder:","Lokales Verzeichnis:" }, |
154 | { "Get only messages smaller","Hole nur Nachrichten kleiner" }, | 154 | { "Get only messages smaller","Hole nur Nachrichten kleiner" }, |
155 | { "kB","kB" }, | 155 | { "kB","kB" }, |
156 | { "Leave Messages on Server","Belasse Nachrichten auf dem Server" }, | 156 | { "Leave Messages on Server","Belasse Nachrichten auf dem Server" }, |
157 | { "Configure POP3","Konfiguriere POP3" }, | 157 | { "Configure POP3","Konfiguriere POP3" }, |
158 | { "ssh $SERVER exec imapd","ssh $SERVER exec imapd" }, | 158 | { "ssh $SERVER exec imapd","ssh $SERVER exec imapd" }, |
159 | { "Configure SMTP","Konfiguriere SMTP" }, | 159 | { "Configure SMTP","Konfiguriere SMTP" }, |
160 | { "Name of the SMTP Server","Name des SMTP Servers" }, | 160 | { "Name of the SMTP Server","Name des SMTP Servers" }, |
161 | { "Port of the SMTP Server","Port des SMTP Servers" }, | 161 | { "Port of the SMTP Server","Port des SMTP Servers" }, |
162 | { "Fetching folder list","Hole Verzeichnis Liste" }, | 162 | { "Fetching folder list","Hole Verzeichnis Liste" }, |
163 | { "Fetch ","Hole " }, | 163 | { "Fetch ","Hole " }, |
164 | { "Fetching header list","Hole Titel Liste" }, | 164 | { "Fetching header list","Hole Titel Liste" }, |
165 | { "Mailbox has %1 mails","Mailbox hat %1 Mails" }, | 165 | { "Mailbox has %1 mails","Mailbox hat %1 Mails" }, |
166 | { "Read this mail","Lies diese Mail" }, | 166 | { "Read this mail","Lies diese Mail" }, |
167 | { "Move/Copy this mail","Verschiebe/kopiere diese Mail" }, | 167 | { "Move/Copy this mail","Verschiebe/kopiere diese Mail" }, |
168 | { "Delete this mail","Lösche diese Mail" }, | 168 | { "Delete this mail","Lösche diese Mail" }, |
169 | { "Move/Copy all selected mail","Verschiebe/kopiere selektierte Mails" }, | 169 | { "Move/Copy all selected mail","Verschiebe/kopiere selektierte Mails" }, |
170 | { "Delete all selected mails","Lösche alle selektierten Mails" }, | 170 | { "Delete all selected mails","Lösche alle selektierten Mails" }, |
171 | { "Clear selection","Selektion aufheben" }, | 171 | { "Clear selection","Selektion aufheben" }, |
172 | { "Reply","Antworten" }, | 172 | { "Reply","Antworten" }, |
173 | { "Forward","Weiterleiten" }, | 173 | { "Forward","Weiterleiten" }, |
174 | { "Attachments","Anhang" }, | 174 | { "Attachments","Anhang" }, |
175 | { "Show Html","Zeige in html" }, | 175 | { "Show Html","Zeige in html" }, |
176 | { "Description","Beschreibung" }, | 176 | { "Description","Beschreibung" }, |
177 | { "Filename","Dateiname" }, | 177 | { "Filename","Dateiname" }, |
178 | { "E-Mail by %1","E-Mail von %1" }, | 178 | { "E-Mail by %1","E-Mail von %1" }, |
179 | { "Cc","Kopie" }, | 179 | { "Cc","Kopie" }, |
180 | { "To","An" }, | 180 | { "To","An" }, |
181 | { "From","Von" }, | 181 | { "From","Von" }, |
182 | { "<p>Do you really want to delete this mail? <br><br>","<p>Wollen Sie diese Mail wirklich löschen? <br><br>" }, | 182 | { "<p>Do you really want to delete this mail? <br><br>","<p>Wollen Sie diese Mail wirklich löschen? <br><br>" }, |
183 | { "Mailbox has %1 mail(s)","Mailbox hat %1 Mail(s)" }, | 183 | { "Mailbox has %1 mail(s)","Mailbox hat %1 Mail(s)" }, |
184 | { "Move/Copie all mails","Verschiebe/kopiere alle Mails" }, | 184 | { "Move/Copie all mails","Verschiebe/kopiere alle Mails" }, |
185 | { "Delete all mails","Lösche alle Mails" }, | 185 | { "Delete all mails","Lösche alle Mails" }, |
186 | { "Create new subfolder","Neues Unterverzeichnis" }, | 186 | { "Create new subfolder","Neues Unterverzeichnis" }, |
187 | { "Delete folder","Lösche Verzeichnis" }, | 187 | { "Delete folder","Lösche Verzeichnis" }, |
188 | { "Refresh folder list","Aktualisiere Liste" }, | 188 | { "Refresh folder list","Aktualisiere Liste" }, |
189 | { "Create new folder","Neues Verzeichnis" }, | 189 | { "Create new folder","Neues Verzeichnis" }, |
190 | { "Disconnect","Diskonnect" }, | 190 | { "Disconnect","Diskonnect" }, |
191 | { "Set offline","Gehe offline" }, | 191 | { "Set offline","Gehe offline" }, |
192 | { "Select target box","Wähle Ziel Box" }, | 192 | { "Select target box","Wähle Ziel Box" }, |
193 | { "<b>Store mail(s) to</b>","<b>Speichere Mail(s) nach</b>" }, | 193 | { "<b>Store mail(s) to</b>","<b>Speichere Mail(s) nach</b>" }, |
194 | { "Folder:","Verzeichnis:" }, | 194 | { "Folder:","Verzeichnis:" }, |
195 | { "Account:","Zugang:" }, | 195 | { "Account:","Zugang:" }, |
196 | { "Prefix will prepend, do not enter","Pfad-Prefix wird vorangestellt" }, | 196 | { "Prefix will prepend, do not enter","Pfad-Prefix wird vorangestellt" }, |
197 | { "Move mail(s)","Verschiebe Mail(s)" }, | 197 | { "Move mail(s)","Verschiebe Mail(s)" }, |
198 | { "only mails smaller","nur Mails kleiner" }, | 198 | { "only mails smaller","nur Mails kleiner" }, |
199 | { " kB"," kB" }, | 199 | { " kB"," kB" }, |
200 | { " message %1 of %2"," Nachricht %1 von %2" }, | 200 | { " message %1 of %2"," Nachricht %1 von %2" }, |
201 | { "Copying...","Am Kopieren..." }, | 201 | { "Copying...","Am Kopieren..." }, |
202 | { "Copy message %1 of %2","Kopiere Nachricht %1 von %2" }, | 202 | { "Copy message %1 of %2","Kopiere Nachricht %1 von %2" }, |
203 | { "Do you really want to delete\nall selected mails?","Wollen Sie wirklich alle\nselektierten Mails Löschen?" }, | 203 | { "Do you really want to delete\nall selected mails?","Wollen Sie wirklich alle\nselektierten Mails Löschen?" }, |
204 | { "Delete All Mails","Lösche alle Mails" }, | 204 | { "Delete All Mails","Lösche alle Mails" }, |
205 | { "Deleting ...","Am Löschen..." }, | 205 | { "Deleting ...","Am Löschen..." }, |
206 | { "Delete message %1 of %2","Lösche Nachricht %1 von %2" }, | 206 | { "Delete message %1 of %2","Lösche Nachricht %1 von %2" }, |
207 | { "Compose Message","Verfasse Nachricht" }, | 207 | { "Compose Message","Verfasse Nachricht" }, |
208 | { "Reply-To","Antwort-An" }, | 208 | { "Reply-To","Antwort-An" }, |
209 | { "BCC","BCC" }, | 209 | { "BCC","BCC" }, |
210 | { "Signature","Signatur" }, | 210 | { "Signature","Signatur" }, |
211 | { "CC","Kopie" }, | 211 | { "CC","Kopie" }, |
212 | { "Options","Optionen" }, | 212 | { "Options","Optionen" }, |
213 | { "Delete File","Lösche Datei" }, | 213 | { "Delete File","Lösche Datei" }, |
214 | { "Add File","Füge Datei hinzu" }, | 214 | { "Add File","Füge Datei hinzu" }, |
215 | { "Attachment","Anhang" }, | 215 | { "Attachment","Anhang" }, |
216 | { "send later","sende später" }, | 216 | { "send later","sende später" }, |
217 | { "use:","via:" }, | 217 | { "use:","via:" }, |
218 | { "Save","Speichern" }, | 218 | { "Save","Speichern" }, |
219 | { "Name","Name" }, | 219 | { "Name","Name" }, |
220 | { "No Receiver spezified","Kein Empfänger angegeben" }, | 220 | { "No Receiver spezified","Kein Empfänger angegeben" }, |
221 | { "Sending mail","Sende Mail" }, | 221 | { "Sending mail","Sende Mail" }, |
222 | { "No","Nein" }, | 222 | { "No","Nein" }, |
223 | { "Yes","Ja" }, | 223 | { "Yes","Ja" }, |
224 | { "Store message into drafts?\n","Speichere Nachricht in Entwürfe?\n" }, | 224 | { "Store message into drafts?\n","Speichere Nachricht in Entwürfe?\n" }, |
225 | { "Store message?","Nachricht speichern?" }, | 225 | { "Store message?","Nachricht speichern?" }, |
226 | { "Select Type","Selektiere Typ" }, | 226 | { "Select Type","Selektiere Typ" }, |
227 | { "Select Account Type","Wähle Art des Zugangs" }, | 227 | { "Select Account Type","Wähle Art des Zugangs" }, |
228 | { "IMAP","IMAP (online lesen)" }, | 228 | { "IMAP","IMAP (online lesen)" }, |
229 | { "POP3","POP3 (holen)" }, | 229 | { "POP3","POP3 (holen)" }, |
230 | { "SMTP","SMTP (senden)" }, | 230 | { "SMTP","SMTP (senden)" }, |
231 | { "<p>Do you really want to delete the selected Account?</p>","<p>Möchten Sie wirklich den ausgewählten Account löschen?</p>" }, | 231 | { "<p>Do you really want to delete the selected Account?</p>","<p>Möchten Sie wirklich den ausgewählten Account löschen?</p>" }, |
232 | { "Question","Eine Frage..." }, | 232 | { "Question","Eine Frage..." }, |
233 | { "Send this message?","Nachricht wirklich senden?" }, | 233 | { "Send this message?","Nachricht wirklich senden?" }, |
234 | { "Stop editing message","Stop editing message" }, | 234 | { "Stop editing message","Stop editing message" }, |
235 | { "Sending mail %1 of %2","Sende Mail %1 von %2" }, | 235 | { "Sending mail %1 of %2","Sende Mail %1 von %2" }, |
236 | { "%1 of %2 bytes send","%1 von %2 Bytes gesendet" }, | 236 | { "%1 of %2 bytes send","%1 von %2 Bytes gesendet" }, |
237 | { "Refresh header list","Aktualisiere Titel Liste" }, | 237 | { "Refresh header list","Aktualisiere Titel Liste" }, |
238 | { "Define a smtp\n account first!\n","Bitte zuerst einen\nSMTP Account anlegen!\n" }, | 238 | { "Define a smtp\n account first!\n","Bitte zuerst einen\nSMTP Account anlegen!\n" }, |
239 | { "Mail queue flushed","Gespeicherte Mails gesendet!" }, | 239 | { "Mail queue flushed","Gespeicherte Mails gesendet!" }, |
240 | { "Please create an\nSMTP account first.\nThe SMTP is needed\nfor sending mail.\n","Bitte legen Sie einen\nSMTP Account an.\nDer SMTP Account wird\nfür das Versenden von\nMails benötigt!" }, | 240 | { "Please create an\nSMTP account first.\nThe SMTP is needed\nfor sending mail.\n","Bitte legen Sie einen\nSMTP Account an.\nDer SMTP Account wird\nfür das Versenden von\nMails benötigt!" }, |
241 | { "Show next mail","Zeige nächste Mail" }, | 241 | { "Show next mail","Zeige nächste Mail" }, |
242 | { "End of List","Ende der Liste" }, | 242 | { "End of List","Ende der Liste" }, |
243 | { "Language","Sprache" }, | 243 | { "Language","Sprache" }, |
244 | { "Time Format","Zeit Format" }, | 244 | { "Time Format","Zeit Format" }, |
245 | { "%1 groups subscribed","%1 Guppen abboniert" }, | 245 | { "%1 groups subscribed","%1 Guppen abboniert" }, |
246 | { "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" }, | 246 | { "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" }, |
247 | { "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" }, | 247 | { "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" }, |
248 | { "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" }, | 248 | { "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" }, |
249 | { "Save settings","Speichere Einstellungen" }, | 249 | { "Save settings","Speichere Einstellungen" }, |
250 | { "Save standard","Speichere Standard" }, | 250 | { "Save standard","Speichere Standard" }, |
251 | { "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" }, | 251 | { "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" }, |
252 | { "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" }, | 252 | { "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" }, |
253 | { "Data storage path","Daten Speicherpfad" }, | 253 | { "Data storage path","Daten Speicherpfad" }, |
254 | { "userdefined","benutzerdefiniert" }, | 254 | { "userdefined","benutzerdefiniert" }, |
255 | { "Reply to this mail","Beantworte diese Mail" }, | 255 | { "Reply to this mail","Beantworte diese Mail" }, |
256 | { "Su:","Be:" }, | 256 | { "Su:","Be:" }, |
257 | { "Fr:","Vo:" }, | 257 | { "Fr:","Vo:" }, |
258 | { "To:","An:" }, | 258 | { "To:","An:" }, |
259 | { "Download Mail","Mail runterladen" }, | 259 | { "Download Mail","Mail runterladen" }, |
260 | { "View Source","Zeige Source" }, | 260 | { "View Source","Zeige Source" }, |
261 | { "Show "To" field in list view","Zeige "An" Feld in Listenansicht" }, | 261 | { "Show "To" field in list view","Zeige "An" Feld in Listenansicht" }, |
262 | { "Show info fields at startup","Zeige Info Felder beim Start" }, | 262 | { "Show info fields at startup","Zeige Info Felder beim Start" }, |
263 | { "Show "Subject" info field","Zeige "Betreff" Info Feld" }, | 263 | { "Show "Subject" info field","Zeige "Betreff" Info Feld" }, |
264 | { "Show "From" info field","Zeige "Von" Info Feld" }, | 264 | { "Show "From" info field","Zeige "Von" Info Feld" }, |
265 | { "Show "To" info field","Zeige "An" Info Feld" }, | 265 | { "Show "To" info field","Zeige "An" Info Feld" }, |
266 | { "Mail saved as draft!","Mail als Entwurf gespeichert!" }, | 266 | { "Mail saved as draft!","Mail als Entwurf gespeichert!" }, |
267 | { "Save signature","Speichere Signatur" }, | 267 | { "Save signature","Speichere Signatur" }, |
268 | { "No paths allowed in\nlocal folder settings.\nPlease specify a folder\nname or leave empty\nto create local folder\nwith account name\nautomatically.","Beim lokalen Verzeichnis\nsind keine Pfade erlaubt.\nBitte Verzeichnisnamen\nangeben oder leer lassen\num automatisch ein lokales\nVerzeichnis mit dem\nZugangsnamen anzulegen." }, | 268 | { "No paths allowed in\nlocal folder settings.\nPlease specify a folder\nname or leave empty\nto create local folder\nwith account name\nautomatically.","Beim lokalen Verzeichnis\nsind keine Pfade erlaubt.\nBitte Verzeichnisnamen\nangeben oder leer lassen\num automatisch ein lokales\nVerzeichnis mit dem\nZugangsnamen anzulegen." }, |
269 | { "Do you really want to\nsend all queued mails?","Möchten sie wirklich\nalle Mails im\nOutgoing-Ordner\nsenden?" }, | 269 | { "Do you really want to\nsend all queued mails?","Möchten sie wirklich\nalle Mails im\nOutgoing-Ordner\nsenden?" }, |
270 | { "Sending all mails","Senden aller Mails" }, | 270 | { "Sending all mails","Senden aller Mails" }, |
271 | { "SMTP Account:","SMTP Zugang:" }, | 271 | { "SMTP Account:","SMTP Zugang:" }, |
272 | { "Select SMTP Account","Wähle SMTP Zugang" }, | 272 | { "Select SMTP Account","Wähle SMTP Zugang" }, |
273 | { "Error sending mail:\n%1","Fehler beim Mailversand:\n%1\nHaben Sie vergessen\ndie Post ausreichend\nzu frankieren? ;-)" }, | 273 | { "Error sending mail:\n%1","Fehler beim Mailversand:\n%1\nHaben Sie vergessen\ndie Post ausreichend\nzu frankieren? ;-)" }, |
274 | { "Error sending mail","Fehler beim Mailversand" }, | 274 | { "Error sending mail","Fehler beim Mailversand" }, |
275 | { "Error sending queued mail.\nBreaking.","Fehler beim Mailversand.\nAbbruch." }, | 275 | { "Error sending queued mail.\nBreaking.","Fehler beim Mailversand.\nAbbruch." }, |
276 | { "Colors","Farben" }, | 276 | { "Colors","Farben" }, |
277 | { "Alternating background of list views","Abwechselnder Hintergrund für Listen" }, | 277 | { "Alternating background of list views","Abwechselnder Hintergrund für Listen" }, |
278 | { "Configure OM/Pi...","Konfiguriere OM/Pi..." }, | 278 | { "Configure OM/Pi...","Konfiguriere OM/Pi..." }, |
279 | { "Global Settings...","Globale Einstellungen..." }, | 279 | { "Global Settings...","Globale Einstellungen..." }, |
280 | { " Local Mailfolders"," Lokale Mailordner" }, | ||
281 | { "Refreshing %1 ... please wait","Lese %1 neu ein ... bitte warten" }, | ||
282 | { "Refresh\n%1\n?","%1\nneu einlesen?" }, | ||
283 | { "Refresh","Neu einlesen" }, | ||
284 | { "Select all","Selektiere alle" }, | ||
285 | { "","" }, | ||
286 | { "","" }, | ||
287 | { "","" }, | ||
288 | { "","" }, | ||
289 | { "","" }, | ||
280 | { "","" }, | 290 | { "","" }, |
281 | { "","" }, | 291 | { "","" }, |
282 | { "","" }, \ No newline at end of file | ||
diff --git a/kmicromail/accountitem.cpp b/kmicromail/accountitem.cpp index fcb2052..985a762 100644 --- a/kmicromail/accountitem.cpp +++ b/kmicromail/accountitem.cpp | |||
@@ -1,1187 +1,1187 @@ | |||
1 | 1 | ||
2 | #include "accountitem.h" | 2 | #include "accountitem.h" |
3 | #include "accountview.h" | 3 | #include "accountview.h" |
4 | #include "newmaildir.h" | 4 | #include "newmaildir.h" |
5 | #include "nntpgroupsdlg.h" | 5 | #include "nntpgroupsdlg.h" |
6 | #include "defines.h" | 6 | #include "defines.h" |
7 | 7 | ||
8 | #include <libmailwrapper/mailtypes.h> | 8 | #include <libmailwrapper/mailtypes.h> |
9 | #include <libmailwrapper/abstractmail.h> | 9 | #include <libmailwrapper/abstractmail.h> |
10 | #include <libmailwrapper/mailwrapper.h> | 10 | #include <libmailwrapper/mailwrapper.h> |
11 | /* OPIE */ | 11 | /* OPIE */ |
12 | //#include <qpe/qpeapplication.h> | 12 | //#include <qpe/qpeapplication.h> |
13 | 13 | ||
14 | /* QT */ | 14 | /* QT */ |
15 | #include <qpopupmenu.h> | 15 | #include <qpopupmenu.h> |
16 | #include <qmessagebox.h> | 16 | #include <qmessagebox.h> |
17 | #include <kiconloader.h> | 17 | #include <kiconloader.h> |
18 | #include <klocale.h> | 18 | #include <klocale.h> |
19 | 19 | ||
20 | #define GET_NEW_MAILS 101 | 20 | #define GET_NEW_MAILS 101 |
21 | 21 | ||
22 | using namespace Opie::Core; | 22 | using namespace Opie::Core; |
23 | #define SETPIX(x) if (!account->getOffline()) {setPixmap( 0,x);} else {setPixmap( 0, PIXMAP_OFFLINE );} | 23 | #define SETPIX(x) if (!account->getOffline()) {setPixmap( 0,x);} else {setPixmap( 0, PIXMAP_OFFLINE );} |
24 | /** | 24 | /** |
25 | * POP3 Account stuff | 25 | * POP3 Account stuff |
26 | */ | 26 | */ |
27 | POP3viewItem::POP3viewItem( POP3account *a, AccountView *parent ) | 27 | POP3viewItem::POP3viewItem( POP3account *a, AccountView *parent ) |
28 | : AccountViewItem( parent ) | 28 | : AccountViewItem( parent ) |
29 | { | 29 | { |
30 | account = a; | 30 | account = a; |
31 | wrapper = AbstractMail::getWrapper( account ); | 31 | wrapper = AbstractMail::getWrapper( account ); |
32 | SETPIX(PIXMAP_POP3FOLDER); | 32 | SETPIX(PIXMAP_POP3FOLDER); |
33 | #if 0 | 33 | #if 0 |
34 | if (!account->getOffline()) | 34 | if (!account->getOffline()) |
35 | { | 35 | { |
36 | setPixmap( 0, ); | 36 | setPixmap( 0, ); |
37 | } | 37 | } |
38 | else | 38 | else |
39 | { | 39 | { |
40 | setPixmap( 0, PIXMAP_OFFLINE ); | 40 | setPixmap( 0, PIXMAP_OFFLINE ); |
41 | } | 41 | } |
42 | #endif | 42 | #endif |
43 | setText( 0, account->getAccountName() ); | 43 | setText( 0, account->getAccountName() ); |
44 | setOpen( true ); | 44 | setOpen( true ); |
45 | } | 45 | } |
46 | 46 | ||
47 | POP3viewItem::~POP3viewItem() | 47 | POP3viewItem::~POP3viewItem() |
48 | { | 48 | { |
49 | delete wrapper; | 49 | delete wrapper; |
50 | } | 50 | } |
51 | 51 | ||
52 | AbstractMail *POP3viewItem::getWrapper() | 52 | AbstractMail *POP3viewItem::getWrapper() |
53 | { | 53 | { |
54 | return wrapper; | 54 | return wrapper; |
55 | } | 55 | } |
56 | 56 | ||
57 | void POP3viewItem::refresh(QValueList<Opie::Core::OSmartPointer<RecMail> > & ) | 57 | void POP3viewItem::refresh(QValueList<Opie::Core::OSmartPointer<RecMail> > & ) |
58 | { | 58 | { |
59 | refresh(); | 59 | refresh(); |
60 | } | 60 | } |
61 | 61 | ||
62 | void POP3viewItem::refresh() | 62 | void POP3viewItem::refresh() |
63 | { | 63 | { |
64 | if (account->getOffline()) return; | 64 | if (account->getOffline()) return; |
65 | QValueList<FolderP> *folders = wrapper->listFolders(); | 65 | QValueList<FolderP> *folders = wrapper->listFolders(); |
66 | QListViewItem *child = firstChild(); | 66 | QListViewItem *child = firstChild(); |
67 | while ( child ) | 67 | while ( child ) |
68 | { | 68 | { |
69 | QListViewItem *tmp = child; | 69 | QListViewItem *tmp = child; |
70 | child = child->nextSibling(); | 70 | child = child->nextSibling(); |
71 | delete tmp; | 71 | delete tmp; |
72 | } | 72 | } |
73 | QValueList<FolderP>::ConstIterator it; | 73 | QValueList<FolderP>::ConstIterator it; |
74 | QListViewItem*item = 0; | 74 | QListViewItem*item = 0; |
75 | for ( it = folders->begin(); it!=folders->end(); ++it) | 75 | for ( it = folders->begin(); it!=folders->end(); ++it) |
76 | { | 76 | { |
77 | item = new POP3folderItem( (*it), this , item ); | 77 | item = new POP3folderItem( (*it), this , item ); |
78 | item->setSelectable( (*it)->may_select()); | 78 | item->setSelectable( (*it)->may_select()); |
79 | } | 79 | } |
80 | delete folders; | 80 | delete folders; |
81 | } | 81 | } |
82 | 82 | ||
83 | RECBODYP POP3viewItem::fetchBody( const RecMailP &mail ) | 83 | RECBODYP POP3viewItem::fetchBody( const RecMailP &mail ) |
84 | { | 84 | { |
85 | 85 | ||
86 | return wrapper->fetchBody( mail ); | 86 | return wrapper->fetchBody( mail ); |
87 | } | 87 | } |
88 | 88 | ||
89 | QPopupMenu * POP3viewItem::getContextMenu() | 89 | QPopupMenu * POP3viewItem::getContextMenu() |
90 | { | 90 | { |
91 | QPopupMenu *m = new QPopupMenu(0); | 91 | QPopupMenu *m = new QPopupMenu(0); |
92 | if (m) | 92 | if (m) |
93 | { | 93 | { |
94 | if (!account->getOffline()) | 94 | if (!account->getOffline()) |
95 | { | 95 | { |
96 | m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); | 96 | m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); |
97 | m->insertItem(i18n("Disconnect"),0); | 97 | m->insertItem(i18n("Disconnect"),0); |
98 | m->insertItem(i18n("Set offline"),1); | 98 | m->insertItem(i18n("Set offline"),1); |
99 | } | 99 | } |
100 | else | 100 | else |
101 | { | 101 | { |
102 | m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); | 102 | m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); |
103 | m->insertItem(i18n("Set online"),1); | 103 | m->insertItem(i18n("Set online"),1); |
104 | } | 104 | } |
105 | } | 105 | } |
106 | return m; | 106 | return m; |
107 | } | 107 | } |
108 | 108 | ||
109 | void POP3viewItem::disconnect() | 109 | void POP3viewItem::disconnect() |
110 | { | 110 | { |
111 | QListViewItem *child = firstChild(); | 111 | QListViewItem *child = firstChild(); |
112 | while ( child ) | 112 | while ( child ) |
113 | { | 113 | { |
114 | QListViewItem *tmp = child; | 114 | QListViewItem *tmp = child; |
115 | child = child->nextSibling(); | 115 | child = child->nextSibling(); |
116 | delete tmp; | 116 | delete tmp; |
117 | } | 117 | } |
118 | wrapper->logout(); | 118 | wrapper->logout(); |
119 | } | 119 | } |
120 | 120 | ||
121 | void POP3viewItem::setOnOffline() | 121 | void POP3viewItem::setOnOffline() |
122 | { | 122 | { |
123 | if (!account->getOffline()) | 123 | if (!account->getOffline()) |
124 | { | 124 | { |
125 | disconnect(); | 125 | disconnect(); |
126 | } | 126 | } |
127 | account->setOffline(!account->getOffline()); | 127 | account->setOffline(!account->getOffline()); |
128 | account->save(); | 128 | account->save(); |
129 | SETPIX(PIXMAP_POP3FOLDER); | 129 | SETPIX(PIXMAP_POP3FOLDER); |
130 | refresh(); | 130 | refresh(); |
131 | } | 131 | } |
132 | 132 | ||
133 | void POP3viewItem::contextMenuSelected(int which) | 133 | void POP3viewItem::contextMenuSelected(int which) |
134 | { | 134 | { |
135 | switch (which) | 135 | switch (which) |
136 | { | 136 | { |
137 | case 0: | 137 | case 0: |
138 | disconnect(); | 138 | disconnect(); |
139 | break; | 139 | break; |
140 | case 1: | 140 | case 1: |
141 | setOnOffline(); | 141 | setOnOffline(); |
142 | break; | 142 | break; |
143 | case GET_NEW_MAILS: // daunlood | 143 | case GET_NEW_MAILS: // daunlood |
144 | if (account->getOffline()) | 144 | if (account->getOffline()) |
145 | setOnOffline(); | 145 | setOnOffline(); |
146 | AccountView*bl = accountView(); | 146 | AccountView*bl = accountView(); |
147 | if (!bl) return; | 147 | if (!bl) return; |
148 | AccountViewItem* in = findSubItem( "inbox" , 0); | 148 | AccountViewItem* in = findSubItem( "inbox" , 0); |
149 | if ( ! in ) | 149 | if ( ! in ) |
150 | return; | 150 | return; |
151 | bl->downloadMailsInbox(in->getFolder() ,getWrapper()); | 151 | bl->downloadMailsInbox(in->getFolder() ,getWrapper()); |
152 | setOnOffline(); | 152 | setOnOffline(); |
153 | break; | 153 | break; |
154 | } | 154 | } |
155 | } | 155 | } |
156 | 156 | ||
157 | POP3folderItem::~POP3folderItem() | 157 | POP3folderItem::~POP3folderItem() |
158 | {} | 158 | {} |
159 | 159 | ||
160 | POP3folderItem::POP3folderItem( const FolderP&folderInit, POP3viewItem *parent , QListViewItem*after ) | 160 | POP3folderItem::POP3folderItem( const FolderP&folderInit, POP3viewItem *parent , QListViewItem*after ) |
161 | : AccountViewItem(folderInit,parent,after ) | 161 | : AccountViewItem(folderInit,parent,after ) |
162 | { | 162 | { |
163 | pop3 = parent; | 163 | pop3 = parent; |
164 | if (folder->getDisplayName().lower()!="inbox") | 164 | if (folder->getDisplayName().lower()!="inbox") |
165 | { | 165 | { |
166 | setPixmap( 0, PIXMAP_POP3FOLDER ); | 166 | setPixmap( 0, PIXMAP_POP3FOLDER ); |
167 | } | 167 | } |
168 | else | 168 | else |
169 | { | 169 | { |
170 | setPixmap( 0, PIXMAP_INBOXFOLDER); | 170 | setPixmap( 0, PIXMAP_INBOXFOLDER); |
171 | } | 171 | } |
172 | setText( 0, folder->getDisplayName() ); | 172 | setText( 0, folder->getDisplayName() ); |
173 | } | 173 | } |
174 | 174 | ||
175 | void POP3folderItem::refresh(QValueList<RecMailP>&target) | 175 | void POP3folderItem::refresh(QValueList<RecMailP>&target) |
176 | { | 176 | { |
177 | if (folder->may_select()) | 177 | if (folder->may_select()) |
178 | pop3->getWrapper()->listMessages( folder->getName(),target ); | 178 | pop3->getWrapper()->listMessages( folder->getName(),target ); |
179 | } | 179 | } |
180 | 180 | ||
181 | RECBODYP POP3folderItem::fetchBody(const RecMailP&aMail) | 181 | RECBODYP POP3folderItem::fetchBody(const RecMailP&aMail) |
182 | { | 182 | { |
183 | return pop3->getWrapper()->fetchBody(aMail); | 183 | return pop3->getWrapper()->fetchBody(aMail); |
184 | } | 184 | } |
185 | 185 | ||
186 | QPopupMenu * POP3folderItem::getContextMenu() | 186 | QPopupMenu * POP3folderItem::getContextMenu() |
187 | { | 187 | { |
188 | QPopupMenu *m = new QPopupMenu(0); | 188 | QPopupMenu *m = new QPopupMenu(0); |
189 | if (m) | 189 | if (m) |
190 | { | 190 | { |
191 | m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); | 191 | m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); |
192 | m->insertItem(i18n("Refresh header list"),0); | 192 | m->insertItem(i18n("Refresh header list"),0); |
193 | m->insertItem(i18n("Delete all mails"),1); | 193 | m->insertItem(i18n("Delete all mails"),1); |
194 | m->insertItem(i18n("Move/Copie all mails"),2); | 194 | m->insertItem(i18n("Move/Copie all mails"),2); |
195 | } | 195 | } |
196 | return m; | 196 | return m; |
197 | } | 197 | } |
198 | 198 | ||
199 | void POP3folderItem::downloadMails() | 199 | void POP3folderItem::downloadMails() |
200 | { | 200 | { |
201 | AccountView*bl = pop3->accountView(); | 201 | AccountView*bl = pop3->accountView(); |
202 | if (!bl) return; | 202 | if (!bl) return; |
203 | bl->downloadMails(folder,pop3->getWrapper()); | 203 | bl->downloadMails(folder,pop3->getWrapper()); |
204 | } | 204 | } |
205 | 205 | ||
206 | void POP3folderItem::contextMenuSelected(int which) | 206 | void POP3folderItem::contextMenuSelected(int which) |
207 | { | 207 | { |
208 | AccountView * view = (AccountView*)listView(); | 208 | AccountView * view = (AccountView*)listView(); |
209 | switch (which) | 209 | switch (which) |
210 | { | 210 | { |
211 | case 0: | 211 | case 0: |
212 | /* must be 'cause pop3 lists are cached */ | 212 | /* must be 'cause pop3 lists are cached */ |
213 | pop3->getWrapper()->logout(); | 213 | pop3->getWrapper()->logout(); |
214 | view->refreshCurrent(); | 214 | view->refreshCurrent(); |
215 | break; | 215 | break; |
216 | case 1: | 216 | case 1: |
217 | deleteAllMail(pop3->getWrapper(),folder); | 217 | deleteAllMail(pop3->getWrapper(),folder); |
218 | break; | 218 | break; |
219 | case 2: | 219 | case 2: |
220 | downloadMails(); | 220 | downloadMails(); |
221 | break; | 221 | break; |
222 | case GET_NEW_MAILS: // daunlood | 222 | case GET_NEW_MAILS: // daunlood |
223 | view->downloadMailsInbox(getFolder() ,pop3->getWrapper()); | 223 | view->downloadMailsInbox(getFolder() ,pop3->getWrapper()); |
224 | break; | 224 | break; |
225 | default: | 225 | default: |
226 | break; | 226 | break; |
227 | } | 227 | } |
228 | } | 228 | } |
229 | 229 | ||
230 | /** | 230 | /** |
231 | * NNTP Account stuff | 231 | * NNTP Account stuff |
232 | */ | 232 | */ |
233 | NNTPviewItem::NNTPviewItem( NNTPaccount *a, AccountView *parent ) | 233 | NNTPviewItem::NNTPviewItem( NNTPaccount *a, AccountView *parent ) |
234 | : AccountViewItem( parent ) | 234 | : AccountViewItem( parent ) |
235 | { | 235 | { |
236 | account = a; | 236 | account = a; |
237 | wrapper = AbstractMail::getWrapper( account ); | 237 | wrapper = AbstractMail::getWrapper( account ); |
238 | //FIXME | 238 | //FIXME |
239 | SETPIX(PIXMAP_POP3FOLDER); | 239 | SETPIX(PIXMAP_POP3FOLDER); |
240 | #if 0 | 240 | #if 0 |
241 | if (!account->getOffline()) | 241 | if (!account->getOffline()) |
242 | { | 242 | { |
243 | setPixmap( 0, ); | 243 | setPixmap( 0, ); |
244 | } | 244 | } |
245 | else | 245 | else |
246 | { | 246 | { |
247 | setPixmap( 0, PIXMAP_OFFLINE ); | 247 | setPixmap( 0, PIXMAP_OFFLINE ); |
248 | } | 248 | } |
249 | #endif | 249 | #endif |
250 | setText( 0, account->getAccountName() ); | 250 | setText( 0, account->getAccountName() ); |
251 | setOpen( true ); | 251 | setOpen( true ); |
252 | } | 252 | } |
253 | 253 | ||
254 | NNTPviewItem::~NNTPviewItem() | 254 | NNTPviewItem::~NNTPviewItem() |
255 | { | 255 | { |
256 | delete wrapper; | 256 | delete wrapper; |
257 | } | 257 | } |
258 | 258 | ||
259 | AbstractMail *NNTPviewItem::getWrapper() | 259 | AbstractMail *NNTPviewItem::getWrapper() |
260 | { | 260 | { |
261 | return wrapper; | 261 | return wrapper; |
262 | } | 262 | } |
263 | 263 | ||
264 | void NNTPviewItem::refresh( QValueList<RecMailP> & ) | 264 | void NNTPviewItem::refresh( QValueList<RecMailP> & ) |
265 | { | 265 | { |
266 | refresh(); | 266 | refresh(); |
267 | } | 267 | } |
268 | 268 | ||
269 | void NNTPviewItem::refresh() | 269 | void NNTPviewItem::refresh() |
270 | { | 270 | { |
271 | if (account->getOffline()) return; | 271 | if (account->getOffline()) return; |
272 | QValueList<FolderP> *folders = wrapper->listFolders(); | 272 | QValueList<FolderP> *folders = wrapper->listFolders(); |
273 | 273 | ||
274 | QListViewItem *child = firstChild(); | 274 | QListViewItem *child = firstChild(); |
275 | while ( child ) | 275 | while ( child ) |
276 | { | 276 | { |
277 | QListViewItem *tmp = child; | 277 | QListViewItem *tmp = child; |
278 | child = child->nextSibling(); | 278 | child = child->nextSibling(); |
279 | delete tmp; | 279 | delete tmp; |
280 | } | 280 | } |
281 | QValueList<FolderP>::ConstIterator it; | 281 | QValueList<FolderP>::ConstIterator it; |
282 | QListViewItem*item = 0; | 282 | QListViewItem*item = 0; |
283 | for ( it = folders->begin(); it!=folders->end(); ++it) | 283 | for ( it = folders->begin(); it!=folders->end(); ++it) |
284 | { | 284 | { |
285 | item = new NNTPfolderItem( (*it), this , item ); | 285 | item = new NNTPfolderItem( (*it), this , item ); |
286 | item->setSelectable( (*it)->may_select()); | 286 | item->setSelectable( (*it)->may_select()); |
287 | } | 287 | } |
288 | delete folders; | 288 | delete folders; |
289 | } | 289 | } |
290 | 290 | ||
291 | RECBODYP NNTPviewItem::fetchBody( const RecMailP &mail ) | 291 | RECBODYP NNTPviewItem::fetchBody( const RecMailP &mail ) |
292 | { | 292 | { |
293 | 293 | ||
294 | return wrapper->fetchBody( mail ); | 294 | return wrapper->fetchBody( mail ); |
295 | } | 295 | } |
296 | 296 | ||
297 | QPopupMenu * NNTPviewItem::getContextMenu() | 297 | QPopupMenu * NNTPviewItem::getContextMenu() |
298 | { | 298 | { |
299 | QPopupMenu *m = new QPopupMenu(0); | 299 | QPopupMenu *m = new QPopupMenu(0); |
300 | if (m) | 300 | if (m) |
301 | { | 301 | { |
302 | if (!account->getOffline()) | 302 | if (!account->getOffline()) |
303 | { | 303 | { |
304 | m->insertItem(i18n("Disconnect"),0); | 304 | m->insertItem(i18n("Disconnect"),0); |
305 | m->insertItem(i18n("Set offline"),1); | 305 | m->insertItem(i18n("Set offline"),1); |
306 | //m->insertItem(i18n("(Un-)Subscribe groups"),2); | 306 | //m->insertItem(i18n("(Un-)Subscribe groups"),2); |
307 | } | 307 | } |
308 | else | 308 | else |
309 | { | 309 | { |
310 | m->insertItem(i18n("Set online"),1); | 310 | m->insertItem(i18n("Set online"),1); |
311 | } | 311 | } |
312 | } | 312 | } |
313 | return m; | 313 | return m; |
314 | } | 314 | } |
315 | 315 | ||
316 | void NNTPviewItem::subscribeGroups() | 316 | void NNTPviewItem::subscribeGroups() |
317 | { | 317 | { |
318 | NNTPGroupsDlg dlg(account); | 318 | NNTPGroupsDlg dlg(account); |
319 | #ifndef DESKTOP_VERSION | 319 | #ifndef DESKTOP_VERSION |
320 | dlg.showMaximized(); | 320 | dlg.showMaximized(); |
321 | #endif | 321 | #endif |
322 | if ( dlg.exec()== QDialog::Accepted ){ | 322 | if ( dlg.exec()== QDialog::Accepted ){ |
323 | refresh(); | 323 | refresh(); |
324 | } | 324 | } |
325 | } | 325 | } |
326 | 326 | ||
327 | void NNTPviewItem::disconnect() | 327 | void NNTPviewItem::disconnect() |
328 | { | 328 | { |
329 | QListViewItem *child = firstChild(); | 329 | QListViewItem *child = firstChild(); |
330 | while ( child ) | 330 | while ( child ) |
331 | { | 331 | { |
332 | QListViewItem *tmp = child; | 332 | QListViewItem *tmp = child; |
333 | child = child->nextSibling(); | 333 | child = child->nextSibling(); |
334 | delete tmp; | 334 | delete tmp; |
335 | } | 335 | } |
336 | wrapper->logout(); | 336 | wrapper->logout(); |
337 | } | 337 | } |
338 | 338 | ||
339 | void NNTPviewItem::setOnOffline() | 339 | void NNTPviewItem::setOnOffline() |
340 | { | 340 | { |
341 | if (!account->getOffline()) | 341 | if (!account->getOffline()) |
342 | { | 342 | { |
343 | disconnect(); | 343 | disconnect(); |
344 | } | 344 | } |
345 | account->setOffline(!account->getOffline()); | 345 | account->setOffline(!account->getOffline()); |
346 | account->save(); | 346 | account->save(); |
347 | //FIXME | 347 | //FIXME |
348 | SETPIX(PIXMAP_POP3FOLDER); | 348 | SETPIX(PIXMAP_POP3FOLDER); |
349 | refresh(); | 349 | refresh(); |
350 | } | 350 | } |
351 | 351 | ||
352 | void NNTPviewItem::contextMenuSelected(int which) | 352 | void NNTPviewItem::contextMenuSelected(int which) |
353 | { | 353 | { |
354 | switch (which) | 354 | switch (which) |
355 | { | 355 | { |
356 | case 0: | 356 | case 0: |
357 | disconnect(); | 357 | disconnect(); |
358 | break; | 358 | break; |
359 | case 1: | 359 | case 1: |
360 | setOnOffline(); | 360 | setOnOffline(); |
361 | break; | 361 | break; |
362 | case 2: | 362 | case 2: |
363 | subscribeGroups(); | 363 | subscribeGroups(); |
364 | break; | 364 | break; |
365 | } | 365 | } |
366 | } | 366 | } |
367 | 367 | ||
368 | NNTPfolderItem::~NNTPfolderItem() | 368 | NNTPfolderItem::~NNTPfolderItem() |
369 | {} | 369 | {} |
370 | 370 | ||
371 | NNTPfolderItem::NNTPfolderItem( const FolderP &folderInit, NNTPviewItem *parent , QListViewItem*after ) | 371 | NNTPfolderItem::NNTPfolderItem( const FolderP &folderInit, NNTPviewItem *parent , QListViewItem*after ) |
372 | : AccountViewItem( folderInit, parent,after ) | 372 | : AccountViewItem( folderInit, parent,after ) |
373 | { | 373 | { |
374 | nntp = parent; | 374 | nntp = parent; |
375 | if (folder->getDisplayName().lower()!="inbox") | 375 | if (folder->getDisplayName().lower()!="inbox") |
376 | { | 376 | { |
377 | setPixmap( 0, PIXMAP_POP3FOLDER ); | 377 | setPixmap( 0, PIXMAP_POP3FOLDER ); |
378 | } | 378 | } |
379 | else | 379 | else |
380 | { | 380 | { |
381 | setPixmap( 0, PIXMAP_INBOXFOLDER); | 381 | setPixmap( 0, PIXMAP_INBOXFOLDER); |
382 | } | 382 | } |
383 | setText( 0, folder->getDisplayName() ); | 383 | setText( 0, folder->getDisplayName() ); |
384 | } | 384 | } |
385 | 385 | ||
386 | void NNTPfolderItem::refresh(QValueList<RecMailP>&target) | 386 | void NNTPfolderItem::refresh(QValueList<RecMailP>&target) |
387 | { | 387 | { |
388 | if (folder->may_select()) | 388 | if (folder->may_select()) |
389 | nntp->getWrapper()->listMessages( folder->getName(),target ); | 389 | nntp->getWrapper()->listMessages( folder->getName(),target ); |
390 | } | 390 | } |
391 | 391 | ||
392 | RECBODYP NNTPfolderItem::fetchBody(const RecMailP&aMail) | 392 | RECBODYP NNTPfolderItem::fetchBody(const RecMailP&aMail) |
393 | { | 393 | { |
394 | return nntp->getWrapper()->fetchBody(aMail); | 394 | return nntp->getWrapper()->fetchBody(aMail); |
395 | } | 395 | } |
396 | 396 | ||
397 | QPopupMenu * NNTPfolderItem::getContextMenu() | 397 | QPopupMenu * NNTPfolderItem::getContextMenu() |
398 | { | 398 | { |
399 | QPopupMenu *m = new QPopupMenu(0); | 399 | QPopupMenu *m = new QPopupMenu(0); |
400 | if (m) | 400 | if (m) |
401 | { | 401 | { |
402 | m->insertItem(i18n("Refresh header list"),0); | 402 | m->insertItem(i18n("Refresh header list"),0); |
403 | m->insertItem(i18n("Copy all postings"),1); | 403 | m->insertItem(i18n("Copy all postings"),1); |
404 | } | 404 | } |
405 | return m; | 405 | return m; |
406 | } | 406 | } |
407 | 407 | ||
408 | void NNTPfolderItem::downloadMails() | 408 | void NNTPfolderItem::downloadMails() |
409 | { | 409 | { |
410 | AccountView*bl = nntp->accountView(); | 410 | AccountView*bl = nntp->accountView(); |
411 | if (!bl) return; | 411 | if (!bl) return; |
412 | bl->downloadMails(folder,nntp->getWrapper()); | 412 | bl->downloadMails(folder,nntp->getWrapper()); |
413 | } | 413 | } |
414 | 414 | ||
415 | void NNTPfolderItem::contextMenuSelected(int which) | 415 | void NNTPfolderItem::contextMenuSelected(int which) |
416 | { | 416 | { |
417 | AccountView * view = (AccountView*)listView(); | 417 | AccountView * view = (AccountView*)listView(); |
418 | switch (which) | 418 | switch (which) |
419 | { | 419 | { |
420 | case 0: | 420 | case 0: |
421 | /* must be 'cause pop3 lists are cached */ | 421 | /* must be 'cause pop3 lists are cached */ |
422 | nntp->getWrapper()->logout(); | 422 | nntp->getWrapper()->logout(); |
423 | view->refreshCurrent(); | 423 | view->refreshCurrent(); |
424 | break; | 424 | break; |
425 | case 1: | 425 | case 1: |
426 | downloadMails(); | 426 | downloadMails(); |
427 | break; | 427 | break; |
428 | default: | 428 | default: |
429 | break; | 429 | break; |
430 | } | 430 | } |
431 | } | 431 | } |
432 | 432 | ||
433 | /** | 433 | /** |
434 | * IMAP Account stuff | 434 | * IMAP Account stuff |
435 | */ | 435 | */ |
436 | IMAPviewItem::IMAPviewItem( IMAPaccount *a, AccountView *parent ) | 436 | IMAPviewItem::IMAPviewItem( IMAPaccount *a, AccountView *parent ) |
437 | : AccountViewItem( parent ) | 437 | : AccountViewItem( parent ) |
438 | { | 438 | { |
439 | account = a; | 439 | account = a; |
440 | wrapper = AbstractMail::getWrapper( account ); | 440 | wrapper = AbstractMail::getWrapper( account ); |
441 | SETPIX(PIXMAP_IMAPFOLDER); | 441 | SETPIX(PIXMAP_IMAPFOLDER); |
442 | setText( 0, account->getAccountName() ); | 442 | setText( 0, account->getAccountName() ); |
443 | setOpen( true ); | 443 | setOpen( true ); |
444 | } | 444 | } |
445 | 445 | ||
446 | IMAPviewItem::~IMAPviewItem() | 446 | IMAPviewItem::~IMAPviewItem() |
447 | { | 447 | { |
448 | delete wrapper; | 448 | delete wrapper; |
449 | } | 449 | } |
450 | 450 | ||
451 | AbstractMail *IMAPviewItem::getWrapper() | 451 | AbstractMail *IMAPviewItem::getWrapper() |
452 | { | 452 | { |
453 | return wrapper; | 453 | return wrapper; |
454 | } | 454 | } |
455 | 455 | ||
456 | void IMAPviewItem::refresh(QValueList<RecMailP>&) | 456 | void IMAPviewItem::refresh(QValueList<RecMailP>&) |
457 | { | 457 | { |
458 | refreshFolders(false); | 458 | refreshFolders(false); |
459 | } | 459 | } |
460 | 460 | ||
461 | const QStringList&IMAPviewItem::subFolders() | 461 | const QStringList&IMAPviewItem::subFolders() |
462 | { | 462 | { |
463 | return currentFolders; | 463 | return currentFolders; |
464 | } | 464 | } |
465 | 465 | ||
466 | void IMAPviewItem::refreshFolders(bool force) | 466 | void IMAPviewItem::refreshFolders(bool force) |
467 | { | 467 | { |
468 | if (childCount()>0 && force==false) return; | 468 | if (childCount()>0 && force==false) return; |
469 | if (account->getOffline()) return; | 469 | if (account->getOffline()) return; |
470 | 470 | ||
471 | removeChilds(); | 471 | removeChilds(); |
472 | currentFolders.clear(); | 472 | currentFolders.clear(); |
473 | QValueList<FolderP> * folders = wrapper->listFolders(); | 473 | QValueList<FolderP> * folders = wrapper->listFolders(); |
474 | 474 | ||
475 | QValueList<FolderP>::Iterator it; | 475 | QValueList<FolderP>::Iterator it; |
476 | QListViewItem*item = 0; | 476 | QListViewItem*item = 0; |
477 | QListViewItem*titem = 0; | 477 | QListViewItem*titem = 0; |
478 | QString fname,del,search; | 478 | QString fname,del,search; |
479 | int pos; | 479 | int pos; |
480 | 480 | ||
481 | for ( it = folders->begin(); it!=folders->end(); ++it) | 481 | for ( it = folders->begin(); it!=folders->end(); ++it) |
482 | { | 482 | { |
483 | if ((*it)->getDisplayName().lower()=="inbox") | 483 | if ((*it)->getDisplayName().lower()=="inbox") |
484 | { | 484 | { |
485 | item = new IMAPfolderItem( (*it), this , item ); | 485 | item = new IMAPfolderItem( (*it), this , item ); |
486 | folders->remove(it); | 486 | folders->remove(it); |
487 | break; | 487 | break; |
488 | } | 488 | } |
489 | } | 489 | } |
490 | for ( it = folders->begin(); it!=folders->end(); ++it) | 490 | for ( it = folders->begin(); it!=folders->end(); ++it) |
491 | { | 491 | { |
492 | fname = (*it)->getDisplayName(); | 492 | fname = (*it)->getDisplayName(); |
493 | currentFolders.append((*it)->getName()); | 493 | currentFolders.append((*it)->getName()); |
494 | pos = fname.findRev((*it)->Separator()); | 494 | pos = fname.findRev((*it)->Separator()); |
495 | if (pos != -1) | 495 | if (pos != -1) |
496 | { | 496 | { |
497 | fname = fname.left(pos); | 497 | fname = fname.left(pos); |
498 | } | 498 | } |
499 | IMAPfolderItem*pitem = (IMAPfolderItem*)findSubItem(fname); | 499 | IMAPfolderItem*pitem = (IMAPfolderItem*)findSubItem(fname); |
500 | if (pitem) | 500 | if (pitem) |
501 | { | 501 | { |
502 | titem = item; | 502 | titem = item; |
503 | item = new IMAPfolderItem( (*it),pitem,pitem->firstChild(),this); | 503 | item = new IMAPfolderItem( (*it),pitem,pitem->firstChild(),this); |
504 | /* setup the short name */ | 504 | /* setup the short name */ |
505 | item->setText(0,(*it)->getDisplayName().mid(pos+1)); | 505 | item->setText(0,(*it)->getDisplayName().mid(pos+1)); |
506 | item = titem; | 506 | item = titem; |
507 | } | 507 | } |
508 | else | 508 | else |
509 | { | 509 | { |
510 | item = new IMAPfolderItem( (*it), this , item ); | 510 | item = new IMAPfolderItem( (*it), this , item ); |
511 | } | 511 | } |
512 | } | 512 | } |
513 | delete folders; | 513 | delete folders; |
514 | } | 514 | } |
515 | 515 | ||
516 | QPopupMenu * IMAPviewItem::getContextMenu() | 516 | QPopupMenu * IMAPviewItem::getContextMenu() |
517 | { | 517 | { |
518 | QPopupMenu *m = new QPopupMenu(0); | 518 | QPopupMenu *m = new QPopupMenu(0); |
519 | if (m) | 519 | if (m) |
520 | { | 520 | { |
521 | if (!account->getOffline()) | 521 | if (!account->getOffline()) |
522 | { | 522 | { |
523 | m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); | 523 | m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); |
524 | m->insertItem(i18n("Refresh folder list"),0); | 524 | m->insertItem(i18n("Refresh folder list"),0); |
525 | m->insertItem(i18n("Create new folder"),1); | 525 | m->insertItem(i18n("Create new folder"),1); |
526 | m->insertSeparator(); | 526 | m->insertSeparator(); |
527 | m->insertItem(i18n("Disconnect"),2); | 527 | m->insertItem(i18n("Disconnect"),2); |
528 | m->insertItem(i18n("Set offline"),3); | 528 | m->insertItem(i18n("Set offline"),3); |
529 | m->insertSeparator(); | 529 | m->insertSeparator(); |
530 | } | 530 | } |
531 | else | 531 | else |
532 | { | 532 | { |
533 | m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); | 533 | m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); |
534 | m->insertItem(i18n("Set online"),3); | 534 | m->insertItem(i18n("Set online"),3); |
535 | } | 535 | } |
536 | } | 536 | } |
537 | return m; | 537 | return m; |
538 | } | 538 | } |
539 | 539 | ||
540 | void IMAPviewItem::createNewFolder() | 540 | void IMAPviewItem::createNewFolder() |
541 | { | 541 | { |
542 | Newmdirdlg ndirdlg; | 542 | Newmdirdlg ndirdlg; |
543 | 543 | ||
544 | #ifndef DESKTOP_VERSION | 544 | #ifndef DESKTOP_VERSION |
545 | //ndirdlg.showMaximized(); | 545 | //ndirdlg.showMaximized(); |
546 | #endif | 546 | #endif |
547 | if ( ndirdlg.exec() ) | 547 | if ( ndirdlg.exec() ) |
548 | { | 548 | { |
549 | QString ndir = ndirdlg.Newdir(); | 549 | QString ndir = ndirdlg.Newdir(); |
550 | bool makesubs = ndirdlg.subpossible(); | 550 | bool makesubs = ndirdlg.subpossible(); |
551 | QString delemiter = "/"; | 551 | QString delemiter = "/"; |
552 | IMAPfolderItem*item = (IMAPfolderItem*)firstChild(); | 552 | IMAPfolderItem*item = (IMAPfolderItem*)firstChild(); |
553 | if (item) | 553 | if (item) |
554 | { | 554 | { |
555 | delemiter = item->Delemiter(); | 555 | delemiter = item->Delemiter(); |
556 | } | 556 | } |
557 | if (wrapper->createMbox(ndir,0,delemiter,makesubs)) | 557 | if (wrapper->createMbox(ndir,0,delemiter,makesubs)) |
558 | { | 558 | { |
559 | refreshFolders(true); | 559 | refreshFolders(true); |
560 | } | 560 | } |
561 | } | 561 | } |
562 | } | 562 | } |
563 | 563 | ||
564 | void IMAPviewItem::contextMenuSelected(int id) | 564 | void IMAPviewItem::contextMenuSelected(int id) |
565 | { | 565 | { |
566 | 566 | ||
567 | switch (id) | 567 | switch (id) |
568 | { | 568 | { |
569 | case 0: | 569 | case 0: |
570 | refreshFolders(true); | 570 | refreshFolders(true); |
571 | break; | 571 | break; |
572 | case 1: | 572 | case 1: |
573 | createNewFolder(); | 573 | createNewFolder(); |
574 | break; | 574 | break; |
575 | case 2: | 575 | case 2: |
576 | removeChilds(); | 576 | removeChilds(); |
577 | wrapper->logout(); | 577 | wrapper->logout(); |
578 | break; | 578 | break; |
579 | case 3: | 579 | case 3: |
580 | if (account->getOffline()==false) | 580 | if (account->getOffline()==false) |
581 | { | 581 | { |
582 | removeChilds(); | 582 | removeChilds(); |
583 | wrapper->logout(); | 583 | wrapper->logout(); |
584 | } | 584 | } |
585 | account->setOffline(!account->getOffline()); | 585 | account->setOffline(!account->getOffline()); |
586 | account->save(); | 586 | account->save(); |
587 | SETPIX(PIXMAP_IMAPFOLDER); | 587 | SETPIX(PIXMAP_IMAPFOLDER); |
588 | refreshFolders(false); | 588 | refreshFolders(false); |
589 | break; | 589 | break; |
590 | case GET_NEW_MAILS: // daunlood | 590 | case GET_NEW_MAILS: // daunlood |
591 | { | 591 | { |
592 | if (account->getOffline()) { | 592 | if (account->getOffline()) { |
593 | contextMenuSelected( 3 ); | 593 | contextMenuSelected( 3 ); |
594 | } | 594 | } |
595 | AccountView*bl = accountView(); | 595 | AccountView*bl = accountView(); |
596 | if (!bl) return; | 596 | if (!bl) return; |
597 | AccountViewItem* in = findSubItem( "inbox" , 0); | 597 | AccountViewItem* in = findSubItem( "inbox" , 0); |
598 | if ( ! in ) | 598 | if ( ! in ) |
599 | return; | 599 | return; |
600 | bl->downloadMailsInbox(in->getFolder(),getWrapper()); | 600 | bl->downloadMailsInbox(in->getFolder(),getWrapper()); |
601 | } | 601 | } |
602 | break; | 602 | break; |
603 | default: | 603 | default: |
604 | break; | 604 | break; |
605 | } | 605 | } |
606 | } | 606 | } |
607 | 607 | ||
608 | RECBODYP IMAPviewItem::fetchBody(const RecMailP&) | 608 | RECBODYP IMAPviewItem::fetchBody(const RecMailP&) |
609 | { | 609 | { |
610 | return new RecBody(); | 610 | return new RecBody(); |
611 | } | 611 | } |
612 | 612 | ||
613 | bool IMAPviewItem::offline() | 613 | bool IMAPviewItem::offline() |
614 | { | 614 | { |
615 | return account->getOffline(); | 615 | return account->getOffline(); |
616 | } | 616 | } |
617 | 617 | ||
618 | IMAPfolderItem::IMAPfolderItem( const FolderP& folderInit, IMAPviewItem *parent , QListViewItem*after ) | 618 | IMAPfolderItem::IMAPfolderItem( const FolderP& folderInit, IMAPviewItem *parent , QListViewItem*after ) |
619 | : AccountViewItem( folderInit, parent , after ) | 619 | : AccountViewItem( folderInit, parent , after ) |
620 | { | 620 | { |
621 | imap = parent; | 621 | imap = parent; |
622 | if (folder->getDisplayName().lower()!="inbox") | 622 | if (folder->getDisplayName().lower()!="inbox") |
623 | { | 623 | { |
624 | setPixmap( 0, PIXMAP_IMAPFOLDER ); | 624 | setPixmap( 0, PIXMAP_IMAPFOLDER ); |
625 | } | 625 | } |
626 | else | 626 | else |
627 | { | 627 | { |
628 | setPixmap( 0, PIXMAP_INBOXFOLDER); | 628 | setPixmap( 0, PIXMAP_INBOXFOLDER); |
629 | } | 629 | } |
630 | setText( 0, folder->getDisplayName() ); | 630 | setText( 0, folder->getDisplayName() ); |
631 | } | 631 | } |
632 | 632 | ||
633 | IMAPfolderItem::IMAPfolderItem(const FolderP &folderInit, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master ) | 633 | IMAPfolderItem::IMAPfolderItem(const FolderP &folderInit, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master ) |
634 | : AccountViewItem(folderInit, parent,after ) | 634 | : AccountViewItem(folderInit, parent,after ) |
635 | { | 635 | { |
636 | imap = master; | 636 | imap = master; |
637 | if (folder->getDisplayName().lower()!="inbox") | 637 | if (folder->getDisplayName().lower()!="inbox") |
638 | { | 638 | { |
639 | setPixmap( 0, PIXMAP_IMAPFOLDER ); | 639 | setPixmap( 0, PIXMAP_IMAPFOLDER ); |
640 | } | 640 | } |
641 | else | 641 | else |
642 | { | 642 | { |
643 | setPixmap( 0, PIXMAP_INBOXFOLDER); | 643 | setPixmap( 0, PIXMAP_INBOXFOLDER); |
644 | } | 644 | } |
645 | setText( 0, folder->getDisplayName() ); | 645 | setText( 0, folder->getDisplayName() ); |
646 | } | 646 | } |
647 | 647 | ||
648 | IMAPfolderItem::~IMAPfolderItem() | 648 | IMAPfolderItem::~IMAPfolderItem() |
649 | {} | 649 | {} |
650 | 650 | ||
651 | const QString& IMAPfolderItem::Delemiter()const | 651 | const QString& IMAPfolderItem::Delemiter()const |
652 | { | 652 | { |
653 | return folder->Separator(); | 653 | return folder->Separator(); |
654 | } | 654 | } |
655 | 655 | ||
656 | void IMAPfolderItem::refresh(QValueList<RecMailP>&target) | 656 | void IMAPfolderItem::refresh(QValueList<RecMailP>&target) |
657 | { | 657 | { |
658 | if (folder->may_select()) | 658 | if (folder->may_select()) |
659 | { | 659 | { |
660 | imap->getWrapper()->listMessages( folder->getName(),target ); | 660 | imap->getWrapper()->listMessages( folder->getName(),target ); |
661 | } | 661 | } |
662 | else | 662 | else |
663 | { | 663 | { |
664 | target.clear(); | 664 | target.clear(); |
665 | } | 665 | } |
666 | } | 666 | } |
667 | 667 | ||
668 | RECBODYP IMAPfolderItem::fetchBody(const RecMailP&aMail) | 668 | RECBODYP IMAPfolderItem::fetchBody(const RecMailP&aMail) |
669 | { | 669 | { |
670 | return imap->getWrapper()->fetchBody(aMail); | 670 | return imap->getWrapper()->fetchBody(aMail); |
671 | } | 671 | } |
672 | 672 | ||
673 | QPopupMenu * IMAPfolderItem::getContextMenu() | 673 | QPopupMenu * IMAPfolderItem::getContextMenu() |
674 | { | 674 | { |
675 | QPopupMenu *m = new QPopupMenu(0); | 675 | QPopupMenu *m = new QPopupMenu(0); |
676 | if (m) | 676 | if (m) |
677 | { | 677 | { |
678 | if (folder->may_select()) | 678 | if (folder->may_select()) |
679 | { | 679 | { |
680 | m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); | 680 | m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); |
681 | m->insertItem(i18n("Refresh header list"),0); | 681 | m->insertItem(i18n("Refresh header list"),0); |
682 | m->insertItem(i18n("Move/Copie all mails"),4); | 682 | m->insertItem(i18n("Move/Copie all mails"),4); |
683 | m->insertItem(i18n("Delete all mails"),1); | 683 | m->insertItem(i18n("Delete all mails"),1); |
684 | } | 684 | } |
685 | if (folder->no_inferior()==false) | 685 | if (folder->no_inferior()==false) |
686 | { | 686 | { |
687 | m->insertItem(i18n("Create new subfolder"),2); | 687 | m->insertItem(i18n("Create new subfolder"),2); |
688 | } | 688 | } |
689 | if (folder->getDisplayName().lower()!="inbox") | 689 | if (folder->getDisplayName().lower()!="inbox") |
690 | { | 690 | { |
691 | m->insertItem(i18n("Delete folder"),3); | 691 | m->insertItem(i18n("Delete folder"),3); |
692 | } | 692 | } |
693 | } | 693 | } |
694 | return m; | 694 | return m; |
695 | } | 695 | } |
696 | 696 | ||
697 | void IMAPfolderItem::createNewFolder() | 697 | void IMAPfolderItem::createNewFolder() |
698 | { | 698 | { |
699 | Newmdirdlg ndirdlg; | 699 | Newmdirdlg ndirdlg; |
700 | //ndirdlg.showMaximized(); | 700 | //ndirdlg.showMaximized(); |
701 | if ( ndirdlg.exec() ) | 701 | if ( ndirdlg.exec() ) |
702 | { | 702 | { |
703 | QString ndir = ndirdlg.Newdir(); | 703 | QString ndir = ndirdlg.Newdir(); |
704 | bool makesubs = ndirdlg.subpossible(); | 704 | bool makesubs = ndirdlg.subpossible(); |
705 | QString delemiter = Delemiter(); | 705 | QString delemiter = Delemiter(); |
706 | if (imap->wrapper->createMbox(ndir,folder,delemiter,makesubs)) | 706 | if (imap->wrapper->createMbox(ndir,folder,delemiter,makesubs)) |
707 | { | 707 | { |
708 | imap->refreshFolders(true); | 708 | imap->refreshFolders(true); |
709 | } | 709 | } |
710 | } | 710 | } |
711 | } | 711 | } |
712 | 712 | ||
713 | void IMAPfolderItem::deleteFolder() | 713 | void IMAPfolderItem::deleteFolder() |
714 | { | 714 | { |
715 | int yesno = QMessageBox::warning(0,i18n("Delete folder"), | 715 | int yesno = QMessageBox::warning(0,i18n("Delete folder"), |
716 | i18n("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>").arg(folder->getDisplayName()), | 716 | i18n("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>").arg(folder->getDisplayName()), |
717 | i18n("Yes"), | 717 | i18n("Yes"), |
718 | i18n("No"),QString::null,1,1); | 718 | i18n("No"),QString::null,1,1); |
719 | 719 | ||
720 | if (yesno == 0) | 720 | if (yesno == 0) |
721 | { | 721 | { |
722 | if (imap->getWrapper()->deleteMbox(folder)) | 722 | if (imap->getWrapper()->deleteMbox(folder)) |
723 | { | 723 | { |
724 | QListView*v=listView(); | 724 | QListView*v=listView(); |
725 | IMAPviewItem * box = imap; | 725 | IMAPviewItem * box = imap; |
726 | /* be carefull - after that this object is destroyd so don't use | 726 | /* be carefull - after that this object is destroyd so don't use |
727 | * any member of it after that call!!*/ | 727 | * any member of it after that call!!*/ |
728 | imap->refreshFolders(true); | 728 | imap->refreshFolders(true); |
729 | if (v) | 729 | if (v) |
730 | { | 730 | { |
731 | v->setSelected(box,true); | 731 | v->setSelected(box,true); |
732 | } | 732 | } |
733 | } | 733 | } |
734 | } | 734 | } |
735 | } | 735 | } |
736 | 736 | ||
737 | void IMAPfolderItem::downloadMails() | 737 | void IMAPfolderItem::downloadMails() |
738 | { | 738 | { |
739 | AccountView*bl = imap->accountView(); | 739 | AccountView*bl = imap->accountView(); |
740 | if (!bl) return; | 740 | if (!bl) return; |
741 | bl->downloadMails(folder,imap->getWrapper()); | 741 | bl->downloadMails(folder,imap->getWrapper()); |
742 | } | 742 | } |
743 | 743 | ||
744 | void IMAPfolderItem::contextMenuSelected(int id) | 744 | void IMAPfolderItem::contextMenuSelected(int id) |
745 | { | 745 | { |
746 | 746 | ||
747 | AccountView * view = (AccountView*)listView(); | 747 | AccountView * view = (AccountView*)listView(); |
748 | switch(id) | 748 | switch(id) |
749 | { | 749 | { |
750 | case 0: | 750 | case 0: |
751 | view->refreshCurrent(); | 751 | view->refreshCurrent(); |
752 | break; | 752 | break; |
753 | case 1: | 753 | case 1: |
754 | deleteAllMail(imap->getWrapper(),folder); | 754 | deleteAllMail(imap->getWrapper(),folder); |
755 | break; | 755 | break; |
756 | case 2: | 756 | case 2: |
757 | createNewFolder(); | 757 | createNewFolder(); |
758 | break; | 758 | break; |
759 | case 3: | 759 | case 3: |
760 | deleteFolder(); | 760 | deleteFolder(); |
761 | break; | 761 | break; |
762 | case 4: | 762 | case 4: |
763 | downloadMails(); | 763 | downloadMails(); |
764 | break; | 764 | break; |
765 | case GET_NEW_MAILS: // daunlood | 765 | case GET_NEW_MAILS: // daunlood |
766 | { | 766 | { |
767 | if (!view) return; | 767 | if (!view) return; |
768 | view->downloadMailsInbox(getFolder(),imap->getWrapper()); | 768 | view->downloadMailsInbox(getFolder(),imap->getWrapper()); |
769 | } | 769 | } |
770 | break; | 770 | break; |
771 | default: | 771 | default: |
772 | break; | 772 | break; |
773 | } | 773 | } |
774 | } | 774 | } |
775 | 775 | ||
776 | /** | 776 | /** |
777 | * MH Account stuff | 777 | * MH Account stuff |
778 | */ | 778 | */ |
779 | /* MH is a little bit different - the top folder can contains messages other than in IMAP and | 779 | /* MH is a little bit different - the top folder can contains messages other than in IMAP and |
780 | POP3 and MBOX */ | 780 | POP3 and MBOX */ |
781 | MHviewItem::MHviewItem( const QString&aPath, AccountView *parent ) | 781 | MHviewItem::MHviewItem( const QString&aPath, AccountView *parent ) |
782 | : AccountViewItem( parent ) | 782 | : AccountViewItem( parent ) |
783 | { | 783 | { |
784 | m_Path = aPath; | 784 | m_Path = aPath; |
785 | /* be carefull - the space within settext is wanted - thats why the string twice */ | 785 | /* be carefull - the space within settext is wanted - thats why the string twice */ |
786 | wrapper = AbstractMail::getWrapper( m_Path,"Local Folders"); | 786 | wrapper = AbstractMail::getWrapper( m_Path,"Local Mailfolders"); |
787 | setPixmap( 0, PIXMAP_LOCALFOLDER ); | 787 | setPixmap( 0, PIXMAP_LOCALFOLDER ); |
788 | setText( 0, " Local Folders" ); | 788 | setText( 0, i18n(" Local Mailfolders") ); |
789 | setOpen( true ); | 789 | setOpen( true ); |
790 | folder = 0; | 790 | folder = 0; |
791 | } | 791 | } |
792 | 792 | ||
793 | MHviewItem::~MHviewItem() | 793 | MHviewItem::~MHviewItem() |
794 | { | 794 | { |
795 | delete wrapper; | 795 | delete wrapper; |
796 | } | 796 | } |
797 | 797 | ||
798 | AbstractMail *MHviewItem::getWrapper() | 798 | AbstractMail *MHviewItem::getWrapper() |
799 | { | 799 | { |
800 | return wrapper; | 800 | return wrapper; |
801 | } | 801 | } |
802 | 802 | ||
803 | void MHviewItem::refresh( QValueList<RecMailP> & target) | 803 | void MHviewItem::refresh( QValueList<RecMailP> & target) |
804 | { | 804 | { |
805 | refresh(false); | 805 | refresh(false); |
806 | getWrapper()->listMessages( "",target ); | 806 | getWrapper()->listMessages( "",target ); |
807 | } | 807 | } |
808 | 808 | ||
809 | void MHviewItem::refresh(bool force) | 809 | void MHviewItem::refresh(bool force) |
810 | { | 810 | { |
811 | if (childCount()>0 && force==false) return; | 811 | if (childCount()>0 && force==false) return; |
812 | removeChilds(); | 812 | removeChilds(); |
813 | currentFolders.clear(); | 813 | currentFolders.clear(); |
814 | QValueList<FolderP> *folders = wrapper->listFolders(); | 814 | QValueList<FolderP> *folders = wrapper->listFolders(); |
815 | QValueList<FolderP>::ConstIterator it; | 815 | QValueList<FolderP>::ConstIterator it; |
816 | MHfolderItem*item = 0; | 816 | MHfolderItem*item = 0; |
817 | MHfolderItem*pmaster = 0; | 817 | MHfolderItem*pmaster = 0; |
818 | QString fname = ""; | 818 | QString fname = ""; |
819 | int pos; | 819 | int pos; |
820 | for ( it = folders->begin(); it!=folders->end(); ++it) | 820 | for ( it = folders->begin(); it!=folders->end(); ++it) |
821 | { | 821 | { |
822 | fname = (*it)->getDisplayName(); | 822 | fname = (*it)->getDisplayName(); |
823 | /* this folder itself */ | 823 | /* this folder itself */ |
824 | if (fname=="/") | 824 | if (fname=="/") |
825 | { | 825 | { |
826 | currentFolders.append(fname); | 826 | currentFolders.append(fname); |
827 | folder = (*it); | 827 | folder = (*it); |
828 | continue; | 828 | continue; |
829 | } | 829 | } |
830 | currentFolders.append(fname); | 830 | currentFolders.append(fname); |
831 | pos = fname.findRev("/"); | 831 | pos = fname.findRev("/"); |
832 | if (pos > 0) | 832 | if (pos > 0) |
833 | { | 833 | { |
834 | fname = fname.left(pos); | 834 | fname = fname.left(pos); |
835 | pmaster = (MHfolderItem*)findSubItem(fname); | 835 | pmaster = (MHfolderItem*)findSubItem(fname); |
836 | } | 836 | } |
837 | else | 837 | else |
838 | { | 838 | { |
839 | pmaster = 0; | 839 | pmaster = 0; |
840 | } | 840 | } |
841 | if (pmaster) | 841 | if (pmaster) |
842 | { | 842 | { |
843 | item = new MHfolderItem( (*it), pmaster, item, this ); | 843 | item = new MHfolderItem( (*it), pmaster, item, this ); |
844 | } | 844 | } |
845 | else | 845 | else |
846 | { | 846 | { |
847 | item = new MHfolderItem( (*it), this , item ); | 847 | item = new MHfolderItem( (*it), this , item ); |
848 | } | 848 | } |
849 | item->setSelectable((*it)->may_select()); | 849 | item->setSelectable((*it)->may_select()); |
850 | } | 850 | } |
851 | delete folders; | 851 | delete folders; |
852 | } | 852 | } |
853 | 853 | ||
854 | RECBODYP MHviewItem::fetchBody( const RecMailP &mail ) | 854 | RECBODYP MHviewItem::fetchBody( const RecMailP &mail ) |
855 | { | 855 | { |
856 | 856 | ||
857 | return wrapper->fetchBody( mail ); | 857 | return wrapper->fetchBody( mail ); |
858 | } | 858 | } |
859 | 859 | ||
860 | QPopupMenu * MHviewItem::getContextMenu() | 860 | QPopupMenu * MHviewItem::getContextMenu() |
861 | { | 861 | { |
862 | QPopupMenu *m = new QPopupMenu(0); | 862 | QPopupMenu *m = new QPopupMenu(0); |
863 | if (m) | 863 | if (m) |
864 | { | 864 | { |
865 | m->insertItem(i18n("Refresh folder list"),0); | 865 | m->insertItem(i18n("Refresh folder list"),0); |
866 | m->insertItem(i18n("Create new folder"),1); | 866 | m->insertItem(i18n("Create new folder"),1); |
867 | m->insertItem(i18n("Delete all mails"),2); | 867 | m->insertItem(i18n("Delete all mails"),2); |
868 | m->insertItem(i18n("Move/Copie all mails"),3); | 868 | m->insertItem(i18n("Move/Copie all mails"),3); |
869 | } | 869 | } |
870 | return m; | 870 | return m; |
871 | } | 871 | } |
872 | 872 | ||
873 | void MHviewItem::createFolder() | 873 | void MHviewItem::createFolder() |
874 | { | 874 | { |
875 | Newmdirdlg ndirdlg(0,0,true); | 875 | Newmdirdlg ndirdlg(0,0,true); |
876 | //ndirdlg.showMaximized(); | 876 | //ndirdlg.showMaximized(); |
877 | if ( ndirdlg.exec() ) | 877 | if ( ndirdlg.exec() ) |
878 | { | 878 | { |
879 | QString ndir = ndirdlg.Newdir(); | 879 | QString ndir = ndirdlg.Newdir(); |
880 | if (wrapper->createMbox(ndir)) | 880 | if (wrapper->createMbox(ndir)) |
881 | { | 881 | { |
882 | refresh(true); | 882 | refresh(true); |
883 | } | 883 | } |
884 | } | 884 | } |
885 | } | 885 | } |
886 | 886 | ||
887 | void MHviewItem::downloadMails() | 887 | void MHviewItem::downloadMails() |
888 | { | 888 | { |
889 | AccountView*bl = accountView(); | 889 | AccountView*bl = accountView(); |
890 | if (!bl) return; | 890 | if (!bl) return; |
891 | bl->downloadMails(folder,getWrapper()); | 891 | bl->downloadMails(folder,getWrapper()); |
892 | } | 892 | } |
893 | 893 | ||
894 | QStringList MHviewItem::subFolders() | 894 | QStringList MHviewItem::subFolders() |
895 | { | 895 | { |
896 | return currentFolders; | 896 | return currentFolders; |
897 | } | 897 | } |
898 | 898 | ||
899 | void MHviewItem::contextMenuSelected(int which) | 899 | void MHviewItem::contextMenuSelected(int which) |
900 | { | 900 | { |
901 | switch (which) | 901 | switch (which) |
902 | { | 902 | { |
903 | case 0: | 903 | case 0: |
904 | refresh(true); | 904 | refresh(true); |
905 | break; | 905 | break; |
906 | case 1: | 906 | case 1: |
907 | createFolder(); | 907 | createFolder(); |
908 | break; | 908 | break; |
909 | case 2: | 909 | case 2: |
910 | deleteAllMail(getWrapper(),folder); | 910 | deleteAllMail(getWrapper(),folder); |
911 | break; | 911 | break; |
912 | case 3: | 912 | case 3: |
913 | downloadMails(); | 913 | downloadMails(); |
914 | break; | 914 | break; |
915 | default: | 915 | default: |
916 | break; | 916 | break; |
917 | } | 917 | } |
918 | } | 918 | } |
919 | 919 | ||
920 | MHfolderItem::~MHfolderItem() | 920 | MHfolderItem::~MHfolderItem() |
921 | {} | 921 | {} |
922 | 922 | ||
923 | MHfolderItem::MHfolderItem( const FolderP &folderInit, MHviewItem *parent , QListViewItem*after ) | 923 | MHfolderItem::MHfolderItem( const FolderP &folderInit, MHviewItem *parent , QListViewItem*after ) |
924 | : AccountViewItem(folderInit, parent,after ) | 924 | : AccountViewItem(folderInit, parent,after ) |
925 | { | 925 | { |
926 | mbox = parent; | 926 | mbox = parent; |
927 | initName(); | 927 | initName(); |
928 | } | 928 | } |
929 | 929 | ||
930 | MHfolderItem::MHfolderItem(const FolderP& folderInit, MHfolderItem *parent, QListViewItem*after, MHviewItem*master) | 930 | MHfolderItem::MHfolderItem(const FolderP& folderInit, MHfolderItem *parent, QListViewItem*after, MHviewItem*master) |
931 | : AccountViewItem(folderInit, parent,after ) | 931 | : AccountViewItem(folderInit, parent,after ) |
932 | { | 932 | { |
933 | folder = folderInit; | 933 | folder = folderInit; |
934 | mbox = master; | 934 | mbox = master; |
935 | initName(); | 935 | initName(); |
936 | } | 936 | } |
937 | 937 | ||
938 | void MHfolderItem::initName() | 938 | void MHfolderItem::initName() |
939 | { | 939 | { |
940 | QString bName = folder->getDisplayName(); | 940 | QString bName = folder->getDisplayName(); |
941 | if (bName.startsWith("/")&&bName.length()>1) | 941 | if (bName.startsWith("/")&&bName.length()>1) |
942 | { | 942 | { |
943 | bName.replace(0,1,""); | 943 | bName.replace(0,1,""); |
944 | } | 944 | } |
945 | int pos = bName.findRev("/"); | 945 | int pos = bName.findRev("/"); |
946 | if (pos > 0) | 946 | if (pos > 0) |
947 | { | 947 | { |
948 | bName.replace(0,pos+1,""); | 948 | bName.replace(0,pos+1,""); |
949 | } | 949 | } |
950 | if (bName.lower() == "outgoing") | 950 | if (bName.lower() == "outgoing") |
951 | { | 951 | { |
952 | setPixmap( 0, PIXMAP_OUTBOXFOLDER ); | 952 | setPixmap( 0, PIXMAP_OUTBOXFOLDER ); |
953 | } | 953 | } |
954 | else if (bName.lower() == "inbox") | 954 | else if (bName.lower() == "inbox") |
955 | { | 955 | { |
956 | setPixmap( 0, PIXMAP_INBOXFOLDER); | 956 | setPixmap( 0, PIXMAP_INBOXFOLDER); |
957 | } else if (bName.lower() == "drafts") { | 957 | } else if (bName.lower() == "drafts") { |
958 | setPixmap(0, SmallIcon ("edit")); | 958 | setPixmap(0, SmallIcon ("edit")); |
959 | } else { | 959 | } else { |
960 | setPixmap( 0, PIXMAP_MBOXFOLDER ); | 960 | setPixmap( 0, PIXMAP_MBOXFOLDER ); |
961 | } | 961 | } |
962 | setText( 0, bName ); | 962 | setText( 0, bName ); |
963 | } | 963 | } |
964 | 964 | ||
965 | const FolderP&MHfolderItem::getFolder()const | 965 | const FolderP&MHfolderItem::getFolder()const |
966 | { | 966 | { |
967 | return folder; | 967 | return folder; |
968 | } | 968 | } |
969 | 969 | ||
970 | void MHfolderItem::refresh(QValueList<RecMailP>&target) | 970 | void MHfolderItem::refresh(QValueList<RecMailP>&target) |
971 | { | 971 | { |
972 | if (folder->may_select()) | 972 | if (folder->may_select()) |
973 | mbox->getWrapper()->listMessages( folder->getName(),target ); | 973 | mbox->getWrapper()->listMessages( folder->getName(),target ); |
974 | } | 974 | } |
975 | 975 | ||
976 | RECBODYP MHfolderItem::fetchBody(const RecMailP&aMail) | 976 | RECBODYP MHfolderItem::fetchBody(const RecMailP&aMail) |
977 | { | 977 | { |
978 | return mbox->getWrapper()->fetchBody(aMail); | 978 | return mbox->getWrapper()->fetchBody(aMail); |
979 | } | 979 | } |
980 | 980 | ||
981 | void MHfolderItem::deleteFolder() | 981 | void MHfolderItem::deleteFolder() |
982 | { | 982 | { |
983 | int yesno = QMessageBox::warning(0,i18n("Delete folder"), | 983 | int yesno = QMessageBox::warning(0,i18n("Delete folder"), |
984 | i18n("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>").arg(folder->getDisplayName()), | 984 | i18n("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>").arg(folder->getDisplayName()), |
985 | i18n("Yes"), | 985 | i18n("Yes"), |
986 | i18n("No"),QString::null,1,1); | 986 | i18n("No"),QString::null,1,1); |
987 | 987 | ||
988 | if (yesno == 0) | 988 | if (yesno == 0) |
989 | { | 989 | { |
990 | if (mbox->getWrapper()->deleteMbox(folder)) | 990 | if (mbox->getWrapper()->deleteMbox(folder)) |
991 | { | 991 | { |
992 | QListView*v=listView(); | 992 | QListView*v=listView(); |
993 | MHviewItem * box = mbox; | 993 | MHviewItem * box = mbox; |
994 | /* be carefull - after that this object is destroyd so don't use | 994 | /* be carefull - after that this object is destroyd so don't use |
995 | * any member of it after that call!!*/ | 995 | * any member of it after that call!!*/ |
996 | mbox->refresh(true); | 996 | mbox->refresh(true); |
997 | if (v) | 997 | if (v) |
998 | { | 998 | { |
999 | v->setSelected(box,true); | 999 | v->setSelected(box,true); |
1000 | } | 1000 | } |
1001 | } | 1001 | } |
1002 | } | 1002 | } |
1003 | } | 1003 | } |
1004 | 1004 | ||
1005 | QPopupMenu * MHfolderItem::getContextMenu() | 1005 | QPopupMenu * MHfolderItem::getContextMenu() |
1006 | { | 1006 | { |
1007 | QPopupMenu *m = new QPopupMenu(0); | 1007 | QPopupMenu *m = new QPopupMenu(0); |
1008 | if (m) | 1008 | if (m) |
1009 | { | 1009 | { |
1010 | m->insertItem(i18n("Move/Copie all mails"),2); | 1010 | m->insertItem(i18n("Move/Copie all mails"),2); |
1011 | m->insertItem(i18n("Delete all mails"),0); | 1011 | m->insertItem(i18n("Delete all mails"),0); |
1012 | m->insertItem(i18n("Create new subfolder"),3); | 1012 | m->insertItem(i18n("Create new subfolder"),3); |
1013 | m->insertItem(i18n("Delete folder"),1); | 1013 | m->insertItem(i18n("Delete folder"),1); |
1014 | } | 1014 | } |
1015 | return m; | 1015 | return m; |
1016 | } | 1016 | } |
1017 | 1017 | ||
1018 | void MHfolderItem::downloadMails() | 1018 | void MHfolderItem::downloadMails() |
1019 | { | 1019 | { |
1020 | AccountView*bl = mbox->accountView(); | 1020 | AccountView*bl = mbox->accountView(); |
1021 | if (!bl) return; | 1021 | if (!bl) return; |
1022 | bl->downloadMails(folder,mbox->getWrapper()); | 1022 | bl->downloadMails(folder,mbox->getWrapper()); |
1023 | } | 1023 | } |
1024 | 1024 | ||
1025 | void MHfolderItem::createFolder() | 1025 | void MHfolderItem::createFolder() |
1026 | { | 1026 | { |
1027 | Newmdirdlg ndirdlg(0,0,true); | 1027 | Newmdirdlg ndirdlg(0,0,true); |
1028 | //ndirdlg.showMaximized(); | 1028 | //ndirdlg.showMaximized(); |
1029 | if (ndirdlg.exec() ) | 1029 | if (ndirdlg.exec() ) |
1030 | { | 1030 | { |
1031 | QString ndir = ndirdlg.Newdir(); | 1031 | QString ndir = ndirdlg.Newdir(); |
1032 | if (mbox->getWrapper()->createMbox(ndir,folder)) | 1032 | if (mbox->getWrapper()->createMbox(ndir,folder)) |
1033 | { | 1033 | { |
1034 | QListView*v=listView(); | 1034 | QListView*v=listView(); |
1035 | MHviewItem * box = mbox; | 1035 | MHviewItem * box = mbox; |
1036 | /* be carefull - after that this object is destroyd so don't use | 1036 | /* be carefull - after that this object is destroyd so don't use |
1037 | * any member of it after that call!!*/ | 1037 | * any member of it after that call!!*/ |
1038 | mbox->refresh(true); | 1038 | mbox->refresh(true); |
1039 | if (v) | 1039 | if (v) |
1040 | { | 1040 | { |
1041 | v->setSelected(box,true); | 1041 | v->setSelected(box,true); |
1042 | } | 1042 | } |
1043 | } | 1043 | } |
1044 | } | 1044 | } |
1045 | } | 1045 | } |
1046 | 1046 | ||
1047 | void MHfolderItem::contextMenuSelected(int which) | 1047 | void MHfolderItem::contextMenuSelected(int which) |
1048 | { | 1048 | { |
1049 | switch(which) | 1049 | switch(which) |
1050 | { | 1050 | { |
1051 | case 0: | 1051 | case 0: |
1052 | deleteAllMail(mbox->getWrapper(),folder); | 1052 | deleteAllMail(mbox->getWrapper(),folder); |
1053 | break; | 1053 | break; |
1054 | case 1: | 1054 | case 1: |
1055 | deleteFolder(); | 1055 | deleteFolder(); |
1056 | break; | 1056 | break; |
1057 | case 2: | 1057 | case 2: |
1058 | downloadMails(); | 1058 | downloadMails(); |
1059 | break; | 1059 | break; |
1060 | case 3: | 1060 | case 3: |
1061 | createFolder(); | 1061 | createFolder(); |
1062 | break; | 1062 | break; |
1063 | default: | 1063 | default: |
1064 | break; | 1064 | break; |
1065 | } | 1065 | } |
1066 | } | 1066 | } |
1067 | 1067 | ||
1068 | bool MHfolderItem::isDraftfolder() | 1068 | bool MHfolderItem::isDraftfolder() |
1069 | { | 1069 | { |
1070 | if (folder && folder->getName()==AbstractMail::defaultLocalfolder()+"/"+AbstractMail::draftFolder()) return true; | 1070 | if (folder && folder->getName()==AbstractMail::defaultLocalfolder()+"/"+AbstractMail::draftFolder()) return true; |
1071 | return false; | 1071 | return false; |
1072 | } | 1072 | } |
1073 | 1073 | ||
1074 | /** | 1074 | /** |
1075 | * Generic stuff | 1075 | * Generic stuff |
1076 | */ | 1076 | */ |
1077 | 1077 | ||
1078 | const QString AccountViewItem::contextName="AccountViewItem"; | 1078 | const QString AccountViewItem::contextName="AccountViewItem"; |
1079 | 1079 | ||
1080 | AccountViewItem::AccountViewItem( AccountView *parent ) | 1080 | AccountViewItem::AccountViewItem( AccountView *parent ) |
1081 | : QListViewItem( parent ) | 1081 | : QListViewItem( parent ) |
1082 | { | 1082 | { |
1083 | init(); | 1083 | init(); |
1084 | m_Backlink = parent; | 1084 | m_Backlink = parent; |
1085 | } | 1085 | } |
1086 | 1086 | ||
1087 | AccountViewItem::AccountViewItem( QListViewItem *parent) | 1087 | AccountViewItem::AccountViewItem( QListViewItem *parent) |
1088 | : QListViewItem( parent),folder(0) | 1088 | : QListViewItem( parent),folder(0) |
1089 | { | 1089 | { |
1090 | init(); | 1090 | init(); |
1091 | } | 1091 | } |
1092 | 1092 | ||
1093 | AccountViewItem::AccountViewItem( QListViewItem *parent , QListViewItem*after ) | 1093 | AccountViewItem::AccountViewItem( QListViewItem *parent , QListViewItem*after ) |
1094 | :QListViewItem( parent,after ),folder(0) | 1094 | :QListViewItem( parent,after ),folder(0) |
1095 | { | 1095 | { |
1096 | init(); | 1096 | init(); |
1097 | } | 1097 | } |
1098 | 1098 | ||
1099 | AccountViewItem::AccountViewItem( const Opie::Core::OSmartPointer<Folder>&folderInit,QListViewItem *parent , QListViewItem*after ) | 1099 | AccountViewItem::AccountViewItem( const Opie::Core::OSmartPointer<Folder>&folderInit,QListViewItem *parent , QListViewItem*after ) |
1100 | :QListViewItem( parent,after ),folder(folderInit) | 1100 | :QListViewItem( parent,after ),folder(folderInit) |
1101 | { | 1101 | { |
1102 | init(); | 1102 | init(); |
1103 | } | 1103 | } |
1104 | 1104 | ||
1105 | void AccountViewItem::init() | 1105 | void AccountViewItem::init() |
1106 | { | 1106 | { |
1107 | m_Backlink = 0; | 1107 | m_Backlink = 0; |
1108 | } | 1108 | } |
1109 | 1109 | ||
1110 | AccountViewItem::~AccountViewItem() | 1110 | AccountViewItem::~AccountViewItem() |
1111 | { | 1111 | { |
1112 | folder = 0; | 1112 | folder = 0; |
1113 | } | 1113 | } |
1114 | 1114 | ||
1115 | AccountView*AccountViewItem::accountView() | 1115 | AccountView*AccountViewItem::accountView() |
1116 | { | 1116 | { |
1117 | return m_Backlink; | 1117 | return m_Backlink; |
1118 | } | 1118 | } |
1119 | 1119 | ||
1120 | void AccountViewItem::deleteAllMail(AbstractMail*wrapper,const FolderP&folder) | 1120 | void AccountViewItem::deleteAllMail(AbstractMail*wrapper,const FolderP&folder) |
1121 | { | 1121 | { |
1122 | if (!wrapper) return; | 1122 | if (!wrapper) return; |
1123 | QString fname=""; | 1123 | QString fname=""; |
1124 | if (folder) fname = folder->getDisplayName(); | 1124 | if (folder) fname = folder->getDisplayName(); |
1125 | int yesno = QMessageBox::warning(0,i18n("Delete all mails"), | 1125 | int yesno = QMessageBox::warning(0,i18n("Delete all mails"), |
1126 | i18n("<center>Realy delete all mails in box <br>%1</center>"). | 1126 | i18n("<center>Realy delete all mails in box <br>%1</center>"). |
1127 | arg(fname), | 1127 | arg(fname), |
1128 | i18n("Yes"), | 1128 | i18n("Yes"), |
1129 | i18n("No"),QString::null,1,1); | 1129 | i18n("No"),QString::null,1,1); |
1130 | 1130 | ||
1131 | if (yesno == 0) | 1131 | if (yesno == 0) |
1132 | { | 1132 | { |
1133 | if (wrapper->deleteAllMail(folder)) | 1133 | if (wrapper->deleteAllMail(folder)) |
1134 | { | 1134 | { |
1135 | AccountView * view = (AccountView*)listView(); | 1135 | AccountView * view = (AccountView*)listView(); |
1136 | if (view) view->refreshCurrent(); | 1136 | if (view) view->refreshCurrent(); |
1137 | } | 1137 | } |
1138 | } | 1138 | } |
1139 | } | 1139 | } |
1140 | 1140 | ||
1141 | void AccountViewItem::removeChilds() | 1141 | void AccountViewItem::removeChilds() |
1142 | { | 1142 | { |
1143 | QListViewItem *child = firstChild(); | 1143 | QListViewItem *child = firstChild(); |
1144 | while ( child ) | 1144 | while ( child ) |
1145 | { | 1145 | { |
1146 | QListViewItem *tmp = child; | 1146 | QListViewItem *tmp = child; |
1147 | child = child->nextSibling(); | 1147 | child = child->nextSibling(); |
1148 | delete tmp; | 1148 | delete tmp; |
1149 | } | 1149 | } |
1150 | } | 1150 | } |
1151 | 1151 | ||
1152 | bool AccountViewItem::matchName(const QString&name)const | 1152 | bool AccountViewItem::matchName(const QString&name)const |
1153 | { | 1153 | { |
1154 | if (!folder) return false; | 1154 | if (!folder) return false; |
1155 | return folder->getDisplayName().lower()==name.lower(); | 1155 | return folder->getDisplayName().lower()==name.lower(); |
1156 | } | 1156 | } |
1157 | 1157 | ||
1158 | 1158 | ||
1159 | AccountViewItem*AccountViewItem::findSubItem(const QString&path,AccountViewItem*start) | 1159 | AccountViewItem*AccountViewItem::findSubItem(const QString&path,AccountViewItem*start) |
1160 | { | 1160 | { |
1161 | AccountViewItem*pitem,*sitem; | 1161 | AccountViewItem*pitem,*sitem; |
1162 | if (!start) pitem = (AccountViewItem*)firstChild(); | 1162 | if (!start) pitem = (AccountViewItem*)firstChild(); |
1163 | else pitem = (AccountViewItem*)start->firstChild(); | 1163 | else pitem = (AccountViewItem*)start->firstChild(); |
1164 | while (pitem) | 1164 | while (pitem) |
1165 | { | 1165 | { |
1166 | if (pitem->matchName(path)) | 1166 | if (pitem->matchName(path)) |
1167 | { | 1167 | { |
1168 | break; | 1168 | break; |
1169 | } | 1169 | } |
1170 | if (pitem->childCount()>0) | 1170 | if (pitem->childCount()>0) |
1171 | { | 1171 | { |
1172 | sitem = findSubItem(path,pitem); | 1172 | sitem = findSubItem(path,pitem); |
1173 | if (sitem) | 1173 | if (sitem) |
1174 | { | 1174 | { |
1175 | pitem = sitem; | 1175 | pitem = sitem; |
1176 | break; | 1176 | break; |
1177 | } | 1177 | } |
1178 | } | 1178 | } |
1179 | pitem=(AccountViewItem*)pitem->nextSibling(); | 1179 | pitem=(AccountViewItem*)pitem->nextSibling(); |
1180 | } | 1180 | } |
1181 | return pitem; | 1181 | return pitem; |
1182 | } | 1182 | } |
1183 | 1183 | ||
1184 | bool AccountViewItem::isDraftfolder() | 1184 | bool AccountViewItem::isDraftfolder() |
1185 | { | 1185 | { |
1186 | return false; | 1186 | return false; |
1187 | } | 1187 | } |
diff --git a/kmicromail/accountview.cpp b/kmicromail/accountview.cpp index cef55ab..4879d57 100644 --- a/kmicromail/accountview.cpp +++ b/kmicromail/accountview.cpp | |||
@@ -1,252 +1,263 @@ | |||
1 | 1 | ||
2 | #include "accountview.h" | 2 | #include "accountview.h" |
3 | #include "accountitem.h" | 3 | #include "accountitem.h" |
4 | #include "selectstore.h" | 4 | #include "selectstore.h" |
5 | 5 | ||
6 | #include <libmailwrapper/settings.h> | 6 | #include <libmailwrapper/settings.h> |
7 | #include <libmailwrapper/mailwrapper.h> | 7 | #include <libmailwrapper/mailwrapper.h> |
8 | #include <libmailwrapper/mailtypes.h> | 8 | #include <libmailwrapper/mailtypes.h> |
9 | #include <libmailwrapper/abstractmail.h> | 9 | #include <libmailwrapper/abstractmail.h> |
10 | 10 | ||
11 | /* OPIE */ | 11 | /* OPIE */ |
12 | #include <qpe/qpeapplication.h> | 12 | #include <qpe/qpeapplication.h> |
13 | 13 | ||
14 | /* QT */ | 14 | /* QT */ |
15 | #include <qmessagebox.h> | 15 | #include <qmessagebox.h> |
16 | #include <qpopupmenu.h> | 16 | #include <qpopupmenu.h> |
17 | #include <qcheckbox.h> | 17 | #include <qcheckbox.h> |
18 | #include <qtimer.h> | 18 | #include <qtimer.h> |
19 | #include <qspinbox.h> | 19 | #include <qspinbox.h> |
20 | #include <klocale.h> | 20 | #include <klocale.h> |
21 | #include <kmessagebox.h> | 21 | #include <kmessagebox.h> |
22 | 22 | ||
23 | using namespace Opie::Core; | 23 | using namespace Opie::Core; |
24 | AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) | 24 | AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) |
25 | : QListView( parent, name, flags ) | 25 | : QListView( parent, name, flags ) |
26 | { | 26 | { |
27 | //connect( this, SIGNAL( selectionChanged(QListViewItem*) ), | 27 | //connect( this, SIGNAL( selectionChanged(QListViewItem*) ), |
28 | // SLOT( refresh(QListViewItem*) ) ); | 28 | // SLOT( refresh(QListViewItem*) ) ); |
29 | connect( this, SIGNAL( clicked(QListViewItem*) ), | 29 | connect( this, SIGNAL( clicked(QListViewItem*) ), |
30 | SLOT( refresh(QListViewItem*) ) ); | 30 | SLOT( refresh(QListViewItem*) ) ); |
31 | connect( this, SIGNAL( returnPressed(QListViewItem*) ), | 31 | connect( this, SIGNAL( returnPressed(QListViewItem*) ), |
32 | SLOT( refresh(QListViewItem*) ) ); | 32 | SLOT( refresh(QListViewItem*) ) ); |
33 | connect( this, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, | 33 | connect( this, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, |
34 | SLOT( slotHold(int,QListViewItem*,const QPoint&,int) ) ); | 34 | SLOT( slotHold(int,QListViewItem*,const QPoint&,int) ) ); |
35 | setSorting(0); | 35 | setSorting(0); |
36 | } | 36 | } |
37 | 37 | ||
38 | AccountView::~AccountView() | 38 | AccountView::~AccountView() |
39 | { | 39 | { |
40 | imapAccounts.clear(); | 40 | imapAccounts.clear(); |
41 | mhAccounts.clear(); | 41 | mhAccounts.clear(); |
42 | } | 42 | } |
43 | 43 | ||
44 | void AccountView::slotContextMenu(int id) | 44 | void AccountView::slotContextMenu(int id) |
45 | { | 45 | { |
46 | AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); | 46 | AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); |
47 | if (!view) return; | 47 | if (!view) return; |
48 | view->contextMenuSelected(id); | 48 | view->contextMenuSelected(id); |
49 | } | 49 | } |
50 | 50 | ||
51 | void AccountView::slotHold(int button, QListViewItem * item,const QPoint&,int) | 51 | void AccountView::slotHold(int button, QListViewItem * item,const QPoint&,int) |
52 | { | 52 | { |
53 | if (button==1) {return;} | 53 | if (button==1) {return;} |
54 | if (!item) return; | 54 | if (!item) return; |
55 | AccountViewItem *view = static_cast<AccountViewItem *>(item); | 55 | AccountViewItem *view = static_cast<AccountViewItem *>(item); |
56 | QPopupMenu*m = view->getContextMenu(); | 56 | QPopupMenu*m = view->getContextMenu(); |
57 | if (!m) return; | 57 | if (!m) return; |
58 | connect(m,SIGNAL(activated(int)),this,SLOT(slotContextMenu(int))); | 58 | connect(m,SIGNAL(activated(int)),this,SLOT(slotContextMenu(int))); |
59 | m->setFocus(); | 59 | m->setFocus(); |
60 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); | 60 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); |
61 | delete m; | 61 | delete m; |
62 | } | 62 | } |
63 | 63 | ||
64 | void AccountView::populate( QList<Account> list ) | 64 | void AccountView::populate( QList<Account> list ) |
65 | { | 65 | { |
66 | clear(); | 66 | clear(); |
67 | 67 | ||
68 | imapAccounts.clear(); | 68 | imapAccounts.clear(); |
69 | mhAccounts.clear(); | 69 | mhAccounts.clear(); |
70 | 70 | ||
71 | mhAccounts.append(new MHviewItem(AbstractMail::defaultLocalfolder(),this)); | 71 | mhAccounts.append(new MHviewItem(AbstractMail::defaultLocalfolder(),this)); |
72 | 72 | ||
73 | Account *it; | 73 | Account *it; |
74 | for ( it = list.first(); it; it = list.next() ) | 74 | for ( it = list.first(); it; it = list.next() ) |
75 | { | 75 | { |
76 | if ( it->getType() == MAILLIB::A_IMAP ) | 76 | if ( it->getType() == MAILLIB::A_IMAP ) |
77 | { | 77 | { |
78 | IMAPaccount *imap = static_cast<IMAPaccount *>(it); | 78 | IMAPaccount *imap = static_cast<IMAPaccount *>(it); |
79 | imapAccounts.append(new IMAPviewItem( imap, this )); | 79 | imapAccounts.append(new IMAPviewItem( imap, this )); |
80 | } | 80 | } |
81 | else if ( it->getType() == MAILLIB::A_POP3 ) | 81 | else if ( it->getType() == MAILLIB::A_POP3 ) |
82 | { | 82 | { |
83 | POP3account *pop3 = static_cast<POP3account *>(it); | 83 | POP3account *pop3 = static_cast<POP3account *>(it); |
84 | /* must not be hold 'cause it isn't required */ | 84 | /* must not be hold 'cause it isn't required */ |
85 | (void) new POP3viewItem( pop3, this ); | 85 | (void) new POP3viewItem( pop3, this ); |
86 | } | 86 | } |
87 | else if ( it->getType() == MAILLIB::A_NNTP ) | 87 | else if ( it->getType() == MAILLIB::A_NNTP ) |
88 | { | 88 | { |
89 | NNTPaccount *nntp = static_cast<NNTPaccount *>(it); | 89 | NNTPaccount *nntp = static_cast<NNTPaccount *>(it); |
90 | /* must not be hold 'cause it isn't required */ | 90 | /* must not be hold 'cause it isn't required */ |
91 | (void) new NNTPviewItem( nntp, this ); | 91 | (void) new NNTPviewItem( nntp, this ); |
92 | } | 92 | } |
93 | } | 93 | } |
94 | } | 94 | } |
95 | 95 | ||
96 | void AccountView::refresh(QListViewItem *item) | 96 | void AccountView::refresh(QListViewItem *item) |
97 | { | 97 | { |
98 | if ( item ) | 98 | if ( item ) |
99 | { | 99 | { |
100 | int result = KMessageBox::warningContinueCancel(this, | 100 | bool ask = true; |
101 | qDebug("text -%s- ",item->text( 0 ).latin1() ); | ||
102 | if ( item->text( 0 ) == i18n (" Local Mailfolders") ) | ||
103 | ask = false; | ||
104 | else { | ||
105 | if ( item->parent() ) | ||
106 | if ( item->parent()->text( 0 ) == i18n (" Local Mailfolders") ) | ||
107 | ask = false; | ||
108 | } | ||
109 | if ( ask ) { | ||
110 | int result = KMessageBox::warningContinueCancel(this, | ||
101 | i18n("Refresh\n%1\n?").arg( item->text(0) ), | 111 | i18n("Refresh\n%1\n?").arg( item->text(0) ), |
102 | i18n("Refresh"),i18n("Refresh"),i18n("Cancel"), | 112 | i18n("Refresh"),i18n("Refresh"),i18n("Cancel"), |
103 | true); | 113 | true); |
104 | if (result != KMessageBox::Continue) return; | 114 | if (result != KMessageBox::Continue) return; |
115 | } | ||
105 | m_currentItem = item; | 116 | m_currentItem = item; |
106 | topLevelWidget()->setCaption( i18n ( "Refreshing %1 ... please wait" ). arg ( m_currentItem->text( 0 ) ) ) ; | 117 | topLevelWidget()->setCaption( i18n ( "Refreshing %1 ... please wait" ). arg ( m_currentItem->text( 0 ) ) ) ; |
107 | QTimer::singleShot( 500, this, SLOT ( refreshCurrentSelected() ) ); | 118 | QTimer::singleShot( 500, this, SLOT ( refreshCurrentSelected() ) ); |
108 | 119 | ||
109 | } | 120 | } |
110 | } | 121 | } |
111 | void AccountView::refreshOutgoing() | 122 | void AccountView::refreshOutgoing() |
112 | { | 123 | { |
113 | m_currentItem = currentItem(); | 124 | m_currentItem = currentItem(); |
114 | if ( !m_currentItem ) return; | 125 | if ( !m_currentItem ) return; |
115 | AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); | 126 | AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); |
116 | if ( !view->getFolder() ) | 127 | if ( !view->getFolder() ) |
117 | return; | 128 | return; |
118 | QString bName = view->getFolder()->getDisplayName(); | 129 | QString bName = view->getFolder()->getDisplayName(); |
119 | if (bName.startsWith("/")&&bName.length()>1) | 130 | if (bName.startsWith("/")&&bName.length()>1) |
120 | { | 131 | { |
121 | bName.replace(0,1,""); | 132 | bName.replace(0,1,""); |
122 | } | 133 | } |
123 | int pos = bName.findRev("/"); | 134 | int pos = bName.findRev("/"); |
124 | if (pos > 0) | 135 | if (pos > 0) |
125 | { | 136 | { |
126 | bName.replace(0,pos+1,""); | 137 | bName.replace(0,pos+1,""); |
127 | } | 138 | } |
128 | //qDebug("name *%s* ",bName.lower().latin1() ); | 139 | //qDebug("name *%s* ",bName.lower().latin1() ); |
129 | if ( bName.lower() == "outgoing" || bName.lower() == "sent" || bName.lower() == "sendfailed" ) { | 140 | if ( bName.lower() == "outgoing" || bName.lower() == "sent" || bName.lower() == "sendfailed" ) { |
130 | refreshCurrent(); | 141 | refreshCurrent(); |
131 | // qDebug("refresh "); | 142 | // qDebug("refresh "); |
132 | } | 143 | } |
133 | } | 144 | } |
134 | void AccountView::refreshCurrentSelected() | 145 | void AccountView::refreshCurrentSelected() |
135 | { | 146 | { |
136 | if ( !m_currentItem ) return; | 147 | if ( !m_currentItem ) return; |
137 | QValueList<RecMailP> headerlist; | 148 | QValueList<RecMailP> headerlist; |
138 | AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); | 149 | AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); |
139 | view->refresh(headerlist); | 150 | view->refresh(headerlist); |
140 | emit refreshMailview(headerlist); | 151 | emit refreshMailview(headerlist); |
141 | topLevelWidget()->setCaption( i18n ( "KOpieMail/Pi" ) ) ; | 152 | topLevelWidget()->setCaption( i18n ( "KOpieMail/Pi" ) ) ; |
142 | } | 153 | } |
143 | 154 | ||
144 | void AccountView::refreshCurrent() | 155 | void AccountView::refreshCurrent() |
145 | { | 156 | { |
146 | m_currentItem = currentItem(); | 157 | m_currentItem = currentItem(); |
147 | if ( !m_currentItem ) return; | 158 | if ( !m_currentItem ) return; |
148 | topLevelWidget()->setCaption( i18n ( "Refreshing %1 ... please wait" ). arg ( m_currentItem->text( 0 ) ) ) ; | 159 | topLevelWidget()->setCaption( i18n ( "Refreshing %1 ... please wait" ). arg ( m_currentItem->text( 0 ) ) ) ; |
149 | QTimer::singleShot( 500, this, SLOT ( refreshCurrentSelected() ) ); | 160 | QTimer::singleShot( 500, this, SLOT ( refreshCurrentSelected() ) ); |
150 | } | 161 | } |
151 | 162 | ||
152 | void AccountView::refreshAll() | 163 | void AccountView::refreshAll() |
153 | { | 164 | { |
154 | } | 165 | } |
155 | 166 | ||
156 | RecBodyP AccountView::fetchBody(const RecMailP&aMail) | 167 | RecBodyP AccountView::fetchBody(const RecMailP&aMail) |
157 | { | 168 | { |
158 | QListViewItem*item = selectedItem (); | 169 | QListViewItem*item = selectedItem (); |
159 | if (!item) return new RecBody(); | 170 | if (!item) return new RecBody(); |
160 | AccountViewItem *view = static_cast<AccountViewItem *>(item); | 171 | AccountViewItem *view = static_cast<AccountViewItem *>(item); |
161 | return view->fetchBody(aMail); | 172 | return view->fetchBody(aMail); |
162 | } | 173 | } |
163 | 174 | ||
164 | void AccountView::setupFolderselect(Selectstore*sels) | 175 | void AccountView::setupFolderselect(Selectstore*sels) |
165 | { | 176 | { |
166 | 177 | ||
167 | #ifndef DESKTOP_VERSION | 178 | #ifndef DESKTOP_VERSION |
168 | sels->showMaximized(); | 179 | sels->showMaximized(); |
169 | #else | 180 | #else |
170 | sels->show(); | 181 | sels->show(); |
171 | #endif | 182 | #endif |
172 | QStringList sFolders; | 183 | QStringList sFolders; |
173 | unsigned int i = 0; | 184 | unsigned int i = 0; |
174 | for (i=0; i < mhAccounts.count();++i) | 185 | for (i=0; i < mhAccounts.count();++i) |
175 | { | 186 | { |
176 | mhAccounts[i]->refresh(false); | 187 | mhAccounts[i]->refresh(false); |
177 | sFolders = mhAccounts[i]->subFolders(); | 188 | sFolders = mhAccounts[i]->subFolders(); |
178 | sels->addAccounts(mhAccounts[i]->getWrapper(),sFolders); | 189 | sels->addAccounts(mhAccounts[i]->getWrapper(),sFolders); |
179 | } | 190 | } |
180 | for (i=0; i < imapAccounts.count();++i) | 191 | for (i=0; i < imapAccounts.count();++i) |
181 | { | 192 | { |
182 | if (imapAccounts[i]->offline()) | 193 | if (imapAccounts[i]->offline()) |
183 | continue; | 194 | continue; |
184 | imapAccounts[i]->refreshFolders(false); | 195 | imapAccounts[i]->refreshFolders(false); |
185 | sels->addAccounts(imapAccounts[i]->getWrapper(),imapAccounts[i]->subFolders()); | 196 | sels->addAccounts(imapAccounts[i]->getWrapper(),imapAccounts[i]->subFolders()); |
186 | } | 197 | } |
187 | } | 198 | } |
188 | void AccountView::downloadMailsInbox(const FolderP&fromFolder,AbstractMail*fromWrapper) | 199 | void AccountView::downloadMailsInbox(const FolderP&fromFolder,AbstractMail*fromWrapper) |
189 | { | 200 | { |
190 | #if 0 | 201 | #if 0 |
191 | AbstractMail*targetMail = 0; | 202 | AbstractMail*targetMail = 0; |
192 | QString targetFolder = ""; | 203 | QString targetFolder = ""; |
193 | Selectstore sels; | 204 | Selectstore sels; |
194 | setupFolderselect(&sels); | 205 | setupFolderselect(&sels); |
195 | if (!sels.exec()) return; | 206 | if (!sels.exec()) return; |
196 | targetMail = sels.currentMail(); | 207 | targetMail = sels.currentMail(); |
197 | targetFolder = sels.currentFolder(); | 208 | targetFolder = sels.currentFolder(); |
198 | if ( (fromWrapper==targetMail && fromFolder->getName()==targetFolder) || | 209 | if ( (fromWrapper==targetMail && fromFolder->getName()==targetFolder) || |
199 | targetFolder.isEmpty()) | 210 | targetFolder.isEmpty()) |
200 | { | 211 | { |
201 | return; | 212 | return; |
202 | } | 213 | } |
203 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) | 214 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) |
204 | { | 215 | { |
205 | QMessageBox::critical(0,i18n("Error creating new Folder"), | 216 | QMessageBox::critical(0,i18n("Error creating new Folder"), |
206 | i18n("<center>Error while creating<br>new folder - breaking.</center>")); | 217 | i18n("<center>Error while creating<br>new folder - breaking.</center>")); |
207 | return; | 218 | return; |
208 | } | 219 | } |
209 | int maxsize = 0; | 220 | int maxsize = 0; |
210 | if ( sels.useSize->isChecked()) | 221 | if ( sels.useSize->isChecked()) |
211 | maxsize = sels.sizeSpinBox->value(); | 222 | maxsize = sels.sizeSpinBox->value(); |
212 | fromWrapper->mvcpAllMails(fromFolder,targetFolder,targetMail,sels.moveMails(), maxsize); | 223 | fromWrapper->mvcpAllMails(fromFolder,targetFolder,targetMail,sels.moveMails(), maxsize); |
213 | #endif | 224 | #endif |
214 | fromWrapper->downloadNewMails( fromFolder, mhAccounts[0]->getWrapper()); | 225 | fromWrapper->downloadNewMails( fromFolder, mhAccounts[0]->getWrapper()); |
215 | refreshCurrent(); | 226 | refreshCurrent(); |
216 | 227 | ||
217 | } | 228 | } |
218 | 229 | ||
219 | void AccountView::downloadMails(const FolderP&fromFolder,AbstractMail*fromWrapper) | 230 | void AccountView::downloadMails(const FolderP&fromFolder,AbstractMail*fromWrapper) |
220 | { | 231 | { |
221 | AbstractMail*targetMail = 0; | 232 | AbstractMail*targetMail = 0; |
222 | QString targetFolder = ""; | 233 | QString targetFolder = ""; |
223 | Selectstore sels; | 234 | Selectstore sels; |
224 | setupFolderselect(&sels); | 235 | setupFolderselect(&sels); |
225 | if (!sels.exec()) return; | 236 | if (!sels.exec()) return; |
226 | targetMail = sels.currentMail(); | 237 | targetMail = sels.currentMail(); |
227 | targetFolder = sels.currentFolder(); | 238 | targetFolder = sels.currentFolder(); |
228 | if ( (fromWrapper==targetMail && fromFolder->getName()==targetFolder) || | 239 | if ( (fromWrapper==targetMail && fromFolder->getName()==targetFolder) || |
229 | targetFolder.isEmpty()) | 240 | targetFolder.isEmpty()) |
230 | { | 241 | { |
231 | return; | 242 | return; |
232 | } | 243 | } |
233 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) | 244 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) |
234 | { | 245 | { |
235 | QMessageBox::critical(0,i18n("Error creating new Folder"), | 246 | QMessageBox::critical(0,i18n("Error creating new Folder"), |
236 | i18n("<center>Error while creating<br>new folder - breaking.</center>")); | 247 | i18n("<center>Error while creating<br>new folder - breaking.</center>")); |
237 | return; | 248 | return; |
238 | } | 249 | } |
239 | int maxsize = 0; | 250 | int maxsize = 0; |
240 | if ( sels.useSize->isChecked()) | 251 | if ( sels.useSize->isChecked()) |
241 | maxsize = sels.sizeSpinBox->value(); | 252 | maxsize = sels.sizeSpinBox->value(); |
242 | 253 | ||
243 | fromWrapper->mvcpAllMails(fromFolder,targetFolder,targetMail,sels.moveMails(), maxsize); | 254 | fromWrapper->mvcpAllMails(fromFolder,targetFolder,targetMail,sels.moveMails(), maxsize); |
244 | refreshCurrent(); | 255 | refreshCurrent(); |
245 | } | 256 | } |
246 | 257 | ||
247 | bool AccountView::currentisDraft() | 258 | bool AccountView::currentisDraft() |
248 | { | 259 | { |
249 | AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); | 260 | AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); |
250 | if (!view) return false; | 261 | if (!view) return false; |
251 | return view->isDraftfolder(); | 262 | return view->isDraftfolder(); |
252 | } | 263 | } |
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp index 82a915e..3dde3cd 100644 --- a/kmicromail/mainwindow.cpp +++ b/kmicromail/mainwindow.cpp | |||
@@ -1,433 +1,447 @@ | |||
1 | 1 | ||
2 | // CHANGED 2004-08-06 Lutz Rogowski | 2 | // CHANGED 2004-08-06 Lutz Rogowski |
3 | #include <qlabel.h> | 3 | #include <qlabel.h> |
4 | #include <qvbox.h> | 4 | #include <qvbox.h> |
5 | #include <qheader.h> | 5 | #include <qheader.h> |
6 | #include <qtimer.h> | 6 | #include <qtimer.h> |
7 | #include <qlayout.h> | 7 | #include <qlayout.h> |
8 | //#include <kdialog.h> | 8 | //#include <kdialog.h> |
9 | #include <kiconloader.h> | 9 | #include <kiconloader.h> |
10 | #include <kapplication.h> | 10 | #include <kapplication.h> |
11 | 11 | ||
12 | #ifdef DESKTOP_VERSION | 12 | #ifdef DESKTOP_VERSION |
13 | #include <qapplication.h> | 13 | #include <qapplication.h> |
14 | #include <qstatusbar.h> | 14 | #include <qstatusbar.h> |
15 | #include <kabc/stdaddressbook.h> | 15 | #include <kabc/stdaddressbook.h> |
16 | extern QStatusBar* globalSstatusBarMainWindow; | 16 | extern QStatusBar* globalSstatusBarMainWindow; |
17 | #else | 17 | #else |
18 | #include <qpe/qpeapplication.h> | 18 | #include <qpe/qpeapplication.h> |
19 | #include <klocale.h> | 19 | #include <klocale.h> |
20 | #endif | 20 | #endif |
21 | #include "defines.h" | 21 | #include "defines.h" |
22 | #include "koprefs.h" | 22 | #include "koprefs.h" |
23 | #include "mainwindow.h" | 23 | #include "mainwindow.h" |
24 | #include "mailistviewitem.h" | 24 | #include "mailistviewitem.h" |
25 | #include <KDGanttMinimizeSplitter.h> | 25 | #include <KDGanttMinimizeSplitter.h> |
26 | #include <libkdepim/kpimglobalprefs.h> | 26 | #include <libkdepim/kpimglobalprefs.h> |
27 | 27 | ||
28 | #include "koprefs.h" | 28 | #include "koprefs.h" |
29 | 29 | ||
30 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | 30 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) |
31 | : QMainWindow( parent, name ) //, flags ) | 31 | : QMainWindow( parent, name ) //, flags ) |
32 | { | 32 | { |
33 | #ifdef DESKTOP_VERSION | 33 | #ifdef DESKTOP_VERSION |
34 | globalSstatusBarMainWindow = statusBar(); | 34 | globalSstatusBarMainWindow = statusBar(); |
35 | #endif | 35 | #endif |
36 | setCaption( i18n( "KOpieMail/Pi" ) ); | 36 | setCaption( i18n( "KOpieMail/Pi" ) ); |
37 | setToolBarsMovable( false ); | 37 | setToolBarsMovable( false ); |
38 | //KABC::StdAddressBook::self(); | 38 | //KABC::StdAddressBook::self(); |
39 | toolBar = new QToolBar( this ); | 39 | toolBar = new QToolBar( this ); |
40 | menuBar = new QPEMenuBar( toolBar ); | 40 | menuBar = new QPEMenuBar( toolBar ); |
41 | mailMenu = new QPopupMenu( menuBar ); | 41 | mailMenu = new QPopupMenu( menuBar ); |
42 | menuBar->insertItem( i18n( "Mail" ), mailMenu ); | 42 | menuBar->insertItem( i18n( "Mail" ), mailMenu ); |
43 | settingsMenu = new QPopupMenu( menuBar ); | 43 | settingsMenu = new QPopupMenu( menuBar ); |
44 | menuBar->insertItem( i18n( "Settings" ), settingsMenu ); | 44 | menuBar->insertItem( i18n( "Settings" ), settingsMenu ); |
45 | 45 | ||
46 | addToolBar( toolBar ); | 46 | addToolBar( toolBar ); |
47 | toolBar->setHorizontalStretchable( true ); | 47 | toolBar->setHorizontalStretchable( true ); |
48 | QAction* getMail = new QAction( i18n( "Get all new mails" ), SmallIcon("enter"), | 48 | QAction* getMail = new QAction( i18n( "Get all new mails" ), SmallIcon("enter"), |
49 | 0, 0, this ); | 49 | 0, 0, this ); |
50 | connect(getMail, SIGNAL( activated() ), | 50 | connect(getMail, SIGNAL( activated() ), |
51 | SLOT( slotGetAllMail() ) ); | 51 | SLOT( slotGetAllMail() ) ); |
52 | getMail->addTo( mailMenu ); | 52 | getMail->addTo( mailMenu ); |
53 | 53 | ||
54 | getMail = new QAction( i18n( "Get new messages" ), SmallIcon("add"), | 54 | getMail = new QAction( i18n( "Get new messages" ), SmallIcon("add"), |
55 | 0, 0, this ); | 55 | 0, 0, this ); |
56 | getMail->addTo( toolBar ); | 56 | getMail->addTo( toolBar ); |
57 | getMail->addTo( mailMenu ); | 57 | getMail->addTo( mailMenu ); |
58 | connect(getMail, SIGNAL( activated() ), | 58 | connect(getMail, SIGNAL( activated() ), |
59 | SLOT( slotGetMail() ) ); | 59 | SLOT( slotGetMail() ) ); |
60 | 60 | ||
61 | composeMail = new QAction( i18n( "Compose new mail" ), SmallIcon("composemail"), | 61 | composeMail = new QAction( i18n( "Compose new mail" ), SmallIcon("composemail"), |
62 | 0, 0, this ); | 62 | 0, 0, this ); |
63 | composeMail->addTo( toolBar ); | 63 | composeMail->addTo( toolBar ); |
64 | composeMail->addTo( mailMenu ); | 64 | composeMail->addTo( mailMenu ); |
65 | 65 | ||
66 | sendQueued = new QAction( i18n( "Send queued mails" ), SmallIcon("sendqueued") , | 66 | sendQueued = new QAction( i18n( "Send queued mails" ), SmallIcon("sendqueued") , |
67 | 0, 0, this ); | 67 | 0, 0, this ); |
68 | sendQueued->addTo( toolBar ); | 68 | sendQueued->addTo( toolBar ); |
69 | sendQueued->addTo( mailMenu ); | 69 | sendQueued->addTo( mailMenu ); |
70 | 70 | ||
71 | /* | 71 | /* |
72 | syncFolders = new QAction( i18n( "Sync mailfolders" ), ICON_SYNC, | 72 | syncFolders = new QAction( i18n( "Sync mailfolders" ), ICON_SYNC, |
73 | 0, 0, this ); | 73 | 0, 0, this ); |
74 | syncFolders->addTo( toolBar ); | 74 | syncFolders->addTo( toolBar ); |
75 | syncFolders->addTo( mailMenu ); | 75 | syncFolders->addTo( mailMenu ); |
76 | */ | 76 | */ |
77 | 77 | ||
78 | showFolders = new QAction( i18n( "Show/Hide folders" ), SmallIcon("showfolders") , | 78 | showFolders = new QAction( i18n( "Show/Hide folders" ), SmallIcon("showfolders") , |
79 | 0, 0, this, 0, true ); | 79 | 0, 0, this, 0, true ); |
80 | showFolders->addTo( toolBar ); | 80 | showFolders->addTo( toolBar ); |
81 | showFolders->addTo( mailMenu ); | 81 | showFolders->addTo( mailMenu ); |
82 | showFolders->setOn( true ); | 82 | showFolders->setOn( true ); |
83 | connect(showFolders, SIGNAL( toggled(bool) ), | 83 | connect(showFolders, SIGNAL( toggled(bool) ), |
84 | SLOT( slotShowFolders(bool) ) ); | 84 | SLOT( slotShowFolders(bool) ) ); |
85 | 85 | ||
86 | /* | 86 | /* |
87 | searchMails = new QAction( i18n( "Search mails" ), SmallIcon("find") ), | 87 | searchMails = new QAction( i18n( "Search mails" ), SmallIcon("find") ), |
88 | 0, 0, this ); | 88 | 0, 0, this ); |
89 | searchMails->kopddTo( toolBar ); | 89 | searchMails->kopddTo( toolBar ); |
90 | searchMails->addTo( mailMenu ); | 90 | searchMails->addTo( mailMenu ); |
91 | */ | 91 | */ |
92 | 92 | ||
93 | deleteMails = new QAction(i18n("Delete Mail"), SmallIcon("trash"), 0, 0, this); | 93 | deleteMails = new QAction(i18n("Delete Mail"), SmallIcon("trash"), 0, 0, this); |
94 | deleteMails->addTo( toolBar ); | 94 | deleteMails->addTo( toolBar ); |
95 | deleteMails->addTo( mailMenu ); | 95 | deleteMails->addTo( mailMenu ); |
96 | connect( deleteMails, SIGNAL( activated() ), | 96 | connect( deleteMails, SIGNAL( activated() ), |
97 | SLOT( slotDeleteAllMail() ) ); | 97 | SLOT( slotDeleteAllMail() ) ); |
98 | 98 | ||
99 | editSettings = new QAction( i18n( "Configure OM/Pi..." ), SmallIcon("SettingsIcon") , | 99 | editSettings = new QAction( i18n( "Configure OM/Pi..." ), SmallIcon("SettingsIcon") , |
100 | 0, 0, this ); | 100 | 0, 0, this ); |
101 | editSettings->addTo( settingsMenu ); | 101 | editSettings->addTo( settingsMenu ); |
102 | connect( editSettings, SIGNAL( activated() ), | 102 | connect( editSettings, SIGNAL( activated() ), |
103 | SLOT( slotEditSettings() ) ); | 103 | SLOT( slotEditSettings() ) ); |
104 | 104 | ||
105 | 105 | ||
106 | QAction * editSettings2 = new QAction( i18n( "Global Settings..." ), SmallIcon("SettingsIcon") , | 106 | QAction * editSettings2 = new QAction( i18n( "Global Settings..." ), SmallIcon("SettingsIcon") , |
107 | 0, 0, this ); | 107 | 0, 0, this ); |
108 | editSettings2->addTo( settingsMenu ); | 108 | editSettings2->addTo( settingsMenu ); |
109 | connect( editSettings2, SIGNAL( activated() ), | 109 | connect( editSettings2, SIGNAL( activated() ), |
110 | SLOT( slotEditGlobalSettings() ) ); | 110 | SLOT( slotEditGlobalSettings() ) ); |
111 | 111 | ||
112 | 112 | ||
113 | 113 | ||
114 | editAccounts = new QAction( i18n( "Configure accounts" ), SmallIcon("editaccounts") , | 114 | editAccounts = new QAction( i18n( "Configure accounts" ), SmallIcon("editaccounts") , |
115 | 0, 0, this ); | 115 | 0, 0, this ); |
116 | editAccounts->addTo( settingsMenu ); | 116 | editAccounts->addTo( settingsMenu ); |
117 | codecMenu = new QPopupMenu( menuBar ); | 117 | codecMenu = new QPopupMenu( menuBar ); |
118 | codecMenu->insertItem( "Western (iso-8859-1)",0,0); | 118 | codecMenu->insertItem( "Western (iso-8859-1)",0,0); |
119 | codecMenu->insertItem( "Cyrillic (iso-8859-5)",1,1); | 119 | codecMenu->insertItem( "Cyrillic (iso-8859-5)",1,1); |
120 | codecMenu->insertItem( "Western (iso-8859-15)",2,2); | 120 | codecMenu->insertItem( "Western (iso-8859-15)",2,2); |
121 | codecMenu->insertItem( "Chinese (big-5)",3,3); | 121 | codecMenu->insertItem( "Chinese (big-5)",3,3); |
122 | codecMenu->insertItem( "Unicode (utf-8)",4,4); | 122 | codecMenu->insertItem( "Unicode (utf-8)",4,4); |
123 | codecMenu->insertItem( "Userdefined ("+KOPrefs::instance()->mSendCodec+")",5,5); | 123 | codecMenu->insertItem( "Userdefined ("+KOPrefs::instance()->mSendCodec+")",5,5); |
124 | //disabled | 124 | //disabled |
125 | //settingsMenu->insertItem( i18n("Codec for new mails"), codecMenu); | 125 | //settingsMenu->insertItem( i18n("Codec for new mails"), codecMenu); |
126 | //setCentralWidget( view ); | 126 | //setCentralWidget( view ); |
127 | 127 | ||
128 | QVBox* wrapperBox = new QVBox( this ); | 128 | QVBox* wrapperBox = new QVBox( this ); |
129 | setCentralWidget( wrapperBox ); | 129 | setCentralWidget( wrapperBox ); |
130 | 130 | ||
131 | // QWidget *view = new QWidget( wrapperBox ); | 131 | // QWidget *view = new QWidget( wrapperBox ); |
132 | KDGanttMinimizeSplitter* splithor = new KDGanttMinimizeSplitter( Qt::Vertical, wrapperBox); | 132 | KDGanttMinimizeSplitter* splithor = new KDGanttMinimizeSplitter( Qt::Vertical, wrapperBox); |
133 | splithor->setMinimizeDirection( KDGanttMinimizeSplitter::Down); | 133 | splithor->setMinimizeDirection( KDGanttMinimizeSplitter::Down); |
134 | KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, splithor); | 134 | KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, splithor); |
135 | split->setMinimizeDirection( KDGanttMinimizeSplitter::Left); | 135 | split->setMinimizeDirection( KDGanttMinimizeSplitter::Left); |
136 | //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); | 136 | //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); |
137 | subLE = 0; | 137 | subLE = 0; |
138 | fromLE = 0; | 138 | fromLE = 0; |
139 | toLE = 0; | 139 | toLE = 0; |
140 | if ( KOPrefs::instance()->mShowInfoSub || KOPrefs::instance()->mShowInfoFrom || KOPrefs::instance()->mShowInfoTo ) { | 140 | if ( KOPrefs::instance()->mShowInfoSub || KOPrefs::instance()->mShowInfoFrom || KOPrefs::instance()->mShowInfoTo ) { |
141 | QWidget* infoBox = new QWidget( splithor ); | 141 | QWidget* infoBox = new QWidget( splithor ); |
142 | QGridLayout *griLay = new QGridLayout( infoBox, 2,2); | 142 | QGridLayout *griLay = new QGridLayout( infoBox, 2,2); |
143 | if ( KOPrefs::instance()->mShowInfoSub ) { | 143 | if ( KOPrefs::instance()->mShowInfoSub ) { |
144 | griLay->addWidget( new QLabel ( i18n("Su:"), infoBox ),0,0 ); | 144 | griLay->addWidget( new QLabel ( i18n("Su:"), infoBox ),0,0 ); |
145 | griLay->addWidget( subLE = new QLineEdit( infoBox ),0,1) ; | 145 | griLay->addWidget( subLE = new QLineEdit( infoBox ),0,1) ; |
146 | } | 146 | } |
147 | if ( KOPrefs::instance()->mShowInfoFrom ) { | 147 | if ( KOPrefs::instance()->mShowInfoFrom ) { |
148 | griLay->addWidget( new QLabel ( i18n("Fr:"), infoBox ),1,0 ); | 148 | griLay->addWidget( new QLabel ( i18n("Fr:"), infoBox ),1,0 ); |
149 | griLay->addWidget( fromLE = new QLineEdit( infoBox ),1,1) ; | 149 | griLay->addWidget( fromLE = new QLineEdit( infoBox ),1,1) ; |
150 | } | 150 | } |
151 | if ( KOPrefs::instance()->mShowInfoTo ) { | 151 | if ( KOPrefs::instance()->mShowInfoTo ) { |
152 | griLay->addWidget( new QLabel ( i18n("To:"), infoBox ),2,0 ); | 152 | griLay->addWidget( new QLabel ( i18n("To:"), infoBox ),2,0 ); |
153 | griLay->addWidget( toLE = new QLineEdit( infoBox ),2,1) ; | 153 | griLay->addWidget( toLE = new QLineEdit( infoBox ),2,1) ; |
154 | } | 154 | } |
155 | infoBox->setMaximumHeight( infoBox->sizeHint().height() ); | 155 | infoBox->setMaximumHeight( infoBox->sizeHint().height() ); |
156 | if ( !KOPrefs::instance()->mShowInfoStart ) { | 156 | if ( !KOPrefs::instance()->mShowInfoStart ) { |
157 | QTimer::singleShot( 1,splithor, SLOT ( toggle() ) ); | 157 | QTimer::singleShot( 1,splithor, SLOT ( toggle() ) ); |
158 | } | 158 | } |
159 | } | 159 | } |
160 | 160 | ||
161 | 161 | ||
162 | folderView = new AccountView( split ); | 162 | folderView = new AccountView( split ); |
163 | folderView->header()->hide(); | 163 | folderView->header()->hide(); |
164 | folderView->setRootIsDecorated( false ); | 164 | folderView->setRootIsDecorated( false ); |
165 | folderView->addColumn( i18n( "Mailbox" ) ); | 165 | folderView->addColumn( i18n( "Mailbox" ) ); |
166 | 166 | ||
167 | //layout->addWidget( folderView ); | 167 | //layout->addWidget( folderView ); |
168 | 168 | ||
169 | mailView = new KListView( split ); | 169 | mailView = new KListView( split ); |
170 | mailView->addColumn( i18n( " " ) ); | 170 | mailView->addColumn( i18n( " " ) ); |
171 | mailView->addColumn( i18n( "Subject" ),QListView::Manual ); | 171 | mailView->addColumn( i18n( "Subject" ),QListView::Manual ); |
172 | mailView->addColumn( i18n( "Sender" ),QListView::Manual ); | 172 | mailView->addColumn( i18n( "Sender" ),QListView::Manual ); |
173 | mailView->addColumn( i18n( "Size" ),QListView::Manual); | 173 | mailView->addColumn( i18n( "Size" ),QListView::Manual); |
174 | mailView->addColumn( i18n( "Date" ),QListView::Manual); | 174 | mailView->addColumn( i18n( "Date" ),QListView::Manual); |
175 | if ( KOPrefs::instance()->mShowToField ) | 175 | if ( KOPrefs::instance()->mShowToField ) |
176 | mailView->addColumn( i18n( "To" ),QListView::Manual); | 176 | mailView->addColumn( i18n( "To" ),QListView::Manual); |
177 | mailView->setAllColumnsShowFocus(true); | 177 | mailView->setAllColumnsShowFocus(true); |
178 | //mailView->setSorting(-1); | 178 | //mailView->setSorting(-1); |
179 | mailView->setRootIsDecorated( false ); | 179 | mailView->setRootIsDecorated( false ); |
180 | statusWidget = new StatusWidget( wrapperBox ); | 180 | statusWidget = new StatusWidget( wrapperBox ); |
181 | statusWidget->hide(); | 181 | statusWidget->hide(); |
182 | mailView->setSelectionMode( QListView::Multi ); | 182 | mailView->setSelectionMode( QListView::Multi ); |
183 | mailView->setMultiSelection( true); | 183 | mailView->setMultiSelection( true); |
184 | mailView->setAlternateBackground(KPimGlobalPrefs::instance()->mAlternateColor ); | 184 | mailView->setAlternateBackground(KPimGlobalPrefs::instance()->mAlternateColor ); |
185 | //layout->addWidget( mailView ); | 185 | //layout->addWidget( mailView ); |
186 | //layout->setStretchFactor( folderView, 1 ); | 186 | //layout->setStretchFactor( folderView, 1 ); |
187 | //layout->setStretchFactor( mailView, 2 ); | 187 | //layout->setStretchFactor( mailView, 2 ); |
188 | 188 | ||
189 | slotAdjustLayout(); | 189 | slotAdjustLayout(); |
190 | #ifndef DESKTOP_VERSION | 190 | #ifndef DESKTOP_VERSION |
191 | QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); | 191 | QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); |
192 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); | 192 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); |
193 | if ( subLE ) | 193 | if ( subLE ) |
194 | QPEApplication::setStylusOperation( subLE ,QPEApplication::RightOnHold); | 194 | QPEApplication::setStylusOperation( subLE ,QPEApplication::RightOnHold); |
195 | if ( fromLE ) | 195 | if ( fromLE ) |
196 | QPEApplication::setStylusOperation( fromLE ,QPEApplication::RightOnHold); | 196 | QPEApplication::setStylusOperation( fromLE ,QPEApplication::RightOnHold); |
197 | if ( toLE ) | 197 | if ( toLE ) |
198 | QPEApplication::setStylusOperation( toLE ,QPEApplication::RightOnHold); | 198 | QPEApplication::setStylusOperation( toLE ,QPEApplication::RightOnHold); |
199 | #endif | 199 | #endif |
200 | connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, | 200 | connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, |
201 | SLOT( mailLeftClicked(QListViewItem*) ) ); | 201 | SLOT( mailLeftClicked(QListViewItem*) ) ); |
202 | connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this, | 202 | connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this, |
203 | SLOT( mailLeftClicked(QListViewItem*) ) ); | 203 | SLOT( mailLeftClicked(QListViewItem*) ) ); |
204 | connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, | 204 | connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, |
205 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); | 205 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); |
206 | connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), | 206 | connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), |
207 | this,SLOT(refreshMailView(const QValueList<RecMailP>&))); | 207 | this,SLOT(refreshMailView(const QValueList<RecMailP>&))); |
208 | 208 | ||
209 | connect( mailView, SIGNAL( currentChanged (QListViewItem* )),this, | 209 | connect( mailView, SIGNAL( currentChanged (QListViewItem* )),this, |
210 | SLOT( setInfoFields(QListViewItem*) ) ); | 210 | SLOT( setInfoFields(QListViewItem*) ) ); |
211 | 211 | ||
212 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); | 212 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); |
213 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); | 213 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); |
214 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); | 214 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); |
215 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); | 215 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); |
216 | //mailView->setMultiSelection ( true ); | 216 | //mailView->setMultiSelection ( true ); |
217 | //mailView->setSelectionMode( QListView::Extended ); | 217 | //mailView->setSelectionMode( QListView::Extended ); |
218 | QValueList<int> list; | 218 | QValueList<int> list; |
219 | int fw = 100; | 219 | int fw = 100; |
220 | if ( QApplication::desktop()->width() > 320 ) | 220 | if ( QApplication::desktop()->width() > 320 ) |
221 | fw = 50; | 221 | fw = 50; |
222 | list.append( fw ); | 222 | list.append( fw ); |
223 | list.append( 100 ); | 223 | list.append( 100 ); |
224 | split->setSizes( list ); | 224 | split->setSizes( list ); |
225 | QTimer::singleShot( 100, this, SLOT( slotAdjustColumns() ) ); | 225 | QTimer::singleShot( 100, this, SLOT( slotAdjustColumns() ) ); |
226 | mailView->setShowSortIndicator ( true ); | 226 | mailView->setShowSortIndicator ( true ); |
227 | QLabel *spacer = new QLabel( toolBar ); | 227 | QLabel *spacer = new QLabel( toolBar ); |
228 | spacer->setBackgroundMode( QWidget::PaletteButton ); | 228 | spacer->setBackgroundMode( QWidget::PaletteButton ); |
229 | toolBar->setStretchableWidget( spacer ); | 229 | toolBar->setStretchableWidget( spacer ); |
230 | 230 | ||
231 | QAction* closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); | 231 | QAction* closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); |
232 | connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); | 232 | connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); |
233 | if ( QApplication::desktop()->width() > 320 ) | 233 | if ( QApplication::desktop()->width() > 320 ) |
234 | closeMail->addTo(toolBar); | 234 | closeMail->addTo(toolBar); |
235 | closeMail->addTo(mailMenu); | 235 | closeMail->addTo(mailMenu); |
236 | 236 | ||
237 | 237 | ||
238 | QPopupMenu* helpMenu = new QPopupMenu( menuBar ); | 238 | QPopupMenu* helpMenu = new QPopupMenu( menuBar ); |
239 | menuBar->insertItem( i18n( "Help" ), helpMenu ); | 239 | menuBar->insertItem( i18n( "Help" ), helpMenu ); |
240 | QAction* li = new QAction(i18n("About"), QPixmap(), 0, 0, this); | 240 | QAction* li = new QAction(i18n("About"), QPixmap(), 0, 0, this); |
241 | connect( li, SIGNAL( activated() ), SLOT( showAbout()) ); | 241 | connect( li, SIGNAL( activated() ), SLOT( showAbout()) ); |
242 | li->addTo(helpMenu); | 242 | li->addTo(helpMenu); |
243 | li = new QAction(i18n("Licence"),QPixmap(), 0, 0, this); | 243 | li = new QAction(i18n("Licence"),QPixmap(), 0, 0, this); |
244 | connect( li, SIGNAL( activated() ), SLOT( showLicence()) ); | 244 | connect( li, SIGNAL( activated() ), SLOT( showLicence()) ); |
245 | li->addTo(helpMenu); | 245 | li->addTo(helpMenu); |
246 | li = new QAction(i18n("LibEtPan Licence"), QPixmap(), 0, 0, this); | 246 | li = new QAction(i18n("LibEtPan Licence"), QPixmap(), 0, 0, this); |
247 | connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) ); | 247 | connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) ); |
248 | li->addTo(helpMenu); | 248 | li->addTo(helpMenu); |
249 | connect( codecMenu, SIGNAL( activated(int) ), this, SLOT( slotSetCodec( int )) ); | 249 | connect( codecMenu, SIGNAL( activated(int) ), this, SLOT( slotSetCodec( int )) ); |
250 | slotSetCodec( KOPrefs::instance()->mCurrentCodec ); | 250 | slotSetCodec( KOPrefs::instance()->mCurrentCodec ); |
251 | menuBar->setMaximumWidth( menuBar->sizeHint().width()); | 251 | menuBar->setMaximumWidth( menuBar->sizeHint().width()); |
252 | //menuBar->setMaximumSize( menuBar->sizeHint()); | 252 | //menuBar->setMaximumSize( menuBar->sizeHint()); |
253 | #ifdef DESKTOP_VERSION | 253 | #ifdef DESKTOP_VERSION |
254 | resize ( 640, 480 ); | 254 | resize ( 640, 480 ); |
255 | #endif | 255 | #endif |
256 | } | 256 | } |
257 | 257 | ||
258 | MainWindow::~MainWindow() | 258 | MainWindow::~MainWindow() |
259 | { | 259 | { |
260 | } | 260 | } |
261 | 261 | ||
262 | void MainWindow::setInfoFields(QListViewItem* item ) | 262 | void MainWindow::setInfoFields(QListViewItem* item ) |
263 | { | 263 | { |
264 | if ( item == 0) { | 264 | if ( item == 0) { |
265 | if ( subLE ) subLE->setText(""); | 265 | if ( subLE ) subLE->setText(""); |
266 | if ( fromLE ) fromLE->setText(""); | 266 | if ( fromLE ) fromLE->setText(""); |
267 | if ( toLE ) toLE->setText(""); | 267 | if ( toLE ) toLE->setText(""); |
268 | return; | 268 | return; |
269 | } | 269 | } |
270 | RecMailP mail = ((MailListViewItem*)item)->data(); | 270 | RecMailP mail = ((MailListViewItem*)item)->data(); |
271 | if ( subLE ) subLE->setText(mail->getSubject()); | 271 | if ( subLE ) subLE->setText(mail->getSubject()); |
272 | if ( fromLE ) fromLE->setText(mail->getFrom()); | 272 | if ( fromLE ) fromLE->setText(mail->getFrom()); |
273 | if ( toLE ) toLE->setText(mail->To().join(";" )); | 273 | if ( toLE ) toLE->setText(mail->To().join(";" )); |
274 | if ( subLE ) subLE->setCursorPosition(0); | 274 | if ( subLE ) subLE->setCursorPosition(0); |
275 | if ( fromLE ) fromLE->setCursorPosition(0); | 275 | if ( fromLE ) fromLE->setCursorPosition(0); |
276 | if ( toLE ) toLE->setCursorPosition(0); | 276 | if ( toLE ) toLE->setCursorPosition(0); |
277 | 277 | ||
278 | } | 278 | } |
279 | void MainWindow::slotSetCodec( int codec ) | 279 | void MainWindow::slotSetCodec( int codec ) |
280 | { | 280 | { |
281 | codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, false ); | 281 | codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, false ); |
282 | //qDebug("codec %d ", codec); | 282 | //qDebug("codec %d ", codec); |
283 | KOPrefs::instance()->mCurrentCodec = codec; | 283 | KOPrefs::instance()->mCurrentCodec = codec; |
284 | KOPrefs::instance()->isDirty = true; | 284 | KOPrefs::instance()->isDirty = true; |
285 | QString name; | 285 | QString name; |
286 | switch ( codec ) { | 286 | switch ( codec ) { |
287 | case 0: | 287 | case 0: |
288 | name = "iso-8859-1"; | 288 | name = "iso-8859-1"; |
289 | break; | 289 | break; |
290 | case 1: | 290 | case 1: |
291 | name = "iso-8859-5"; | 291 | name = "iso-8859-5"; |
292 | break; | 292 | break; |
293 | case 2: | 293 | case 2: |
294 | name = "iso-8859-15"; | 294 | name = "iso-8859-15"; |
295 | break; | 295 | break; |
296 | case 3: | 296 | case 3: |
297 | name = "big-5"; | 297 | name = "big-5"; |
298 | break; | 298 | break; |
299 | case 4: | 299 | case 4: |
300 | name = "utf-8"; | 300 | name = "utf-8"; |
301 | break; | 301 | break; |
302 | case 5: | 302 | case 5: |
303 | name = KOPrefs::instance()->mSendCodec.lower(); | 303 | name = KOPrefs::instance()->mSendCodec.lower(); |
304 | break; | 304 | break; |
305 | } | 305 | } |
306 | KOPrefs::instance()->mCurrentCodeName = name ; | 306 | KOPrefs::instance()->mCurrentCodeName = name ; |
307 | codecMenu->changeItem ( 5, "Userdefined ("+KOPrefs::instance()->mSendCodec+")"); | 307 | codecMenu->changeItem ( 5, "Userdefined ("+KOPrefs::instance()->mSendCodec+")"); |
308 | codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, true ); | 308 | codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, true ); |
309 | } | 309 | } |
310 | void MainWindow::showLicence() | 310 | void MainWindow::showLicence() |
311 | { | 311 | { |
312 | KApplication::showLicence(); | 312 | KApplication::showLicence(); |
313 | } | 313 | } |
314 | void MainWindow::showAbout() | 314 | void MainWindow::showAbout() |
315 | { | 315 | { |
316 | QString version; | 316 | QString version; |
317 | #include <../version> | 317 | #include <../version> |
318 | 318 | ||
319 | QString cap = "About KOpieMail/Pi"; | 319 | QString cap = "About KOpieMail/Pi"; |
320 | QString text =i18n("KOpieMail/Platform-independent\n") + | 320 | QString text =i18n("KOpieMail/Platform-independent\n") + |
321 | "(OM/Pi) " + version + " - " | 321 | "(OM/Pi) " + version + " - " |
322 | 322 | ||
323 | #ifdef DESKTOP_VERSION | 323 | #ifdef DESKTOP_VERSION |
324 | "Desktop Edition\n" | 324 | "Desktop Edition\n" |
325 | #else | 325 | #else |
326 | "PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n" | 326 | "PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n" |
327 | #endif | 327 | #endif |
328 | "www.pi-sync.info\n\n" | 328 | "www.pi-sync.info\n\n" |
329 | 329 | ||
330 | 330 | ||
331 | 331 | ||
332 | "Copyright (c) 2004 Lutz Rogowski <lutz@pi-sync.info>\n" | 332 | "Copyright (c) 2004 Lutz Rogowski <lutz@pi-sync.info>\n" |
333 | "KOpieMail/Pi is based on Opie Mail\n" | 333 | "KOpieMail/Pi is based on Opie Mail\n" |
334 | "Copyright (c) Rajko Albrecht and the Opie team\n" | 334 | "Copyright (c) Rajko Albrecht and the Opie team\n" |
335 | "KOpieMail/Pi is licensed under the GPL\n" | 335 | "KOpieMail/Pi is licensed under the GPL\n" |
336 | "\n" | 336 | "\n" |
337 | "KOpieMail/Pi uses LibEtPan - a mail stuff library\n" | 337 | "KOpieMail/Pi uses LibEtPan - a mail stuff library\n" |
338 | "Copyright (C) 2001, 2002 - DINH Viet Hoa\n" | 338 | "Copyright (C) 2001, 2002 - DINH Viet Hoa\n" |
339 | "libEtPan has its own licence - see LibEtPan licence\n"; | 339 | "libEtPan has its own licence - see LibEtPan licence\n"; |
340 | 340 | ||
341 | KApplication::showText( cap, text ); | 341 | KApplication::showText( cap, text ); |
342 | } | 342 | } |
343 | void MainWindow::showEtpanLicence() | 343 | void MainWindow::showEtpanLicence() |
344 | { | 344 | { |
345 | KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" ); | 345 | KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" ); |
346 | 346 | ||
347 | } | 347 | } |
348 | void MainWindow::appMessage(const QCString &, const QByteArray &) | 348 | void MainWindow::appMessage(const QCString &, const QByteArray &) |
349 | { | 349 | { |
350 | qDebug("appMessage implemented by subclass"); | 350 | qDebug("appMessage implemented by subclass"); |
351 | } | 351 | } |
352 | 352 | ||
353 | void MainWindow::slotAdjustLayout() { | 353 | void MainWindow::slotAdjustLayout() { |
354 | 354 | ||
355 | /* | 355 | /* |
356 | QWidget *d = QApplication::desktop(); | 356 | QWidget *d = QApplication::desktop(); |
357 | 357 | ||
358 | if ( d->width() < d->height() ) { | 358 | if ( d->width() < d->height() ) { |
359 | layout->setDirection( QBoxLayout::TopToBottom ); | 359 | layout->setDirection( QBoxLayout::TopToBottom ); |
360 | } else { | 360 | } else { |
361 | layout->setDirection( QBoxLayout::LeftToRight ); | 361 | layout->setDirection( QBoxLayout::LeftToRight ); |
362 | } | 362 | } |
363 | */ | 363 | */ |
364 | } | 364 | } |
365 | 365 | ||
366 | void MainWindow::slotAdjustColumns() | 366 | void MainWindow::slotAdjustColumns() |
367 | { | 367 | { |
368 | bool hidden = folderView->isHidden(); | 368 | |
369 | if ( hidden ) folderView->show(); | 369 | if ( !folderView->isHidden() ) |
370 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); | 370 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); |
371 | if ( hidden ) folderView->hide(); | ||
372 | 371 | ||
373 | mailView->setColumnWidth( 0, 10 ); | 372 | mailView->setColumnWidth( 0, 10 ); |
374 | mailView->setColumnWidth( 1, 100 ); | 373 | mailView->setColumnWidth( 1, 100 ); |
375 | mailView->setColumnWidth( 2, 100 ); | 374 | mailView->setColumnWidth( 2, 100 ); |
376 | mailView->setColumnWidth( 3, 70 ); | 375 | mailView->setColumnWidth( 3, 70 ); |
377 | mailView->setColumnWidth( 4, 170 ); | 376 | mailView->setColumnWidth( 4, 180 ); |
377 | if ( KOPrefs::instance()->mShowToField ) | ||
378 | mailView->setColumnWidth( 5, 100 ); | ||
379 | mailView->setColumnAlignment( 3, AlignRight); | ||
380 | mailView->setColumnAlignment( 4, AlignRight); | ||
381 | } | ||
382 | void MainWindow::slotAdjustColumnsWide() | ||
383 | { | ||
384 | if ( !folderView->isHidden() ) | ||
385 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); | ||
386 | |||
387 | mailView->setColumnWidth( 0, 10 ); | ||
388 | mailView->setColumnWidth( 1, 200 ); | ||
389 | mailView->setColumnWidth( 2, 200 ); | ||
390 | mailView->setColumnWidth( 3, 70 ); | ||
391 | mailView->setColumnWidth( 4, 180 ); | ||
378 | if ( KOPrefs::instance()->mShowToField ) | 392 | if ( KOPrefs::instance()->mShowToField ) |
379 | mailView->setColumnWidth( 5, 100 ); | 393 | mailView->setColumnWidth( 5, 100 ); |
380 | mailView->setColumnAlignment( 3, AlignRight); | 394 | mailView->setColumnAlignment( 3, AlignRight); |
381 | } | 395 | } |
382 | 396 | ||
383 | void MainWindow::slotEditSettings() | 397 | void MainWindow::slotEditSettings() |
384 | { | 398 | { |
385 | } | 399 | } |
386 | void MainWindow::slotEditGlobalSettings() | 400 | void MainWindow::slotEditGlobalSettings() |
387 | { | 401 | { |
388 | } | 402 | } |
389 | 403 | ||
390 | void MainWindow::slotShowFolders( bool ) | 404 | void MainWindow::slotShowFolders( bool ) |
391 | { | 405 | { |
392 | qDebug("not implemented: "); | 406 | qDebug("not implemented: "); |
393 | } | 407 | } |
394 | 408 | ||
395 | void MainWindow::refreshMailView(const QValueList<RecMailP>&) | 409 | void MainWindow::refreshMailView(const QValueList<RecMailP>&) |
396 | { | 410 | { |
397 | qDebug("not implemented: "); | 411 | qDebug("not implemented: "); |
398 | } | 412 | } |
399 | 413 | ||
400 | void MainWindow::mailLeftClicked(QListViewItem * ) | 414 | void MainWindow::mailLeftClicked(QListViewItem * ) |
401 | { | 415 | { |
402 | qDebug("not implemented: "); | 416 | qDebug("not implemented: "); |
403 | } | 417 | } |
404 | 418 | ||
405 | void MainWindow::displayMail() | 419 | void MainWindow::displayMail() |
406 | { | 420 | { |
407 | qDebug("not implemented: "); | 421 | qDebug("not implemented: "); |
408 | } | 422 | } |
409 | 423 | ||
410 | void MainWindow::slotDeleteMail() | 424 | void MainWindow::slotDeleteMail() |
411 | { | 425 | { |
412 | qDebug("not implemented: "); | 426 | qDebug("not implemented: "); |
413 | } | 427 | } |
414 | 428 | ||
415 | void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) | 429 | void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) |
416 | { | 430 | { |
417 | qDebug("not implemented: "); | 431 | qDebug("not implemented: "); |
418 | } | 432 | } |
419 | 433 | ||
420 | void MainWindow::slotSendQueued() | 434 | void MainWindow::slotSendQueued() |
421 | { | 435 | { |
422 | qDebug("not implemented: "); | 436 | qDebug("not implemented: "); |
423 | } | 437 | } |
424 | 438 | ||
425 | void MainWindow::slotEditAccounts() | 439 | void MainWindow::slotEditAccounts() |
426 | { | 440 | { |
427 | qDebug("not implemented: "); | 441 | qDebug("not implemented: "); |
428 | } | 442 | } |
429 | 443 | ||
430 | void MainWindow::slotComposeMail() | 444 | void MainWindow::slotComposeMail() |
431 | { | 445 | { |
432 | qDebug("not implemented: "); | 446 | qDebug("not implemented: "); |
433 | } | 447 | } |
diff --git a/kmicromail/mainwindow.h b/kmicromail/mainwindow.h index 178d2bb..f65f3b4 100644 --- a/kmicromail/mainwindow.h +++ b/kmicromail/mainwindow.h | |||
@@ -1,74 +1,75 @@ | |||
1 | 1 | ||
2 | // CHANGED 2004-08-06 Lutz Rogowski | 2 | // CHANGED 2004-08-06 Lutz Rogowski |
3 | #ifndef MAINWINDOW_H | 3 | #ifndef MAINWINDOW_H |
4 | #define MAINWINDOW_H | 4 | #define MAINWINDOW_H |
5 | 5 | ||
6 | #include <qmainwindow.h> | 6 | #include <qmainwindow.h> |
7 | #include <klistview.h> | 7 | #include <klistview.h> |
8 | #include <qaction.h> | 8 | #include <qaction.h> |
9 | #include <qlineedit.h> | 9 | #include <qlineedit.h> |
10 | 10 | ||
11 | #include <qtoolbar.h> | 11 | #include <qtoolbar.h> |
12 | #ifdef DESKTOP_VERSION | 12 | #ifdef DESKTOP_VERSION |
13 | #include <qmenubar.h> | 13 | #include <qmenubar.h> |
14 | #define QPEMenuBar QMenuBar | 14 | #define QPEMenuBar QMenuBar |
15 | #else | 15 | #else |
16 | #include <qpe/qpemenubar.h> | 16 | #include <qpe/qpemenubar.h> |
17 | #endif | 17 | #endif |
18 | 18 | ||
19 | #include "accountview.h" | 19 | #include "accountview.h" |
20 | #include "statuswidget.h" | 20 | #include "statuswidget.h" |
21 | 21 | ||
22 | #include <libmailwrapper/mailtypes.h> | 22 | #include <libmailwrapper/mailtypes.h> |
23 | #include <opie2/osmartpointer.h> | 23 | #include <opie2/osmartpointer.h> |
24 | 24 | ||
25 | class RecMail; | 25 | class RecMail; |
26 | 26 | ||
27 | class MainWindow : public QMainWindow | 27 | class MainWindow : public QMainWindow |
28 | { | 28 | { |
29 | Q_OBJECT | 29 | Q_OBJECT |
30 | 30 | ||
31 | public: | 31 | public: |
32 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); | 32 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); |
33 | virtual ~MainWindow(); | 33 | virtual ~MainWindow(); |
34 | 34 | ||
35 | public slots: | 35 | public slots: |
36 | virtual void slotAdjustColumns(); | 36 | virtual void slotAdjustColumns(); |
37 | virtual void slotAdjustColumnsWide(); | ||
37 | virtual void appMessage(const QCString &msg, const QByteArray &data); | 38 | virtual void appMessage(const QCString &msg, const QByteArray &data); |
38 | virtual void slotComposeMail(); | 39 | virtual void slotComposeMail(); |
39 | 40 | ||
40 | protected slots: | 41 | protected slots: |
41 | virtual void setInfoFields(QListViewItem* ); | 42 | virtual void setInfoFields(QListViewItem* ); |
42 | virtual void slotSendQueued(); | 43 | virtual void slotSendQueued(); |
43 | virtual void slotEditAccounts(); | 44 | virtual void slotEditAccounts(); |
44 | virtual void slotShowFolders( bool show ); | 45 | virtual void slotShowFolders( bool show ); |
45 | virtual void refreshMailView(const QValueList<RecMailP>&); | 46 | virtual void refreshMailView(const QValueList<RecMailP>&); |
46 | virtual void displayMail(); | 47 | virtual void displayMail(); |
47 | virtual void slotGetMail() = 0; | 48 | virtual void slotGetMail() = 0; |
48 | virtual void slotGetAllMail() = 0; | 49 | virtual void slotGetAllMail() = 0; |
49 | virtual void slotDeleteMail(); | 50 | virtual void slotDeleteMail(); |
50 | virtual void slotDeleteAllMail() = 0; | 51 | virtual void slotDeleteAllMail() = 0; |
51 | virtual void slotSetCodec(int); | 52 | virtual void slotSetCodec(int); |
52 | virtual void mailHold(int, QListViewItem *,const QPoint&,int); | 53 | virtual void mailHold(int, QListViewItem *,const QPoint&,int); |
53 | virtual void slotAdjustLayout(); | 54 | virtual void slotAdjustLayout(); |
54 | virtual void slotEditSettings(); | 55 | virtual void slotEditSettings(); |
55 | virtual void slotEditGlobalSettings(); | 56 | virtual void slotEditGlobalSettings(); |
56 | virtual void mailLeftClicked( QListViewItem * ); | 57 | virtual void mailLeftClicked( QListViewItem * ); |
57 | void showLicence(); | 58 | void showLicence(); |
58 | void showAbout(); | 59 | void showAbout(); |
59 | void showEtpanLicence(); | 60 | void showEtpanLicence(); |
60 | 61 | ||
61 | protected: | 62 | protected: |
62 | QToolBar *toolBar; | 63 | QToolBar *toolBar; |
63 | StatusWidget *statusWidget; | 64 | StatusWidget *statusWidget; |
64 | QPEMenuBar *menuBar; | 65 | QPEMenuBar *menuBar; |
65 | QPopupMenu *mailMenu, *settingsMenu, *codecMenu; | 66 | QPopupMenu *mailMenu, *settingsMenu, *codecMenu; |
66 | QAction *composeMail, *sendQueued, *showFolders, *searchMails, *deleteMails, | 67 | QAction *composeMail, *sendQueued, *showFolders, *searchMails, *deleteMails, |
67 | *editSettings, *editAccounts, *syncFolders; | 68 | *editSettings, *editAccounts, *syncFolders; |
68 | AccountView *folderView; | 69 | AccountView *folderView; |
69 | KListView *mailView; | 70 | KListView *mailView; |
70 | QLineEdit* toLE,*fromLE,*subLE; | 71 | QLineEdit* toLE,*fromLE,*subLE; |
71 | //QBoxLayout *layout; | 72 | //QBoxLayout *layout; |
72 | }; | 73 | }; |
73 | 74 | ||
74 | #endif | 75 | #endif |
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index e296d9c..75a75b9 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp | |||
@@ -1,690 +1,694 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | 1 | // CHANGED 2004-09-31 Lutz Rogowski |
2 | // CHANGED 2004-08-06 Lutz Rogowski | 2 | // CHANGED 2004-08-06 Lutz Rogowski |
3 | 3 | ||
4 | 4 | ||
5 | #define protected public | 5 | #define protected public |
6 | #include <qwidget.h> | 6 | #include <qwidget.h> |
7 | #undef protected | 7 | #undef protected |
8 | #include "koprefsdialog.h" | 8 | #include "koprefsdialog.h" |
9 | #include <kapplication.h> | 9 | #include <kapplication.h> |
10 | #include <libkdepim/externalapphandler.h> | 10 | #include <libkdepim/externalapphandler.h> |
11 | #include <libkdepim/kpimglobalprefs.h> | 11 | #include <libkdepim/kpimglobalprefs.h> |
12 | #ifdef MINIKDE_KDIALOG_H | 12 | #ifdef MINIKDE_KDIALOG_H |
13 | #undef MINIKDE_KDIALOG_H | 13 | #undef MINIKDE_KDIALOG_H |
14 | #endif | 14 | #endif |
15 | #include "settingsdialog.h" | 15 | #include "settingsdialog.h" |
16 | #include "opiemail.h" | 16 | #include "opiemail.h" |
17 | #include "editaccounts.h" | 17 | #include "editaccounts.h" |
18 | #include "composemail.h" | 18 | #include "composemail.h" |
19 | #include "mailistviewitem.h" | 19 | #include "mailistviewitem.h" |
20 | #include "viewmail.h" | 20 | #include "viewmail.h" |
21 | #include "selectstore.h" | 21 | #include "selectstore.h" |
22 | #include "selectsmtp.h" | 22 | #include "selectsmtp.h" |
23 | #include "accountitem.h" | 23 | #include "accountitem.h" |
24 | #include "accountview.h" | 24 | #include "accountview.h" |
25 | #include "klocale.h" | 25 | #include "klocale.h" |
26 | 26 | ||
27 | #include <qmessagebox.h> | 27 | #include <qmessagebox.h> |
28 | #include <qtimer.h> | 28 | #include <qtimer.h> |
29 | #include <qcursor.h> | 29 | #include <qcursor.h> |
30 | #include <qtextbrowser.h> | 30 | #include <qtextbrowser.h> |
31 | #include <qregexp.h> | 31 | #include <qregexp.h> |
32 | #include <qpe/global.h> | 32 | #include <qpe/global.h> |
33 | 33 | ||
34 | #ifdef DESKTOP_VERSION | 34 | #ifdef DESKTOP_VERSION |
35 | #include <qapplication.h> | 35 | #include <qapplication.h> |
36 | #else | 36 | #else |
37 | #include <qpe/qpeapplication.h> | 37 | #include <qpe/qpeapplication.h> |
38 | #endif | 38 | #endif |
39 | #include <libmailwrapper/smtpwrapper.h> | 39 | #include <libmailwrapper/smtpwrapper.h> |
40 | #include <libmailwrapper/mailtypes.h> | 40 | #include <libmailwrapper/mailtypes.h> |
41 | #include <libmailwrapper/abstractmail.h> | 41 | #include <libmailwrapper/abstractmail.h> |
42 | #include "koprefs.h" | 42 | #include "koprefs.h" |
43 | 43 | ||
44 | //using namespace Opie::Core; | 44 | //using namespace Opie::Core; |
45 | 45 | ||
46 | OpieMail::OpieMail( QWidget *parent, const char *name ) | 46 | OpieMail::OpieMail( QWidget *parent, const char *name ) |
47 | : MainWindow( parent, name) //, WStyle_ContextHelp ) | 47 | : MainWindow( parent, name) //, WStyle_ContextHelp ) |
48 | { | 48 | { |
49 | mCurrentComposer = 0; | 49 | mCurrentComposer = 0; |
50 | settings = new Settings(); | 50 | settings = new Settings(); |
51 | tb = 0; | 51 | tb = 0; |
52 | setIcon(SmallIcon( "kmicromail" ) ); | 52 | setIcon(SmallIcon( "kmicromail" ) ); |
53 | folderView->populate( settings->getAccounts() ); | 53 | folderView->populate( settings->getAccounts() ); |
54 | connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), | 54 | connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), |
55 | this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); | 55 | this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); |
56 | folderView->setFocus(); | 56 | folderView->setFocus(); |
57 | } | 57 | } |
58 | 58 | ||
59 | OpieMail::~OpieMail() | 59 | OpieMail::~OpieMail() |
60 | { | 60 | { |
61 | if (settings) delete settings; | 61 | if (settings) delete settings; |
62 | if ( tb ) | 62 | if ( tb ) |
63 | delete tb; | 63 | delete tb; |
64 | } | 64 | } |
65 | 65 | ||
66 | void OpieMail::appMessage(const QCString &msg, const QByteArray &data) | 66 | void OpieMail::appMessage(const QCString &msg, const QByteArray &data) |
67 | { | 67 | { |
68 | 68 | ||
69 | } | 69 | } |
70 | #include <stdlib.h> | 70 | #include <stdlib.h> |
71 | void OpieMail::message(const QCString &msg, const QByteArray &data) | 71 | void OpieMail::message(const QCString &msg, const QByteArray &data) |
72 | { | 72 | { |
73 | // copied from old mail2 | 73 | // copied from old mail2 |
74 | static int ii = 0; | 74 | static int ii = 0; |
75 | //qDebug("QCOP CALL ############################# %d ", ii); | 75 | //qDebug("QCOP CALL ############################# %d ", ii); |
76 | //QString mess ( msg ); | 76 | //QString mess ( msg ); |
77 | //qDebug("Message = %s ",mess.latin1()); | 77 | //qDebug("Message = %s ",mess.latin1()); |
78 | ++ii; | 78 | ++ii; |
79 | //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this); | 79 | //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this); |
80 | 80 | ||
81 | mPendingEmail = QString::null; | 81 | mPendingEmail = QString::null; |
82 | mPendingName = QString::null; | 82 | mPendingName = QString::null; |
83 | if (msg == "writeMail(QString,QString)") | 83 | if (msg == "writeMail(QString,QString)") |
84 | { | 84 | { |
85 | //qDebug("writeMail(QString,QString) "); | 85 | //qDebug("writeMail(QString,QString) "); |
86 | QDataStream stream(data,IO_ReadOnly); | 86 | QDataStream stream(data,IO_ReadOnly); |
87 | stream >> mPendingName >> mPendingEmail; | 87 | stream >> mPendingName >> mPendingEmail; |
88 | // removing the whitespaces at beginning and end is needed! | 88 | // removing the whitespaces at beginning and end is needed! |
89 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); | 89 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); |
90 | } | 90 | } |
91 | else if (msg == "newMail()") | 91 | else if (msg == "newMail()") |
92 | { | 92 | { |
93 | //qDebug("slotComposeMail() "); | 93 | //qDebug("slotComposeMail() "); |
94 | // we cannot call slotComposeMail(); directly, because may be executing a QCOP call | 94 | // we cannot call slotComposeMail(); directly, because may be executing a QCOP call |
95 | // and a QCOP call does not like a processevents in his execution | 95 | // and a QCOP call does not like a processevents in his execution |
96 | // with the Qtimer we call slotComposeMail() after we reached the main event loop | 96 | // with the Qtimer we call slotComposeMail() after we reached the main event loop |
97 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); | 97 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); |
98 | // slotComposeMail(); | 98 | // slotComposeMail(); |
99 | } | 99 | } |
100 | else if (msg == "newMail(QString)") | 100 | else if (msg == "newMail(QString)") |
101 | { | 101 | { |
102 | //qDebug(" newMail(QString)"); | 102 | //qDebug(" newMail(QString)"); |
103 | QDataStream stream(data,IO_ReadOnly); | 103 | QDataStream stream(data,IO_ReadOnly); |
104 | stream >> mPendingName; | 104 | stream >> mPendingName; |
105 | // the format is | 105 | // the format is |
106 | // NAME <EMAIL>:SUBJECT | 106 | // NAME <EMAIL>:SUBJECT |
107 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); | 107 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); |
108 | } else { | 108 | } else { |
109 | mPendingData = data; | 109 | mPendingData = data; |
110 | mPendingMessage = msg; | 110 | mPendingMessage = msg; |
111 | QTimer::singleShot ( 50, this, SLOT(slotExtAppHandler() ) ); | 111 | QTimer::singleShot ( 50, this, SLOT(slotExtAppHandler() ) ); |
112 | } | 112 | } |
113 | 113 | ||
114 | //qDebug("END OpieMail::message "); | 114 | //qDebug("END OpieMail::message "); |
115 | } | 115 | } |
116 | void OpieMail::slotExtAppHandler() | 116 | void OpieMail::slotExtAppHandler() |
117 | { | 117 | { |
118 | ExternalAppHandler::instance()->appMessage ( mPendingMessage, mPendingData ); | 118 | ExternalAppHandler::instance()->appMessage ( mPendingMessage, mPendingData ); |
119 | } | 119 | } |
120 | void OpieMail::slotwriteMail2(const QString& namemail ) | 120 | void OpieMail::slotwriteMail2(const QString& namemail ) |
121 | { | 121 | { |
122 | //qDebug("OpieMail::slotwriteMail2 "); | 122 | //qDebug("OpieMail::slotwriteMail2 "); |
123 | //qApp->processEvents(); | 123 | //qApp->processEvents(); |
124 | ComposeMail compose( settings, this, 0, true ); | 124 | ComposeMail compose( settings, this, 0, true ); |
125 | if ( !namemail.isEmpty() ) { | 125 | if ( !namemail.isEmpty() ) { |
126 | QString to = namemail; | 126 | QString to = namemail; |
127 | if ( namemail.find( " <") > 1 ) { | 127 | if ( namemail.find( " <") > 1 ) { |
128 | to = "\"" +to.replace( QRegExp( " <"), "\" <") ; | 128 | to = "\"" +to.replace( QRegExp( " <"), "\" <") ; |
129 | } else | 129 | } else |
130 | if ( namemail.find( "<") > 1 ) { | 130 | if ( namemail.find( "<") > 1 ) { |
131 | to = "\"" +to.replace( QRegExp( "<"), "\" <") ; | 131 | to = "\"" +to.replace( QRegExp( "<"), "\" <") ; |
132 | } | 132 | } |
133 | int sub = to.find( ">:"); | 133 | int sub = to.find( ">:"); |
134 | if ( sub > 0 ) { | 134 | if ( sub > 0 ) { |
135 | compose.setTo( to.left(sub+1) ); | 135 | compose.setTo( to.left(sub+1) ); |
136 | compose.setSubject( to.mid(sub+2) ); | 136 | compose.setSubject( to.mid(sub+2) ); |
137 | } else | 137 | } else |
138 | compose.setTo( to ); | 138 | compose.setTo( to ); |
139 | } | 139 | } |
140 | compose.slotAdjustColumns(); | 140 | compose.slotAdjustColumns(); |
141 | #ifndef DESKTOP_VERSION | 141 | #ifndef DESKTOP_VERSION |
142 | compose.showMaximized(); | 142 | compose.showMaximized(); |
143 | #endif | 143 | #endif |
144 | mCurrentComposer = &compose; | 144 | mCurrentComposer = &compose; |
145 | compose.exec(); | 145 | compose.exec(); |
146 | mCurrentComposer = 0; | 146 | mCurrentComposer = 0; |
147 | folderView->refreshOutgoing(); | 147 | folderView->refreshOutgoing(); |
148 | raise(); | 148 | raise(); |
149 | //qDebug("retttich "); | 149 | //qDebug("retttich "); |
150 | } | 150 | } |
151 | void OpieMail::slotwriteMail(const QString&name,const QString&email) | 151 | void OpieMail::slotwriteMail(const QString&name,const QString&email) |
152 | { | 152 | { |
153 | // qDebug("OpieMail::slotwriteMail "); | 153 | // qDebug("OpieMail::slotwriteMail "); |
154 | ComposeMail compose( settings, this, 0, true ); | 154 | ComposeMail compose( settings, this, 0, true ); |
155 | if (!email.isEmpty()) | 155 | if (!email.isEmpty()) |
156 | { | 156 | { |
157 | if (!name.isEmpty()) | 157 | if (!name.isEmpty()) |
158 | { | 158 | { |
159 | compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">"); | 159 | compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">"); |
160 | } | 160 | } |
161 | else | 161 | else |
162 | { | 162 | { |
163 | compose.setTo(email); | 163 | compose.setTo(email); |
164 | } | 164 | } |
165 | } | 165 | } |
166 | compose.slotAdjustColumns(); | 166 | compose.slotAdjustColumns(); |
167 | #ifndef DESKTOP_VERSION | 167 | #ifndef DESKTOP_VERSION |
168 | compose.showMaximized(); | 168 | compose.showMaximized(); |
169 | #endif | 169 | #endif |
170 | 170 | ||
171 | mCurrentComposer = &compose; | 171 | mCurrentComposer = &compose; |
172 | compose.exec(); | 172 | compose.exec(); |
173 | mCurrentComposer = 0; | 173 | mCurrentComposer = 0; |
174 | folderView->refreshOutgoing(); | 174 | folderView->refreshOutgoing(); |
175 | raise(); | 175 | raise(); |
176 | } | 176 | } |
177 | 177 | ||
178 | void OpieMail::slotComposeMail() | 178 | void OpieMail::slotComposeMail() |
179 | { | 179 | { |
180 | if ( mPendingEmail == QString::null && mPendingName == QString::null) | 180 | if ( mPendingEmail == QString::null && mPendingName == QString::null) |
181 | slotwriteMail2( QString () ); | 181 | slotwriteMail2( QString () ); |
182 | else { | 182 | else { |
183 | if ( mPendingEmail == QString::null ) | 183 | if ( mPendingEmail == QString::null ) |
184 | slotwriteMail2( mPendingName ); | 184 | slotwriteMail2( mPendingName ); |
185 | else | 185 | else |
186 | slotwriteMail( mPendingName, mPendingEmail ); | 186 | slotwriteMail( mPendingName, mPendingEmail ); |
187 | } | 187 | } |
188 | //slotwriteMail(0l,0l); | 188 | //slotwriteMail(0l,0l); |
189 | } | 189 | } |
190 | 190 | ||
191 | void OpieMail::slotSendQueued() | 191 | void OpieMail::slotSendQueued() |
192 | { | 192 | { |
193 | SMTPaccount *smtp = 0; | 193 | SMTPaccount *smtp = 0; |
194 | 194 | ||
195 | QList<Account> list = settings->getAccounts(); | 195 | QList<Account> list = settings->getAccounts(); |
196 | QList<SMTPaccount> smtpList; | 196 | QList<SMTPaccount> smtpList; |
197 | smtpList.setAutoDelete(false); | 197 | smtpList.setAutoDelete(false); |
198 | Account *it; | 198 | Account *it; |
199 | for ( it = list.first(); it; it = list.next() ) | 199 | for ( it = list.first(); it; it = list.next() ) |
200 | { | 200 | { |
201 | if ( it->getType() == MAILLIB::A_SMTP ) | 201 | if ( it->getType() == MAILLIB::A_SMTP ) |
202 | { | 202 | { |
203 | smtp = static_cast<SMTPaccount *>(it); | 203 | smtp = static_cast<SMTPaccount *>(it); |
204 | smtpList.append(smtp); | 204 | smtpList.append(smtp); |
205 | } | 205 | } |
206 | } | 206 | } |
207 | if (smtpList.count()==0) | 207 | if (smtpList.count()==0) |
208 | { | 208 | { |
209 | QMessageBox::information(0,i18n("Info"),i18n("Define a smtp\n account first!\n")); | 209 | QMessageBox::information(0,i18n("Info"),i18n("Define a smtp\n account first!\n")); |
210 | return; | 210 | return; |
211 | } | 211 | } |
212 | if ( QMessageBox::warning(this, i18n("Sending all mails"), i18n("Do you really want to\nsend all queued mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No ) | 212 | if ( QMessageBox::warning(this, i18n("Sending all mails"), i18n("Do you really want to\nsend all queued mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No ) |
213 | return; | 213 | return; |
214 | if (smtpList.count()==1) | 214 | if (smtpList.count()==1) |
215 | { | 215 | { |
216 | smtp = smtpList.at(0); | 216 | smtp = smtpList.at(0); |
217 | } | 217 | } |
218 | else | 218 | else |
219 | { | 219 | { |
220 | smtp = 0; | 220 | smtp = 0; |
221 | selectsmtp selsmtp; | 221 | selectsmtp selsmtp; |
222 | selsmtp.setSelectionlist(&smtpList); | 222 | selsmtp.setSelectionlist(&smtpList); |
223 | selsmtp.resize( selsmtp.sizeHint() ); | 223 | selsmtp.resize( selsmtp.sizeHint() ); |
224 | if ( selsmtp.exec() == QDialog::Accepted ) | 224 | if ( selsmtp.exec() == QDialog::Accepted ) |
225 | { | 225 | { |
226 | smtp = selsmtp.selected_smtp(); | 226 | smtp = selsmtp.selected_smtp(); |
227 | } | 227 | } |
228 | } | 228 | } |
229 | if (smtp) | 229 | if (smtp) |
230 | { | 230 | { |
231 | 231 | ||
232 | Global::statusMessage("Sending mails...!"); | 232 | Global::statusMessage("Sending mails...!"); |
233 | SMTPwrapper * wrap = new SMTPwrapper(smtp); | 233 | SMTPwrapper * wrap = new SMTPwrapper(smtp); |
234 | if ( wrap->flushOutbox() ) | 234 | if ( wrap->flushOutbox() ) |
235 | { | 235 | { |
236 | Global::statusMessage("Mails sent!"); | 236 | Global::statusMessage("Mails sent!"); |
237 | } | 237 | } |
238 | delete wrap; | 238 | delete wrap; |
239 | } | 239 | } |
240 | folderView->refreshOutgoing(); | 240 | folderView->refreshOutgoing(); |
241 | } | 241 | } |
242 | 242 | ||
243 | void OpieMail::slotSearchMails() | 243 | void OpieMail::slotSearchMails() |
244 | { | 244 | { |
245 | qDebug("OpieMail::slotSearchMails():not implemented "); | 245 | qDebug("OpieMail::slotSearchMails():not implemented "); |
246 | } | 246 | } |
247 | void OpieMail::slotEditGlobalSettings() | 247 | void OpieMail::slotEditGlobalSettings() |
248 | { | 248 | { |
249 | KPimPrefsGlobalDialog gc ( this ); | 249 | KPimPrefsGlobalDialog gc ( this ); |
250 | gc.exec(); | 250 | gc.exec(); |
251 | } | 251 | } |
252 | 252 | ||
253 | void OpieMail::slotEditSettings() | 253 | void OpieMail::slotEditSettings() |
254 | { | 254 | { |
255 | 255 | ||
256 | KOPrefsDialog settingsDialog( this, "koprefs", true ); | 256 | KOPrefsDialog settingsDialog( this, "koprefs", true ); |
257 | #ifndef DESKTOP_VERSION | 257 | #ifndef DESKTOP_VERSION |
258 | settingsDialog.showMaximized(); | 258 | settingsDialog.showMaximized(); |
259 | #endif | 259 | #endif |
260 | settingsDialog.exec(); | 260 | settingsDialog.exec(); |
261 | 261 | ||
262 | slotSetCodec( KOPrefs::instance()->mCurrentCodec ); | 262 | slotSetCodec( KOPrefs::instance()->mCurrentCodec ); |
263 | // KApplication::execDialog(settingsDialog); | 263 | // KApplication::execDialog(settingsDialog); |
264 | } | 264 | } |
265 | 265 | ||
266 | void OpieMail::slotEditAccounts() | 266 | void OpieMail::slotEditAccounts() |
267 | { | 267 | { |
268 | EditAccounts eaDialog( settings, this, 0, true ); | 268 | EditAccounts eaDialog( settings, this, 0, true ); |
269 | eaDialog.slotAdjustColumns(); | 269 | eaDialog.slotAdjustColumns(); |
270 | #ifndef DESKTOP_VERSION | 270 | #ifndef DESKTOP_VERSION |
271 | eaDialog.showMaximized(); | 271 | eaDialog.showMaximized(); |
272 | #endif | 272 | #endif |
273 | eaDialog.exec(); | 273 | eaDialog.exec(); |
274 | if ( settings ) delete settings; | 274 | if ( settings ) delete settings; |
275 | settings = new Settings(); | 275 | settings = new Settings(); |
276 | 276 | ||
277 | folderView->populate( settings->getAccounts() ); | 277 | folderView->populate( settings->getAccounts() ); |
278 | } | 278 | } |
279 | void OpieMail::replyMail() | 279 | void OpieMail::replyMail() |
280 | { | 280 | { |
281 | 281 | ||
282 | QListViewItem*item = mailView->currentItem(); | 282 | QListViewItem*item = mailView->currentItem(); |
283 | if (!item) return; | 283 | if (!item) return; |
284 | RecMailP mail = ((MailListViewItem*)item)->data(); | 284 | RecMailP mail = ((MailListViewItem*)item)->data(); |
285 | RecBodyP body = folderView->fetchBody(mail); | 285 | RecBodyP body = folderView->fetchBody(mail); |
286 | 286 | ||
287 | QString rtext; | 287 | QString rtext; |
288 | rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose | 288 | rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose |
289 | .arg( mail->getFrom()) | 289 | .arg( mail->getFrom()) |
290 | .arg( mail->getDate()); | 290 | .arg( mail->getDate()); |
291 | 291 | ||
292 | QString text = body->Bodytext(); | 292 | QString text = body->Bodytext(); |
293 | QStringList lines = QStringList::split(QRegExp("\\n"), text); | 293 | QStringList lines = QStringList::split(QRegExp("\\n"), text); |
294 | QStringList::Iterator it; | 294 | QStringList::Iterator it; |
295 | for (it = lines.begin(); it != lines.end(); it++) | 295 | for (it = lines.begin(); it != lines.end(); it++) |
296 | { | 296 | { |
297 | rtext += "> " + *it + "\n"; | 297 | rtext += "> " + *it + "\n"; |
298 | } | 298 | } |
299 | rtext += "\n"; | 299 | rtext += "\n"; |
300 | 300 | ||
301 | QString prefix; | 301 | QString prefix; |
302 | if ( mail->getSubject().find(QRegExp("^Re: .*$")) != -1) prefix = ""; | 302 | if ( mail->getSubject().find(QRegExp("^Re: .*$")) != -1) prefix = ""; |
303 | else prefix = "Re: "; // no i18n on purpose | 303 | else prefix = "Re: "; // no i18n on purpose |
304 | 304 | ||
305 | Settings *settings = new Settings(); | 305 | Settings *settings = new Settings(); |
306 | ComposeMail composer( settings ,this, 0, true); | 306 | ComposeMail composer( settings ,this, 0, true); |
307 | if (mail->Replyto().isEmpty()) { | 307 | if (mail->Replyto().isEmpty()) { |
308 | composer.setTo( mail->getFrom()); | 308 | composer.setTo( mail->getFrom()); |
309 | } else { | 309 | } else { |
310 | composer.setTo( mail->Replyto()); | 310 | composer.setTo( mail->Replyto()); |
311 | } | 311 | } |
312 | composer.setSubject( prefix + mail->getSubject()); | 312 | composer.setSubject( prefix + mail->getSubject()); |
313 | composer.setMessage( rtext ); | 313 | composer.setMessage( rtext ); |
314 | composer.setInReplyTo( mail->Msgid()); | 314 | composer.setInReplyTo( mail->Msgid()); |
315 | composer.setCharset( body->getCharset() ); | 315 | composer.setCharset( body->getCharset() ); |
316 | 316 | ||
317 | mCurrentComposer = &composer; | 317 | mCurrentComposer = &composer; |
318 | if ( QDialog::Accepted == KApplication::execDialog( &composer ) ) | 318 | if ( QDialog::Accepted == KApplication::execDialog( &composer ) ) |
319 | { | 319 | { |
320 | mail->Wrapper()->answeredMail(mail); | 320 | mail->Wrapper()->answeredMail(mail); |
321 | } | 321 | } |
322 | mCurrentComposer = 0; | 322 | mCurrentComposer = 0; |
323 | folderView->refreshOutgoing(); | 323 | folderView->refreshOutgoing(); |
324 | delete settings; | 324 | delete settings; |
325 | 325 | ||
326 | } | 326 | } |
327 | void OpieMail::closeViewMail(ViewMail * vm) | 327 | void OpieMail::closeViewMail(ViewMail * vm) |
328 | { | 328 | { |
329 | vm->hide(); | 329 | vm->hide(); |
330 | } | 330 | } |
331 | 331 | ||
332 | void OpieMail::slotDownloadMail( ) | 332 | void OpieMail::slotDownloadMail( ) |
333 | { | 333 | { |
334 | QListViewItem*item = mailView->currentItem(); | 334 | QListViewItem*item = mailView->currentItem(); |
335 | if (!item ) { | 335 | if (!item ) { |
336 | Global::statusMessage("Error: No item slected!"); | 336 | Global::statusMessage("Error: No item slected!"); |
337 | return; | 337 | return; |
338 | } | 338 | } |
339 | RecMailP mail = ((MailListViewItem*)item)->data(); | 339 | RecMailP mail = ((MailListViewItem*)item)->data(); |
340 | Account * acc = mail->Wrapper()->getAccount(); | 340 | Account * acc = mail->Wrapper()->getAccount(); |
341 | if ( !acc ) { | 341 | if ( !acc ) { |
342 | Global::statusMessage("Mail is already stored locally!"); | 342 | Global::statusMessage("Mail is already stored locally!"); |
343 | return; | 343 | return; |
344 | } | 344 | } |
345 | QString lfName = acc->getLocalFolder(); | 345 | QString lfName = acc->getLocalFolder(); |
346 | //qDebug("local folder " + lfName ); | 346 | //qDebug("local folder " + lfName ); |
347 | if ( lfName.isEmpty() ) | 347 | if ( lfName.isEmpty() ) |
348 | lfName = acc->getAccountName(); | 348 | lfName = acc->getAccountName(); |
349 | AbstractMail* targetMail = folderView->allAccounts()[0]->getWrapper(); | 349 | AbstractMail* targetMail = folderView->allAccounts()[0]->getWrapper(); |
350 | //qDebug("target %d %d ",targetMail,mail->Wrapper() ); | 350 | //qDebug("target %d %d ",targetMail,mail->Wrapper() ); |
351 | if ( targetMail == mail->Wrapper() ) { | 351 | if ( targetMail == mail->Wrapper() ) { |
352 | Global::statusMessage("Mail is already locally stored!"); | 352 | Global::statusMessage("Mail is already locally stored!"); |
353 | return; | 353 | return; |
354 | } | 354 | } |
355 | if ( !targetMail->createMbox(lfName)) { | 355 | if ( !targetMail->createMbox(lfName)) { |
356 | Global::statusMessage("Error creating folder!"); | 356 | Global::statusMessage("Error creating folder!"); |
357 | return; | 357 | return; |
358 | } | 358 | } |
359 | Global::statusMessage("Fetching mail...please wait!"); | 359 | Global::statusMessage("Fetching mail...please wait!"); |
360 | qApp->processEvents(); | 360 | qApp->processEvents(); |
361 | encodedString*st = 0; | 361 | encodedString*st = 0; |
362 | st = mail->Wrapper()->fetchRawBody(mail); | 362 | st = mail->Wrapper()->fetchRawBody(mail); |
363 | if ( st ) { | 363 | if ( st ) { |
364 | targetMail->storeMessage(st->Content(),st->Length(),lfName); | 364 | targetMail->storeMessage(st->Content(),st->Length(),lfName); |
365 | Global::statusMessage("Mail stored in "+ lfName); | 365 | Global::statusMessage("Mail stored in "+ lfName); |
366 | delete st; | 366 | delete st; |
367 | } else { | 367 | } else { |
368 | Global::statusMessage("Error: Cannot fetch mail!"); | 368 | Global::statusMessage("Error: Cannot fetch mail!"); |
369 | } | 369 | } |
370 | } | 370 | } |
371 | 371 | ||
372 | 372 | ||
373 | void OpieMail::deleteAndDisplayNextMail(ViewMail * vm) | 373 | void OpieMail::deleteAndDisplayNextMail(ViewMail * vm) |
374 | { | 374 | { |
375 | QListViewItem*item = mailView->currentItem(); | 375 | QListViewItem*item = mailView->currentItem(); |
376 | if (!item ) { | 376 | if (!item ) { |
377 | closeViewMail(vm); | 377 | closeViewMail(vm); |
378 | return; | 378 | return; |
379 | } | 379 | } |
380 | RecMailP mail = ((MailListViewItem*)item)->data(); | 380 | RecMailP mail = ((MailListViewItem*)item)->data(); |
381 | mail->Wrapper()->deleteMail( mail ); | 381 | mail->Wrapper()->deleteMail( mail ); |
382 | item = item->itemBelow(); | 382 | item = item->itemBelow(); |
383 | if (!item ) { | 383 | if (!item ) { |
384 | closeViewMail(vm); | 384 | closeViewMail(vm); |
385 | return; | 385 | return; |
386 | } | 386 | } |
387 | mailView->setCurrentItem(item); | 387 | mailView->setCurrentItem(item); |
388 | mail = ((MailListViewItem*)item)->data(); | 388 | mail = ((MailListViewItem*)item)->data(); |
389 | RecBodyP body = folderView->fetchBody(mail); | 389 | RecBodyP body = folderView->fetchBody(mail); |
390 | vm->setBody( body ); | 390 | vm->setBody( body ); |
391 | vm->setMail( mail ); | 391 | vm->setMail( mail ); |
392 | } | 392 | } |
393 | void OpieMail::displayNextMail(ViewMail * vm) | 393 | void OpieMail::displayNextMail(ViewMail * vm) |
394 | { | 394 | { |
395 | QListViewItem*item = mailView->currentItem(); | 395 | QListViewItem*item = mailView->currentItem(); |
396 | if (!item) return; | 396 | if (!item) return; |
397 | ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); | 397 | ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); |
398 | item = item->itemBelow(); | 398 | item = item->itemBelow(); |
399 | if (!item) { | 399 | if (!item) { |
400 | vm->setCaption(i18n("End of List" )); | 400 | vm->setCaption(i18n("End of List" )); |
401 | return; | 401 | return; |
402 | } | 402 | } |
403 | mailView->setCurrentItem(item); | 403 | mailView->setCurrentItem(item); |
404 | RecMailP mail = ((MailListViewItem*)item)->data(); | 404 | RecMailP mail = ((MailListViewItem*)item)->data(); |
405 | RecBodyP body = folderView->fetchBody(mail); | 405 | RecBodyP body = folderView->fetchBody(mail); |
406 | vm->setBody( body ); | 406 | vm->setBody( body ); |
407 | vm->setMail( mail ); | 407 | vm->setMail( mail ); |
408 | } | 408 | } |
409 | void OpieMail::displayMail() | 409 | void OpieMail::displayMail() |
410 | { | 410 | { |
411 | QListViewItem*item = mailView->currentItem(); | 411 | QListViewItem*item = mailView->currentItem(); |
412 | if (!item) return; | 412 | if (!item) return; |
413 | RecMailP mail = ((MailListViewItem*)item)->data(); | 413 | RecMailP mail = ((MailListViewItem*)item)->data(); |
414 | RecBodyP body = folderView->fetchBody(mail); | 414 | RecBodyP body = folderView->fetchBody(mail); |
415 | ViewMail readMail( this,"", Qt::WType_Modal ); | 415 | ViewMail readMail( this,"", Qt::WType_Modal ); |
416 | readMail.setBody( body ); | 416 | readMail.setBody( body ); |
417 | readMail.setMail( mail ); | 417 | readMail.setMail( mail ); |
418 | #ifndef DESKTOP_VERSION | 418 | #ifndef DESKTOP_VERSION |
419 | readMail.showMaximized(); | 419 | readMail.showMaximized(); |
420 | #else | 420 | #else |
421 | readMail.resize( 640, 480); | 421 | readMail.resize( 640, 480); |
422 | #endif | 422 | #endif |
423 | connect( &readMail,SIGNAL( showNextMail(ViewMail *) ), this, SLOT( displayNextMail(ViewMail *) ) ); | 423 | connect( &readMail,SIGNAL( showNextMail(ViewMail *) ), this, SLOT( displayNextMail(ViewMail *) ) ); |
424 | connect( &readMail,SIGNAL( deleteAndDisplayNextMail(ViewMail *) ), this, SLOT(deleteAndDisplayNextMail(ViewMail *) ) ); | 424 | connect( &readMail,SIGNAL( deleteAndDisplayNextMail(ViewMail *) ), this, SLOT(deleteAndDisplayNextMail(ViewMail *) ) ); |
425 | connect( &readMail,SIGNAL( signalDownloadMail() ), this, SLOT( slotDownloadMail() ) ); | 425 | connect( &readMail,SIGNAL( signalDownloadMail() ), this, SLOT( slotDownloadMail() ) ); |
426 | 426 | ||
427 | readMail.exec(); | 427 | readMail.exec(); |
428 | 428 | ||
429 | if ( readMail.deleted ) | 429 | if ( readMail.deleted ) |
430 | { | 430 | { |
431 | folderView->refreshCurrent(); | 431 | folderView->refreshCurrent(); |
432 | } | 432 | } |
433 | else | 433 | else |
434 | { | 434 | { |
435 | QListViewItem*item = mailView->currentItem(); | 435 | QListViewItem*item = mailView->currentItem(); |
436 | if (item) | 436 | if (item) |
437 | ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); | 437 | ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); |
438 | } | 438 | } |
439 | } | 439 | } |
440 | void OpieMail::slotGetAllMail() | 440 | void OpieMail::slotGetAllMail() |
441 | { | 441 | { |
442 | QListViewItem * item = folderView->firstChild(); | 442 | QListViewItem * item = folderView->firstChild(); |
443 | while ( item ){ | 443 | while ( item ){ |
444 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); | 444 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); |
445 | item = item->nextSibling (); | 445 | item = item->nextSibling (); |
446 | } | 446 | } |
447 | } | 447 | } |
448 | void OpieMail::slotGetMail() | 448 | void OpieMail::slotGetMail() |
449 | { | 449 | { |
450 | QListViewItem * item = folderView->currentItem(); | 450 | QListViewItem * item = folderView->currentItem(); |
451 | if ( ! item ) return; | 451 | if ( ! item ) return; |
452 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); | 452 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); |
453 | } | 453 | } |
454 | void OpieMail::slotDeleteMail() | 454 | void OpieMail::slotDeleteMail() |
455 | { | 455 | { |
456 | if (!mailView->currentItem()) return; | 456 | if (!mailView->currentItem()) return; |
457 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); | 457 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); |
458 | 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 ) | 458 | 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 ) |
459 | { | 459 | { |
460 | mail->Wrapper()->deleteMail( mail ); | 460 | mail->Wrapper()->deleteMail( mail ); |
461 | folderView->refreshCurrent(); | 461 | folderView->refreshCurrent(); |
462 | } | 462 | } |
463 | } | 463 | } |
464 | void OpieMail::slotDeleteAllMail() | 464 | void OpieMail::slotDeleteAllMail() |
465 | { | 465 | { |
466 | 466 | ||
467 | QValueList<RecMailP> t; | 467 | QValueList<RecMailP> t; |
468 | if ( QMessageBox::warning(this, i18n("Delete All Mails"), i18n("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) | 468 | if ( QMessageBox::warning(this, i18n("Delete All Mails"), i18n("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) |
469 | { | 469 | { |
470 | MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); | 470 | MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); |
471 | while ( item ) { | 471 | while ( item ) { |
472 | if ( item->isSelected() ) { | 472 | if ( item->isSelected() ) { |
473 | t.append( item->data() ); | 473 | t.append( item->data() ); |
474 | } | 474 | } |
475 | item = (MailListViewItem*)item->nextSibling(); | 475 | item = (MailListViewItem*)item->nextSibling(); |
476 | } | 476 | } |
477 | } | 477 | } |
478 | else | 478 | else |
479 | return; | 479 | return; |
480 | if ( t.count() == 0 ) | 480 | if ( t.count() == 0 ) |
481 | return; | 481 | return; |
482 | RecMailP mail = t.first(); | 482 | RecMailP mail = t.first(); |
483 | mail->Wrapper()->deleteMailList(t); | 483 | mail->Wrapper()->deleteMailList(t); |
484 | folderView->refreshCurrent(); | 484 | folderView->refreshCurrent(); |
485 | 485 | ||
486 | 486 | ||
487 | } | 487 | } |
488 | void OpieMail::clearSelection() | 488 | void OpieMail::clearSelection() |
489 | { | 489 | { |
490 | mailView->clearSelection(); | 490 | mailView->clearSelection(); |
491 | 491 | ||
492 | } | 492 | } |
493 | void OpieMail::selectAll() | 493 | void OpieMail::selectAll() |
494 | { | 494 | { |
495 | QListViewItem* item = mailView->firstChild (); | 495 | QListViewItem* item = mailView->firstChild (); |
496 | while ( item ) { | 496 | while ( item ) { |
497 | mailView->setSelected ( item, true ); | 497 | mailView->setSelected ( item, true ); |
498 | item = item->nextSibling(); | 498 | item = item->nextSibling(); |
499 | } | 499 | } |
500 | } | 500 | } |
501 | 501 | ||
502 | void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) | 502 | void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) |
503 | { | 503 | { |
504 | if (!mailView->currentItem()) return; | 504 | if (!mailView->currentItem()) return; |
505 | MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType(); | 505 | MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType(); |
506 | /* just the RIGHT button - or hold on pda */ | 506 | /* just the RIGHT button - or hold on pda */ |
507 | if (button!=2) {return;} | 507 | if (button!=2) {return;} |
508 | if (!item) return; | 508 | if (!item) return; |
509 | QPopupMenu *m = new QPopupMenu(0); | 509 | QPopupMenu *m = new QPopupMenu(0); |
510 | if (m) | 510 | if (m) |
511 | { | 511 | { |
512 | if (mailtype==MAILLIB::A_NNTP) { | 512 | if (mailtype==MAILLIB::A_NNTP) { |
513 | m->insertItem(i18n("Read this posting"),this,SLOT(displayMail())); | 513 | m->insertItem(i18n("Read this posting"),this,SLOT(displayMail())); |
514 | m->insertItem(i18n("Copy this posting"),this,SLOT(slotMoveCopyMail())); | 514 | m->insertItem(i18n("Copy this posting"),this,SLOT(slotMoveCopyMail())); |
515 | m->insertSeparator(); | 515 | m->insertSeparator(); |
516 | m->insertItem(i18n("Copy all selected postings"),this,SLOT(slotMoveCopyAllMail())); | 516 | m->insertItem(i18n("Copy all selected postings"),this,SLOT(slotMoveCopyAllMail())); |
517 | m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection())); | 517 | m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection())); |
518 | } else { | 518 | } else { |
519 | if (folderView->currentisDraft()) { | 519 | if (folderView->currentisDraft()) { |
520 | m->insertItem(i18n("Edit this mail"),this,SLOT(reEditMail())); | 520 | m->insertItem(i18n("Edit this mail"),this,SLOT(reEditMail())); |
521 | } | 521 | } |
522 | m->insertItem(i18n("Reply to this mail"),this,SLOT(replyMail())); | 522 | m->insertItem(i18n("Reply to this mail"),this,SLOT(replyMail())); |
523 | m->insertItem(i18n("Read this mail"),this,SLOT(displayMail())); | 523 | m->insertItem(i18n("Read this mail"),this,SLOT(displayMail())); |
524 | m->insertSeparator(); | 524 | m->insertSeparator(); |
525 | m->insertItem(i18n("Move/Copy this mail"),this,SLOT(slotMoveCopyMail())); | 525 | m->insertItem(i18n("Move/Copy this mail"),this,SLOT(slotMoveCopyMail())); |
526 | m->insertItem(i18n("Delete this mail"),this,SLOT(slotDeleteMail())); | 526 | m->insertItem(i18n("Delete this mail"),this,SLOT(slotDeleteMail())); |
527 | m->insertSeparator(); | 527 | m->insertSeparator(); |
528 | m->insertItem(i18n("Move/Copy all selected mail"),this,SLOT(slotMoveCopyAllMail())); | 528 | m->insertItem(i18n("Move/Copy all selected mail"),this,SLOT(slotMoveCopyAllMail())); |
529 | m->insertItem(i18n("Delete all selected mails"),this,SLOT(slotDeleteAllMail())); | 529 | m->insertItem(i18n("Delete all selected mails"),this,SLOT(slotDeleteAllMail())); |
530 | m->insertSeparator(); | 530 | m->insertSeparator(); |
531 | m->insertItem(i18n("Select all"),this,SLOT(selectAll())); | 531 | m->insertItem(i18n("Select all"),this,SLOT(selectAll())); |
532 | m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection())); | 532 | m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection())); |
533 | } | 533 | } |
534 | m->setFocus(); | 534 | m->setFocus(); |
535 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); | 535 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); |
536 | delete m; | 536 | delete m; |
537 | } | 537 | } |
538 | } | 538 | } |
539 | 539 | ||
540 | void OpieMail::slotShowFolders( bool show ) | 540 | void OpieMail::slotShowFolders( bool show ) |
541 | { | 541 | { |
542 | if ( show && folderView->isHidden() ) | 542 | if ( show && folderView->isHidden() ) |
543 | { | 543 | { |
544 | slotAdjustColumns(); | ||
544 | folderView->show(); | 545 | folderView->show(); |
546 | //slotAdjustColumns(); | ||
545 | } | 547 | } |
546 | else if ( !show && !folderView->isHidden() ) | 548 | else if ( !show && !folderView->isHidden() ) |
547 | { | 549 | { |
550 | slotAdjustColumnsWide(); | ||
548 | folderView->hide(); | 551 | folderView->hide(); |
552 | //slotAdjustColumnsWide(); | ||
549 | } | 553 | } |
550 | } | 554 | } |
551 | 555 | ||
552 | void OpieMail::refreshMailView(const QValueList<RecMailP>&list) | 556 | void OpieMail::refreshMailView(const QValueList<RecMailP>&list) |
553 | { | 557 | { |
554 | MailListViewItem*item = 0; | 558 | MailListViewItem*item = 0; |
555 | mailView->clear(); | 559 | mailView->clear(); |
556 | 560 | ||
557 | QValueList<RecMailP>::ConstIterator it; | 561 | QValueList<RecMailP>::ConstIterator it; |
558 | for (it = list.begin(); it != list.end();++it) | 562 | for (it = list.begin(); it != list.end();++it) |
559 | { | 563 | { |
560 | item = new MailListViewItem(mailView,item); | 564 | item = new MailListViewItem(mailView,item); |
561 | item->storeData((*it)); | 565 | item->storeData((*it)); |
562 | item->showEntry(); | 566 | item->showEntry(); |
563 | } | 567 | } |
564 | mailView->setSorting ( 4, false ); | 568 | mailView->setSorting ( 4, false ); |
565 | } | 569 | } |
566 | 570 | ||
567 | void OpieMail::mailLeftClicked( QListViewItem *item ) | 571 | void OpieMail::mailLeftClicked( QListViewItem *item ) |
568 | { | 572 | { |
569 | mailView->clearSelection(); | 573 | mailView->clearSelection(); |
570 | /* just LEFT button - or tap with stylus on pda */ | 574 | /* just LEFT button - or tap with stylus on pda */ |
571 | //if (button!=1) return; | 575 | //if (button!=1) return; |
572 | if (!item) return; | 576 | if (!item) return; |
573 | if (folderView->currentisDraft()) { | 577 | if (folderView->currentisDraft()) { |
574 | reEditMail(); | 578 | reEditMail(); |
575 | } else { | 579 | } else { |
576 | displayMail(); | 580 | displayMail(); |
577 | } | 581 | } |
578 | } | 582 | } |
579 | 583 | ||
580 | void OpieMail::slotMoveCopyMail() | 584 | void OpieMail::slotMoveCopyMail() |
581 | { | 585 | { |
582 | if (!mailView->currentItem()) return; | 586 | if (!mailView->currentItem()) return; |
583 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); | 587 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); |
584 | AbstractMail*targetMail = 0; | 588 | AbstractMail*targetMail = 0; |
585 | QString targetFolder = ""; | 589 | QString targetFolder = ""; |
586 | Selectstore sels; | 590 | Selectstore sels; |
587 | folderView->setupFolderselect(&sels); | 591 | folderView->setupFolderselect(&sels); |
588 | if (!sels.exec()) return; | 592 | if (!sels.exec()) return; |
589 | targetMail = sels.currentMail(); | 593 | targetMail = sels.currentMail(); |
590 | targetFolder = sels.currentFolder(); | 594 | targetFolder = sels.currentFolder(); |
591 | if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || | 595 | if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || |
592 | targetFolder.isEmpty()) | 596 | targetFolder.isEmpty()) |
593 | { | 597 | { |
594 | return; | 598 | return; |
595 | } | 599 | } |
596 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) | 600 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) |
597 | { | 601 | { |
598 | QMessageBox::critical(0,i18n("Error creating new Folder"), | 602 | QMessageBox::critical(0,i18n("Error creating new Folder"), |
599 | i18n("<center>Error while creating<br>new folder - breaking.</center>")); | 603 | i18n("<center>Error while creating<br>new folder - breaking.</center>")); |
600 | return; | 604 | return; |
601 | } | 605 | } |
602 | sels.hide(); | 606 | sels.hide(); |
603 | qApp->processEvents(); | 607 | qApp->processEvents(); |
604 | // qDebug("hiding sels "); | 608 | // qDebug("hiding sels "); |
605 | mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails()); | 609 | mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails()); |
606 | folderView->refreshCurrent(); | 610 | folderView->refreshCurrent(); |
607 | } | 611 | } |
608 | 612 | ||
609 | void OpieMail::slotMoveCopyAllMail() | 613 | void OpieMail::slotMoveCopyAllMail() |
610 | { | 614 | { |
611 | 615 | ||
612 | if (!mailView->currentItem()) return; | 616 | if (!mailView->currentItem()) return; |
613 | QValueList<RecMailP> t; | 617 | QValueList<RecMailP> t; |
614 | // 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 ) | 618 | // 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 ) |
615 | { | 619 | { |
616 | MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); | 620 | MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); |
617 | while ( item ) { | 621 | while ( item ) { |
618 | if ( item->isSelected() ) { | 622 | if ( item->isSelected() ) { |
619 | t.append( item->data() ); | 623 | t.append( item->data() ); |
620 | } | 624 | } |
621 | item = (MailListViewItem*)item->nextSibling(); | 625 | item = (MailListViewItem*)item->nextSibling(); |
622 | } | 626 | } |
623 | } | 627 | } |
624 | // else | 628 | // else |
625 | // return; | 629 | // return; |
626 | if ( t.count() == 0 ) | 630 | if ( t.count() == 0 ) |
627 | return; | 631 | return; |
628 | RecMailP mail = t.first(); | 632 | RecMailP mail = t.first(); |
629 | AbstractMail*targetMail = 0; | 633 | AbstractMail*targetMail = 0; |
630 | QString targetFolder = ""; | 634 | QString targetFolder = ""; |
631 | Selectstore sels; | 635 | Selectstore sels; |
632 | folderView->setupFolderselect(&sels); | 636 | folderView->setupFolderselect(&sels); |
633 | if (!sels.exec()) return; | 637 | if (!sels.exec()) return; |
634 | targetMail = sels.currentMail(); | 638 | targetMail = sels.currentMail(); |
635 | targetFolder = sels.currentFolder(); | 639 | targetFolder = sels.currentFolder(); |
636 | if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || | 640 | if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || |
637 | targetFolder.isEmpty()) | 641 | targetFolder.isEmpty()) |
638 | { | 642 | { |
639 | return; | 643 | return; |
640 | } | 644 | } |
641 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) | 645 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) |
642 | { | 646 | { |
643 | QMessageBox::critical(0,i18n("Error creating new Folder"), | 647 | QMessageBox::critical(0,i18n("Error creating new Folder"), |
644 | i18n("<center>Error while creating<br>new folder - breaking.</center>")); | 648 | i18n("<center>Error while creating<br>new folder - breaking.</center>")); |
645 | return; | 649 | return; |
646 | } | 650 | } |
647 | sels.hide(); | 651 | sels.hide(); |
648 | qApp->processEvents(); | 652 | qApp->processEvents(); |
649 | //qDebug("hiding sels "); | 653 | //qDebug("hiding sels "); |
650 | mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails()); | 654 | mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails()); |
651 | folderView->refreshCurrent(); | 655 | folderView->refreshCurrent(); |
652 | } | 656 | } |
653 | 657 | ||
654 | void OpieMail::reEditMail() | 658 | void OpieMail::reEditMail() |
655 | { | 659 | { |
656 | if (!mailView->currentItem()) return; | 660 | if (!mailView->currentItem()) return; |
657 | 661 | ||
658 | ComposeMail compose( settings, this, 0, true ); | 662 | ComposeMail compose( settings, this, 0, true ); |
659 | compose.reEditMail(((MailListViewItem*)mailView->currentItem() )->data()); | 663 | compose.reEditMail(((MailListViewItem*)mailView->currentItem() )->data()); |
660 | compose.slotAdjustColumns(); | 664 | compose.slotAdjustColumns(); |
661 | #ifndef DESKTOP_VERSION | 665 | #ifndef DESKTOP_VERSION |
662 | compose.showMaximized(); | 666 | compose.showMaximized(); |
663 | #else | 667 | #else |
664 | compose.resize(640,480); | 668 | compose.resize(640,480); |
665 | #endif | 669 | #endif |
666 | mCurrentComposer = &compose; | 670 | mCurrentComposer = &compose; |
667 | compose.exec(); | 671 | compose.exec(); |
668 | folderView->refreshOutgoing(); | 672 | folderView->refreshOutgoing(); |
669 | mCurrentComposer = 0; | 673 | mCurrentComposer = 0; |
670 | } | 674 | } |
671 | 675 | ||
672 | void OpieMail::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList) | 676 | void OpieMail::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList) |
673 | { | 677 | { |
674 | 678 | ||
675 | if ( mCurrentComposer ) { | 679 | if ( mCurrentComposer ) { |
676 | mCurrentComposer->insertAttendees(uid,nameList,emailList,uidList); | 680 | mCurrentComposer->insertAttendees(uid,nameList,emailList,uidList); |
677 | } else { | 681 | } else { |
678 | ComposeMail compose( settings, this, 0, true ); | 682 | ComposeMail compose( settings, this, 0, true ); |
679 | compose.slotAdjustColumns(); | 683 | compose.slotAdjustColumns(); |
680 | #ifndef DESKTOP_VERSION | 684 | #ifndef DESKTOP_VERSION |
681 | compose.showMaximized(); | 685 | compose.showMaximized(); |
682 | #endif | 686 | #endif |
683 | mCurrentComposer = &compose; | 687 | mCurrentComposer = &compose; |
684 | mCurrentComposer->insertAttendees(uid,nameList,emailList,uidList); | 688 | mCurrentComposer->insertAttendees(uid,nameList,emailList,uidList); |
685 | compose.exec(); | 689 | compose.exec(); |
686 | mCurrentComposer = 0; | 690 | mCurrentComposer = 0; |
687 | folderView->refreshOutgoing(); | 691 | folderView->refreshOutgoing(); |
688 | raise(); | 692 | raise(); |
689 | } | 693 | } |
690 | } | 694 | } |