-rw-r--r-- | bin/kdepim/WhatsNew.txt | 2 | ||||
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 2 | ||||
-rw-r--r-- | kaddressbook/filtereditdialog.cpp | 2 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 3 | ||||
-rw-r--r-- | korganizer/koagenda.cpp | 3 | ||||
-rw-r--r-- | korganizer/koeditorgeneral.cpp | 15 | ||||
-rw-r--r-- | korganizer/koeditorgeneral.h | 1 | ||||
-rw-r--r-- | libkdepim/ksyncmanager.cpp | 15 | ||||
-rw-r--r-- | microkde/kglobalsettings.cpp | 8 |
9 files changed, 37 insertions, 14 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 706fb7f..1c2bff8 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,181 +1,183 @@ | |||
1 | Info about the changes in new versions of KDE-Pim/Pi | 1 | Info about the changes in new versions of KDE-Pim/Pi |
2 | 2 | ||
3 | ********** VERSION 2.0.21 ************ | 3 | ********** VERSION 2.0.21 ************ |
4 | 4 | ||
5 | Fixed another SMTP problem in OM/Pi. | 5 | Fixed another SMTP problem in OM/Pi. |
6 | Some small changed in the new datenavigator in KO/Pi. | 6 | Some small changed in the new datenavigator in KO/Pi. |
7 | Changed default setting for new filter in KA/Pi to "exclude categories". | ||
8 | Changed the default font size for 640x480 display | ||
7 | 9 | ||
8 | ********** VERSION 2.0.20 ************ | 10 | ********** VERSION 2.0.20 ************ |
9 | 11 | ||
10 | Two small fixes in OM/Pi. | 12 | Two small fixes in OM/Pi. |
11 | 13 | ||
12 | Better resizing of the new datenavigator in KO/Pi. | 14 | Better resizing of the new datenavigator in KO/Pi. |
13 | 15 | ||
14 | ********** VERSION 2.0.19 ************ | 16 | ********** VERSION 2.0.19 ************ |
15 | KO/Pi: | 17 | KO/Pi: |
16 | Enhancements and bugfixes in the new datenavigator. | 18 | Enhancements and bugfixes in the new datenavigator. |
17 | Bugfix in this changelog: | 19 | Bugfix in this changelog: |
18 | The datenavigator was changed in version 2.0.18, not the datepicker. | 20 | The datenavigator was changed in version 2.0.18, not the datepicker. |
19 | 21 | ||
20 | ********** VERSION 2.0.18 ************ | 22 | ********** VERSION 2.0.18 ************ |
21 | KO/Pi: | 23 | KO/Pi: |
22 | Fixed some minor problems. | 24 | Fixed some minor problems. |
23 | Cleaned up the KO/Pi config dialog. | 25 | Cleaned up the KO/Pi config dialog. |
24 | Fixed problem moving events in aganda view. | 26 | Fixed problem moving events in aganda view. |
25 | Made datepicker scaleable, i.e. if the datenavigator shows now a | 27 | Made datepicker scaleable, i.e. if the datenavigator shows now a |
26 | datenavigator matrix depending on its size. | 28 | datenavigator matrix depending on its size. |
27 | Birthdays are now displayed green in the datenavigator. | 29 | Birthdays are now displayed green in the datenavigator. |
28 | What'sThis Help in datenavigator shows all events of the day. | 30 | What'sThis Help in datenavigator shows all events of the day. |
29 | 31 | ||
30 | OM/Pi: | 32 | OM/Pi: |
31 | Updated the backend mail library to the latest version. | 33 | Updated the backend mail library to the latest version. |
32 | Please backup your mail before using this version. | 34 | Please backup your mail before using this version. |
33 | 35 | ||
34 | ********** VERSION 2.0.17 ************ | 36 | ********** VERSION 2.0.17 ************ |
35 | 37 | ||
36 | KO/Pi: | 38 | KO/Pi: |
37 | Tooltips in month view were not sorted. Fixed. | 39 | Tooltips in month view were not sorted. Fixed. |
38 | Daylabel in agenda view ( for display of one day ) was too short. Fixed. | 40 | Daylabel in agenda view ( for display of one day ) was too short. Fixed. |
39 | Conflict display dialog for syncing was not on top of other windows. Fixed. | 41 | Conflict display dialog for syncing was not on top of other windows. Fixed. |
40 | Fixed some minor problems. | 42 | Fixed some minor problems. |
41 | 43 | ||
42 | Fixed an endless loop when importing vcs file with RESOURCES entry. | 44 | Fixed an endless loop when importing vcs file with RESOURCES entry. |
43 | 45 | ||
44 | ********** VERSION 2.0.16 ************ | 46 | ********** VERSION 2.0.16 ************ |
45 | OM/Pi: | 47 | OM/Pi: |
46 | Fixed the SMTP account setting the option. | 48 | Fixed the SMTP account setting the option. |
47 | Fixed something in mail sending. | 49 | Fixed something in mail sending. |
48 | 50 | ||
49 | KO/Pi: | 51 | KO/Pi: |
50 | Added possibility to export selected events/todos as vcal file. | 52 | Added possibility to export selected events/todos as vcal file. |
51 | 53 | ||
52 | ********** VERSION 2.0.15 ************ | 54 | ********** VERSION 2.0.15 ************ |
53 | 55 | ||
54 | PwM/Pi: | 56 | PwM/Pi: |
55 | Added keyboard shorcuts for | 57 | Added keyboard shorcuts for |
56 | - toggling summary view (space bar) | 58 | - toggling summary view (space bar) |
57 | - delete item (delete + backspace key) | 59 | - delete item (delete + backspace key) |
58 | - add new item ( i + n key) | 60 | - add new item ( i + n key) |
59 | Fixed length of info in the title. | 61 | Fixed length of info in the title. |
60 | 62 | ||
61 | KO/Pi-KA/Pi: | 63 | KO/Pi-KA/Pi: |
62 | Changed "ME" menu bar entry to an icon. | 64 | Changed "ME" menu bar entry to an icon. |
63 | 65 | ||
64 | KO/Pi: | 66 | KO/Pi: |
65 | Fixed two minor bugs in displaying todos. | 67 | Fixed two minor bugs in displaying todos. |
66 | If in month view a cell is selected, the key shortcut "d" shows now that date. | 68 | If in month view a cell is selected, the key shortcut "d" shows now that date. |
67 | Added complete info for a todo in month view as an icon left of the text. | 69 | Added complete info for a todo in month view as an icon left of the text. |
68 | Fixed problems of displaying data when "<" or ">" are used in summary/location/description. | 70 | Fixed problems of displaying data when "<" or ">" are used in summary/location/description. |
69 | Fixed problem of search dialog size when switching displays. | 71 | Fixed problem of search dialog size when switching displays. |
70 | Cancel key now closes date picker. | 72 | Cancel key now closes date picker. |
71 | Rearranged KO/Pi file menu structure. | 73 | Rearranged KO/Pi file menu structure. |
72 | 74 | ||
73 | OM/Pi: | 75 | OM/Pi: |
74 | Added to the SMTP account setting the option | 76 | Added to the SMTP account setting the option |
75 | "No secure connection". | 77 | "No secure connection". |
76 | You have to configure your SMTP accounts again, sorry. | 78 | You have to configure your SMTP accounts again, sorry. |
77 | 79 | ||
78 | KA/Pi: | 80 | KA/Pi: |
79 | Added support for importing quoted-printable. | 81 | Added support for importing quoted-printable. |
80 | Support was added by Peter P.. Thanks, Peter! | 82 | Support was added by Peter P.. Thanks, Peter! |
81 | 83 | ||
82 | 84 | ||
83 | ********** VERSION 2.0.14 ************ | 85 | ********** VERSION 2.0.14 ************ |
84 | 86 | ||
85 | Made Passwordmanager PwM/Pi more userfriendly: | 87 | Made Passwordmanager PwM/Pi more userfriendly: |
86 | Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. | 88 | Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. |
87 | Fixed bug in KO/Pi todo printing. | 89 | Fixed bug in KO/Pi todo printing. |
88 | Made Qtopia calendar import possible on desktop . | 90 | Made Qtopia calendar import possible on desktop . |
89 | 91 | ||
90 | ********** VERSION 2.0.13 ************ | 92 | ********** VERSION 2.0.13 ************ |
91 | 93 | ||
92 | Fixed a problem in the addressee select dialog and made it more user friendly by adding a minimize splitter. | 94 | Fixed a problem in the addressee select dialog and made it more user friendly by adding a minimize splitter. |
93 | 95 | ||
94 | In the search dialog you can switch now the focus from search line edit to the list view by pressing key "arrow down". | 96 | In the search dialog you can switch now the focus from search line edit to the list view by pressing key "arrow down". |
95 | 97 | ||
96 | OM/Pi: | 98 | OM/Pi: |
97 | Fixed a refresh problem of outgoing/sent/sendfailed folders after sending mails. | 99 | Fixed a refresh problem of outgoing/sent/sendfailed folders after sending mails. |
98 | Added missing German translation. | 100 | Added missing German translation. |
99 | Added warning if path is specified in local folder settings of account config. | 101 | Added warning if path is specified in local folder settings of account config. |
100 | 102 | ||
101 | ********** VERSION 2.0.12 ************ | 103 | ********** VERSION 2.0.12 ************ |
102 | 104 | ||
103 | KO/Pi: | 105 | KO/Pi: |
104 | Fixed a bug in todo start/due date handling for non recurring todos with a start and due date. | 106 | Fixed a bug in todo start/due date handling for non recurring todos with a start and due date. |
105 | Fixed some layout problems in the KO/Pi agenda view when there were many conflicting itmes. | 107 | Fixed some layout problems in the KO/Pi agenda view when there were many conflicting itmes. |
106 | Fixed several problems of the keyboard focus in the desktop versions when opening the search dialog/event viewer. | 108 | Fixed several problems of the keyboard focus in the desktop versions when opening the search dialog/event viewer. |
107 | 109 | ||
108 | Fixed problem in pi-sync mode when wrong password was sent. | 110 | Fixed problem in pi-sync mode when wrong password was sent. |
109 | 111 | ||
110 | OM/Pi: | 112 | OM/Pi: |
111 | Fixed a crash when displaying mails with "Show mail as html" was checked in the config. | 113 | Fixed a crash when displaying mails with "Show mail as html" was checked in the config. |
112 | Added a check before displaying the mail if the mail is in html format, if "Show mail as html" is enabled. | 114 | Added a check before displaying the mail if the mail is in html format, if "Show mail as html" is enabled. |
113 | 115 | ||
114 | ********** VERSION 2.0.11 ************ | 116 | ********** VERSION 2.0.11 ************ |
115 | 117 | ||
116 | Fixed some problems in pi-sync mode | 118 | Fixed some problems in pi-sync mode |
117 | (e.g. details of events were not synced properly) | 119 | (e.g. details of events were not synced properly) |
118 | 120 | ||
119 | ********** VERSION 2.0.10 ************ | 121 | ********** VERSION 2.0.10 ************ |
120 | 122 | ||
121 | KO/Pi: | 123 | KO/Pi: |
122 | In the desktop versions the context menu in the search dialog was broken after introducing the What'sThis info for the list view. | 124 | In the desktop versions the context menu in the search dialog was broken after introducing the What'sThis info for the list view. |
123 | This is fixed. | 125 | This is fixed. |
124 | Changed the search dialog a bit to make it more user friendly. | 126 | Changed the search dialog a bit to make it more user friendly. |
125 | (E.g.: Removed message box about "no items found" and set key focus to search line edit after search). | 127 | (E.g.: Removed message box about "no items found" and set key focus to search line edit after search). |
126 | 128 | ||
127 | Added config option to hide the week number in KO/Pi toolbar. | 129 | Added config option to hide the week number in KO/Pi toolbar. |
128 | 130 | ||
129 | ********** VERSION 2.0.9 ************ | 131 | ********** VERSION 2.0.9 ************ |
130 | 132 | ||
131 | Made month view icons for multiday events a bit nicer. | 133 | Made month view icons for multiday events a bit nicer. |
132 | Some minor fixes in KO/Pi | 134 | Some minor fixes in KO/Pi |
133 | (e.g. go to today did not work for new week view properly). | 135 | (e.g. go to today did not work for new week view properly). |
134 | 136 | ||
135 | 137 | ||
136 | ********** VERSION 2.0.8 ************ | 138 | ********** VERSION 2.0.8 ************ |
137 | 139 | ||
138 | Fixed a problem in dependency info in the ipk files for the Zaurus. | 140 | Fixed a problem in dependency info in the ipk files for the Zaurus. |
139 | 141 | ||
140 | Added icon for the stealth new week view and made navigation more user friendly in monthview by adding a prev/next week button to the navigator bar. | 142 | Added icon for the stealth new week view and made navigation more user friendly in monthview by adding a prev/next week button to the navigator bar. |
141 | 143 | ||
142 | Added a "go today" button to the datepicker. | 144 | Added a "go today" button to the datepicker. |
143 | 145 | ||
144 | Added "created" and "last modified" to event/todo viewer (and What'sThis viewer) | 146 | Added "created" and "last modified" to event/todo viewer (and What'sThis viewer) |
145 | and made it configureable to show these values. | 147 | and made it configureable to show these values. |
146 | 148 | ||
147 | Fixed a problem for events (from external iCal files) that do have a duration but no end date. | 149 | Fixed a problem for events (from external iCal files) that do have a duration but no end date. |
148 | 150 | ||
149 | 151 | ||
150 | ********** VERSION 2.0.7 ************ | 152 | ********** VERSION 2.0.7 ************ |
151 | 153 | ||
152 | Added global application font settings | 154 | Added global application font settings |
153 | (for all KDE-Pim/Pi apps) to the general settings. | 155 | (for all KDE-Pim/Pi apps) to the general settings. |
154 | 156 | ||
155 | Fixed a problem in OM/Pi when trying to login to some IMAP servers | 157 | Fixed a problem in OM/Pi when trying to login to some IMAP servers |
156 | (like the IMAP server of Apple: mail.mac.com ) | 158 | (like the IMAP server of Apple: mail.mac.com ) |
157 | 159 | ||
158 | Added recurring todos to KO/Pi. | 160 | Added recurring todos to KO/Pi. |
159 | 161 | ||
160 | 162 | ||
161 | ********** VERSION 2.0.6 ************ | 163 | ********** VERSION 2.0.6 ************ |
162 | 164 | ||
163 | Stable release 2.0.6! | 165 | Stable release 2.0.6! |
164 | 166 | ||
165 | Some bugfixes in the pi-sync mode. | 167 | Some bugfixes in the pi-sync mode. |
166 | Added German translation for pi-sync mode. | 168 | Added German translation for pi-sync mode. |
167 | 169 | ||
168 | KO/Pi: | 170 | KO/Pi: |
169 | Made the todolist using alternate background. | 171 | Made the todolist using alternate background. |
170 | 172 | ||
171 | Other minor fixes in KO/Pi. | 173 | Other minor fixes in KO/Pi. |
172 | 174 | ||
173 | 175 | ||
174 | You can find the complete changelog | 176 | You can find the complete changelog |
175 | from version 1.7.7 to 2.0.5 | 177 | from version 1.7.7 to 2.0.5 |
176 | in the source package or on | 178 | in the source package or on |
177 | 179 | ||
178 | http://www.pi-sync.net/html/changelog.html | 180 | http://www.pi-sync.net/html/changelog.html |
179 | 181 | ||
180 | 182 | ||
181 | 183 | ||
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index b976f1b..c6cd0ae 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1113,197 +1113,197 @@ | |||
1113 | { "Form2","Form2" }, | 1113 | { "Form2","Form2" }, |
1114 | { "Filter enabled","Filter angeschaltet" }, | 1114 | { "Filter enabled","Filter angeschaltet" }, |
1115 | { "Edit Filters","Ändere Filter" }, | 1115 | { "Edit Filters","Ändere Filter" }, |
1116 | { "Print What's Next View...","Drucke What's Next Ansicht..." }, | 1116 | { "Print What's Next View...","Drucke What's Next Ansicht..." }, |
1117 | { "Agenda","Agenda" }, | 1117 | { "Agenda","Agenda" }, |
1118 | { " ("," (" }, | 1118 | { " ("," (" }, |
1119 | { "<p><b>Due on:</b> %1</p>","<p><b>Fällig am:</b> %1</p>" }, | 1119 | { "<p><b>Due on:</b> %1</p>","<p><b>Fällig am:</b> %1</p>" }, |
1120 | { "Print","Print" }, | 1120 | { "Print","Print" }, |
1121 | { "&Setup Printer...","Drucker &Setup..." }, | 1121 | { "&Setup Printer...","Drucker &Setup..." }, |
1122 | { "View Type","Zeige Typ" }, | 1122 | { "View Type","Zeige Typ" }, |
1123 | { "Page &orientation:","Seiten Ausrichtung:" }, | 1123 | { "Page &orientation:","Seiten Ausrichtung:" }, |
1124 | { "Use Default of Selected Style","Default des selektierten Stils" }, | 1124 | { "Use Default of Selected Style","Default des selektierten Stils" }, |
1125 | { "Use Default Setting of Printer","Default Einstellung des Druckers" }, | 1125 | { "Use Default Setting of Printer","Default Einstellung des Druckers" }, |
1126 | { "Portrait","Portrait" }, | 1126 | { "Portrait","Portrait" }, |
1127 | { "Landscape","Landschaft" }, | 1127 | { "Landscape","Landschaft" }, |
1128 | { "Print day","Drucke Tag" }, | 1128 | { "Print day","Drucke Tag" }, |
1129 | { "CalPrintDay_Base","CalPrintDay_Base" }, | 1129 | { "CalPrintDay_Base","CalPrintDay_Base" }, |
1130 | { "Date && Time Range","Datum && Zeitspanne" }, | 1130 | { "Date && Time Range","Datum && Zeitspanne" }, |
1131 | { "&End date:","&Enddatum:" }, | 1131 | { "&End date:","&Enddatum:" }, |
1132 | { "&Start date:","&Startdatum:" }, | 1132 | { "&Start date:","&Startdatum:" }, |
1133 | { "Start &time:","Startzeit:" }, | 1133 | { "Start &time:","Startzeit:" }, |
1134 | { "End ti&me:","Endzeit:" }, | 1134 | { "End ti&me:","Endzeit:" }, |
1135 | { "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" }, | 1135 | { "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" }, |
1136 | { "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" }, | 1136 | { "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" }, |
1137 | { "Alt+D","Alt+D" }, | 1137 | { "Alt+D","Alt+D" }, |
1138 | { "&Use colors","Nutze Farben" }, | 1138 | { "&Use colors","Nutze Farben" }, |
1139 | { "Alt+U","Alt+U" }, | 1139 | { "Alt+U","Alt+U" }, |
1140 | { "Print week","Drucke Woche" }, | 1140 | { "Print week","Drucke Woche" }, |
1141 | { "CalPrintWeek_Base","CalPrintWeek_Base" }, | 1141 | { "CalPrintWeek_Base","CalPrintWeek_Base" }, |
1142 | { "Use &colors","Nutze Farben" }, | 1142 | { "Use &colors","Nutze Farben" }, |
1143 | { "Type of View","Typ der Ansicht" }, | 1143 | { "Type of View","Typ der Ansicht" }, |
1144 | { "Print as &Filofax page","Drucke als &Filofax Seite" }, | 1144 | { "Print as &Filofax page","Drucke als &Filofax Seite" }, |
1145 | { "Alt+F","Alt+F" }, | 1145 | { "Alt+F","Alt+F" }, |
1146 | { "Print as &timetable view:","Drucke als Zeittabelle:" }, | 1146 | { "Print as &timetable view:","Drucke als Zeittabelle:" }, |
1147 | { "Alt+T","Alt+T" }, | 1147 | { "Alt+T","Alt+T" }, |
1148 | { "Print as split week view","Drucke als gesplittete Wochenansicht" }, | 1148 | { "Print as split week view","Drucke als gesplittete Wochenansicht" }, |
1149 | { "Print month","Drucke Monat" }, | 1149 | { "Print month","Drucke Monat" }, |
1150 | { "CalPrintMonth_Base","CalPrintMonth_Base" }, | 1150 | { "CalPrintMonth_Base","CalPrintMonth_Base" }, |
1151 | { "&Start month:","&Startmonat:" }, | 1151 | { "&Start month:","&Startmonat:" }, |
1152 | { "&End month:","&Endmonat:" }, | 1152 | { "&End month:","&Endmonat:" }, |
1153 | { "Print week &numbers","Drucke Wochen Nummer(n)" }, | 1153 | { "Print week &numbers","Drucke Wochen Nummer(n)" }, |
1154 | { "Print todos","Drucke Todos" }, | 1154 | { "Print todos","Drucke Todos" }, |
1155 | { "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" }, | 1155 | { "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" }, |
1156 | { "Include &description of the item","Inclusive Itembeschreibung" }, | 1156 | { "Include &description of the item","Inclusive Itembeschreibung" }, |
1157 | { "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" }, | 1157 | { "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" }, |
1158 | { "Include &priority of the item","Inclusive Priorität des Items" }, | 1158 | { "Include &priority of the item","Inclusive Priorität des Items" }, |
1159 | { "Items to Print","Zu druckende Items" }, | 1159 | { "Items to Print","Zu druckende Items" }, |
1160 | { "&From:","Von:" }, | 1160 | { "&From:","Von:" }, |
1161 | { "&To:","Bis:" }, | 1161 | { "&To:","Bis:" }, |
1162 | { "Print &all todo items","Drucke alle Todo Items" }, | 1162 | { "Print &all todo items","Drucke alle Todo Items" }, |
1163 | { "Print only &uncompleted items","Drucke nur nicht erledigte Todos" }, | 1163 | { "Print only &uncompleted items","Drucke nur nicht erledigte Todos" }, |
1164 | { "Only items due in the &range:","Nur Items in dem Zeitraum:" }, | 1164 | { "Only items due in the &range:","Nur Items in dem Zeitraum:" }, |
1165 | { "Todo List","Todo Liste" }, | 1165 | { "Todo List","Todo Liste" }, |
1166 | { "&Title:","&Titel:" }, | 1166 | { "&Title:","&Titel:" }, |
1167 | { "Co&nnect subtodos with its parent","Verbinde Unter-Todos mit ihren Ober-Todos" }, | 1167 | { "Co&nnect subtodos with its parent","Verbinde Unter-Todos mit ihren Ober-Todos" }, |
1168 | { "Todo list","Todo Liste" }, | 1168 | { "Todo list","Todo Liste" }, |
1169 | { "&Print...","Drucke..." }, | 1169 | { "&Print...","Drucke..." }, |
1170 | { "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" }, | 1170 | { "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" }, |
1171 | { "[Unconfigured]","[Unkonfiguriert]" }, | 1171 | { "[Unconfigured]","[Unkonfiguriert]" }, |
1172 | { "OK","OK" }, | 1172 | { "OK","OK" }, |
1173 | { "FilterEditor","FilterEditor" }, | 1173 | { "FilterEditor","FilterEditor" }, |
1174 | { "Include","Inclusive" }, | 1174 | { "Include","Inclusive" }, |
1175 | { "Exclude","Exclusive" }, | 1175 | { "Exclude","Exclusive" }, |
1176 | { "Edit Selection...","Editiere Auswahl" }, | 1176 | { "Edit Selection...","Editiere Auswahl" }, |
1177 | { "recurring events","wiederholende Termine" }, | 1177 | { "recurring events","wiederholende Termine" }, |
1178 | { "recurr. events","wiederh.Termine" }, | 1178 | { "recurr. events","wiederh.Termine" }, |
1179 | { "completed to-dos","erledigte Todos" }, | 1179 | { "completed to-dos","erledigte Todos" }, |
1180 | { "events","Termine" }, | 1180 | { "events","Termine" }, |
1181 | { "todos","Todos" }, | 1181 | { "todos","Todos" }, |
1182 | { "journals","Journale" }, | 1182 | { "journals","Journale" }, |
1183 | { "public","öffentl." }, | 1183 | { "public","öffentl." }, |
1184 | { "private","privat" }, | 1184 | { "private","privat" }, |
1185 | { "confidential","vertraul." }, | 1185 | { "confidential","vertraul." }, |
1186 | { "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Unter-Todos.\nAlle erledigten Unter-Todos\nwerden auch gelöscht!" }, | 1186 | { "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Unter-Todos.\nAlle erledigten Unter-Todos\nwerden auch gelöscht!" }, |
1187 | { "Yesterday","Gestern" }, | 1187 | { "Yesterday","Gestern" }, |
1188 | { "Day after tomorrow","Übermorgen" }, | 1188 | { "Day after tomorrow","Übermorgen" }, |
1189 | { "Tomorrow","Morgen" }, | 1189 | { "Tomorrow","Morgen" }, |
1190 | { "Day before yesterday","Vorgestern" }, | 1190 | { "Day before yesterday","Vorgestern" }, |
1191 | { "Size %1","Größe %1" }, | 1191 | { "Size %1","Größe %1" }, |
1192 | { "New Agendasize: %1","Neue Agendagröße: %1" }, | 1192 | { "New Agendasize: %1","Neue Agendagröße: %1" }, |
1193 | { " (%1 y.)"," (%1 J.)" }, | 1193 | { " (%1 y.)"," (%1 J.)" }, |
1194 | { "Allday:","Ganztägig:" }, | 1194 | { "Allday:","Ganztägig:" }, |
1195 | { "compl.todos","erled.Todos" }, | 1195 | { "compl.todos","erled.Todos" }, |
1196 | { "Day view","Tagesansicht" }, | 1196 | { "Day view","Tagesansicht" }, |
1197 | { "Next days","Nächste Tage" }, | 1197 | { "Next days","Nächste Tage" }, |
1198 | { "Next week","Nächste Woche" }, | 1198 | { "Next week","Nächste Woche" }, |
1199 | { "Next two weeks","Nächste zwei Wochen" }, | 1199 | { "Next two weeks","Nächste zwei Wochen" }, |
1200 | { "Next month","Nächster Monat" }, | 1200 | { "Next month","Nächster Monat" }, |
1201 | { "Journal view","Journal" }, | 1201 | { "Journal view","Journal" }, |
1202 | { "Display all opened","Zeige alle geöffnet" }, | 1202 | { "Display all opened","Zeige alle geöffnet" }, |
1203 | { "Display all closed","Zeige alle geschlossen" }, | 1203 | { "Display all closed","Zeige alle geschlossen" }, |
1204 | { "Display all flat","Zeige alle flach" }, | 1204 | { "Display all flat","Zeige alle flach" }, |
1205 | { "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" }, | 1205 | { "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" }, |
1206 | { "Default todo done color:","Standard Todo erledigt Farbe" }, | 1206 | { "Default todo done color:","Standard Todo erledigt Farbe" }, |
1207 | { "Select week %1-%2","Wähle Woche %1-%2" }, | 1207 | { "Select week %1-%2","Wähle Woche %1-%2" }, |
1208 | { "Select Week","Wähle Woche" }, | 1208 | { "Select Week","Wähle Woche" }, |
1209 | { "Set alarm for selected...","Setze Alarm für Selekt..." }, | 1209 | { "Set alarm for selected...","Setze Alarm für Selekt..." }, |
1210 | { "Set Alarm!","Setze Alarm!" }, | 1210 | { "Set Alarm!","Setze Alarm!" }, |
1211 | { "Canged alarm for %1 items","Alarm für %1 Items geändert" }, | 1211 | { "Canged alarm for %1 items","Alarm für %1 Items geändert" }, |
1212 | { " and "," und " }, | 1212 | { " and "," und " }, |
1213 | { "<IMG src="%1"> only )","nur <IMG src="%1"> )" }, | 1213 | { "<IMG src="%1"> only )","nur <IMG src="%1"> )" }, |
1214 | { "Mail to selected","Mail an Ausgewählte" }, | 1214 | { "Mail to selected","Mail an Ausgewählte" }, |
1215 | { "Mail to all","Mail an Alle" }, | 1215 | { "Mail to all","Mail an Alle" }, |
1216 | { "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, | 1216 | { "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, |
1217 | { "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, | 1217 | { "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, |
1218 | { " on"," am" }, | 1218 | { " on"," am" }, |
1219 | { " completed on "," erledigt am " }, | 1219 | { " completed on "," erledigt am " }, |
1220 | { "Save as Event template","Speichere als Vorlage" }, | 1220 | { "Save as Event template","Speichere als Vorlage" }, |
1221 | { "Load Event template","Lade Termin Vorlage" }, | 1221 | { "Load Event template","Lade Termin Vorlage" }, |
1222 | { "Save as Journal template","Speichere als Journal Vorlage" }, | 1222 | { "Save as Journal template","Speichere als Journal Vorlage" }, |
1223 | { "Insert Journal template","Füge Journal Vorlage ein" }, | 1223 | { "Insert Journal template","Füge Journal Vorlage ein" }, |
1224 | { "Sub todos:<br>","Unter Todos:<br>" }, | 1224 | { "Sub todos:<br>","Unter Todos:<br>" }, |
1225 | { "Parent todo:<br>","Über Todo:<br>" }, | 1225 | { "Parent todo:<br>","Über Todo:<br>" }, |
1226 | { "Set current as color category","Setze Gewählte als Farbkategorie" }, | 1226 | { "Set current as color category","Setze Gewählte als Farbkategorie" }, |
1227 | { " completed"," erledigt" }, | 1227 | { " completed"," erledigt" }, |
1228 | { "(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!","(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi basiert auf KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) und das KDE Team.\nKOrganizer/Pi ist lizensiert unter der GPL.\nKO/Pi kann kompiliert werden für\nLinux, Zaurus-PDA und Windows\nwww.pi-sync.info --- www.korganizer.org\nBesonderen Dank an Michael und Ben\nfür intensives Testen!" }, | 1228 | { "(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!","(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi basiert auf KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) und das KDE Team.\nKOrganizer/Pi ist lizensiert unter der GPL.\nKO/Pi kann kompiliert werden für\nLinux, Zaurus-PDA und Windows\nwww.pi-sync.info --- www.korganizer.org\nBesonderen Dank an Michael und Ben\nfür intensives Testen!" }, |
1229 | { "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, | 1229 | { "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, |
1230 | { "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, | 1230 | { "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, |
1231 | { "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, | 1231 | { "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, |
1232 | { "Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?","Verbindungsversuch wegen\nZeitüberschreitung gescheitert!\nWurde vergessen Pi-Sync auf\nder Gegenstelle anzuschalten?" }, | 1232 | { "Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?","Verbindungsversuch wegen\nZeitüberschreitung gescheitert!\nWurde vergessen Pi-Sync auf\nder Gegenstelle anzuschalten?" }, |
1233 | { "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, | 1233 | { "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, |
1234 | { "Error","Fehler" }, | 1234 | { "Error","Fehler" }, |
1235 | { ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, | 1235 | { ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, |
1236 | { "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, | 1236 | { "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, |
1237 | { "Warning","Warnung" }, | 1237 | { "Warning","Warnung" }, |
1238 | { "Select week number","Wähle Wochen Nummer" }, | 1238 | { "Select week number","Wähle Wochen Nummer" }, |
1239 | { "Februar","Februar" }, | 1239 | { "Februar","Februar" }, |
1240 | { "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" }, | 1240 | { "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" }, |
1241 | { "W","W" }, | 1241 | { "W","W" }, |
1242 | { "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" }, | 1242 | { "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" }, |
1243 | { "T: %1","T: %1" }, | 1243 | { "T: %1","T: %1" }, |
1244 | { "Start: ","Start: " }, | 1244 | { "Start: ","Start: " }, |
1245 | { "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, | 1245 | { "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, |
1246 | { "Password for remote access:","Passwort für fernen Zugriff:" }, | 1246 | { "Password for remote access:","Passwort für fernen Zugriff:" }, |
1247 | { "Remote IP address:","Ferne IP Adresse:" }, | 1247 | { "Remote IP address:","Ferne IP Adresse:" }, |
1248 | { "Remote port number:","Ferne Port Nummer:" }, | 1248 | { "Remote port number:","Ferne Port Nummer:" }, |
1249 | { "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, | 1249 | { "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, |
1250 | { "Remote from: ","Fern von: " }, | 1250 | { "Remote from: ","Fern von: " }, |
1251 | { "Local from: ","Lokal von: " }, | 1251 | { "Local from: ","Lokal von: " }, |
1252 | { "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out\n","Synchronisationsübersicht:\n\n %d lokal hinzugefügt\n %d fern hinzugefügt\n %d lokal geändert\n %d fern geändert\n %d lokal gelöscht\n %d fern gelöscht\n %d eingehende ausgefiltert\n %d ausgehende ausgefiltert\n" }, | 1252 | { "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out\n","Synchronisationsübersicht:\n\n %d lokal hinzugefügt\n %d fern hinzugefügt\n %d lokal geändert\n %d fern geändert\n %d lokal gelöscht\n %d fern gelöscht\n %d eingehende ausgefiltert\n %d ausgehende ausgefiltert\n" }, |
1253 | { "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, | 1253 | { "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, |
1254 | { "Write back","Schreibe zurück" }, | 1254 | { "Write back","Schreibe zurück" }, |
1255 | { "KO/Pi Synchronization","KO/Pi Synchronisation" }, | 1255 | { "KO/Pi Synchronization","KO/Pi Synchronisation" }, |
1256 | { "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, | 1256 | { "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, |
1257 | { "Received sync request","Sync Anfrage erhalten" }, | 1257 | { "Received sync request","Sync Anfrage erhalten" }, |
1258 | { "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." }, | 1258 | { "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." }, |
1259 | { "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, | 1259 | { "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, |
1260 | { "Data saved to temp file!","Daten in temp Datei gespeichert!" }, | 1260 | { "Data saved to temp file!","Daten in temp Datei gespeichert!" }, |
1261 | { "Sending file...","Sende Datei..." }, | 1261 | { "Sending file...","Sende Datei..." }, |
1262 | { "Waiting for synced file...","Warte auf gesyncte Daten..." }, | 1262 | { "Waiting for synced file...","Warte auf gesyncte Daten..." }, |
1263 | { "Receiving synced file...","Gesyncte Daten erhalten..." }, | 1263 | { "Receiving synced file...","Gesyncte Daten erhalten..." }, |
1264 | { "Received %1 bytes","%1 Bytes erhalten" }, | 1264 | { "Received %1 bytes","%1 Bytes erhalten" }, |
1265 | { "Writing file to disk...","Speichere Datei..." }, | 1265 | { "Writing file to disk...","Speichere Datei..." }, |
1266 | { "Pi-Sync successful!","Pi-Sync erfolgreich!" }, | 1266 | { "Pi-Sync successful!","Pi-Sync erfolgreich!" }, |
1267 | { "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, | 1267 | { "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, |
1268 | { "Synchronize!","Synchronisiere!" }, | 1268 | { "Synchronize!","Synchronisiere!" }, |
1269 | { "High clock skew!","Großer Uhrzeitunterschied!" }, | 1269 | { "High clock skew!","Großer Uhrzeitunterschied!" }, |
1270 | { "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, | 1270 | { "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, |
1271 | { "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" }, | 1271 | { "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" }, |
1272 | { "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, | 1272 | { "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, |
1273 | { "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, | 1273 | { "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, |
1274 | { "List week view","Listenwochenansicht" }, | 1274 | { "List week view","Listenwochenansicht" }, |
1275 | { "List week","Listenwochenansicht" }, | 1275 | { "List week","Listenwochenansicht" }, |
1276 | { "Next Week","Nächste Woche" }, | 1276 | { "Next Week","Nächste Woche" }, |
1277 | { "Previous Week","Vorherige Woche" }, | 1277 | { "Previous Week","Vorherige Woche" }, |
1278 | { "No items were found matching\nyour search expression.\nUse the wildcard characters\n'*' and '?' where needed.","Keine Einträge gefunden die\ndem Suchausdruck entsprechen.\nBenutze Platzhalter Zeichen\n'*' und '?' wo benötigt." }, | 1278 | { "No items were found matching\nyour search expression.\nUse the wildcard characters\n'*' and '?' where needed.","Keine Einträge gefunden die\ndem Suchausdruck entsprechen.\nBenutze Platzhalter Zeichen\n'*' und '?' wo benötigt." }, |
1279 | { "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" }, | 1279 | { "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" }, |
1280 | { "Details","Details" }, | 1280 | { "Details","Details" }, |
1281 | { "Created time","Erstellt Zeit" }, | 1281 | { "Created time","Erstellt Zeit" }, |
1282 | { "Last modified time","Geändert Zeit" }, | 1282 | { "Last modified time","Geändert Zeit" }, |
1283 | { "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" }, | 1283 | { "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" }, |
1284 | { "View Options","Anzeige Optionen" }, | 1284 | { "View Options","Anzeige Optionen" }, |
1285 | { "<b>Created: ","<b>Erstellt am: " }, | 1285 | { "<b>Created: ","<b>Erstellt am: " }, |
1286 | { "<b>Last modified: ","<b>Zuletzt geändert am: " }, | 1286 | { "<b>Last modified: ","<b>Zuletzt geändert am: " }, |
1287 | { "Journal: ","Journal: " }, | 1287 | { "Journal: ","Journal: " }, |
1288 | { "yearly","jährlich" }, | 1288 | { "yearly","jährlich" }, |
1289 | { "(%1) ","%1-" }, | 1289 | { "(%1) ","%1-" }, |
1290 | { "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" }, | 1290 | { "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" }, |
1291 | { "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" }, | 1291 | { "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" }, |
1292 | { "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" }, | 1292 | { "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" }, |
1293 | { "Summary/Loc.","Titel/Ort" }, | 1293 | { "Summary/Loc.","Titel/Ort" }, |
1294 | { "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." }, | 1294 | { "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." }, |
1295 | { "Week Number","Wochennummer" }, | 1295 | { "Week Number","Wochennummer" }, |
1296 | { "Import","Importiere" }, | 1296 | { "Import","Importiere" }, |
1297 | { "Export","Exportiere" }, | 1297 | { "Export","Exportiere" }, |
1298 | { "Beam","Beame" }, | 1298 | { "Beam","Beame" }, |
1299 | { "Export selected","Exportiere Selektierte" }, | 1299 | { "Export selected","Exportiere Selektierte" }, |
1300 | { "As iCal (ics) file...","Als iCal (ics) Datei..." }, | 1300 | { "As iCal (ics) file...","Als iCal (ics) Datei..." }, |
1301 | { "As vCal (vcs) file...","Als vCal (vcs) Datei..." }, | 1301 | { "As vCal (vcs) file...","Als vCal (vcs) Datei..." }, |
1302 | { "Journal/Details...","Journale/Details..." }, | 1302 | { "Journal/Details...","Journale/Details..." }, |
1303 | { "Agenda View","Agenda Ansicht" }, | 1303 | { "Agenda View","Agenda Ansicht" }, |
1304 | { "Show current time","Zeige aktuelle Zeit" }, | 1304 | { "Show current time","Zeige aktuelle Zeit" }, |
1305 | { "","" }, | 1305 | { "Edit new item","Bearbeite neuen Eintrag" }, |
1306 | { "","" }, | 1306 | { "","" }, |
1307 | { "","" }, | 1307 | { "","" }, |
1308 | { "","" }, | 1308 | { "","" }, |
1309 | { "","" }, | 1309 | { "","" }, |
diff --git a/kaddressbook/filtereditdialog.cpp b/kaddressbook/filtereditdialog.cpp index 1194406..ef9b979 100644 --- a/kaddressbook/filtereditdialog.cpp +++ b/kaddressbook/filtereditdialog.cpp | |||
@@ -1,315 +1,315 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> | 3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | /* | 24 | /* |
25 | Enhanced Version of the file for platform independent KDE tools. | 25 | Enhanced Version of the file for platform independent KDE tools. |
26 | Copyright (c) 2004 Ulf Schenk | 26 | Copyright (c) 2004 Ulf Schenk |
27 | 27 | ||
28 | $Id$ | 28 | $Id$ |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <qbuttongroup.h> | 31 | #include <qbuttongroup.h> |
32 | #include <qhbox.h> | 32 | #include <qhbox.h> |
33 | #include <qlabel.h> | 33 | #include <qlabel.h> |
34 | #include <qlayout.h> | 34 | #include <qlayout.h> |
35 | #include <qpushbutton.h> | 35 | #include <qpushbutton.h> |
36 | #include <qradiobutton.h> | 36 | #include <qradiobutton.h> |
37 | #include <qcheckbox.h> | 37 | #include <qcheckbox.h> |
38 | #include <qregexp.h> | 38 | #include <qregexp.h> |
39 | #include <qstring.h> | 39 | #include <qstring.h> |
40 | #include <qtoolbutton.h> | 40 | #include <qtoolbutton.h> |
41 | #include <qtooltip.h> | 41 | #include <qtooltip.h> |
42 | #include <qwidget.h> | 42 | #include <qwidget.h> |
43 | 43 | ||
44 | #include <kapplication.h> | 44 | #include <kapplication.h> |
45 | #include <kbuttonbox.h> | 45 | #include <kbuttonbox.h> |
46 | #include <kdebug.h> | 46 | #include <kdebug.h> |
47 | #include <kiconloader.h> | 47 | #include <kiconloader.h> |
48 | #include <klineedit.h> | 48 | #include <klineedit.h> |
49 | #include <klistbox.h> | 49 | #include <klistbox.h> |
50 | #include <klistview.h> | 50 | #include <klistview.h> |
51 | #include <klocale.h> | 51 | #include <klocale.h> |
52 | #include <kglobal.h> | 52 | #include <kglobal.h> |
53 | 53 | ||
54 | #include "kabprefs.h" | 54 | #include "kabprefs.h" |
55 | #include "filtereditdialog.h" | 55 | #include "filtereditdialog.h" |
56 | 56 | ||
57 | FilterEditDialog::FilterEditDialog( QWidget *parent, const char *name ) | 57 | FilterEditDialog::FilterEditDialog( QWidget *parent, const char *name ) |
58 | : KDialogBase( Plain, i18n( "Edit Address Book Filter" ), | 58 | : KDialogBase( Plain, i18n( "Edit Address Book Filter" ), |
59 | Help | Ok | Cancel, Ok, parent, name, /*US false*/ true, true ) | 59 | Help | Ok | Cancel, Ok, parent, name, /*US false*/ true, true ) |
60 | { | 60 | { |
61 | initGUI(); | 61 | initGUI(); |
62 | 62 | ||
63 | QStringList cats = KABPrefs::instance()->mCustomCategories; | 63 | QStringList cats = KABPrefs::instance()->mCustomCategories; |
64 | 64 | ||
65 | QStringList::Iterator iter; | 65 | QStringList::Iterator iter; |
66 | for ( iter = cats.begin(); iter != cats.end(); ++iter ) | 66 | for ( iter = cats.begin(); iter != cats.end(); ++iter ) |
67 | mCategoriesView->insertItem( new QCheckListItem( mCategoriesView, (*iter), QCheckListItem::CheckBox ) ); | 67 | mCategoriesView->insertItem( new QCheckListItem( mCategoriesView, (*iter), QCheckListItem::CheckBox ) ); |
68 | filterNameTextChanged( mNameEdit->text() ); | 68 | filterNameTextChanged( mNameEdit->text() ); |
69 | } | 69 | } |
70 | 70 | ||
71 | FilterEditDialog::~FilterEditDialog() | 71 | FilterEditDialog::~FilterEditDialog() |
72 | { | 72 | { |
73 | } | 73 | } |
74 | 74 | ||
75 | void FilterEditDialog::setFilter( const Filter &filter ) | 75 | void FilterEditDialog::setFilter( const Filter &filter ) |
76 | { | 76 | { |
77 | mNameEdit->setText( filter.name() ); | 77 | mNameEdit->setText( filter.name() ); |
78 | 78 | ||
79 | QStringList categories = filter.categories(); | 79 | QStringList categories = filter.categories(); |
80 | QListViewItem *item = mCategoriesView->firstChild(); | 80 | QListViewItem *item = mCategoriesView->firstChild(); |
81 | while ( item != 0 ) { | 81 | while ( item != 0 ) { |
82 | if ( categories.contains( item->text( 0 ) ) ) { | 82 | if ( categories.contains( item->text( 0 ) ) ) { |
83 | QCheckListItem *checkItem = static_cast<QCheckListItem*>( item ); | 83 | QCheckListItem *checkItem = static_cast<QCheckListItem*>( item ); |
84 | checkItem->setOn( true ); | 84 | checkItem->setOn( true ); |
85 | } | 85 | } |
86 | 86 | ||
87 | item = item->nextSibling(); | 87 | item = item->nextSibling(); |
88 | } | 88 | } |
89 | 89 | ||
90 | if ( filter.matchRule() == Filter::Matching ) | 90 | if ( filter.matchRule() == Filter::Matching ) |
91 | mMatchRuleGroup->setButton( 0 ); | 91 | mMatchRuleGroup->setButton( 0 ); |
92 | else | 92 | else |
93 | mMatchRuleGroup->setButton( 1 ); | 93 | mMatchRuleGroup->setButton( 1 ); |
94 | 94 | ||
95 | int c = filter.criteria() ; | 95 | int c = filter.criteria() ; |
96 | mPublic->setChecked(c &Filter::ShowPublic); | 96 | mPublic->setChecked(c &Filter::ShowPublic); |
97 | mPrivate->setChecked(c & Filter::ShowPrivate); | 97 | mPrivate->setChecked(c & Filter::ShowPrivate); |
98 | mConfidential->setChecked(c & Filter::ShowConfidential); | 98 | mConfidential->setChecked(c & Filter::ShowConfidential); |
99 | } | 99 | } |
100 | 100 | ||
101 | Filter FilterEditDialog::filter() | 101 | Filter FilterEditDialog::filter() |
102 | { | 102 | { |
103 | Filter filter; | 103 | Filter filter; |
104 | 104 | ||
105 | filter.setName( mNameEdit->text() ); | 105 | filter.setName( mNameEdit->text() ); |
106 | 106 | ||
107 | QStringList categories; | 107 | QStringList categories; |
108 | QListViewItem *item = mCategoriesView->firstChild(); | 108 | QListViewItem *item = mCategoriesView->firstChild(); |
109 | while ( item != 0 ) { | 109 | while ( item != 0 ) { |
110 | QCheckListItem *checkItem = static_cast<QCheckListItem*>( item ); | 110 | QCheckListItem *checkItem = static_cast<QCheckListItem*>( item ); |
111 | if ( checkItem->isOn() ) | 111 | if ( checkItem->isOn() ) |
112 | categories.append( item->text( 0 ) ); | 112 | categories.append( item->text( 0 ) ); |
113 | 113 | ||
114 | item = item->nextSibling(); | 114 | item = item->nextSibling(); |
115 | } | 115 | } |
116 | filter.setCategories( categories ); | 116 | filter.setCategories( categories ); |
117 | 117 | ||
118 | if ( mMatchRuleGroup->find( 0 )->isOn() ) | 118 | if ( mMatchRuleGroup->find( 0 )->isOn() ) |
119 | filter.setMatchRule( Filter::Matching ); | 119 | filter.setMatchRule( Filter::Matching ); |
120 | else | 120 | else |
121 | filter.setMatchRule( Filter::NotMatching ); | 121 | filter.setMatchRule( Filter::NotMatching ); |
122 | 122 | ||
123 | int c = 0; | 123 | int c = 0; |
124 | if (mPublic->isChecked()) c |= Filter::ShowPublic; | 124 | if (mPublic->isChecked()) c |= Filter::ShowPublic; |
125 | if (mPrivate->isChecked()) c |= Filter::ShowPrivate; | 125 | if (mPrivate->isChecked()) c |= Filter::ShowPrivate; |
126 | if (mConfidential->isChecked()) c |= Filter::ShowConfidential; | 126 | if (mConfidential->isChecked()) c |= Filter::ShowConfidential; |
127 | filter.setCriteria( c ) ; | 127 | filter.setCriteria( c ) ; |
128 | 128 | ||
129 | return filter; | 129 | return filter; |
130 | } | 130 | } |
131 | 131 | ||
132 | void FilterEditDialog::initGUI() | 132 | void FilterEditDialog::initGUI() |
133 | { | 133 | { |
134 | #ifndef KAB_EMBEDDED | 134 | #ifndef KAB_EMBEDDED |
135 | resize( 490, 300 ); | 135 | resize( 490, 300 ); |
136 | #else //KAB_EMBEDDED | 136 | #else //KAB_EMBEDDED |
137 | resize( KMIN(KGlobal::getDesktopWidth()-10, 490), KMIN(KGlobal::getDesktopHeight()-50, 300)); | 137 | resize( KMIN(KGlobal::getDesktopWidth()-10, 490), KMIN(KGlobal::getDesktopHeight()-50, 300)); |
138 | #endif //KAB_EMBEDDED | 138 | #endif //KAB_EMBEDDED |
139 | 139 | ||
140 | 140 | ||
141 | QWidget *page = plainPage(); | 141 | QWidget *page = plainPage(); |
142 | QLabel *label; | 142 | QLabel *label; |
143 | 143 | ||
144 | QGridLayout *topLayout = new QGridLayout( page, 3, 2, 0, spacingHint() ); | 144 | QGridLayout *topLayout = new QGridLayout( page, 3, 2, 0, spacingHint() ); |
145 | 145 | ||
146 | label = new QLabel( i18n( "Name" ), page ); | 146 | label = new QLabel( i18n( "Name" ), page ); |
147 | mNameEdit = new KLineEdit( page ); | 147 | mNameEdit = new KLineEdit( page ); |
148 | mNameEdit->setFocus(); | 148 | mNameEdit->setFocus(); |
149 | topLayout->addWidget( label, 0, 0 ); | 149 | topLayout->addWidget( label, 0, 0 ); |
150 | topLayout->addWidget( mNameEdit, 0, 1 ); | 150 | topLayout->addWidget( mNameEdit, 0, 1 ); |
151 | connect( mNameEdit, SIGNAL( textChanged( const QString& ) ), | 151 | connect( mNameEdit, SIGNAL( textChanged( const QString& ) ), |
152 | SLOT( filterNameTextChanged( const QString&) ) ); | 152 | SLOT( filterNameTextChanged( const QString&) ) ); |
153 | 153 | ||
154 | mCategoriesView = new KListView( page ); | 154 | mCategoriesView = new KListView( page ); |
155 | mCategoriesView->addColumn( i18n( "Categories" ) ); | 155 | mCategoriesView->addColumn( i18n( "Categories" ) ); |
156 | topLayout->addMultiCellWidget( mCategoriesView, 1, 1, 0, 1 ); | 156 | topLayout->addMultiCellWidget( mCategoriesView, 1, 1, 0, 1 ); |
157 | 157 | ||
158 | mMatchRuleGroup = new QHButtonGroup( i18n( "Category rule" ), page ); | 158 | mMatchRuleGroup = new QHButtonGroup( i18n( "Category rule" ), page ); |
159 | mMatchRuleGroup->setExclusive( true ); | 159 | mMatchRuleGroup->setExclusive( true ); |
160 | QRadioButton *radio = new QRadioButton( i18n( "Include categories" ), mMatchRuleGroup ); | 160 | QRadioButton *radio = new QRadioButton( i18n( "Include categories" ), mMatchRuleGroup ); |
161 | radio->setChecked( true ); | ||
162 | //mMatchRuleGroup->insert( radio ); | 161 | //mMatchRuleGroup->insert( radio ); |
163 | radio = new QRadioButton( i18n( "Exclude categories" ), mMatchRuleGroup ); | 162 | radio = new QRadioButton( i18n( "Exclude categories" ), mMatchRuleGroup ); |
163 | radio->setChecked( true ); | ||
164 | //mMatchRuleGroup->insert( radio ); | 164 | //mMatchRuleGroup->insert( radio ); |
165 | topLayout->addMultiCellWidget( mMatchRuleGroup, 2, 2, 0, 1 ); | 165 | topLayout->addMultiCellWidget( mMatchRuleGroup, 2, 2, 0, 1 ); |
166 | 166 | ||
167 | QHButtonGroup * mMatchPPCGroup = new QHButtonGroup(i18n( "Include contacts, that are:" ), page ); | 167 | QHButtonGroup * mMatchPPCGroup = new QHButtonGroup(i18n( "Include contacts, that are:" ), page ); |
168 | mPublic = new QCheckBox( i18n( "public" ), mMatchPPCGroup ); | 168 | mPublic = new QCheckBox( i18n( "public" ), mMatchPPCGroup ); |
169 | mPrivate = new QCheckBox( i18n( "private" ), mMatchPPCGroup ); | 169 | mPrivate = new QCheckBox( i18n( "private" ), mMatchPPCGroup ); |
170 | mConfidential = new QCheckBox( i18n( "confidential" ), mMatchPPCGroup ); | 170 | mConfidential = new QCheckBox( i18n( "confidential" ), mMatchPPCGroup ); |
171 | mPublic->setChecked( true ); | 171 | mPublic->setChecked( true ); |
172 | mPrivate->setChecked( true ); | 172 | mPrivate->setChecked( true ); |
173 | mConfidential->setChecked( true ); | 173 | mConfidential->setChecked( true ); |
174 | topLayout->addMultiCellWidget( mMatchPPCGroup, 3, 3, 0, 1 ); | 174 | topLayout->addMultiCellWidget( mMatchPPCGroup, 3, 3, 0, 1 ); |
175 | 175 | ||
176 | } | 176 | } |
177 | 177 | ||
178 | void FilterEditDialog::filterNameTextChanged( const QString &text ) | 178 | void FilterEditDialog::filterNameTextChanged( const QString &text ) |
179 | { | 179 | { |
180 | enableButtonOK( !text.isEmpty() ); | 180 | enableButtonOK( !text.isEmpty() ); |
181 | } | 181 | } |
182 | 182 | ||
183 | void FilterEditDialog::slotHelp() | 183 | void FilterEditDialog::slotHelp() |
184 | { | 184 | { |
185 | #ifndef KAB_EMBEDDED | 185 | #ifndef KAB_EMBEDDED |
186 | kapp->invokeHelp( "using-filters" ); | 186 | kapp->invokeHelp( "using-filters" ); |
187 | #endif //KAB_EMBEDDED | 187 | #endif //KAB_EMBEDDED |
188 | } | 188 | } |
189 | 189 | ||
190 | FilterDialog::FilterDialog( QWidget *parent, const char *name ) | 190 | FilterDialog::FilterDialog( QWidget *parent, const char *name ) |
191 | : KDialogBase( Plain, i18n( "Edit Address Book Filters" ), | 191 | : KDialogBase( Plain, i18n( "Edit Address Book Filters" ), |
192 | Ok | Cancel, Ok, parent, name, /*US false*/true, true ) | 192 | Ok | Cancel, Ok, parent, name, /*US false*/true, true ) |
193 | { | 193 | { |
194 | initGUI(); | 194 | initGUI(); |
195 | } | 195 | } |
196 | 196 | ||
197 | FilterDialog::~FilterDialog() | 197 | FilterDialog::~FilterDialog() |
198 | { | 198 | { |
199 | } | 199 | } |
200 | 200 | ||
201 | void FilterDialog::setFilters( const Filter::List &list ) | 201 | void FilterDialog::setFilters( const Filter::List &list ) |
202 | { | 202 | { |
203 | mFilterList.clear(); | 203 | mFilterList.clear(); |
204 | mInternalFilterList.clear(); | 204 | mInternalFilterList.clear(); |
205 | 205 | ||
206 | Filter::List::ConstIterator it; | 206 | Filter::List::ConstIterator it; |
207 | for ( it = list.begin(); it != list.end(); ++it ) { | 207 | for ( it = list.begin(); it != list.end(); ++it ) { |
208 | if ( (*it).isInternal() ) | 208 | if ( (*it).isInternal() ) |
209 | mInternalFilterList.append( *it ); | 209 | mInternalFilterList.append( *it ); |
210 | else | 210 | else |
211 | mFilterList.append( *it ); | 211 | mFilterList.append( *it ); |
212 | } | 212 | } |
213 | 213 | ||
214 | refresh(); | 214 | refresh(); |
215 | } | 215 | } |
216 | 216 | ||
217 | Filter::List FilterDialog::filters() const | 217 | Filter::List FilterDialog::filters() const |
218 | { | 218 | { |
219 | Filter::List list = mFilterList + mInternalFilterList; | 219 | Filter::List list = mFilterList + mInternalFilterList; |
220 | return list; | 220 | return list; |
221 | } | 221 | } |
222 | 222 | ||
223 | void FilterDialog::add() | 223 | void FilterDialog::add() |
224 | { | 224 | { |
225 | #ifndef KAB_EMBEDDED | 225 | #ifndef KAB_EMBEDDED |
226 | FilterEditDialog dlg( this ); | 226 | FilterEditDialog dlg( this ); |
227 | #else //KAB_EMBEDDED | 227 | #else //KAB_EMBEDDED |
228 | FilterEditDialog dlg( this->parentWidget() ); | 228 | FilterEditDialog dlg( this->parentWidget() ); |
229 | #endif //KAB_EMBEDDED | 229 | #endif //KAB_EMBEDDED |
230 | 230 | ||
231 | if ( dlg.exec() ) | 231 | if ( dlg.exec() ) |
232 | mFilterList.append( dlg.filter() ); | 232 | mFilterList.append( dlg.filter() ); |
233 | 233 | ||
234 | refresh(); | 234 | refresh(); |
235 | 235 | ||
236 | mFilterListBox->setCurrentItem( mFilterListBox->count() - 1 ); | 236 | mFilterListBox->setCurrentItem( mFilterListBox->count() - 1 ); |
237 | } | 237 | } |
238 | 238 | ||
239 | void FilterDialog::edit() | 239 | void FilterDialog::edit() |
240 | { | 240 | { |
241 | FilterEditDialog dlg( this ); | 241 | FilterEditDialog dlg( this ); |
242 | 242 | ||
243 | uint pos = mFilterListBox->currentItem(); | 243 | uint pos = mFilterListBox->currentItem(); |
244 | 244 | ||
245 | dlg.setFilter( mFilterList[ pos ] ); | 245 | dlg.setFilter( mFilterList[ pos ] ); |
246 | 246 | ||
247 | if ( dlg.exec() ) { | 247 | if ( dlg.exec() ) { |
248 | mFilterList.remove( mFilterList.at( pos ) ); | 248 | mFilterList.remove( mFilterList.at( pos ) ); |
249 | mFilterList.insert( mFilterList.at( pos ), dlg.filter() ); | 249 | mFilterList.insert( mFilterList.at( pos ), dlg.filter() ); |
250 | } | 250 | } |
251 | 251 | ||
252 | refresh(); | 252 | refresh(); |
253 | 253 | ||
254 | mFilterListBox->setCurrentItem( pos ); | 254 | mFilterListBox->setCurrentItem( pos ); |
255 | } | 255 | } |
256 | 256 | ||
257 | void FilterDialog::remove() | 257 | void FilterDialog::remove() |
258 | { | 258 | { |
259 | mFilterList.remove( mFilterList.at( mFilterListBox->currentItem() ) ); | 259 | mFilterList.remove( mFilterList.at( mFilterListBox->currentItem() ) ); |
260 | 260 | ||
261 | selectionChanged( 0 ); | 261 | selectionChanged( 0 ); |
262 | 262 | ||
263 | refresh(); | 263 | refresh(); |
264 | } | 264 | } |
265 | 265 | ||
266 | void FilterDialog::refresh() | 266 | void FilterDialog::refresh() |
267 | { | 267 | { |
268 | mFilterListBox->clear(); | 268 | mFilterListBox->clear(); |
269 | 269 | ||
270 | Filter::List::Iterator iter; | 270 | Filter::List::Iterator iter; |
271 | for ( iter = mFilterList.begin(); iter != mFilterList.end(); ++iter ) | 271 | for ( iter = mFilterList.begin(); iter != mFilterList.end(); ++iter ) |
272 | mFilterListBox->insertItem( (*iter).name() ); | 272 | mFilterListBox->insertItem( (*iter).name() ); |
273 | } | 273 | } |
274 | 274 | ||
275 | void FilterDialog::selectionChanged( QListBoxItem *item ) | 275 | void FilterDialog::selectionChanged( QListBoxItem *item ) |
276 | { | 276 | { |
277 | bool state = ( item != 0 ); | 277 | bool state = ( item != 0 ); |
278 | 278 | ||
279 | mEditButton->setEnabled( state ); | 279 | mEditButton->setEnabled( state ); |
280 | mRemoveButton->setEnabled( state ); | 280 | mRemoveButton->setEnabled( state ); |
281 | } | 281 | } |
282 | 282 | ||
283 | void FilterDialog::initGUI() | 283 | void FilterDialog::initGUI() |
284 | { | 284 | { |
285 | #ifndef KAB_EMBEDDED | 285 | #ifndef KAB_EMBEDDED |
286 | resize( 330, 200 ); | 286 | resize( 330, 200 ); |
287 | #else //KAB_EMBEDDED | 287 | #else //KAB_EMBEDDED |
288 | resize( KMIN(KGlobal::getDesktopWidth()-10, 330), KMIN(KGlobal::getDesktopHeight()-50, 200)); | 288 | resize( KMIN(KGlobal::getDesktopWidth()-10, 330), KMIN(KGlobal::getDesktopHeight()-50, 200)); |
289 | #endif //KAB_EMBEDDED | 289 | #endif //KAB_EMBEDDED |
290 | 290 | ||
291 | QWidget *page = plainPage(); | 291 | QWidget *page = plainPage(); |
292 | 292 | ||
293 | QGridLayout *topLayout = new QGridLayout( page, 1, 2, 0, spacingHint() ); | 293 | QGridLayout *topLayout = new QGridLayout( page, 1, 2, 0, spacingHint() ); |
294 | 294 | ||
295 | mFilterListBox = new KListBox( page ); | 295 | mFilterListBox = new KListBox( page ); |
296 | topLayout->addWidget( mFilterListBox, 0, 0 ); | 296 | topLayout->addWidget( mFilterListBox, 0, 0 ); |
297 | connect( mFilterListBox, SIGNAL( selectionChanged( QListBoxItem * ) ), | 297 | connect( mFilterListBox, SIGNAL( selectionChanged( QListBoxItem * ) ), |
298 | SLOT( selectionChanged( QListBoxItem * ) ) ); | 298 | SLOT( selectionChanged( QListBoxItem * ) ) ); |
299 | connect( mFilterListBox, SIGNAL( doubleClicked ( QListBoxItem * ) ), | 299 | connect( mFilterListBox, SIGNAL( doubleClicked ( QListBoxItem * ) ), |
300 | SLOT( edit() ) ); | 300 | SLOT( edit() ) ); |
301 | 301 | ||
302 | KButtonBox *buttonBox = new KButtonBox( page, Vertical ); | 302 | KButtonBox *buttonBox = new KButtonBox( page, Vertical ); |
303 | buttonBox->addButton( i18n( "&Add..." ), this, SLOT( add() ) ); | 303 | buttonBox->addButton( i18n( "&Add..." ), this, SLOT( add() ) ); |
304 | mEditButton = buttonBox->addButton( i18n( "&Edit..." ), this, SLOT( edit() ) ); | 304 | mEditButton = buttonBox->addButton( i18n( "&Edit..." ), this, SLOT( edit() ) ); |
305 | mEditButton->setEnabled( false ); | 305 | mEditButton->setEnabled( false ); |
306 | mRemoveButton = buttonBox->addButton( i18n( "&Remove" ), this, SLOT( remove() ) ); | 306 | mRemoveButton = buttonBox->addButton( i18n( "&Remove" ), this, SLOT( remove() ) ); |
307 | mRemoveButton->setEnabled( false ); | 307 | mRemoveButton->setEnabled( false ); |
308 | 308 | ||
309 | buttonBox->layout(); | 309 | buttonBox->layout(); |
310 | topLayout->addWidget( buttonBox, 0, 1 ); | 310 | topLayout->addWidget( buttonBox, 0, 1 ); |
311 | } | 311 | } |
312 | 312 | ||
313 | #ifndef KAB_EMBEDDED | 313 | #ifndef KAB_EMBEDDED |
314 | #include "filtereditdialog.moc" | 314 | #include "filtereditdialog.moc" |
315 | #endif //KAB_EMBEDDED | 315 | #endif //KAB_EMBEDDED |
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index e8f6132..59aa5a5 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -2997,339 +2997,342 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo | |||
2997 | inL = inR; | 2997 | inL = inR; |
2998 | inL.setIDStr( idS ); | 2998 | inL.setIDStr( idS ); |
2999 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 2999 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
3000 | inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); | 3000 | inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); |
3001 | inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); | 3001 | inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); |
3002 | } | 3002 | } |
3003 | inL.setResource( 0 ); | 3003 | inL.setResource( 0 ); |
3004 | local->insertAddressee( inL , false ); | 3004 | local->insertAddressee( inL , false ); |
3005 | ++changedLocal; | 3005 | ++changedLocal; |
3006 | } | 3006 | } |
3007 | } | 3007 | } |
3008 | } | 3008 | } |
3009 | } else { // no conflict ********** add or delete remote | 3009 | } else { // no conflict ********** add or delete remote |
3010 | if ( filterIN.name().isEmpty() || filterIN.filterAddressee( inR ) ) { | 3010 | if ( filterIN.name().isEmpty() || filterIN.filterAddressee( inR ) ) { |
3011 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 3011 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
3012 | QString des = addresseeLSync.note(); | 3012 | QString des = addresseeLSync.note(); |
3013 | if ( des.find( inR.getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it | 3013 | if ( des.find( inR.getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it |
3014 | inR.setTempSyncStat( SYNC_TEMPSTATE_DELETE ); | 3014 | inR.setTempSyncStat( SYNC_TEMPSTATE_DELETE ); |
3015 | remote->insertAddressee( inR, false ); | 3015 | remote->insertAddressee( inR, false ); |
3016 | ++deletedAddresseeR; | 3016 | ++deletedAddresseeR; |
3017 | } else { | 3017 | } else { |
3018 | inR.setRevision( modifiedCalendar ); | 3018 | inR.setRevision( modifiedCalendar ); |
3019 | remote->insertAddressee( inR, false ); | 3019 | remote->insertAddressee( inR, false ); |
3020 | inL = inR; | 3020 | inL = inR; |
3021 | inL.setIDStr( ":" ); | 3021 | inL.setIDStr( ":" ); |
3022 | inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); | 3022 | inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); |
3023 | inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); | 3023 | inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); |
3024 | inL.setResource( 0 ); | 3024 | inL.setResource( 0 ); |
3025 | local->insertAddressee( inL , false); | 3025 | local->insertAddressee( inL , false); |
3026 | ++addedAddressee; | 3026 | ++addedAddressee; |
3027 | } | 3027 | } |
3028 | } else { | 3028 | } else { |
3029 | if ( inR.revision() > mLastAddressbookSync || mode == 5 ) { | 3029 | if ( inR.revision() > mLastAddressbookSync || mode == 5 ) { |
3030 | inR.setRevision( modifiedCalendar ); | 3030 | inR.setRevision( modifiedCalendar ); |
3031 | remote->insertAddressee( inR, false ); | 3031 | remote->insertAddressee( inR, false ); |
3032 | inR.setResource( 0 ); | 3032 | inR.setResource( 0 ); |
3033 | local->insertAddressee( inR, false ); | 3033 | local->insertAddressee( inR, false ); |
3034 | ++addedAddressee; | 3034 | ++addedAddressee; |
3035 | } else { | 3035 | } else { |
3036 | // pending checkExternSyncAddressee(addresseeRSyncSharp, inR); | 3036 | // pending checkExternSyncAddressee(addresseeRSyncSharp, inR); |
3037 | remote->removeAddressee( inR ); | 3037 | remote->removeAddressee( inR ); |
3038 | ++deletedAddresseeR; | 3038 | ++deletedAddresseeR; |
3039 | } | 3039 | } |
3040 | } | 3040 | } |
3041 | } else { | 3041 | } else { |
3042 | ++filteredIN; | 3042 | ++filteredIN; |
3043 | } | 3043 | } |
3044 | } | 3044 | } |
3045 | } | 3045 | } |
3046 | ++incCounter; | 3046 | ++incCounter; |
3047 | } | 3047 | } |
3048 | er.clear(); | 3048 | er.clear(); |
3049 | QStringList el = local->uidList(); | 3049 | QStringList el = local->uidList(); |
3050 | modulo = (el.count()/10)+1; | 3050 | modulo = (el.count()/10)+1; |
3051 | 3051 | ||
3052 | syncManager->showProgressBar(0, i18n("Add / remove addressees"), el.count()); | 3052 | syncManager->showProgressBar(0, i18n("Add / remove addressees"), el.count()); |
3053 | incCounter = 0; | 3053 | incCounter = 0; |
3054 | while ( incCounter < el.count()) { | 3054 | while ( incCounter < el.count()) { |
3055 | qApp->processEvents(); | 3055 | qApp->processEvents(); |
3056 | if (syncManager->isProgressBarCanceled()) | 3056 | if (syncManager->isProgressBarCanceled()) |
3057 | return false; | 3057 | return false; |
3058 | if ( incCounter % modulo == 0 ) | 3058 | if ( incCounter % modulo == 0 ) |
3059 | syncManager->showProgressBar(incCounter); | 3059 | syncManager->showProgressBar(incCounter); |
3060 | uid = el[ incCounter ]; | 3060 | uid = el[ incCounter ]; |
3061 | bool skipIncidence = false; | 3061 | bool skipIncidence = false; |
3062 | if ( uid.left(19) == QString("last-syncAddressee-") ) | 3062 | if ( uid.left(19) == QString("last-syncAddressee-") ) |
3063 | skipIncidence = true; | 3063 | skipIncidence = true; |
3064 | if ( !skipIncidence ) { | 3064 | if ( !skipIncidence ) { |
3065 | inL = local->findByUid( uid ); | 3065 | inL = local->findByUid( uid ); |
3066 | if ( !inL.resource() || inL.resource()->includeInSync() ) { | 3066 | if ( !inL.resource() || inL.resource()->includeInSync() ) { |
3067 | inR = remote->findByUid( uid ); | 3067 | inR = remote->findByUid( uid ); |
3068 | if ( inR.isEmpty() ){ | 3068 | if ( inR.isEmpty() ){ |
3069 | if ( filterOUT.name().isEmpty() || filterOUT.filterAddressee( inL ) ) { | 3069 | if ( filterOUT.name().isEmpty() || filterOUT.filterAddressee( inL ) ) { |
3070 | // no conflict ********** add or delete local | 3070 | // no conflict ********** add or delete local |
3071 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 3071 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
3072 | if ( !inL.getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { | 3072 | if ( !inL.getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { |
3073 | // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); | 3073 | // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); |
3074 | local->removeAddressee( inL ); | 3074 | local->removeAddressee( inL ); |
3075 | ++deletedAddresseeL; | 3075 | ++deletedAddresseeL; |
3076 | } else { | 3076 | } else { |
3077 | if ( ! syncManager->mWriteBackExistingOnly ) { | 3077 | if ( ! syncManager->mWriteBackExistingOnly ) { |
3078 | inL.removeID(mCurrentSyncDevice ); | 3078 | inL.removeID(mCurrentSyncDevice ); |
3079 | ++addedAddresseeR; | 3079 | ++addedAddresseeR; |
3080 | inL.setRevision( modifiedCalendar ); | 3080 | inL.setRevision( modifiedCalendar ); |
3081 | local->insertAddressee( inL, false ); | 3081 | local->insertAddressee( inL, false ); |
3082 | inR = inL; | 3082 | inR = inL; |
3083 | inR.setTempSyncStat( SYNC_TEMPSTATE_ADDED_EXTERNAL ); | 3083 | inR.setTempSyncStat( SYNC_TEMPSTATE_ADDED_EXTERNAL ); |
3084 | inR.setResource( 0 ); | 3084 | inR.setResource( 0 ); |
3085 | remote->insertAddressee( inR, false ); | 3085 | remote->insertAddressee( inR, false ); |
3086 | } | 3086 | } |
3087 | } | 3087 | } |
3088 | } else { | 3088 | } else { |
3089 | if ( inL.revision() < mLastAddressbookSync && mode != 4 ) { | 3089 | if ( inL.revision() < mLastAddressbookSync && mode != 4 ) { |
3090 | //qDebug("data %s ", inL.revision().toString().latin1()); | 3090 | //qDebug("data %s ", inL.revision().toString().latin1()); |
3091 | // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); | 3091 | // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); |
3092 | local->removeAddressee( inL ); | 3092 | local->removeAddressee( inL ); |
3093 | ++deletedAddresseeL; | 3093 | ++deletedAddresseeL; |
3094 | } else { | 3094 | } else { |
3095 | if ( ! syncManager->mWriteBackExistingOnly ) { | 3095 | if ( ! syncManager->mWriteBackExistingOnly ) { |
3096 | ++addedAddresseeR; | 3096 | ++addedAddresseeR; |
3097 | inL.setRevision( modifiedCalendar ); | 3097 | inL.setRevision( modifiedCalendar ); |
3098 | local->insertAddressee( inL, false ); | 3098 | local->insertAddressee( inL, false ); |
3099 | inR = inL; | 3099 | inR = inL; |
3100 | inR.setIDStr( ":" ); | 3100 | inR.setIDStr( ":" ); |
3101 | inR.setResource( 0 ); | 3101 | inR.setResource( 0 ); |
3102 | remote->insertAddressee( inR, false ); | 3102 | remote->insertAddressee( inR, false ); |
3103 | } | 3103 | } |
3104 | } | 3104 | } |
3105 | } | 3105 | } |
3106 | } else { | 3106 | } else { |
3107 | ++filteredOUT; | 3107 | ++filteredOUT; |
3108 | } | 3108 | } |
3109 | } | 3109 | } |
3110 | } | 3110 | } |
3111 | } | 3111 | } |
3112 | ++incCounter; | 3112 | ++incCounter; |
3113 | } | 3113 | } |
3114 | el.clear(); | 3114 | el.clear(); |
3115 | syncManager->hideProgressBar(); | 3115 | syncManager->hideProgressBar(); |
3116 | mLastAddressbookSync = QDateTime::currentDateTime().addSecs( 1 ); | 3116 | mLastAddressbookSync = QDateTime::currentDateTime().addSecs( 1 ); |
3117 | // get rid of micro seconds | 3117 | // get rid of micro seconds |
3118 | QTime t = mLastAddressbookSync.time(); | 3118 | QTime t = mLastAddressbookSync.time(); |
3119 | mLastAddressbookSync.setTime( QTime (t.hour (), t.minute (), t.second () ) ); | 3119 | mLastAddressbookSync.setTime( QTime (t.hour (), t.minute (), t.second () ) ); |
3120 | addresseeLSync.setRevision( mLastAddressbookSync ); | 3120 | addresseeLSync.setRevision( mLastAddressbookSync ); |
3121 | addresseeRSync.setRevision( mLastAddressbookSync ); | 3121 | addresseeRSync.setRevision( mLastAddressbookSync ); |
3122 | addresseeRSync.setRole( i18n("!Remote from: ")+mCurrentSyncName ) ; | 3122 | addresseeRSync.setRole( i18n("!Remote from: ")+mCurrentSyncName ) ; |
3123 | addresseeLSync.setRole(i18n("!Local from: ") + mCurrentSyncName ); | 3123 | addresseeLSync.setRole(i18n("!Local from: ") + mCurrentSyncName ); |
3124 | addresseeRSync.setGivenName( i18n("!DO NOT EDIT!") ) ; | 3124 | addresseeRSync.setGivenName( i18n("!DO NOT EDIT!") ) ; |
3125 | addresseeLSync.setGivenName(i18n("!DO NOT EDIT!") ); | 3125 | addresseeLSync.setGivenName(i18n("!DO NOT EDIT!") ); |
3126 | addresseeRSync.setOrganization( "!"+mLastAddressbookSync.toString() ) ; | 3126 | addresseeRSync.setOrganization( "!"+mLastAddressbookSync.toString() ) ; |
3127 | addresseeLSync.setOrganization("!"+ mLastAddressbookSync.toString() ); | 3127 | addresseeLSync.setOrganization("!"+ mLastAddressbookSync.toString() ); |
3128 | addresseeRSync.setNote( "" ) ; | 3128 | addresseeRSync.setNote( "" ) ; |
3129 | addresseeLSync.setNote( "" ); | 3129 | addresseeLSync.setNote( "" ); |
3130 | 3130 | ||
3131 | if ( mGlobalSyncMode == SYNC_MODE_NORMAL) | 3131 | if ( mGlobalSyncMode == SYNC_MODE_NORMAL) |
3132 | remote->insertAddressee( addresseeRSync, false ); | 3132 | remote->insertAddressee( addresseeRSync, false ); |
3133 | local->insertAddressee( addresseeLSync, false ); | 3133 | local->insertAddressee( addresseeLSync, false ); |
3134 | QString mes; | 3134 | QString mes; |
3135 | mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out"),addedAddressee, addedAddresseeR, changedLocal, changedRemote, deletedAddresseeL, deletedAddresseeR, filteredIN, filteredOUT ); | 3135 | mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out"),addedAddressee, addedAddresseeR, changedLocal, changedRemote, deletedAddresseeL, deletedAddresseeR, filteredIN, filteredOUT ); |
3136 | qDebug( mes ); | 3136 | qDebug( mes ); |
3137 | mes = i18n("Local addressbook changed!\n") +mes; | 3137 | mes = i18n("Local addressbook changed!\n") +mes; |
3138 | if ( syncManager->mShowSyncSummary ) { | 3138 | if ( syncManager->mShowSyncSummary ) { |
3139 | if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, | 3139 | if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, |
3140 | i18n("KA/Pi Synchronization"),i18n("Write back"))) { | 3140 | i18n("KA/Pi Synchronization"),i18n("Write back"))) { |
3141 | qDebug("KA: WB cancelled "); | 3141 | qDebug("KA: WB cancelled "); |
3142 | syncManager->mWriteBackFile = false; | 3142 | syncManager->mWriteBackFile = false; |
3143 | return syncOK; | 3143 | return syncOK; |
3144 | } | 3144 | } |
3145 | } | 3145 | } |
3146 | return syncOK; | 3146 | return syncOK; |
3147 | } | 3147 | } |
3148 | 3148 | ||
3149 | 3149 | ||
3150 | //this is a overwritten callbackmethods from the syncinterface | 3150 | //this is a overwritten callbackmethods from the syncinterface |
3151 | bool KABCore::sync(KSyncManager* manager, QString filename, int mode) | 3151 | bool KABCore::sync(KSyncManager* manager, QString filename, int mode) |
3152 | { | 3152 | { |
3153 | 3153 | ||
3154 | //pending prepare addresseeview for output | 3154 | //pending prepare addresseeview for output |
3155 | //pending detect, if remote file has REV field. if not switch to external sync | 3155 | //pending detect, if remote file has REV field. if not switch to external sync |
3156 | mGlobalSyncMode = SYNC_MODE_NORMAL; | 3156 | mGlobalSyncMode = SYNC_MODE_NORMAL; |
3157 | if ( manager != syncManager ) | 3157 | if ( manager != syncManager ) |
3158 | qDebug("KABCore::sync:: ERROR! :: manager != syncManager "); | 3158 | qDebug("KABCore::sync:: ERROR! :: manager != syncManager "); |
3159 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); | 3159 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); |
3160 | 3160 | ||
3161 | AddressBook abLocal(filename,"syncContact"); | 3161 | AddressBook abLocal(filename,"syncContact"); |
3162 | bool syncOK = false; | 3162 | bool syncOK = false; |
3163 | if ( abLocal.load() ) { | 3163 | if ( abLocal.load() ) { |
3164 | qDebug("KA: Sync::AB loaded %s,sync mode %d",filename.latin1(), mode ); | 3164 | qDebug("KA: Sync::AB loaded %s,sync mode %d",filename.latin1(), mode ); |
3165 | bool external = false; | 3165 | bool external = false; |
3166 | bool isXML = false; | 3166 | bool isXML = false; |
3167 | if ( filename.right(4) == ".xml") { | 3167 | if ( filename.right(4) == ".xml") { |
3168 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 3168 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
3169 | isXML = true; | 3169 | isXML = true; |
3170 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); | 3170 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); |
3171 | } else { | 3171 | } else { |
3172 | external = !manager->mIsKapiFile; | 3172 | external = !manager->mIsKapiFile; |
3173 | if ( external ) { | 3173 | if ( external ) { |
3174 | qDebug("KA: Sync::Setting vcf mode to external "); | 3174 | qDebug("KA: Sync::Setting vcf mode to external "); |
3175 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 3175 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
3176 | AddressBook::Iterator it; | 3176 | AddressBook::Iterator it; |
3177 | for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { | 3177 | for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { |
3178 | (*it).setID( mCurrentSyncDevice, (*it).uid() ); | 3178 | (*it).setID( mCurrentSyncDevice, (*it).uid() ); |
3179 | (*it).computeCsum( mCurrentSyncDevice ); | 3179 | (*it).computeCsum( mCurrentSyncDevice ); |
3180 | } | 3180 | } |
3181 | } | 3181 | } |
3182 | } | 3182 | } |
3183 | //AddressBook::Iterator it; | 3183 | //AddressBook::Iterator it; |
3184 | //QStringList vcards; | 3184 | //QStringList vcards; |
3185 | //for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { | 3185 | //for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { |
3186 | // qDebug("Name %s ", (*it).familyName().latin1()); | 3186 | // qDebug("Name %s ", (*it).familyName().latin1()); |
3187 | //} | 3187 | //} |
3188 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode ); | 3188 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode ); |
3189 | syncManager->hideProgressBar(); | ||
3189 | if ( syncOK ) { | 3190 | if ( syncOK ) { |
3190 | if ( syncManager->mWriteBackFile ) | 3191 | if ( syncManager->mWriteBackFile ) |
3191 | { | 3192 | { |
3192 | if ( external ) | 3193 | if ( external ) |
3193 | abLocal.removeSyncAddressees( !isXML); | 3194 | abLocal.removeSyncAddressees( !isXML); |
3194 | qDebug("KA: Sync::Saving remote AB "); | 3195 | qDebug("KA: Sync::Saving remote AB "); |
3195 | if ( ! abLocal.saveAB()) | 3196 | if ( ! abLocal.saveAB()) |
3196 | qDebug("KA: sync::Error writing back AB to file "); | 3197 | qDebug("KA: sync::Error writing back AB to file "); |
3197 | if ( external ) { | 3198 | if ( external ) { |
3198 | // afterwrite processing | 3199 | // afterwrite processing |
3199 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ,isXML); | 3200 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ,isXML); |
3200 | } | 3201 | } |
3201 | } | 3202 | } |
3202 | } | 3203 | } |
3203 | setModified(); | 3204 | setModified(); |
3204 | 3205 | ||
3205 | } | 3206 | } |
3206 | abLocal.removeResources(); | 3207 | abLocal.removeResources(); |
3207 | if ( syncOK ) | 3208 | if ( syncOK ) |
3208 | mViewManager->refreshView(); | 3209 | mViewManager->refreshView(); |
3209 | return syncOK; | 3210 | return syncOK; |
3210 | 3211 | ||
3211 | } | 3212 | } |
3212 | void KABCore::removeSyncInfo( QString syncProfile) | 3213 | void KABCore::removeSyncInfo( QString syncProfile) |
3213 | { | 3214 | { |
3214 | qDebug("KA: AB:removeSyncInfo for profile %s ", syncProfile.latin1()); | 3215 | qDebug("KA: AB:removeSyncInfo for profile %s ", syncProfile.latin1()); |
3215 | mAddressBook->removeSyncInfo( syncProfile ); | 3216 | mAddressBook->removeSyncInfo( syncProfile ); |
3216 | setModified(); | 3217 | setModified(); |
3217 | } | 3218 | } |
3218 | 3219 | ||
3219 | 3220 | ||
3220 | //this is a overwritten callbackmethods from the syncinterface | 3221 | //this is a overwritten callbackmethods from the syncinterface |
3221 | bool KABCore::syncExternal(KSyncManager* manager, QString resource) | 3222 | bool KABCore::syncExternal(KSyncManager* manager, QString resource) |
3222 | { | 3223 | { |
3223 | if ( resource == "phone" ) | 3224 | if ( resource == "phone" ) |
3224 | return syncPhone(); | 3225 | return syncPhone(); |
3225 | disableBR( true ); | 3226 | disableBR( true ); |
3226 | if ( manager != syncManager ) | 3227 | if ( manager != syncManager ) |
3227 | qDebug("KABCore::syncExternal:: ERROR! :: manager != syncManager "); | 3228 | qDebug("KABCore::syncExternal:: ERROR! :: manager != syncManager "); |
3228 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); | 3229 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); |
3229 | 3230 | ||
3230 | AddressBook abLocal( resource,"syncContact"); | 3231 | AddressBook abLocal( resource,"syncContact"); |
3231 | bool syncOK = false; | 3232 | bool syncOK = false; |
3232 | message(i18n("Loading DTM address data..."), false); | 3233 | message(i18n("Loading DTM address data..."), false); |
3233 | if ( abLocal.load() ) { | 3234 | if ( abLocal.load() ) { |
3234 | qDebug("KA: AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1()); | 3235 | qDebug("KA: AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1()); |
3235 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 3236 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
3236 | message(i18n("Sync preprocessing..."),false); | 3237 | message(i18n("Sync preprocessing..."),false); |
3237 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false ); | 3238 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false ); |
3238 | message(i18n("Synchronizing..."),false); | 3239 | message(i18n("Synchronizing..."),false); |
3239 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); | 3240 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); |
3241 | syncManager->hideProgressBar(); | ||
3240 | if ( syncOK ) { | 3242 | if ( syncOK ) { |
3241 | if ( syncManager->mWriteBackFile ) { | 3243 | if ( syncManager->mWriteBackFile ) { |
3242 | abLocal.removeSyncAddressees( false ); | 3244 | abLocal.removeSyncAddressees( false ); |
3243 | message(i18n("Saving DTM address data..."),false); | 3245 | message(i18n("Saving DTM address data..."),false); |
3244 | abLocal.saveAB(); | 3246 | abLocal.saveAB(); |
3245 | message(i18n("Sync postprocessing..."),false); | 3247 | message(i18n("Sync postprocessing..."),false); |
3246 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); | 3248 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); |
3247 | } | 3249 | } |
3248 | } else | 3250 | } else |
3249 | message( i18n("Sync cancelled or failed.") ); | 3251 | message( i18n("Sync cancelled or failed.") ); |
3250 | setModified(); | 3252 | setModified(); |
3251 | } | 3253 | } |
3252 | abLocal.removeResources(); | 3254 | abLocal.removeResources(); |
3253 | if ( syncOK ) { | 3255 | if ( syncOK ) { |
3254 | mViewManager->refreshView(); | 3256 | mViewManager->refreshView(); |
3255 | message(i18n("DTM syncing finished.")); | 3257 | message(i18n("DTM syncing finished.")); |
3256 | } | 3258 | } |
3257 | disableBR( false ); | 3259 | disableBR( false ); |
3258 | return syncOK; | 3260 | return syncOK; |
3259 | 3261 | ||
3260 | } | 3262 | } |
3261 | void KABCore::message( QString m, bool startTimer) | 3263 | void KABCore::message( QString m, bool startTimer) |
3262 | { | 3264 | { |
3263 | topLevelWidget()->setCaption( m ); | 3265 | topLevelWidget()->setCaption( m ); |
3264 | qApp->processEvents(); | 3266 | qApp->processEvents(); |
3265 | if ( startTimer ) | 3267 | if ( startTimer ) |
3266 | mMessageTimer->start( 15000, true ); | 3268 | mMessageTimer->start( 15000, true ); |
3267 | else | 3269 | else |
3268 | mMessageTimer->stop(); | 3270 | mMessageTimer->stop(); |
3269 | } | 3271 | } |
3270 | bool KABCore::syncPhone() | 3272 | bool KABCore::syncPhone() |
3271 | { | 3273 | { |
3272 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); | 3274 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); |
3273 | QString fileName = getPhoneFile(); | 3275 | QString fileName = getPhoneFile(); |
3274 | if ( !PhoneAccess::readFromPhone( fileName) ) { | 3276 | if ( !PhoneAccess::readFromPhone( fileName) ) { |
3275 | message(i18n("Phone access failed!")); | 3277 | message(i18n("Phone access failed!")); |
3276 | return false; | 3278 | return false; |
3277 | } | 3279 | } |
3278 | AddressBook abLocal( fileName,"syncContact"); | 3280 | AddressBook abLocal( fileName,"syncContact"); |
3279 | bool syncOK = false; | 3281 | bool syncOK = false; |
3280 | { | 3282 | { |
3281 | abLocal.importFromFile( fileName ); | 3283 | abLocal.importFromFile( fileName ); |
3282 | qDebug("KA: AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1()); | 3284 | qDebug("KA: AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1()); |
3283 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 3285 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
3284 | abLocal.preparePhoneSync( mCurrentSyncDevice, true ); | 3286 | abLocal.preparePhoneSync( mCurrentSyncDevice, true ); |
3285 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); | 3287 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); |
3286 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); | 3288 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); |
3289 | syncManager->hideProgressBar(); | ||
3287 | if ( syncOK ) { | 3290 | if ( syncOK ) { |
3288 | if ( syncManager->mWriteBackFile ) { | 3291 | if ( syncManager->mWriteBackFile ) { |
3289 | abLocal.removeSyncAddressees( true ); | 3292 | abLocal.removeSyncAddressees( true ); |
3290 | abLocal.saveABphone( fileName ); | 3293 | abLocal.saveABphone( fileName ); |
3291 | abLocal.findNewExtIds( fileName, mCurrentSyncDevice ); | 3294 | abLocal.findNewExtIds( fileName, mCurrentSyncDevice ); |
3292 | //abLocal.preparePhoneSync( mCurrentSyncDevice, false ); | 3295 | //abLocal.preparePhoneSync( mCurrentSyncDevice, false ); |
3293 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); | 3296 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); |
3294 | } | 3297 | } |
3295 | } | 3298 | } |
3296 | setModified(); | 3299 | setModified(); |
3297 | } | 3300 | } |
3298 | abLocal.removeResources(); | 3301 | abLocal.removeResources(); |
3299 | if ( syncOK ) | 3302 | if ( syncOK ) |
3300 | mViewManager->refreshView(); | 3303 | mViewManager->refreshView(); |
3301 | return syncOK; | 3304 | return syncOK; |
3302 | } | 3305 | } |
3303 | void KABCore::getFile( bool success ) | 3306 | void KABCore::getFile( bool success ) |
3304 | { | 3307 | { |
3305 | if ( ! success ) { | 3308 | if ( ! success ) { |
3306 | message( i18n("Error receiving file. Nothing changed!") ); | 3309 | message( i18n("Error receiving file. Nothing changed!") ); |
3307 | return; | 3310 | return; |
3308 | } | 3311 | } |
3309 | int count = mAddressBook->importFromFile( sentSyncFile() , false, true ); | 3312 | int count = mAddressBook->importFromFile( sentSyncFile() , false, true ); |
3310 | if ( count ) | 3313 | if ( count ) |
3311 | setModified( true ); | 3314 | setModified( true ); |
3312 | message( i18n("Pi-Sync successful!") ); | 3315 | message( i18n("Pi-Sync successful!") ); |
3313 | mViewManager->refreshView(); | 3316 | mViewManager->refreshView(); |
3314 | } | 3317 | } |
3315 | void KABCore::syncFileRequest() | 3318 | void KABCore::syncFileRequest() |
3316 | { | 3319 | { |
3317 | if ( KABPrefs::instance()->mPassiveSyncWithDesktop ) { | 3320 | if ( KABPrefs::instance()->mPassiveSyncWithDesktop ) { |
3318 | syncManager->slotSyncMenu( 999 ); | 3321 | syncManager->slotSyncMenu( 999 ); |
3319 | } | 3322 | } |
3320 | mAddressBook->export2File( sentSyncFile() ); | 3323 | mAddressBook->export2File( sentSyncFile() ); |
3321 | } | 3324 | } |
3322 | QString KABCore::sentSyncFile() | 3325 | QString KABCore::sentSyncFile() |
3323 | { | 3326 | { |
3324 | #ifdef DESKTOP_VERSION | 3327 | #ifdef DESKTOP_VERSION |
3325 | return locateLocal( "tmp", "copysyncab.vcf" ); | 3328 | return locateLocal( "tmp", "copysyncab.vcf" ); |
3326 | #else | 3329 | #else |
3327 | return QString( "/tmp/copysyncab.vcf" ); | 3330 | return QString( "/tmp/copysyncab.vcf" ); |
3328 | #endif | 3331 | #endif |
3329 | } | 3332 | } |
3330 | 3333 | ||
3331 | void KABCore::setCaptionBack() | 3334 | void KABCore::setCaptionBack() |
3332 | { | 3335 | { |
3333 | mMessageTimer->stop(); | 3336 | mMessageTimer->stop(); |
3334 | topLevelWidget()->setCaption( i18n("KAddressbook/Pi") ); | 3337 | topLevelWidget()->setCaption( i18n("KAddressbook/Pi") ); |
3335 | } | 3338 | } |
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index 5420822..2820ca2 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp | |||
@@ -359,384 +359,387 @@ void KOAgenda::changeColumns(int columns) | |||
359 | //QApplication::sendEvent( this, &event ); | 359 | //QApplication::sendEvent( this, &event ); |
360 | } | 360 | } |
361 | 361 | ||
362 | /* | 362 | /* |
363 | This is the eventFilter function, which gets all events from the KOAgendaItems | 363 | This is the eventFilter function, which gets all events from the KOAgendaItems |
364 | contained in the agenda. It has to handle moving and resizing for all items. | 364 | contained in the agenda. It has to handle moving and resizing for all items. |
365 | */ | 365 | */ |
366 | bool KOAgenda::eventFilter ( QObject *object, QEvent *event ) | 366 | bool KOAgenda::eventFilter ( QObject *object, QEvent *event ) |
367 | { | 367 | { |
368 | // kdDebug() << "KOAgenda::eventFilter" << endl; | 368 | // kdDebug() << "KOAgenda::eventFilter" << endl; |
369 | switch(event->type()) { | 369 | switch(event->type()) { |
370 | case QEvent::MouseButtonPress: | 370 | case QEvent::MouseButtonPress: |
371 | case QEvent::MouseButtonDblClick: | 371 | case QEvent::MouseButtonDblClick: |
372 | case QEvent::MouseButtonRelease: | 372 | case QEvent::MouseButtonRelease: |
373 | case QEvent::MouseMove: | 373 | case QEvent::MouseMove: |
374 | return eventFilter_mouse(object, static_cast<QMouseEvent *>(event)); | 374 | return eventFilter_mouse(object, static_cast<QMouseEvent *>(event)); |
375 | 375 | ||
376 | case (QEvent::Leave): | 376 | case (QEvent::Leave): |
377 | if (!mActionItem) | 377 | if (!mActionItem) |
378 | setCursor(arrowCursor); | 378 | setCursor(arrowCursor); |
379 | return true; | 379 | return true; |
380 | 380 | ||
381 | default: | 381 | default: |
382 | return QScrollView::eventFilter(object,event); | 382 | return QScrollView::eventFilter(object,event); |
383 | } | 383 | } |
384 | } | 384 | } |
385 | 385 | ||
386 | 386 | ||
387 | bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) | 387 | bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) |
388 | { | 388 | { |
389 | //qDebug("KOAgenda::eventFilter_mous "); | 389 | //qDebug("KOAgenda::eventFilter_mous "); |
390 | QPoint viewportPos; | 390 | QPoint viewportPos; |
391 | if (object != viewport()) { | 391 | if (object != viewport()) { |
392 | viewportPos = ((QWidget *)object)->mapToParent(me->pos()); | 392 | viewportPos = ((QWidget *)object)->mapToParent(me->pos()); |
393 | } else { | 393 | } else { |
394 | viewportPos = me->pos(); | 394 | viewportPos = me->pos(); |
395 | } | 395 | } |
396 | static int startX = 0; | 396 | static int startX = 0; |
397 | static int startY = 0; | 397 | static int startY = 0; |
398 | static int blockmoveDist = ( QApplication::desktop()->width() < 480 ? 15 : 20 ); | 398 | static int blockmoveDist = ( QApplication::desktop()->width() < 480 ? 15 : 20 ); |
399 | static bool blockMoving = true; | 399 | static bool blockMoving = true; |
400 | static bool leftMouseDown = false; | 400 | static bool leftMouseDown = false; |
401 | static bool rightMouseDown = false; | 401 | static bool rightMouseDown = false; |
402 | static QTime rightClickTime; | 402 | static QTime rightClickTime; |
403 | bool rightButtonPressed = false; | 403 | bool rightButtonPressed = false; |
404 | switch (me->type()) { | 404 | switch (me->type()) { |
405 | case QEvent::MouseButtonPress: | 405 | case QEvent::MouseButtonPress: |
406 | rightClickTime.restart(); | 406 | rightClickTime.restart(); |
407 | if (me->button() == LeftButton) { | 407 | if (me->button() == LeftButton) { |
408 | leftMouseDown = true; | 408 | leftMouseDown = true; |
409 | } | 409 | } |
410 | else if (me->button() == RightButton) | 410 | else if (me->button() == RightButton) |
411 | rightMouseDown = true; | 411 | rightMouseDown = true; |
412 | blockMoving = true; | 412 | blockMoving = true; |
413 | startX = viewportPos.x(); | 413 | startX = viewportPos.x(); |
414 | startY = viewportPos.y(); | 414 | startY = viewportPos.y(); |
415 | if (object != viewport()) { | 415 | if (object != viewport()) { |
416 | if (me->button() == RightButton) { | 416 | if (me->button() == RightButton) { |
417 | mClickedItem = (KOAgendaItem *)object; | 417 | mClickedItem = (KOAgendaItem *)object; |
418 | if (mClickedItem) { | 418 | if (mClickedItem) { |
419 | selectItem(mClickedItem); | 419 | selectItem(mClickedItem); |
420 | } | 420 | } |
421 | } else if (me->button() == LeftButton) { | 421 | } else if (me->button() == LeftButton) { |
422 | mActionItem = (KOAgendaItem *)object; | 422 | mActionItem = (KOAgendaItem *)object; |
423 | if (mActionItem) { | 423 | if (mActionItem) { |
424 | if ( mSelectionHeight > 0 ) { | 424 | if ( mSelectionHeight > 0 ) { |
425 | int selectionCellX = mSelectionCellX * mGridSpacingX; | 425 | int selectionCellX = mSelectionCellX * mGridSpacingX; |
426 | int selectionYTop = mSelectionYTop; | 426 | int selectionYTop = mSelectionYTop; |
427 | int gridSpacingX = mGridSpacingX; | 427 | int gridSpacingX = mGridSpacingX; |
428 | int selectionHeight = mSelectionHeight; | 428 | int selectionHeight = mSelectionHeight; |
429 | clearSelection(); | 429 | clearSelection(); |
430 | repaintContents( selectionCellX, selectionYTop, | 430 | repaintContents( selectionCellX, selectionYTop, |
431 | gridSpacingX, selectionHeight,false ); | 431 | gridSpacingX, selectionHeight,false ); |
432 | } | 432 | } |
433 | selectItem(mActionItem); | 433 | selectItem(mActionItem); |
434 | Incidence *incidence = mActionItem->incidence(); | 434 | Incidence *incidence = mActionItem->incidence(); |
435 | if ( incidence->isReadOnly() /*|| incidence->recurrence()->doesRecur() */) { | 435 | if ( incidence->isReadOnly() /*|| incidence->recurrence()->doesRecur() */) { |
436 | mActionItem = 0; | 436 | mActionItem = 0; |
437 | } else { | 437 | } else { |
438 | startItemAction(viewportPos); | 438 | startItemAction(viewportPos); |
439 | } | 439 | } |
440 | } | 440 | } |
441 | } | 441 | } |
442 | } else { // ---------- viewport() | 442 | } else { // ---------- viewport() |
443 | selectItem(0); | 443 | selectItem(0); |
444 | mActionItem = 0; | 444 | mActionItem = 0; |
445 | if (me->button() == LeftButton ) { | 445 | if (me->button() == LeftButton ) { |
446 | setCursor(arrowCursor); | 446 | setCursor(arrowCursor); |
447 | startSelectAction(viewportPos); | 447 | startSelectAction(viewportPos); |
448 | } | 448 | } |
449 | } | 449 | } |
450 | break; | 450 | break; |
451 | 451 | ||
452 | case QEvent::MouseButtonRelease: | 452 | case QEvent::MouseButtonRelease: |
453 | if ( rightClickTime.elapsed() > 500 && blockMoving ) | 453 | if ( rightClickTime.elapsed() > 500 && blockMoving ) |
454 | rightButtonPressed = true; | 454 | rightButtonPressed = true; |
455 | if (object != viewport()) { | 455 | if (object != viewport()) { |
456 | if (me->button() == RightButton || rightButtonPressed ) { | 456 | if (me->button() == RightButton || rightButtonPressed ) { |
457 | if ( blockMoving ) { | 457 | if ( blockMoving ) { |
458 | mClickedItem = (KOAgendaItem *)object; | 458 | mClickedItem = (KOAgendaItem *)object; |
459 | if (mActionItem ) { | 459 | if (mActionItem ) { |
460 | endItemAction(); | 460 | endItemAction(); |
461 | } | 461 | } |
462 | leftMouseDown = false; // no more leftMouse computation | 462 | leftMouseDown = false; // no more leftMouse computation |
463 | if (mClickedItem) { | 463 | if (mClickedItem) { |
464 | selectItem(mClickedItem); | 464 | selectItem(mClickedItem); |
465 | emit showIncidencePopupSignal(mClickedItem->incidence()); | 465 | emit showIncidencePopupSignal(mClickedItem->incidence()); |
466 | } | 466 | } |
467 | } | 467 | } |
468 | } else if (me->button() == LeftButton && leftMouseDown) { | 468 | } else if (me->button() == LeftButton && leftMouseDown) { |
469 | if (mActionItem) { | 469 | if (mActionItem) { |
470 | QPoint clipperPos = clipper()->mapFromGlobal(viewport()->mapToGlobal(viewportPos)); | 470 | QPoint clipperPos = clipper()->mapFromGlobal(viewport()->mapToGlobal(viewportPos)); |
471 | //qDebug(" %d %d %d ",clipperPos.y(),visibleHeight() , 9 ); | 471 | //qDebug(" %d %d %d ",clipperPos.y(),visibleHeight() , 9 ); |
472 | if ( mActionType == MOVE && (clipperPos.y() > visibleHeight()-2 ||clipperPos.y() < 0 ) ) { | 472 | if ( mActionType == MOVE && (clipperPos.y() > visibleHeight()-2 ||clipperPos.y() < 0 ) ) { |
473 | mScrollUpTimer.stop(); | 473 | mScrollUpTimer.stop(); |
474 | mScrollDownTimer.stop(); | 474 | mScrollDownTimer.stop(); |
475 | mActionItem->resetMove(); | 475 | mActionItem->resetMove(); |
476 | placeSubCells( mActionItem ); | 476 | placeSubCells( mActionItem ); |
477 | // emit startDragSignal( mActionItem->incidence() ); | 477 | // emit startDragSignal( mActionItem->incidence() ); |
478 | setCursor( arrowCursor ); | 478 | setCursor( arrowCursor ); |
479 | mActionItem = 0; | 479 | mActionItem = 0; |
480 | mActionType = NOP; | 480 | mActionType = NOP; |
481 | mItemMoved = 0; | 481 | mItemMoved = 0; |
482 | leftMouseDown = false; | 482 | leftMouseDown = false; |
483 | return true; | 483 | return true; |
484 | } | 484 | } |
485 | endItemAction(); | 485 | endItemAction(); |
486 | } | 486 | } |
487 | } | 487 | } |
488 | 488 | ||
489 | } else { // ---------- viewport() | 489 | } else { // ---------- viewport() |
490 | if (me->button() == RightButton || rightButtonPressed ) { //right click | 490 | if (me->button() == RightButton || rightButtonPressed ) { //right click |
491 | if ( blockMoving ) { // we did mot moved the mouse much - popup menu | 491 | if ( blockMoving ) { // we did mot moved the mouse much - popup menu |
492 | if ( leftMouseDown ) { // we have a simulated right click - clear left mouse action | 492 | if ( leftMouseDown ) { // we have a simulated right click - clear left mouse action |
493 | endSelectAction( false ); // do not emit new event signal | 493 | endSelectAction( false ); // do not emit new event signal |
494 | leftMouseDown = false; // no more leftMouse computation | 494 | leftMouseDown = false; // no more leftMouse computation |
495 | } | 495 | } |
496 | int x,y; | 496 | int x,y; |
497 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); | 497 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); |
498 | int gx,gy; | 498 | int gx,gy; |
499 | contentsToGrid(x,y,gx,gy); | 499 | contentsToGrid(x,y,gx,gy); |
500 | mCurrentCellX = gx; | 500 | mCurrentCellX = gx; |
501 | mCurrentCellY = gy; | 501 | mCurrentCellY = gy; |
502 | mStartCellX = gx; | 502 | mStartCellX = gx; |
503 | mStartCellY = gy; | 503 | mStartCellY = gy; |
504 | mNewItemPopup->popup( viewport()->mapToGlobal( me->pos() ) ); | 504 | mNewItemPopup->popup( viewport()->mapToGlobal( me->pos() ) ); |
505 | } | 505 | } |
506 | } | 506 | } |
507 | else if (me->button() == LeftButton && leftMouseDown ) { //left click | 507 | else if (me->button() == LeftButton && leftMouseDown ) { //left click |
508 | endSelectAction( true ); // emit new event signal | 508 | endSelectAction( true ); // emit new event signal |
509 | } | 509 | } |
510 | } | 510 | } |
511 | if (me->button() == LeftButton) | 511 | if (me->button() == LeftButton) |
512 | leftMouseDown = false; | 512 | leftMouseDown = false; |
513 | else if (me->button() == RightButton) | 513 | else if (me->button() == RightButton) |
514 | rightMouseDown = false; | 514 | rightMouseDown = false; |
515 | break; | 515 | break; |
516 | 516 | ||
517 | case QEvent::MouseMove: | 517 | case QEvent::MouseMove: |
518 | if ( !rightMouseDown && !leftMouseDown ) | 518 | if ( !rightMouseDown && !leftMouseDown ) |
519 | return true; | 519 | return true; |
520 | if ( blockMoving ) { | 520 | if ( blockMoving ) { |
521 | int dX, dY; | 521 | int dX, dY; |
522 | dX = startX - viewportPos.x(); | 522 | dX = startX - viewportPos.x(); |
523 | if ( dX < 0 ) | 523 | if ( dX < 0 ) |
524 | dX = -dX; | 524 | dX = -dX; |
525 | dY = viewportPos.y() - startY; | 525 | dY = viewportPos.y() - startY; |
526 | if ( dY < 0 ) | 526 | if ( dY < 0 ) |
527 | dY = -dY; | 527 | dY = -dY; |
528 | //qDebug("%d %d %d ", dX, dY , blockmoveDist ); | 528 | //qDebug("%d %d %d ", dX, dY , blockmoveDist ); |
529 | if ( dX > blockmoveDist || dY > blockmoveDist ) { | 529 | if ( dX > blockmoveDist || dY > blockmoveDist ) { |
530 | blockMoving = false; | 530 | blockMoving = false; |
531 | } | 531 | } |
532 | } | 532 | } |
533 | if (object != viewport()) { | 533 | if (object != viewport()) { |
534 | KOAgendaItem *moveItem = (KOAgendaItem *)object; | 534 | KOAgendaItem *moveItem = (KOAgendaItem *)object; |
535 | if (!moveItem->incidence()->isReadOnly() ) { | 535 | if (!moveItem->incidence()->isReadOnly() ) { |
536 | if (!mActionItem) | 536 | if (!mActionItem) |
537 | setNoActionCursor(moveItem,viewportPos); | 537 | setNoActionCursor(moveItem,viewportPos); |
538 | else { | 538 | else { |
539 | if ( !blockMoving ) | 539 | if ( !blockMoving ) |
540 | performItemAction(viewportPos); | 540 | performItemAction(viewportPos); |
541 | } | 541 | } |
542 | } | 542 | } |
543 | } else { // ---------- viewport() | 543 | } else { // ---------- viewport() |
544 | if ( mActionType == SELECT ) { | 544 | if ( mActionType == SELECT ) { |
545 | performSelectAction( viewportPos ); | 545 | performSelectAction( viewportPos ); |
546 | } | 546 | } |
547 | } | 547 | } |
548 | break; | 548 | break; |
549 | 549 | ||
550 | case QEvent::MouseButtonDblClick: | 550 | case QEvent::MouseButtonDblClick: |
551 | blockMoving = false; | ||
552 | leftMouseDown = false; | ||
553 | rightMouseDown = false; | ||
551 | if (object == viewport()) { | 554 | if (object == viewport()) { |
552 | selectItem(0); | 555 | selectItem(0); |
553 | int x,y; | 556 | int x,y; |
554 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); | 557 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); |
555 | int gx,gy; | 558 | int gx,gy; |
556 | contentsToGrid(x,y,gx,gy); | 559 | contentsToGrid(x,y,gx,gy); |
557 | emit newEventSignal(gx,gy); | 560 | emit newEventSignal(gx,gy); |
558 | } else { | 561 | } else { |
559 | KOAgendaItem *doubleClickedItem = (KOAgendaItem *)object; | 562 | KOAgendaItem *doubleClickedItem = (KOAgendaItem *)object; |
560 | selectItem(doubleClickedItem); | 563 | selectItem(doubleClickedItem); |
561 | if ( KOPrefs::instance()->mEditOnDoubleClick ) | 564 | if ( KOPrefs::instance()->mEditOnDoubleClick ) |
562 | emit editIncidenceSignal(doubleClickedItem->incidence()); | 565 | emit editIncidenceSignal(doubleClickedItem->incidence()); |
563 | else | 566 | else |
564 | emit showIncidenceSignal(doubleClickedItem->incidence()); | 567 | emit showIncidenceSignal(doubleClickedItem->incidence()); |
565 | } | 568 | } |
566 | break; | 569 | break; |
567 | 570 | ||
568 | default: | 571 | default: |
569 | break; | 572 | break; |
570 | } | 573 | } |
571 | return true; | 574 | return true; |
572 | } | 575 | } |
573 | 576 | ||
574 | void KOAgenda::newItem( int item ) | 577 | void KOAgenda::newItem( int item ) |
575 | { | 578 | { |
576 | if ( item == 1 ) { //new event | 579 | if ( item == 1 ) { //new event |
577 | newEventSignal(mStartCellX ,mStartCellY ); | 580 | newEventSignal(mStartCellX ,mStartCellY ); |
578 | } else | 581 | } else |
579 | if ( item == 2 ) { //new event | 582 | if ( item == 2 ) { //new event |
580 | newTodoSignal(mStartCellX ,mStartCellY ); | 583 | newTodoSignal(mStartCellX ,mStartCellY ); |
581 | } else | 584 | } else |
582 | { | 585 | { |
583 | QDate day = mSelectedDates[mStartCellX]; | 586 | QDate day = mSelectedDates[mStartCellX]; |
584 | emit showDateView( item, day ); | 587 | emit showDateView( item, day ); |
585 | // 3Day view | 588 | // 3Day view |
586 | // 4Week view | 589 | // 4Week view |
587 | // 5Month view | 590 | // 5Month view |
588 | // 6Journal view | 591 | // 6Journal view |
589 | } | 592 | } |
590 | } | 593 | } |
591 | void KOAgenda::startSelectAction(QPoint viewportPos) | 594 | void KOAgenda::startSelectAction(QPoint viewportPos) |
592 | { | 595 | { |
593 | //emit newStartSelectSignal(); | 596 | //emit newStartSelectSignal(); |
594 | 597 | ||
595 | mActionType = SELECT; | 598 | mActionType = SELECT; |
596 | 599 | ||
597 | int x,y; | 600 | int x,y; |
598 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); | 601 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); |
599 | int gx,gy; | 602 | int gx,gy; |
600 | contentsToGrid(x,y,gx,gy); | 603 | contentsToGrid(x,y,gx,gy); |
601 | 604 | ||
602 | mStartCellX = gx; | 605 | mStartCellX = gx; |
603 | mStartCellY = gy; | 606 | mStartCellY = gy; |
604 | mCurrentCellX = gx; | 607 | mCurrentCellX = gx; |
605 | mCurrentCellY = gy; | 608 | mCurrentCellY = gy; |
606 | 609 | ||
607 | // Store coordinates of old selection | 610 | // Store coordinates of old selection |
608 | int selectionX = mSelectionCellX * mGridSpacingX; | 611 | int selectionX = mSelectionCellX * mGridSpacingX; |
609 | int selectionYTop = mSelectionYTop; | 612 | int selectionYTop = mSelectionYTop; |
610 | int selectionHeight = mSelectionHeight; | 613 | int selectionHeight = mSelectionHeight; |
611 | 614 | ||
612 | // Store new selection | 615 | // Store new selection |
613 | mSelectionCellX = gx; | 616 | mSelectionCellX = gx; |
614 | mSelectionYTop = gy * mGridSpacingY; | 617 | mSelectionYTop = gy * mGridSpacingY; |
615 | mSelectionHeight = mGridSpacingY; | 618 | mSelectionHeight = mGridSpacingY; |
616 | 619 | ||
617 | // Clear old selection | 620 | // Clear old selection |
618 | repaintContents( selectionX, selectionYTop, | 621 | repaintContents( selectionX, selectionYTop, |
619 | mGridSpacingX, selectionHeight,false ); | 622 | mGridSpacingX, selectionHeight,false ); |
620 | 623 | ||
621 | // Paint new selection | 624 | // Paint new selection |
622 | // repaintContents( mSelectionCellX * mGridSpacingX, mSelectionYTop, | 625 | // repaintContents( mSelectionCellX * mGridSpacingX, mSelectionYTop, |
623 | // mGridSpacingX, mSelectionHeight ); | 626 | // mGridSpacingX, mSelectionHeight ); |
624 | } | 627 | } |
625 | 628 | ||
626 | void KOAgenda::performSelectAction(QPoint viewportPos) | 629 | void KOAgenda::performSelectAction(QPoint viewportPos) |
627 | { | 630 | { |
628 | int x,y; | 631 | int x,y; |
629 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); | 632 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); |
630 | int gx,gy; | 633 | int gx,gy; |
631 | contentsToGrid(x,y,gx,gy); | 634 | contentsToGrid(x,y,gx,gy); |
632 | 635 | ||
633 | QPoint clipperPos = clipper()-> | 636 | QPoint clipperPos = clipper()-> |
634 | mapFromGlobal(viewport()->mapToGlobal(viewportPos)); | 637 | mapFromGlobal(viewport()->mapToGlobal(viewportPos)); |
635 | 638 | ||
636 | // Scroll if cursor was moved to upper or lower end of agenda. | 639 | // Scroll if cursor was moved to upper or lower end of agenda. |
637 | if (clipperPos.y() < mScrollBorderWidth) { | 640 | if (clipperPos.y() < mScrollBorderWidth) { |
638 | mScrollUpTimer.start(mScrollDelay); | 641 | mScrollUpTimer.start(mScrollDelay); |
639 | } else if (visibleHeight() - clipperPos.y() < | 642 | } else if (visibleHeight() - clipperPos.y() < |
640 | mScrollBorderWidth) { | 643 | mScrollBorderWidth) { |
641 | mScrollDownTimer.start(mScrollDelay); | 644 | mScrollDownTimer.start(mScrollDelay); |
642 | } else { | 645 | } else { |
643 | mScrollUpTimer.stop(); | 646 | mScrollUpTimer.stop(); |
644 | mScrollDownTimer.stop(); | 647 | mScrollDownTimer.stop(); |
645 | } | 648 | } |
646 | 649 | ||
647 | if ( gy > mCurrentCellY ) { | 650 | if ( gy > mCurrentCellY ) { |
648 | mSelectionHeight = ( gy + 1 ) * mGridSpacingY - mSelectionYTop; | 651 | mSelectionHeight = ( gy + 1 ) * mGridSpacingY - mSelectionYTop; |
649 | 652 | ||
650 | #if 0 | 653 | #if 0 |
651 | // FIXME: Repaint only the newly selected region | 654 | // FIXME: Repaint only the newly selected region |
652 | repaintContents( mSelectionCellX * mGridSpacingX, | 655 | repaintContents( mSelectionCellX * mGridSpacingX, |
653 | mCurrentCellY + mGridSpacingY, | 656 | mCurrentCellY + mGridSpacingY, |
654 | mGridSpacingX, | 657 | mGridSpacingX, |
655 | mSelectionHeight - ( gy - mCurrentCellY - 1 ) * mGridSpacingY ); | 658 | mSelectionHeight - ( gy - mCurrentCellY - 1 ) * mGridSpacingY ); |
656 | #else | 659 | #else |
657 | repaintContents( (KOGlobals::self()->reverseLayout() ? | 660 | repaintContents( (KOGlobals::self()->reverseLayout() ? |
658 | mColumns - 1 - mSelectionCellX : mSelectionCellX) * | 661 | mColumns - 1 - mSelectionCellX : mSelectionCellX) * |
659 | mGridSpacingX, mSelectionYTop, | 662 | mGridSpacingX, mSelectionYTop, |
660 | mGridSpacingX, mSelectionHeight , false); | 663 | mGridSpacingX, mSelectionHeight , false); |
661 | #endif | 664 | #endif |
662 | 665 | ||
663 | mCurrentCellY = gy; | 666 | mCurrentCellY = gy; |
664 | } else if ( gy < mCurrentCellY ) { | 667 | } else if ( gy < mCurrentCellY ) { |
665 | if ( gy >= mStartCellY ) { | 668 | if ( gy >= mStartCellY ) { |
666 | int selectionHeight = mSelectionHeight; | 669 | int selectionHeight = mSelectionHeight; |
667 | mSelectionHeight = ( gy + 1 ) * mGridSpacingY - mSelectionYTop; | 670 | mSelectionHeight = ( gy + 1 ) * mGridSpacingY - mSelectionYTop; |
668 | 671 | ||
669 | repaintContents( (KOGlobals::self()->reverseLayout() ? | 672 | repaintContents( (KOGlobals::self()->reverseLayout() ? |
670 | mColumns - 1 - mSelectionCellX : mSelectionCellX) * | 673 | mColumns - 1 - mSelectionCellX : mSelectionCellX) * |
671 | mGridSpacingX, mSelectionYTop, | 674 | mGridSpacingX, mSelectionYTop, |
672 | mGridSpacingX, selectionHeight,false ); | 675 | mGridSpacingX, selectionHeight,false ); |
673 | 676 | ||
674 | mCurrentCellY = gy; | 677 | mCurrentCellY = gy; |
675 | } else { | 678 | } else { |
676 | } | 679 | } |
677 | } | 680 | } |
678 | } | 681 | } |
679 | 682 | ||
680 | void KOAgenda::endSelectAction( bool emitNewEvent ) | 683 | void KOAgenda::endSelectAction( bool emitNewEvent ) |
681 | { | 684 | { |
682 | mActionType = NOP; | 685 | mActionType = NOP; |
683 | mScrollUpTimer.stop(); | 686 | mScrollUpTimer.stop(); |
684 | mScrollDownTimer.stop(); | 687 | mScrollDownTimer.stop(); |
685 | 688 | ||
686 | emit newTimeSpanSignal(mStartCellX,mStartCellY,mCurrentCellX,mCurrentCellY); | 689 | emit newTimeSpanSignal(mStartCellX,mStartCellY,mCurrentCellX,mCurrentCellY); |
687 | if ( emitNewEvent && mStartCellY < mCurrentCellY ) { | 690 | if ( emitNewEvent && mStartCellY < mCurrentCellY ) { |
688 | qDebug("ew event signal "); | 691 | qDebug("ew event signal "); |
689 | emit newEventSignal(mStartCellX,mStartCellY,mCurrentCellX,mCurrentCellY); | 692 | emit newEventSignal(mStartCellX,mStartCellY,mCurrentCellX,mCurrentCellY); |
690 | } | 693 | } |
691 | } | 694 | } |
692 | 695 | ||
693 | void KOAgenda::startItemAction(QPoint viewportPos) | 696 | void KOAgenda::startItemAction(QPoint viewportPos) |
694 | { | 697 | { |
695 | int x,y; | 698 | int x,y; |
696 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); | 699 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); |
697 | int gx,gy; | 700 | int gx,gy; |
698 | contentsToGrid(x,y,gx,gy); | 701 | contentsToGrid(x,y,gx,gy); |
699 | 702 | ||
700 | mStartCellX = gx; | 703 | mStartCellX = gx; |
701 | mStartCellY = gy; | 704 | mStartCellY = gy; |
702 | mCurrentCellX = gx; | 705 | mCurrentCellX = gx; |
703 | mCurrentCellY = gy; | 706 | mCurrentCellY = gy; |
704 | 707 | ||
705 | if (mAllDayMode) { | 708 | if (mAllDayMode) { |
706 | int gridDistanceX = (x - gx * mGridSpacingX); | 709 | int gridDistanceX = (x - gx * mGridSpacingX); |
707 | if (gridDistanceX < mResizeBorderWidth && | 710 | if (gridDistanceX < mResizeBorderWidth && |
708 | mActionItem->cellX() == mCurrentCellX) { | 711 | mActionItem->cellX() == mCurrentCellX) { |
709 | mActionType = RESIZELEFT; | 712 | mActionType = RESIZELEFT; |
710 | setCursor(sizeHorCursor); | 713 | setCursor(sizeHorCursor); |
711 | } else if ((mGridSpacingX - gridDistanceX) < mResizeBorderWidth && | 714 | } else if ((mGridSpacingX - gridDistanceX) < mResizeBorderWidth && |
712 | mActionItem->cellXWidth() == mCurrentCellX) { | 715 | mActionItem->cellXWidth() == mCurrentCellX) { |
713 | mActionType = RESIZERIGHT; | 716 | mActionType = RESIZERIGHT; |
714 | setCursor(sizeHorCursor); | 717 | setCursor(sizeHorCursor); |
715 | } else { | 718 | } else { |
716 | mActionType = MOVE; | 719 | mActionType = MOVE; |
717 | mActionItem->startMove(); | 720 | mActionItem->startMove(); |
718 | setCursor(sizeAllCursor); | 721 | setCursor(sizeAllCursor); |
719 | } | 722 | } |
720 | } else { | 723 | } else { |
721 | int gridDistanceY = (y - gy * mGridSpacingY); | 724 | int gridDistanceY = (y - gy * mGridSpacingY); |
722 | bool allowResize = ( mActionItem->incidence()->type() != "Todo" ); | 725 | bool allowResize = ( mActionItem->incidence()->type() != "Todo" ); |
723 | if (allowResize && gridDistanceY < mResizeBorderWidth && | 726 | if (allowResize && gridDistanceY < mResizeBorderWidth && |
724 | mActionItem->cellYTop() == mCurrentCellY && | 727 | mActionItem->cellYTop() == mCurrentCellY && |
725 | !mActionItem->firstMultiItem()) { | 728 | !mActionItem->firstMultiItem()) { |
726 | mActionType = RESIZETOP; | 729 | mActionType = RESIZETOP; |
727 | setCursor(sizeVerCursor); | 730 | setCursor(sizeVerCursor); |
728 | } else if (allowResize &&(mGridSpacingY - gridDistanceY) < mResizeBorderWidth && | 731 | } else if (allowResize &&(mGridSpacingY - gridDistanceY) < mResizeBorderWidth && |
729 | mActionItem->cellYBottom() == mCurrentCellY && | 732 | mActionItem->cellYBottom() == mCurrentCellY && |
730 | !mActionItem->lastMultiItem()) { | 733 | !mActionItem->lastMultiItem()) { |
731 | mActionType = RESIZEBOTTOM; | 734 | mActionType = RESIZEBOTTOM; |
732 | setCursor(sizeVerCursor); | 735 | setCursor(sizeVerCursor); |
733 | } else { | 736 | } else { |
734 | mActionType = MOVE; | 737 | mActionType = MOVE; |
735 | mActionItem->startMove(); | 738 | mActionItem->startMove(); |
736 | setCursor(sizeAllCursor); | 739 | setCursor(sizeAllCursor); |
737 | } | 740 | } |
738 | } | 741 | } |
739 | } | 742 | } |
740 | 743 | ||
741 | void KOAgenda::performItemAction(QPoint viewportPos) | 744 | void KOAgenda::performItemAction(QPoint viewportPos) |
742 | { | 745 | { |
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp index 496f125..4ee5292 100644 --- a/korganizer/koeditorgeneral.cpp +++ b/korganizer/koeditorgeneral.cpp | |||
@@ -36,484 +36,491 @@ | |||
36 | #include <kdebug.h> | 36 | #include <kdebug.h> |
37 | #include <klocale.h> | 37 | #include <klocale.h> |
38 | #include <kiconloader.h> | 38 | #include <kiconloader.h> |
39 | #include <kmessagebox.h> | 39 | #include <kmessagebox.h> |
40 | #include <kfiledialog.h> | 40 | #include <kfiledialog.h> |
41 | #include <kstandarddirs.h> | 41 | #include <kstandarddirs.h> |
42 | 42 | ||
43 | #include <libkcal/todo.h> | 43 | #include <libkcal/todo.h> |
44 | #include <libkcal/event.h> | 44 | #include <libkcal/event.h> |
45 | #include <libkdepim/categoryselectdialog.h> | 45 | #include <libkdepim/categoryselectdialog.h> |
46 | #include <libkdepim/kdateedit.h> | 46 | #include <libkdepim/kdateedit.h> |
47 | 47 | ||
48 | #include "koprefs.h" | 48 | #include "koprefs.h" |
49 | #include "koglobals.h" | 49 | #include "koglobals.h" |
50 | 50 | ||
51 | #include "koeditorgeneral.h" | 51 | #include "koeditorgeneral.h" |
52 | #include "kolocationbox.h" | 52 | #include "kolocationbox.h" |
53 | #ifndef DESKTOP_VERSION | 53 | #ifndef DESKTOP_VERSION |
54 | #include <qpe/qpeapplication.h> | 54 | #include <qpe/qpeapplication.h> |
55 | #else | 55 | #else |
56 | #include <qapplication.h> | 56 | #include <qapplication.h> |
57 | #endif | 57 | #endif |
58 | 58 | ||
59 | KOEditorGeneral::KOEditorGeneral(QObject* parent, const char* name) : | 59 | KOEditorGeneral::KOEditorGeneral(QObject* parent, const char* name) : |
60 | QObject( parent, name) | 60 | QObject( parent, name) |
61 | { | 61 | { |
62 | } | 62 | } |
63 | 63 | ||
64 | KOEditorGeneral::~KOEditorGeneral() | 64 | KOEditorGeneral::~KOEditorGeneral() |
65 | { | 65 | { |
66 | } | 66 | } |
67 | 67 | ||
68 | void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout) | 68 | void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout) |
69 | { | 69 | { |
70 | QGridLayout *headerLayout = new QGridLayout(topLayout); | 70 | QGridLayout *headerLayout = new QGridLayout(topLayout); |
71 | 71 | ||
72 | #if 0 | 72 | #if 0 |
73 | mOwnerLabel = new QLabel(i18n("Owner:"),parent); | 73 | mOwnerLabel = new QLabel(i18n("Owner:"),parent); |
74 | headerLayout->addMultiCellWidget(mOwnerLabel,0,0,0,1); | 74 | headerLayout->addMultiCellWidget(mOwnerLabel,0,0,0,1); |
75 | #endif | 75 | #endif |
76 | 76 | ||
77 | QLabel *summaryLabel = new QLabel(i18n("Summary:"),parent); | 77 | QLabel *summaryLabel = new QLabel(i18n("Summary:"),parent); |
78 | headerLayout->addWidget(summaryLabel,1,0); | 78 | headerLayout->addWidget(summaryLabel,1,0); |
79 | 79 | ||
80 | mSummaryEdit = new KOLocationBox(TRUE,parent, 10); | 80 | mSummaryEdit = new KOLocationBox(TRUE,parent, 10); |
81 | mSummaryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); | 81 | mSummaryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); |
82 | //mSummaryEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5 ,(QSizePolicy::SizeType)3 ,FALSE) ); | 82 | //mSummaryEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5 ,(QSizePolicy::SizeType)3 ,FALSE) ); |
83 | //qDebug("h %d %d ", summaryLabel->sizeHint().height(),mSummaryEdit->sizeHint().height() ); | 83 | //qDebug("h %d %d ", summaryLabel->sizeHint().height(),mSummaryEdit->sizeHint().height() ); |
84 | int hei = (summaryLabel->sizeHint().height() + mSummaryEdit->sizeHint().height())/2; | 84 | int hei = (summaryLabel->sizeHint().height() + mSummaryEdit->sizeHint().height())/2; |
85 | if ( QApplication::desktop()->width() > 320 ) | 85 | if ( QApplication::desktop()->width() > 320 ) |
86 | mSummaryEdit->setMaximumHeight( hei +6 ); | 86 | mSummaryEdit->setMaximumHeight( hei +6 ); |
87 | //qDebug("%d %d %d %d %d %d ", QSizePolicy::Fixed , QSizePolicy::Minimum , QSizePolicy:: Maximum , QSizePolicy:: Preferred , QSizePolicy:: MinimumExpanding , QSizePolicy::Expanding ); | 87 | //qDebug("%d %d %d %d %d %d ", QSizePolicy::Fixed , QSizePolicy::Minimum , QSizePolicy:: Maximum , QSizePolicy:: Preferred , QSizePolicy:: MinimumExpanding , QSizePolicy::Expanding ); |
88 | // SizeType { Fixed = 0, Minimum = MayGrow, Maximum = MayShrink, Preferred = MayGrow|MayShrink, MinimumExpanding = Minimum|ExpMask, Expanding = MinimumExpanding|MayShrink } | 88 | // SizeType { Fixed = 0, Minimum = MayGrow, Maximum = MayShrink, Preferred = MayGrow|MayShrink, MinimumExpanding = Minimum|ExpMask, Expanding = MinimumExpanding|MayShrink } |
89 | // mSummaryEdit = new QLineEdit(parent); | 89 | // mSummaryEdit = new QLineEdit(parent); |
90 | headerLayout->addWidget(mSummaryEdit,1,1); | 90 | headerLayout->addWidget(mSummaryEdit,1,1); |
91 | connect ( mSummaryEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); | 91 | connect ( mSummaryEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); |
92 | 92 | ||
93 | QLabel *locationLabel = new QLabel(i18n("Location:"),parent); | 93 | QLabel *locationLabel = new QLabel(i18n("Location:"),parent); |
94 | headerLayout->addWidget(locationLabel,2,0); | 94 | headerLayout->addWidget(locationLabel,2,0); |
95 | 95 | ||
96 | mLocationEdit = new KOLocationBox(TRUE,parent,10); | 96 | mLocationEdit = new KOLocationBox(TRUE,parent,10); |
97 | mLocationEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); | 97 | mLocationEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); |
98 | if ( QApplication::desktop()->width() > 320 ) | 98 | if ( QApplication::desktop()->width() > 320 ) |
99 | mLocationEdit->setMaximumHeight( hei + 6); | 99 | mLocationEdit->setMaximumHeight( hei + 6); |
100 | 100 | ||
101 | // mLocationEdit = new QLineEdit(parent); | 101 | // mLocationEdit = new QLineEdit(parent); |
102 | connect ( mLocationEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); | 102 | connect ( mLocationEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); |
103 | headerLayout->addWidget(mLocationEdit,2,1); | 103 | headerLayout->addWidget(mLocationEdit,2,1); |
104 | headerLayout->setColStretch( 1, 10); | 104 | headerLayout->setColStretch( 1, 10); |
105 | } | 105 | } |
106 | void KOEditorGeneral::setFocusOn( int i ) | 106 | void KOEditorGeneral::setFocusOn( int i ) |
107 | { | 107 | { |
108 | qApp->processEvents(); | 108 | qApp->processEvents(); |
109 | if ( i == 1 ) { | 109 | if ( i == 1 ) { |
110 | mDescriptionEdit->setFocus(); | 110 | mDescriptionEdit->setFocus(); |
111 | mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333); | 111 | mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333); |
112 | } | 112 | } |
113 | if ( i == 2 ) { | 113 | if ( i == 2 ) { |
114 | mSummaryEdit->setFocus(); | 114 | mSummaryEdit->setFocus(); |
115 | } | 115 | } |
116 | 116 | ||
117 | } | 117 | } |
118 | void KOEditorGeneral::editCategories() | 118 | void KOEditorGeneral::editCategories() |
119 | { | 119 | { |
120 | // qDebug("KOEditorGeneral::editCategories() "); | 120 | // qDebug("KOEditorGeneral::editCategories() "); |
121 | KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); | 121 | KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); |
122 | connect(csd,SIGNAL(categoriesSelected(const QString &)), this ,SLOT(setCategories(const QString &))); | 122 | connect(csd,SIGNAL(categoriesSelected(const QString &)), this ,SLOT(setCategories(const QString &))); |
123 | //KOGlobals::fitDialogToScreen( csd ); | 123 | //KOGlobals::fitDialogToScreen( csd ); |
124 | csd->setColorEnabled(); | 124 | csd->setColorEnabled(); |
125 | csd->setSelected( QStringList::split (",", mCategoriesLabel->text()) ); | 125 | csd->setSelected( QStringList::split (",", mCategoriesLabel->text()) ); |
126 | csd->exec(); | 126 | csd->exec(); |
127 | delete csd; | 127 | delete csd; |
128 | } | 128 | } |
129 | void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout) | 129 | void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout) |
130 | { | 130 | { |
131 | QBoxLayout *categoriesLayout = new QHBoxLayout( topLayout ); | 131 | QBoxLayout *categoriesLayout = new QHBoxLayout( topLayout ); |
132 | 132 | ||
133 | mCategoriesButton = new QPushButton(parent); | 133 | mCategoriesButton = new QPushButton(parent); |
134 | mCategoriesButton->setText(i18n("Categories...")); | 134 | mCategoriesButton->setText(i18n("Categories...")); |
135 | connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() )); | 135 | connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() )); |
136 | categoriesLayout->addWidget(mCategoriesButton); | 136 | categoriesLayout->addWidget(mCategoriesButton); |
137 | 137 | ||
138 | mCategoriesLabel = new QLabel(parent); | 138 | mCategoriesLabel = new QLabel(parent); |
139 | mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken); | 139 | mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken); |
140 | categoriesLayout->addWidget(mCategoriesLabel,1); | 140 | categoriesLayout->addWidget(mCategoriesLabel,1); |
141 | } | 141 | } |
142 | 142 | ||
143 | void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout) | 143 | void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout) |
144 | { | 144 | { |
145 | QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout ); | 145 | QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout ); |
146 | 146 | ||
147 | QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent); | 147 | QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent); |
148 | mCancelBox = new QCheckBox ( i18n("Cancelled"), parent); | 148 | mCancelBox = new QCheckBox ( i18n("Cancelled"), parent); |
149 | secrecyLayout->addWidget(mCancelBox); | 149 | secrecyLayout->addWidget(mCancelBox); |
150 | secrecyLayout->addWidget(secrecyLabel); | 150 | secrecyLayout->addWidget(secrecyLabel); |
151 | 151 | ||
152 | mSecrecyCombo = new QComboBox(parent); | 152 | mSecrecyCombo = new QComboBox(parent); |
153 | mSecrecyCombo->insertStringList(Incidence::secrecyList()); | 153 | mSecrecyCombo->insertStringList(Incidence::secrecyList()); |
154 | secrecyLayout->addWidget(mSecrecyCombo); | 154 | secrecyLayout->addWidget(mSecrecyCombo); |
155 | } | 155 | } |
156 | 156 | ||
157 | void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout) | 157 | void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout) |
158 | { | 158 | { |
159 | mDescriptionEdit = new KTextEdit(parent); | 159 | mDescriptionEdit = new KTextEdit(parent); |
160 | mDescriptionEdit->setFont(KOPrefs::instance()->mEditBoxFont ); | 160 | mDescriptionEdit->setFont(KOPrefs::instance()->mEditBoxFont ); |
161 | mDescriptionEdit->append(""); | 161 | mDescriptionEdit->append(""); |
162 | mDescriptionEdit->setReadOnly(false); | 162 | mDescriptionEdit->setReadOnly(false); |
163 | mDescriptionEdit->setOverwriteMode(false); | 163 | mDescriptionEdit->setOverwriteMode(false); |
164 | mDescriptionEdit->setWordWrap( KTextEdit::WidgetWidth ); | 164 | mDescriptionEdit->setWordWrap( KTextEdit::WidgetWidth ); |
165 | topLayout->addWidget(mDescriptionEdit); | 165 | topLayout->addWidget(mDescriptionEdit); |
166 | #ifndef DESKTOP_VERSION | 166 | #ifndef DESKTOP_VERSION |
167 | QPEApplication::setStylusOperation( mDescriptionEdit, QPEApplication::RightOnHold ); | 167 | QPEApplication::setStylusOperation( mDescriptionEdit, QPEApplication::RightOnHold ); |
168 | #endif | 168 | #endif |
169 | 169 | ||
170 | } | 170 | } |
171 | 171 | ||
172 | void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout) | 172 | void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout) |
173 | { | 173 | { |
174 | QBoxLayout *alarmLayout = new QHBoxLayout(topLayout); | 174 | QBoxLayout *alarmLayout = new QHBoxLayout(topLayout); |
175 | 175 | ||
176 | //mAlarmBell = new QLabel(parent); | 176 | //mAlarmBell = new QLabel(parent); |
177 | //mAlarmBell->setPixmap(SmallIcon("bell")); | 177 | //mAlarmBell->setPixmap(SmallIcon("bell")); |
178 | //alarmLayout->addWidget(mAlarmBell); | 178 | //alarmLayout->addWidget(mAlarmBell); |
179 | if ( QApplication::desktop()->width() < 320 ) | 179 | if ( QApplication::desktop()->width() < 320 ) |
180 | mAlarmButton = new QCheckBox(i18n("Rem."),parent); | 180 | mAlarmButton = new QCheckBox(i18n("Rem."),parent); |
181 | else | 181 | else |
182 | mAlarmButton = new QCheckBox(i18n("Reminder:"),parent); | 182 | mAlarmButton = new QCheckBox(i18n("Reminder:"),parent); |
183 | 183 | ||
184 | connect(mAlarmButton, SIGNAL(toggled(bool)), SLOT(enableAlarmEdit(bool))); | 184 | connect(mAlarmButton, SIGNAL(toggled(bool)), SLOT(enableAlarmEdit(bool))); |
185 | alarmLayout->addWidget(mAlarmButton); | 185 | alarmLayout->addWidget(mAlarmButton); |
186 | 186 | ||
187 | mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ; | 187 | mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ; |
188 | alarmLayout->addWidget(mAlarmTimeEdit); | 188 | alarmLayout->addWidget(mAlarmTimeEdit); |
189 | mAlarmIncrCombo = new QComboBox(false, parent); | 189 | mAlarmIncrCombo = new QComboBox(false, parent); |
190 | if ( QApplication::desktop()->width() < 320 ) { | 190 | if ( QApplication::desktop()->width() < 320 ) { |
191 | mAlarmIncrCombo->insertItem(i18n("min")); | 191 | mAlarmIncrCombo->insertItem(i18n("min")); |
192 | mAlarmIncrCombo->insertItem(i18n("hou")); | 192 | mAlarmIncrCombo->insertItem(i18n("hou")); |
193 | mAlarmIncrCombo->insertItem(i18n("day")); | 193 | mAlarmIncrCombo->insertItem(i18n("day")); |
194 | mAlarmTimeEdit->setMaximumWidth( mAlarmTimeEdit->sizeHint().width() ); | 194 | mAlarmTimeEdit->setMaximumWidth( mAlarmTimeEdit->sizeHint().width() ); |
195 | mAlarmIncrCombo->setMaximumWidth( mAlarmIncrCombo->sizeHint().width() ); | 195 | mAlarmIncrCombo->setMaximumWidth( mAlarmIncrCombo->sizeHint().width() ); |
196 | } else { | 196 | } else { |
197 | mAlarmIncrCombo->insertItem(i18n("minute(s)")); | 197 | mAlarmIncrCombo->insertItem(i18n("minute(s)")); |
198 | mAlarmIncrCombo->insertItem(i18n("hour(s)")); | 198 | mAlarmIncrCombo->insertItem(i18n("hour(s)")); |
199 | mAlarmIncrCombo->insertItem(i18n("day(s)")); | 199 | mAlarmIncrCombo->insertItem(i18n("day(s)")); |
200 | } | 200 | } |
201 | 201 | ||
202 | // mAlarmIncrCombo->setMinimumHeight(20); | 202 | // mAlarmIncrCombo->setMinimumHeight(20); |
203 | alarmLayout->addWidget(mAlarmIncrCombo); | 203 | alarmLayout->addWidget(mAlarmIncrCombo); |
204 | mAlarmSoundButton = new QPushButton(parent); | 204 | mAlarmSoundButton = new QPushButton(parent); |
205 | mAlarmSoundButton->setPixmap(SmallIcon("playsound")); | 205 | mAlarmSoundButton->setPixmap(SmallIcon("playsound")); |
206 | mAlarmSoundButton->setToggleButton(true); | 206 | mAlarmSoundButton->setToggleButton(true); |
207 | QToolTip::add(mAlarmSoundButton, i18n("No sound set")); | 207 | QToolTip::add(mAlarmSoundButton, i18n("No sound set")); |
208 | connect(mAlarmSoundButton, SIGNAL(clicked()), SLOT(pickAlarmSound())); | 208 | connect(mAlarmSoundButton, SIGNAL(clicked()), SLOT(pickAlarmSound())); |
209 | alarmLayout->addWidget(mAlarmSoundButton); | 209 | alarmLayout->addWidget(mAlarmSoundButton); |
210 | 210 | ||
211 | mAlarmProgramButton = new QPushButton(parent); | 211 | mAlarmProgramButton = new QPushButton(parent); |
212 | mAlarmProgramButton->setPixmap(SmallIcon("run")); | 212 | mAlarmProgramButton->setPixmap(SmallIcon("run")); |
213 | mAlarmProgramButton->setToggleButton(true); | 213 | mAlarmProgramButton->setToggleButton(true); |
214 | QToolTip::add(mAlarmProgramButton, i18n("No program set")); | 214 | QToolTip::add(mAlarmProgramButton, i18n("No program set")); |
215 | connect(mAlarmProgramButton, SIGNAL(clicked()), SLOT(pickAlarmProgram())); | 215 | connect(mAlarmProgramButton, SIGNAL(clicked()), SLOT(pickAlarmProgram())); |
216 | alarmLayout->addWidget(mAlarmProgramButton); | 216 | alarmLayout->addWidget(mAlarmProgramButton); |
217 | mAlarmSoundButton->setMaximumWidth( mAlarmSoundButton->sizeHint().width() + 4 ); | 217 | mAlarmSoundButton->setMaximumWidth( mAlarmSoundButton->sizeHint().width() + 4 ); |
218 | mAlarmProgramButton->setMaximumWidth(mAlarmProgramButton->sizeHint().width() + 4 ); | 218 | mAlarmProgramButton->setMaximumWidth(mAlarmProgramButton->sizeHint().width() + 4 ); |
219 | // if ( KOPrefs::instance()->mCompactDialogs ) { | 219 | // if ( KOPrefs::instance()->mCompactDialogs ) { |
220 | // mAlarmSoundButton->hide(); | 220 | // mAlarmSoundButton->hide(); |
221 | // mAlarmProgramButton->hide(); | 221 | // mAlarmProgramButton->hide(); |
222 | // } | 222 | // } |
223 | } | 223 | } |
224 | 224 | ||
225 | void KOEditorGeneral::pickAlarmSound() | 225 | void KOEditorGeneral::pickAlarmSound() |
226 | { | 226 | { |
227 | 227 | ||
228 | qDebug("KOEditorGeneral::pickAlarmSound() %d",mAlarmSoundButton->isOn() ); | ||
228 | //QString prefix = mAlarmSound; | 229 | //QString prefix = mAlarmSound; |
229 | if (!mAlarmSoundButton->isOn()) { | 230 | if (!mAlarmSoundButton->isOn()) { |
230 | //mAlarmSound = ""; | 231 | //mAlarmSound = ""; |
231 | QToolTip::remove(mAlarmSoundButton); | 232 | QToolTip::remove(mAlarmSoundButton); |
232 | QToolTip::add(mAlarmSoundButton, i18n("No sound set")); | 233 | QToolTip::add(mAlarmSoundButton, i18n("No sound set")); |
233 | mAlarmProgramButton->setOn(true); | 234 | mAlarmProgramButton->setOn(true); |
234 | mAlarmSoundButton->setOn(false); | 235 | mAlarmSoundButton->setOn(false); |
236 | pickAlarmProgram(); | ||
235 | } else { | 237 | } else { |
236 | QString fileName(KFileDialog::getOpenFileName(mAlarmSound, | 238 | QString fileName(KFileDialog::getOpenFileName(mAlarmSound, |
237 | i18n("*.wav|Wav Files"), 0)); | 239 | i18n("*.wav|Wav Files"), 0)); |
238 | if (!fileName.isEmpty()) { | 240 | if (!fileName.isEmpty()) { |
239 | mAlarmSound = fileName; | 241 | mAlarmSound = fileName; |
240 | QToolTip::remove(mAlarmSoundButton); | 242 | QToolTip::remove(mAlarmSoundButton); |
241 | QString dispStr = i18n("Playing '%1'").arg(fileName); | 243 | QString dispStr = i18n("Playing '%1'").arg(fileName); |
242 | QToolTip::add(mAlarmSoundButton, dispStr); | 244 | QToolTip::add(mAlarmSoundButton, dispStr); |
243 | mAlarmProgramButton->setOn(false); | 245 | mAlarmProgramButton->setOn(false); |
244 | mAlarmSoundButton->setOn(true); | 246 | mAlarmSoundButton->setOn(true); |
245 | } else { | 247 | } else { |
246 | mAlarmProgramButton->setOn(true); | 248 | mAlarmProgramButton->setOn(true); |
247 | mAlarmSoundButton->setOn(false); | 249 | mAlarmSoundButton->setOn(false); |
248 | 250 | ||
249 | } | 251 | } |
250 | } | 252 | } |
251 | 253 | ||
252 | if (mAlarmProgramButton->isOn()) | 254 | if (mAlarmProgramButton->isOn()) |
253 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); | 255 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); |
254 | if ( mAlarmSoundButton->isOn()) | 256 | if ( mAlarmSoundButton->isOn()) |
255 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio.Al.: ") + getFittingPath(mAlarmSound) ); | 257 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); |
256 | } | 258 | } |
257 | 259 | ||
258 | void KOEditorGeneral::pickAlarmProgram() | 260 | void KOEditorGeneral::pickAlarmProgram() |
259 | { | 261 | { |
260 | if (!mAlarmProgramButton->isOn()) { | 262 | if (!mAlarmProgramButton->isOn()) { |
261 | //mAlarmProgram = ""; | 263 | //mAlarmProgram = ""; |
262 | QToolTip::remove(mAlarmProgramButton); | 264 | QToolTip::remove(mAlarmProgramButton); |
263 | QToolTip::add(mAlarmProgramButton, i18n("No program set")); | 265 | QToolTip::add(mAlarmProgramButton, i18n("No program set")); |
264 | mAlarmProgramButton->setOn(false); | 266 | mAlarmProgramButton->setOn(false); |
265 | mAlarmSoundButton->setOn(true); | 267 | mAlarmSoundButton->setOn(true); |
268 | pickAlarmSound(); | ||
266 | } else { | 269 | } else { |
267 | QString fileName(KFileDialog::getOpenFileName(mAlarmProgram,i18n("Procedure Alarm.: ") , 0)); | 270 | QString fileName(KFileDialog::getOpenFileName(mAlarmProgram,i18n("Procedure Alarm: ") , 0)); |
268 | if (!fileName.isEmpty()) { | 271 | if (!fileName.isEmpty()) { |
269 | mAlarmProgram = fileName; | 272 | mAlarmProgram = fileName; |
270 | QToolTip::remove(mAlarmProgramButton); | 273 | QToolTip::remove(mAlarmProgramButton); |
271 | QString dispStr = i18n("Running '%1'").arg(fileName); | 274 | QString dispStr = i18n("Running '%1'").arg(fileName); |
272 | QToolTip::add(mAlarmProgramButton, dispStr); | 275 | QToolTip::add(mAlarmProgramButton, dispStr); |
273 | mAlarmSoundButton->setOn(false); | 276 | mAlarmSoundButton->setOn(false); |
274 | mAlarmProgramButton->setOn(true); | 277 | mAlarmProgramButton->setOn(true); |
275 | } else { | 278 | } else { |
276 | mAlarmProgramButton->setOn(false); | 279 | mAlarmProgramButton->setOn(false); |
277 | mAlarmSoundButton->setOn(true); | 280 | mAlarmSoundButton->setOn(true); |
278 | } | 281 | } |
279 | } | 282 | } |
280 | if (mAlarmProgramButton->isOn()) | 283 | if (mAlarmProgramButton->isOn()) |
281 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); | 284 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); |
282 | if ( mAlarmSoundButton->isOn()) | 285 | if ( mAlarmSoundButton->isOn()) |
283 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Sound.Al.: ") + getFittingPath(mAlarmSound) ); | 286 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); |
284 | } | 287 | } |
285 | 288 | ||
286 | 289 | ||
287 | QString KOEditorGeneral::getFittingPath( const QString s ) | 290 | QString KOEditorGeneral::getFittingPath( const QString s ) |
288 | { | 291 | { |
289 | int maxlen = 50; | 292 | int maxlen = 50; |
290 | if ( QApplication::desktop()->width() < 640 ) { | 293 | if ( QApplication::desktop()->width() < 640 ) { |
291 | if ( QApplication::desktop()->width() < 320 ) | 294 | if ( QApplication::desktop()->width() < 320 ) |
292 | maxlen = 22; | 295 | maxlen = 22; |
293 | else | 296 | else |
294 | maxlen = 35; | 297 | maxlen = 35; |
295 | } | 298 | } |
296 | if ( s.length() > maxlen ) { | 299 | if ( s.length() > maxlen ) { |
297 | return "..."+s.right(maxlen -3); | 300 | return "..."+s.right(maxlen -3); |
298 | } | 301 | } |
299 | return s; | 302 | return s; |
300 | } | 303 | } |
301 | 304 | ||
302 | void KOEditorGeneral::enableAlarmEdit(bool enable) | 305 | void KOEditorGeneral::enableAlarmEdit(bool enable) |
303 | { | 306 | { |
304 | if ( enable ) { | 307 | if ( enable ) { |
305 | if (!mAlarmProgramButton->isOn() && !mAlarmSoundButton->isOn()) { | 308 | if (!mAlarmProgramButton->isOn() && !mAlarmSoundButton->isOn()) { |
306 | mAlarmSoundButton->setOn( true ); | 309 | mAlarmSoundButton->setOn( true ); |
307 | if ( mAlarmSound.isEmpty() ) | 310 | if ( mAlarmSound.isEmpty() ) |
308 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; | 311 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; |
309 | else { | 312 | else { |
310 | if ( ! QFile::exists( mAlarmSound ) ) | 313 | if ( ! QFile::exists( mAlarmSound ) ) |
311 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; | 314 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; |
312 | } | 315 | } |
313 | } | 316 | } |
314 | if (mAlarmProgramButton->isOn()) | 317 | if (mAlarmProgramButton->isOn()) |
315 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); | 318 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); |
316 | if (!mAlarmSound.isEmpty() && mAlarmSoundButton->isOn()) | 319 | if (!mAlarmSound.isEmpty() && mAlarmSoundButton->isOn()) |
317 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); | 320 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); |
318 | } | 321 | } |
319 | else { | 322 | else { |
320 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Alarm disabled for this item")); | 323 | ((QWidget*)parent())->topLevelWidget()->setCaption(mAlarmMessage); |
324 | //((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Edit item: ") + mSummaryEdit->currentText()); | ||
325 | |||
321 | 326 | ||
322 | } | 327 | } |
323 | mAlarmTimeEdit->setEnabled(enable); | 328 | mAlarmTimeEdit->setEnabled(enable); |
324 | mAlarmSoundButton->setEnabled(enable); | 329 | mAlarmSoundButton->setEnabled(enable); |
325 | mAlarmProgramButton->setEnabled(enable); | 330 | mAlarmProgramButton->setEnabled(enable); |
326 | mAlarmIncrCombo->setEnabled(enable); | 331 | mAlarmIncrCombo->setEnabled(enable); |
327 | } | 332 | } |
328 | 333 | ||
329 | void KOEditorGeneral::disableAlarmEdit(bool disable) | 334 | void KOEditorGeneral::disableAlarmEdit(bool disable) |
330 | { | 335 | { |
331 | enableAlarmEdit( !disable ); | 336 | enableAlarmEdit( !disable ); |
332 | } | 337 | } |
333 | 338 | ||
334 | void KOEditorGeneral::enableAlarm( bool enable ) | 339 | void KOEditorGeneral::enableAlarm( bool enable ) |
335 | { | 340 | { |
336 | enableAlarmEdit( enable ); | 341 | enableAlarmEdit( enable ); |
337 | } | 342 | } |
338 | 343 | ||
339 | void KOEditorGeneral::alarmDisable(bool disable) | 344 | void KOEditorGeneral::alarmDisable(bool disable) |
340 | { | 345 | { |
341 | if (!disable) { | 346 | if (!disable) { |
342 | //mAlarmBell->setEnabled(true); | 347 | //mAlarmBell->setEnabled(true); |
343 | mAlarmButton->setEnabled(true); | 348 | mAlarmButton->setEnabled(true); |
344 | } else { | 349 | } else { |
345 | //mAlarmBell->setEnabled(false); | 350 | //mAlarmBell->setEnabled(false); |
346 | mAlarmButton->setEnabled(false); | 351 | mAlarmButton->setEnabled(false); |
347 | mAlarmButton->setChecked(false); | 352 | mAlarmButton->setChecked(false); |
348 | mAlarmTimeEdit->setEnabled(false); | 353 | mAlarmTimeEdit->setEnabled(false); |
349 | mAlarmSoundButton->setEnabled(false); | 354 | mAlarmSoundButton->setEnabled(false); |
350 | mAlarmProgramButton->setEnabled(false); | 355 | mAlarmProgramButton->setEnabled(false); |
351 | mAlarmIncrCombo->setEnabled(false); | 356 | mAlarmIncrCombo->setEnabled(false); |
352 | } | 357 | } |
353 | } | 358 | } |
354 | 359 | ||
355 | void KOEditorGeneral::setCategories(const QString &str) | 360 | void KOEditorGeneral::setCategories(const QString &str) |
356 | { | 361 | { |
357 | mCategoriesLabel->setText(str); | 362 | mCategoriesLabel->setText(str); |
358 | } | 363 | } |
359 | 364 | ||
360 | void KOEditorGeneral::setDefaults(bool allDay) | 365 | void KOEditorGeneral::setDefaults(bool allDay) |
361 | { | 366 | { |
362 | #if 0 | 367 | #if 0 |
363 | mOwnerLabel->setText(i18n("Owner: ") + KOPrefs::instance()->fullName()); | 368 | mOwnerLabel->setText(i18n("Owner: ") + KOPrefs::instance()->fullName()); |
364 | #endif | 369 | #endif |
365 | 370 | ||
371 | mAlarmMessage = i18n("Edit new item"); | ||
366 | enableAlarmEdit( !allDay ); | 372 | enableAlarmEdit( !allDay ); |
367 | 373 | ||
368 | // TODO: Implement a KPrefsComboItem to solve this in a clean way. | 374 | // TODO: Implement a KPrefsComboItem to solve this in a clean way. |
369 | int alarmTime; | 375 | int alarmTime; |
370 | int a[] = { 1,5,10,15,30,60,180, 1440 }; | 376 | int a[] = { 1,5,10,15,30,60,180, 1440 }; |
371 | int index = KOPrefs::instance()->mAlarmTime; | 377 | int index = KOPrefs::instance()->mAlarmTime; |
372 | if (index < 0 || index > 7) { | 378 | if (index < 0 || index > 7) { |
373 | alarmTime = 15; | 379 | alarmTime = 15; |
374 | } else { | 380 | } else { |
375 | alarmTime = a[index]; | 381 | alarmTime = a[index]; |
376 | } | 382 | } |
377 | mAlarmButton ->setChecked( false ); | 383 | mAlarmButton ->setChecked( false ); |
378 | mAlarmTimeEdit->setValue(alarmTime); | 384 | mAlarmTimeEdit->setValue(alarmTime); |
379 | mAlarmIncrCombo->setCurrentItem(0); | 385 | mAlarmIncrCombo->setCurrentItem(0); |
380 | enableAlarmEdit( false ); | 386 | enableAlarmEdit( false ); |
381 | //alarmDisable (false); | 387 | //alarmDisable (false); |
382 | mSecrecyCombo->setCurrentItem(Incidence::SecrecyPublic); | 388 | mSecrecyCombo->setCurrentItem(Incidence::SecrecyPublic); |
383 | mCancelBox->setChecked( false ); | 389 | mCancelBox->setChecked( false ); |
384 | mSummaryEdit->setEditText(""); | 390 | mSummaryEdit->setEditText(""); |
385 | mLocationEdit->setEditText(""); | 391 | mLocationEdit->setEditText(""); |
386 | mDescriptionEdit->setText(""); | 392 | mDescriptionEdit->setText(""); |
387 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; | 393 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; |
388 | setCategories(""); | 394 | setCategories(""); |
389 | } | 395 | } |
390 | void KOEditorGeneral::setSecrecy( int num ) | 396 | void KOEditorGeneral::setSecrecy( int num ) |
391 | { | 397 | { |
392 | mSecrecyCombo->setCurrentItem(num); | 398 | mSecrecyCombo->setCurrentItem(num); |
393 | } | 399 | } |
394 | void KOEditorGeneral::readIncidence(Incidence *event) | 400 | void KOEditorGeneral::readIncidence(Incidence *event) |
395 | { | 401 | { |
396 | 402 | ||
403 | mAlarmMessage = i18n("Edit") +" "+event->summary(); | ||
397 | mAlarmIncrCombo->setCurrentItem(0); | 404 | mAlarmIncrCombo->setCurrentItem(0); |
398 | mSummaryEdit->setEditText(event->summary()); | 405 | mSummaryEdit->setEditText(event->summary()); |
399 | mLocationEdit->setEditText(event->location()); | 406 | mLocationEdit->setEditText(event->location()); |
400 | mDescriptionEdit->setText(event->description()); | 407 | mDescriptionEdit->setText(event->description()); |
401 | 408 | ||
402 | #if 0 | 409 | #if 0 |
403 | // organizer information | 410 | // organizer information |
404 | mOwnerLabel->setText(i18n("Owner: ") + event->organizer()); | 411 | mOwnerLabel->setText(i18n("Owner: ") + event->organizer()); |
405 | #endif | 412 | #endif |
406 | 413 | ||
407 | enableAlarmEdit( event->isAlarmEnabled() ); | 414 | enableAlarmEdit( event->isAlarmEnabled() ); |
408 | //qDebug("KOEditorGeneral::readIncidence(Incidence *event) "); | 415 | //qDebug("KOEditorGeneral::readIncidence(Incidence *event) "); |
409 | if(!event->isAlarmEnabled()) { | 416 | if(!event->isAlarmEnabled()) { |
410 | // TODO: Implement a KPrefsComboItem to solve this in a clean way. | 417 | // TODO: Implement a KPrefsComboItem to solve this in a clean way. |
411 | int alarmTime; | 418 | int alarmTime; |
412 | int a[] = { 1,5,10,15,30,60,180, 1440 }; | 419 | int a[] = { 1,5,10,15,30,60,180, 1440 }; |
413 | int index = KOPrefs::instance()->mAlarmTime; | 420 | int index = KOPrefs::instance()->mAlarmTime; |
414 | if (index < 0 || index > 7) { | 421 | if (index < 0 || index > 7) { |
415 | alarmTime = 15; | 422 | alarmTime = 15; |
416 | } else { | 423 | } else { |
417 | alarmTime = a[index]; | 424 | alarmTime = a[index]; |
418 | } | 425 | } |
419 | mAlarmTimeEdit->setValue(alarmTime); | 426 | mAlarmTimeEdit->setValue(alarmTime); |
420 | } | 427 | } |
421 | mAlarmButton->setChecked( event->isAlarmEnabled() ); | 428 | mAlarmButton->setChecked( event->isAlarmEnabled() ); |
422 | mSecrecyCombo->setCurrentItem(event->secrecy()); | 429 | mSecrecyCombo->setCurrentItem(event->secrecy()); |
423 | mCancelBox->setChecked( event->cancelled() ); | 430 | mCancelBox->setChecked( event->cancelled() ); |
424 | mAlarmProgramButton->setOn(false); | 431 | mAlarmProgramButton->setOn(false); |
425 | mAlarmSoundButton->setOn(false); | 432 | mAlarmSoundButton->setOn(false); |
426 | 433 | ||
427 | // set up alarm stuff | 434 | // set up alarm stuff |
428 | QPtrList<Alarm> alarms = event->alarms(); | 435 | QPtrList<Alarm> alarms = event->alarms(); |
429 | Alarm* alarm; | 436 | Alarm* alarm; |
430 | mAlarmIncrCombo->setCurrentItem(0); | 437 | mAlarmIncrCombo->setCurrentItem(0); |
431 | for ( alarm = alarms.first(); alarm; alarm = alarms.next() ) { | 438 | for ( alarm = alarms.first(); alarm; alarm = alarms.next() ) { |
432 | int offset; | 439 | int offset; |
433 | if ( alarm->hasTime() ) { | 440 | if ( alarm->hasTime() ) { |
434 | QDateTime t = alarm->time(); | 441 | QDateTime t = alarm->time(); |
435 | offset = event->dtStart().secsTo( t ); | 442 | offset = event->dtStart().secsTo( t ); |
436 | } else { | 443 | } else { |
437 | offset = alarm->startOffset().asSeconds(); | 444 | offset = alarm->startOffset().asSeconds(); |
438 | } | 445 | } |
439 | if ( offset != 0 ) { | 446 | if ( offset != 0 ) { |
440 | offset = offset / -60; // make minutes | 447 | offset = offset / -60; // make minutes |
441 | if (offset % 60 == 0) { // divides evenly into hours? | 448 | if (offset % 60 == 0) { // divides evenly into hours? |
442 | offset = offset / 60; | 449 | offset = offset / 60; |
443 | mAlarmIncrCombo->setCurrentItem(1); | 450 | mAlarmIncrCombo->setCurrentItem(1); |
444 | if (offset % 24 == 0) { // divides evenly into days? | 451 | if (offset % 24 == 0) { // divides evenly into days? |
445 | offset = offset / 24; | 452 | offset = offset / 24; |
446 | mAlarmIncrCombo->setCurrentItem(2); | 453 | mAlarmIncrCombo->setCurrentItem(2); |
447 | } | 454 | } |
448 | } | 455 | } |
449 | } | 456 | } |
450 | mAlarmTimeEdit->setValue( offset ); | 457 | mAlarmTimeEdit->setValue( offset ); |
451 | if (alarm->type() == Alarm::Procedure) { | 458 | if (alarm->type() == Alarm::Procedure) { |
452 | 459 | ||
453 | mAlarmProgram = alarm->programFile(); | 460 | mAlarmProgram = alarm->programFile(); |
454 | mAlarmProgramButton->setOn(true); | 461 | mAlarmProgramButton->setOn(true); |
455 | QString dispStr = i18n("Running '%1'").arg(mAlarmProgram); | 462 | QString dispStr = i18n("Running '%1'").arg(mAlarmProgram); |
456 | QToolTip::add(mAlarmProgramButton, dispStr); | 463 | QToolTip::add(mAlarmProgramButton, dispStr); |
457 | } | 464 | } |
458 | else if (alarm->type() == Alarm::Audio) { | 465 | else if (alarm->type() == Alarm::Audio) { |
459 | mAlarmSound = alarm->audioFile(); | 466 | mAlarmSound = alarm->audioFile(); |
460 | if ( ! QFile::exists( mAlarmSound ) ) | 467 | if ( ! QFile::exists( mAlarmSound ) ) |
461 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; | 468 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; |
462 | mAlarmSoundButton->setOn(true); | 469 | mAlarmSoundButton->setOn(true); |
463 | QString dispStr = i18n("Playing '%1'").arg(mAlarmSound); | 470 | QString dispStr = i18n("Playing '%1'").arg(mAlarmSound); |
464 | QToolTip::add(mAlarmSoundButton, dispStr); | 471 | QToolTip::add(mAlarmSoundButton, dispStr); |
465 | } | 472 | } |
466 | mAlarmButton->setChecked(alarm->enabled()); | 473 | mAlarmButton->setChecked(alarm->enabled()); |
467 | enableAlarmEdit( alarm->enabled() ); | 474 | enableAlarmEdit( alarm->enabled() ); |
468 | //qDebug("nableAlarmEdit( alarm->enabled() )********* "); | 475 | //qDebug("nableAlarmEdit( alarm->enabled() )********* "); |
469 | // TODO: Deal with multiple alarms | 476 | // TODO: Deal with multiple alarms |
470 | break; // For now, stop after the first alarm | 477 | break; // For now, stop after the first alarm |
471 | } | 478 | } |
472 | 479 | ||
473 | setCategories(event->categoriesStr()); | 480 | setCategories(event->categoriesStr()); |
474 | } | 481 | } |
475 | 482 | ||
476 | void KOEditorGeneral::writeIncidence(Incidence *event) | 483 | void KOEditorGeneral::writeIncidence(Incidence *event) |
477 | { | 484 | { |
478 | // kdDebug() << "KOEditorGeneral::writeEvent()" << endl; | 485 | // kdDebug() << "KOEditorGeneral::writeEvent()" << endl; |
479 | mLocationEdit->save(KOLocationBox::LOCATION); | 486 | mLocationEdit->save(KOLocationBox::LOCATION); |
480 | event->setSummary(mSummaryEdit->currentText()); | 487 | event->setSummary(mSummaryEdit->currentText()); |
481 | event->setLocation(mLocationEdit->currentText()); | 488 | event->setLocation(mLocationEdit->currentText()); |
482 | event->setDescription(mDescriptionEdit->text()); | 489 | event->setDescription(mDescriptionEdit->text()); |
483 | event->setCategories(mCategoriesLabel->text()); | 490 | event->setCategories(mCategoriesLabel->text()); |
484 | event->setSecrecy(mSecrecyCombo->currentItem()); | 491 | event->setSecrecy(mSecrecyCombo->currentItem()); |
485 | event->setCancelled(mCancelBox->isChecked() );; | 492 | event->setCancelled(mCancelBox->isChecked() );; |
486 | // alarm stuff | 493 | // alarm stuff |
487 | if (mAlarmButton->isChecked()) { | 494 | if (mAlarmButton->isChecked()) { |
488 | if (event->alarms().count() == 0) | 495 | if (event->alarms().count() == 0) |
489 | event->newAlarm(); | 496 | event->newAlarm(); |
490 | QPtrList<Alarm> alarms = event->alarms(); | 497 | QPtrList<Alarm> alarms = event->alarms(); |
491 | Alarm *alarm; | 498 | Alarm *alarm; |
492 | for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { | 499 | for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { |
493 | alarm->setEnabled(true); | 500 | alarm->setEnabled(true); |
494 | int j = mAlarmTimeEdit->value()* -60; | 501 | int j = mAlarmTimeEdit->value()* -60; |
495 | if (mAlarmIncrCombo->currentItem() == 1) | 502 | if (mAlarmIncrCombo->currentItem() == 1) |
496 | j = j * 60; | 503 | j = j * 60; |
497 | else if (mAlarmIncrCombo->currentItem() == 2) | 504 | else if (mAlarmIncrCombo->currentItem() == 2) |
498 | j = j * (60 * 24); | 505 | j = j * (60 * 24); |
499 | alarm->setStartOffset( j ); | 506 | alarm->setStartOffset( j ); |
500 | 507 | ||
501 | if (!mAlarmProgram.isEmpty() && mAlarmProgramButton->isOn()) { | 508 | if (!mAlarmProgram.isEmpty() && mAlarmProgramButton->isOn()) { |
502 | alarm->setProcedureAlarm(mAlarmProgram); | 509 | alarm->setProcedureAlarm(mAlarmProgram); |
503 | } | 510 | } |
504 | else if (!mAlarmSound.isEmpty() && mAlarmSoundButton->isOn()) | 511 | else if (!mAlarmSound.isEmpty() && mAlarmSoundButton->isOn()) |
505 | alarm->setAudioAlarm(mAlarmSound); | 512 | alarm->setAudioAlarm(mAlarmSound); |
506 | else | 513 | else |
507 | alarm->setType(Alarm::Invalid); | 514 | alarm->setType(Alarm::Invalid); |
508 | //alarm->setAudioAlarm("default"); | 515 | //alarm->setAudioAlarm("default"); |
509 | // TODO: Deal with multiple alarms | 516 | // TODO: Deal with multiple alarms |
510 | break; // For now, stop after the first alarm | 517 | break; // For now, stop after the first alarm |
511 | } | 518 | } |
512 | } else { | 519 | } else { |
513 | Alarm* alarm = event->alarms().first(); | 520 | Alarm* alarm = event->alarms().first(); |
514 | if ( alarm ) { | 521 | if ( alarm ) { |
515 | alarm->setEnabled(false); | 522 | alarm->setEnabled(false); |
516 | alarm->setType(Alarm::Invalid); | 523 | alarm->setType(Alarm::Invalid); |
517 | } | 524 | } |
518 | } | 525 | } |
519 | } | 526 | } |
diff --git a/korganizer/koeditorgeneral.h b/korganizer/koeditorgeneral.h index de8edaf..f4728c7 100644 --- a/korganizer/koeditorgeneral.h +++ b/korganizer/koeditorgeneral.h | |||
@@ -1,113 +1,114 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #ifndef KOEDITORGENERAL_H | 23 | #ifndef KOEDITORGENERAL_H |
24 | #define KOEDITORGENERAL_H | 24 | #define KOEDITORGENERAL_H |
25 | 25 | ||
26 | #include <qframe.h> | 26 | #include <qframe.h> |
27 | #include <qlabel.h> | 27 | #include <qlabel.h> |
28 | #include <qcheckbox.h> | 28 | #include <qcheckbox.h> |
29 | #include <qpushbutton.h> | 29 | #include <qpushbutton.h> |
30 | #include <qgroupbox.h> | 30 | #include <qgroupbox.h> |
31 | #include <qlineedit.h> | 31 | #include <qlineedit.h> |
32 | #include <qcombobox.h> | 32 | #include <qcombobox.h> |
33 | #include <qlistview.h> | 33 | #include <qlistview.h> |
34 | #include <qradiobutton.h> | 34 | #include <qradiobutton.h> |
35 | #include <qlayout.h> | 35 | #include <qlayout.h> |
36 | #include <qspinbox.h> | 36 | #include <qspinbox.h> |
37 | 37 | ||
38 | #include <ktextedit.h> | 38 | #include <ktextedit.h> |
39 | #include <krestrictedline.h> | 39 | #include <krestrictedline.h> |
40 | 40 | ||
41 | #include <libkcal/incidence.h> | 41 | #include <libkcal/incidence.h> |
42 | 42 | ||
43 | #include "ktimeedit.h" | 43 | #include "ktimeedit.h" |
44 | 44 | ||
45 | class KDateEdit; | 45 | class KDateEdit; |
46 | class KOLocationBox; | 46 | class KOLocationBox; |
47 | using namespace KCal; | 47 | using namespace KCal; |
48 | 48 | ||
49 | class KOEditorGeneral : public QObject | 49 | class KOEditorGeneral : public QObject |
50 | { | 50 | { |
51 | Q_OBJECT | 51 | Q_OBJECT |
52 | public: | 52 | public: |
53 | KOEditorGeneral (QObject* parent=0,const char* name=0); | 53 | KOEditorGeneral (QObject* parent=0,const char* name=0); |
54 | virtual ~KOEditorGeneral(); | 54 | virtual ~KOEditorGeneral(); |
55 | void setFocusOn( int i ); | 55 | void setFocusOn( int i ); |
56 | void initHeader(QWidget *,QBoxLayout *); | 56 | void initHeader(QWidget *,QBoxLayout *); |
57 | void initDescription(QWidget *,QBoxLayout *); | 57 | void initDescription(QWidget *,QBoxLayout *); |
58 | void initSecrecy(QWidget *,QBoxLayout *); | 58 | void initSecrecy(QWidget *,QBoxLayout *); |
59 | void initCategories(QWidget *,QBoxLayout *); | 59 | void initCategories(QWidget *,QBoxLayout *); |
60 | void initAlarm(QWidget *,QBoxLayout *); | 60 | void initAlarm(QWidget *,QBoxLayout *); |
61 | 61 | ||
62 | /** Set widgets to default values */ | 62 | /** Set widgets to default values */ |
63 | void setDefaults(bool allDay); | 63 | void setDefaults(bool allDay); |
64 | /** Read event object and setup widgets accordingly */ | 64 | /** Read event object and setup widgets accordingly */ |
65 | void readIncidence(Incidence *); | 65 | void readIncidence(Incidence *); |
66 | /** Write event settings to event object */ | 66 | /** Write event settings to event object */ |
67 | void writeIncidence(Incidence *); | 67 | void writeIncidence(Incidence *); |
68 | 68 | ||
69 | /** Check if the input is valid. */ | 69 | /** Check if the input is valid. */ |
70 | bool validateInput() { return true; } | 70 | bool validateInput() { return true; } |
71 | 71 | ||
72 | void enableAlarm( bool enable ); | 72 | void enableAlarm( bool enable ); |
73 | void setSecrecy( int num ); | 73 | void setSecrecy( int num ); |
74 | public slots: | 74 | public slots: |
75 | void setCategories(const QString &); | 75 | void setCategories(const QString &); |
76 | void editCategories(); | 76 | void editCategories(); |
77 | 77 | ||
78 | protected slots: | 78 | protected slots: |
79 | void enableAlarmEdit( bool enable ); | 79 | void enableAlarmEdit( bool enable ); |
80 | void disableAlarmEdit( bool disable ); | 80 | void disableAlarmEdit( bool disable ); |
81 | void alarmDisable( bool disable ); | 81 | void alarmDisable( bool disable ); |
82 | void pickAlarmSound(); | 82 | void pickAlarmSound(); |
83 | void pickAlarmProgram(); | 83 | void pickAlarmProgram(); |
84 | 84 | ||
85 | signals: | 85 | signals: |
86 | void openCategoryDialog(); | 86 | void openCategoryDialog(); |
87 | void allAccepted(); | 87 | void allAccepted(); |
88 | 88 | ||
89 | protected: | 89 | protected: |
90 | //QLineEdit *mSummaryEdit; | 90 | //QLineEdit *mSummaryEdit; |
91 | //QLineEdit *mLocationEdit; | 91 | //QLineEdit *mLocationEdit; |
92 | KOLocationBox *mSummaryEdit; | 92 | KOLocationBox *mSummaryEdit; |
93 | KOLocationBox *mLocationEdit; | 93 | KOLocationBox *mLocationEdit; |
94 | QLabel *mAlarmBell; | 94 | QLabel *mAlarmBell; |
95 | QCheckBox *mAlarmButton; | 95 | QCheckBox *mAlarmButton; |
96 | QSpinBox *mAlarmTimeEdit; | 96 | QSpinBox *mAlarmTimeEdit; |
97 | QPushButton *mAlarmSoundButton; | 97 | QPushButton *mAlarmSoundButton; |
98 | QPushButton *mAlarmProgramButton; | 98 | QPushButton *mAlarmProgramButton; |
99 | QComboBox *mAlarmIncrCombo; | 99 | QComboBox *mAlarmIncrCombo; |
100 | KTextEdit *mDescriptionEdit; | 100 | KTextEdit *mDescriptionEdit; |
101 | QLabel *mOwnerLabel; | 101 | QLabel *mOwnerLabel; |
102 | QComboBox *mSecrecyCombo; | 102 | QComboBox *mSecrecyCombo; |
103 | QCheckBox *mCancelBox; | 103 | QCheckBox *mCancelBox; |
104 | QPushButton *mCategoriesButton; | 104 | QPushButton *mCategoriesButton; |
105 | QLabel *mCategoriesLabel; | 105 | QLabel *mCategoriesLabel; |
106 | 106 | ||
107 | private: | 107 | private: |
108 | QString getFittingPath( const QString ) ; | 108 | QString getFittingPath( const QString ) ; |
109 | QString mAlarmSound; | 109 | QString mAlarmSound; |
110 | QString mAlarmProgram; | 110 | QString mAlarmProgram; |
111 | QString mAlarmMessage; | ||
111 | }; | 112 | }; |
112 | 113 | ||
113 | #endif | 114 | #endif |
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index 7319285..184cb39 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp | |||
@@ -1,266 +1,260 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KDE-Pim/Pi. | 2 | This file is part of KDE-Pim/Pi. |
3 | Copyright (c) 2004 Ulf Schenk | 3 | Copyright (c) 2004 Ulf Schenk |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | // $Id$ | 21 | // $Id$ |
22 | 22 | ||
23 | #include "ksyncmanager.h" | 23 | #include "ksyncmanager.h" |
24 | 24 | ||
25 | #include <stdlib.h> | 25 | #include <stdlib.h> |
26 | 26 | ||
27 | #ifndef _WIN32_ | 27 | #ifndef _WIN32_ |
28 | #include <unistd.h> | 28 | #include <unistd.h> |
29 | #endif | 29 | #endif |
30 | 30 | ||
31 | 31 | ||
32 | #include "ksyncprofile.h" | 32 | #include "ksyncprofile.h" |
33 | #include "ksyncprefsdialog.h" | 33 | #include "ksyncprefsdialog.h" |
34 | #include "kpimprefs.h" | 34 | #include "kpimprefs.h" |
35 | #include <kmessagebox.h> | 35 | #include <kmessagebox.h> |
36 | 36 | ||
37 | #include <qdir.h> | 37 | #include <qdir.h> |
38 | #include <qprogressbar.h> | 38 | #include <qprogressbar.h> |
39 | #include <qpopupmenu.h> | 39 | #include <qpopupmenu.h> |
40 | #include <qpushbutton.h> | 40 | #include <qpushbutton.h> |
41 | #include <qradiobutton.h> | 41 | #include <qradiobutton.h> |
42 | #include <qbuttongroup.h> | 42 | #include <qbuttongroup.h> |
43 | #include <qtimer.h> | 43 | #include <qtimer.h> |
44 | #include <qmessagebox.h> | 44 | #include <qmessagebox.h> |
45 | #include <qapplication.h> | 45 | #include <qapplication.h> |
46 | #include <qlineedit.h> | 46 | #include <qlineedit.h> |
47 | #include <qdialog.h> | 47 | #include <qdialog.h> |
48 | #include <qlayout.h> | 48 | #include <qlayout.h> |
49 | #include <qtextcodec.h> | 49 | #include <qtextcodec.h> |
50 | #include <qlabel.h> | 50 | #include <qlabel.h> |
51 | #include <qcheckbox.h> | 51 | #include <qcheckbox.h> |
52 | 52 | ||
53 | #include <klocale.h> | 53 | #include <klocale.h> |
54 | #include <kglobal.h> | 54 | #include <kglobal.h> |
55 | #include <kconfig.h> | 55 | #include <kconfig.h> |
56 | #include <kfiledialog.h> | 56 | #include <kfiledialog.h> |
57 | 57 | ||
58 | QDateTime KSyncManager::mRequestedSyncEvent; | 58 | QDateTime KSyncManager::mRequestedSyncEvent; |
59 | 59 | ||
60 | 60 | ||
61 | KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu) | 61 | KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu) |
62 | : QObject(), mPrefs(prefs ), mParent(parent),mImplementation(implementation), mTargetApp(ta), mSyncMenu(syncmenu) | 62 | : QObject(), mPrefs(prefs ), mParent(parent),mImplementation(implementation), mTargetApp(ta), mSyncMenu(syncmenu) |
63 | { | 63 | { |
64 | mServerSocket = 0; | 64 | mServerSocket = 0; |
65 | bar = new QProgressBar ( 1, 0 ); | 65 | bar = new QProgressBar ( 1, 0 ); |
66 | bar->setCaption (""); | 66 | bar->setCaption (""); |
67 | mWriteBackInPast = 2; | 67 | mWriteBackInPast = 2; |
68 | int w = 300; | 68 | |
69 | if ( QApplication::desktop()->width() < 320 ) | ||
70 | w = 220; | ||
71 | int h = bar->sizeHint().height() ; | ||
72 | int dw = QApplication::desktop()->width(); | ||
73 | int dh = QApplication::desktop()->height(); | ||
74 | bar->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | ||
75 | 69 | ||
76 | } | 70 | } |
77 | 71 | ||
78 | KSyncManager::~KSyncManager() | 72 | KSyncManager::~KSyncManager() |
79 | { | 73 | { |
80 | delete bar; | 74 | delete bar; |
81 | } | 75 | } |
82 | 76 | ||
83 | void KSyncManager::setDefaultFileName( QString s) | 77 | void KSyncManager::setDefaultFileName( QString s) |
84 | { | 78 | { |
85 | mDefFileName = s ; | 79 | mDefFileName = s ; |
86 | if ( mPrefs->mPassiveSyncAutoStart ) | 80 | if ( mPrefs->mPassiveSyncAutoStart ) |
87 | enableQuick( false ); | 81 | enableQuick( false ); |
88 | } | 82 | } |
89 | 83 | ||
90 | void KSyncManager::fillSyncMenu() | 84 | void KSyncManager::fillSyncMenu() |
91 | { | 85 | { |
92 | if ( mSyncMenu->count() ) | 86 | if ( mSyncMenu->count() ) |
93 | mSyncMenu->clear(); | 87 | mSyncMenu->clear(); |
94 | 88 | ||
95 | mSyncMenu->insertItem( i18n("Configure..."), 0 ); | 89 | mSyncMenu->insertItem( i18n("Configure..."), 0 ); |
96 | mSyncMenu->insertSeparator(); | 90 | mSyncMenu->insertSeparator(); |
97 | QPopupMenu *clearMenu = new QPopupMenu ( mSyncMenu ); | 91 | QPopupMenu *clearMenu = new QPopupMenu ( mSyncMenu ); |
98 | mSyncMenu->insertItem( i18n("Remove sync info"),clearMenu, 5000 ); | 92 | mSyncMenu->insertItem( i18n("Remove sync info"),clearMenu, 5000 ); |
99 | clearMenu->insertItem( i18n("For all profiles"), 1 ); | 93 | clearMenu->insertItem( i18n("For all profiles"), 1 ); |
100 | clearMenu->insertSeparator(); | 94 | clearMenu->insertSeparator(); |
101 | connect ( clearMenu, SIGNAL( activated ( int ) ), this, SLOT (slotClearMenu( int ) ) ); | 95 | connect ( clearMenu, SIGNAL( activated ( int ) ), this, SLOT (slotClearMenu( int ) ) ); |
102 | mSyncMenu->insertSeparator(); | 96 | mSyncMenu->insertSeparator(); |
103 | if ( mServerSocket == 0 ) { | 97 | if ( mServerSocket == 0 ) { |
104 | mSyncMenu->insertItem( i18n("Enable Pi-Sync"), 2 ); | 98 | mSyncMenu->insertItem( i18n("Enable Pi-Sync"), 2 ); |
105 | } else { | 99 | } else { |
106 | mSyncMenu->insertItem( i18n("Disable Pi-Sync"), 3 ); | 100 | mSyncMenu->insertItem( i18n("Disable Pi-Sync"), 3 ); |
107 | } | 101 | } |
108 | mSyncMenu->insertSeparator(); | 102 | mSyncMenu->insertSeparator(); |
109 | mSyncMenu->insertItem( i18n("Multiple sync"), 1 ); | 103 | mSyncMenu->insertItem( i18n("Multiple sync"), 1 ); |
110 | mSyncMenu->insertSeparator(); | 104 | mSyncMenu->insertSeparator(); |
111 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); | 105 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); |
112 | config.setGroup("General"); | 106 | config.setGroup("General"); |
113 | QStringList prof = config.readListEntry("SyncProfileNames"); | 107 | QStringList prof = config.readListEntry("SyncProfileNames"); |
114 | mLocalMachineName = config.readEntry("LocalMachineName","undefined"); | 108 | mLocalMachineName = config.readEntry("LocalMachineName","undefined"); |
115 | if ( prof.count() < 2 ) { | 109 | if ( prof.count() < 2 ) { |
116 | prof.clear(); | 110 | prof.clear(); |
117 | QString externalName; | 111 | QString externalName; |
118 | #ifdef DESKTOP_VERSION | 112 | #ifdef DESKTOP_VERSION |
119 | #ifdef _WIN32_ | 113 | #ifdef _WIN32_ |
120 | externalName = "OutLook(not_implemented)"; | 114 | externalName = "OutLook(not_implemented)"; |
121 | #else | 115 | #else |
122 | externalName = "KDE_Desktop"; | 116 | externalName = "KDE_Desktop"; |
123 | #endif | 117 | #endif |
124 | #else | 118 | #else |
125 | externalName = "Sharp_DTM"; | 119 | externalName = "Sharp_DTM"; |
126 | #endif | 120 | #endif |
127 | prof << externalName; | 121 | prof << externalName; |
128 | prof << i18n("Local_file"); | 122 | prof << i18n("Local_file"); |
129 | prof << i18n("Last_file"); | 123 | prof << i18n("Last_file"); |
130 | KSyncProfile* temp = new KSyncProfile (); | 124 | KSyncProfile* temp = new KSyncProfile (); |
131 | temp->setName( prof[0] ); | 125 | temp->setName( prof[0] ); |
132 | temp->writeConfig(&config); | 126 | temp->writeConfig(&config); |
133 | temp->setName( prof[1] ); | 127 | temp->setName( prof[1] ); |
134 | temp->writeConfig(&config); | 128 | temp->writeConfig(&config); |
135 | temp->setName( prof[2] ); | 129 | temp->setName( prof[2] ); |
136 | temp->writeConfig(&config); | 130 | temp->writeConfig(&config); |
137 | config.setGroup("General"); | 131 | config.setGroup("General"); |
138 | config.writeEntry("SyncProfileNames",prof); | 132 | config.writeEntry("SyncProfileNames",prof); |
139 | config.writeEntry("ExternSyncProfiles",externalName); | 133 | config.writeEntry("ExternSyncProfiles",externalName); |
140 | config.sync(); | 134 | config.sync(); |
141 | delete temp; | 135 | delete temp; |
142 | } | 136 | } |
143 | mExternSyncProfiles = config.readListEntry("ExternSyncProfiles"); | 137 | mExternSyncProfiles = config.readListEntry("ExternSyncProfiles"); |
144 | mSyncProfileNames = prof; | 138 | mSyncProfileNames = prof; |
145 | unsigned int i; | 139 | unsigned int i; |
146 | for ( i = 0; i < prof.count(); ++i ) { | 140 | for ( i = 0; i < prof.count(); ++i ) { |
147 | mSyncMenu->insertItem( prof[i], 1000+i ); | 141 | mSyncMenu->insertItem( prof[i], 1000+i ); |
148 | clearMenu->insertItem( prof[i], 1000+i ); | 142 | clearMenu->insertItem( prof[i], 1000+i ); |
149 | if ( i == 2 ) | 143 | if ( i == 2 ) |
150 | mSyncMenu->insertSeparator(); | 144 | mSyncMenu->insertSeparator(); |
151 | } | 145 | } |
152 | QDir app_dir; | 146 | QDir app_dir; |
153 | //US do not display SharpDTM if app is pwmpi, or no sharpfiles available | 147 | //US do not display SharpDTM if app is pwmpi, or no sharpfiles available |
154 | if ( mTargetApp == PWMPI) { | 148 | if ( mTargetApp == PWMPI) { |
155 | mSyncMenu->removeItem( 1000 ); | 149 | mSyncMenu->removeItem( 1000 ); |
156 | clearMenu->removeItem( 1000 ); | 150 | clearMenu->removeItem( 1000 ); |
157 | } | 151 | } |
158 | #ifndef DESKTOP_VERSION | 152 | #ifndef DESKTOP_VERSION |
159 | else if (!app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) { | 153 | else if (!app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) { |
160 | mSyncMenu->removeItem( 1000 ); | 154 | mSyncMenu->removeItem( 1000 ); |
161 | clearMenu->removeItem( 1000 ); | 155 | clearMenu->removeItem( 1000 ); |
162 | } | 156 | } |
163 | #endif | 157 | #endif |
164 | mSyncMenu->removeItem( 1002 ); | 158 | mSyncMenu->removeItem( 1002 ); |
165 | clearMenu->removeItem( 1002 ); | 159 | clearMenu->removeItem( 1002 ); |
166 | } | 160 | } |
167 | void KSyncManager::slotClearMenu( int action ) | 161 | void KSyncManager::slotClearMenu( int action ) |
168 | { | 162 | { |
169 | QString syncDevice; | 163 | QString syncDevice; |
170 | if ( action > 999 ) { | 164 | if ( action > 999 ) { |
171 | syncDevice = mSyncProfileNames[action - 1000] ; | 165 | syncDevice = mSyncProfileNames[action - 1000] ; |
172 | } | 166 | } |
173 | 167 | ||
174 | 168 | ||
175 | 169 | ||
176 | int result = 0; | 170 | int result = 0; |
177 | QString sd; | 171 | QString sd; |
178 | if ( syncDevice.isEmpty() ) | 172 | if ( syncDevice.isEmpty() ) |
179 | sd = i18n("Do you want to\nclear all sync info\nof all profiles?"); | 173 | sd = i18n("Do you want to\nclear all sync info\nof all profiles?"); |
180 | else | 174 | else |
181 | sd = i18n("Do you want to\nclear the sync\ninfo of profile\n%1?\n"). arg( syncDevice ); | 175 | sd = i18n("Do you want to\nclear the sync\ninfo of profile\n%1?\n"). arg( syncDevice ); |
182 | 176 | ||
183 | result = QMessageBox::warning( mParent, i18n("Warning!"),sd,i18n("OK"), i18n("Cancel"), 0, | 177 | result = QMessageBox::warning( mParent, i18n("Warning!"),sd,i18n("OK"), i18n("Cancel"), 0, |
184 | 0, 1 ); | 178 | 0, 1 ); |
185 | if ( result ) | 179 | if ( result ) |
186 | return; | 180 | return; |
187 | mImplementation->removeSyncInfo( syncDevice ); | 181 | mImplementation->removeSyncInfo( syncDevice ); |
188 | } | 182 | } |
189 | void KSyncManager::slotSyncMenu( int action ) | 183 | void KSyncManager::slotSyncMenu( int action ) |
190 | { | 184 | { |
191 | qDebug("KSM::syncaction %d ", action); | 185 | qDebug("KSM::syncaction %d ", action); |
192 | if ( action == 5000 ) | 186 | if ( action == 5000 ) |
193 | return; | 187 | return; |
194 | mSyncWithDesktop = false; | 188 | mSyncWithDesktop = false; |
195 | if ( action == 0 ) { | 189 | if ( action == 0 ) { |
196 | 190 | ||
197 | // seems to be a Qt2 event handling bug | 191 | // seems to be a Qt2 event handling bug |
198 | // syncmenu.clear causes a segfault at first time | 192 | // syncmenu.clear causes a segfault at first time |
199 | // when we call it after the main event loop, it is ok | 193 | // when we call it after the main event loop, it is ok |
200 | // same behaviour when calling OM/Pi via QCOP for the first time | 194 | // same behaviour when calling OM/Pi via QCOP for the first time |
201 | QTimer::singleShot ( 1, this, SLOT ( confSync() ) ); | 195 | QTimer::singleShot ( 1, this, SLOT ( confSync() ) ); |
202 | //confSync(); | 196 | //confSync(); |
203 | 197 | ||
204 | return; | 198 | return; |
205 | } | 199 | } |
206 | if ( action == 1 ) { | 200 | if ( action == 1 ) { |
207 | multiSync( true ); | 201 | multiSync( true ); |
208 | return; | 202 | return; |
209 | } | 203 | } |
210 | if ( action == 2 ) { | 204 | if ( action == 2 ) { |
211 | enableQuick(); | 205 | enableQuick(); |
212 | QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); | 206 | QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); |
213 | return; | 207 | return; |
214 | } | 208 | } |
215 | if ( action == 3 ) { | 209 | if ( action == 3 ) { |
216 | delete mServerSocket; | 210 | delete mServerSocket; |
217 | mServerSocket = 0; | 211 | mServerSocket = 0; |
218 | QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); | 212 | QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); |
219 | return; | 213 | return; |
220 | } | 214 | } |
221 | 215 | ||
222 | if (blockSave()) | 216 | if (blockSave()) |
223 | return; | 217 | return; |
224 | 218 | ||
225 | setBlockSave(true); | 219 | setBlockSave(true); |
226 | bool silent = false; | 220 | bool silent = false; |
227 | if ( action == 999 ) { | 221 | if ( action == 999 ) { |
228 | //special mode for silent syncing | 222 | //special mode for silent syncing |
229 | action = 1000; | 223 | action = 1000; |
230 | silent = true; | 224 | silent = true; |
231 | } | 225 | } |
232 | 226 | ||
233 | mCurrentSyncProfile = action - 1000 ; | 227 | mCurrentSyncProfile = action - 1000 ; |
234 | mCurrentSyncDevice = mSyncProfileNames[mCurrentSyncProfile] ; | 228 | mCurrentSyncDevice = mSyncProfileNames[mCurrentSyncProfile] ; |
235 | mCurrentSyncName = mLocalMachineName ; | 229 | mCurrentSyncName = mLocalMachineName ; |
236 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); | 230 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); |
237 | KSyncProfile* temp = new KSyncProfile (); | 231 | KSyncProfile* temp = new KSyncProfile (); |
238 | temp->setName(mSyncProfileNames[mCurrentSyncProfile]); | 232 | temp->setName(mSyncProfileNames[mCurrentSyncProfile]); |
239 | temp->readConfig(&config); | 233 | temp->readConfig(&config); |
240 | if (silent) { | 234 | if (silent) { |
241 | mAskForPreferences = false; | 235 | mAskForPreferences = false; |
242 | mShowSyncSummary = false; | 236 | mShowSyncSummary = false; |
243 | mWriteBackFile = true; | 237 | mWriteBackFile = true; |
244 | mSyncAlgoPrefs = 2;// take newest | 238 | mSyncAlgoPrefs = 2;// take newest |
245 | } | 239 | } |
246 | else { | 240 | else { |
247 | mAskForPreferences = temp->getAskForPreferences(); | 241 | mAskForPreferences = temp->getAskForPreferences(); |
248 | mShowSyncSummary = temp->getShowSummaryAfterSync(); | 242 | mShowSyncSummary = temp->getShowSummaryAfterSync(); |
249 | mWriteBackFile = temp->getWriteBackFile(); | 243 | mWriteBackFile = temp->getWriteBackFile(); |
250 | mSyncAlgoPrefs = temp->getSyncPrefs(); | 244 | mSyncAlgoPrefs = temp->getSyncPrefs(); |
251 | } | 245 | } |
252 | mWriteBackExistingOnly = temp->getWriteBackExisting(); | 246 | mWriteBackExistingOnly = temp->getWriteBackExisting(); |
253 | mIsKapiFile = temp->getIsKapiFile(); | 247 | mIsKapiFile = temp->getIsKapiFile(); |
254 | mWriteBackInFuture = 0; | 248 | mWriteBackInFuture = 0; |
255 | if ( temp->getWriteBackFuture() ) { | 249 | if ( temp->getWriteBackFuture() ) { |
256 | mWriteBackInFuture = temp->getWriteBackFutureWeeks( ); | 250 | mWriteBackInFuture = temp->getWriteBackFutureWeeks( ); |
257 | mWriteBackInPast = temp->getWriteBackPastWeeks( ); | 251 | mWriteBackInPast = temp->getWriteBackPastWeeks( ); |
258 | } | 252 | } |
259 | mFilterInCal = temp->getFilterInCal(); | 253 | mFilterInCal = temp->getFilterInCal(); |
260 | mFilterOutCal = temp->getFilterOutCal(); | 254 | mFilterOutCal = temp->getFilterOutCal(); |
261 | mFilterInAB = temp->getFilterInAB(); | 255 | mFilterInAB = temp->getFilterInAB(); |
262 | mFilterOutAB = temp->getFilterOutAB(); | 256 | mFilterOutAB = temp->getFilterOutAB(); |
263 | 257 | ||
264 | if ( action == 1000 ) { | 258 | if ( action == 1000 ) { |
265 | mIsKapiFile = false; | 259 | mIsKapiFile = false; |
266 | #ifdef DESKTOP_VERSION | 260 | #ifdef DESKTOP_VERSION |
@@ -820,384 +814,391 @@ bool KSyncManager::edit_sync_options() | |||
820 | QRadioButton newest( i18n("Take newest entry on conflict"), &gr ); | 814 | QRadioButton newest( i18n("Take newest entry on conflict"), &gr ); |
821 | QRadioButton ask( i18n("Ask for every entry on conflict"), &gr ); | 815 | QRadioButton ask( i18n("Ask for every entry on conflict"), &gr ); |
822 | QRadioButton f_loc( i18n("Force: Take local entry always"), &gr ); | 816 | QRadioButton f_loc( i18n("Force: Take local entry always"), &gr ); |
823 | QRadioButton f_rem( i18n("Force: Take remote entry always"), &gr ); | 817 | QRadioButton f_rem( i18n("Force: Take remote entry always"), &gr ); |
824 | //QRadioButton both( i18n("Take both on conflict"), &gr ); | 818 | //QRadioButton both( i18n("Take both on conflict"), &gr ); |
825 | QPushButton pb ( "OK", &dia); | 819 | QPushButton pb ( "OK", &dia); |
826 | lay.addWidget( &pb ); | 820 | lay.addWidget( &pb ); |
827 | connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) ); | 821 | connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) ); |
828 | switch ( mSyncAlgoPrefs ) { | 822 | switch ( mSyncAlgoPrefs ) { |
829 | case 0: | 823 | case 0: |
830 | loc.setChecked( true); | 824 | loc.setChecked( true); |
831 | break; | 825 | break; |
832 | case 1: | 826 | case 1: |
833 | rem.setChecked( true ); | 827 | rem.setChecked( true ); |
834 | break; | 828 | break; |
835 | case 2: | 829 | case 2: |
836 | newest.setChecked( true); | 830 | newest.setChecked( true); |
837 | break; | 831 | break; |
838 | case 3: | 832 | case 3: |
839 | ask.setChecked( true); | 833 | ask.setChecked( true); |
840 | break; | 834 | break; |
841 | case 4: | 835 | case 4: |
842 | f_loc.setChecked( true); | 836 | f_loc.setChecked( true); |
843 | break; | 837 | break; |
844 | case 5: | 838 | case 5: |
845 | f_rem.setChecked( true); | 839 | f_rem.setChecked( true); |
846 | break; | 840 | break; |
847 | case 6: | 841 | case 6: |
848 | // both.setChecked( true); | 842 | // both.setChecked( true); |
849 | break; | 843 | break; |
850 | default: | 844 | default: |
851 | break; | 845 | break; |
852 | } | 846 | } |
853 | if ( dia.exec() ) { | 847 | if ( dia.exec() ) { |
854 | mSyncAlgoPrefs = rem.isChecked()*1+newest.isChecked()*2+ ask.isChecked()*3+ f_loc.isChecked()*4+ f_rem.isChecked()*5;//+ both.isChecked()*6 ; | 848 | mSyncAlgoPrefs = rem.isChecked()*1+newest.isChecked()*2+ ask.isChecked()*3+ f_loc.isChecked()*4+ f_rem.isChecked()*5;//+ both.isChecked()*6 ; |
855 | return true; | 849 | return true; |
856 | } | 850 | } |
857 | return false; | 851 | return false; |
858 | } | 852 | } |
859 | 853 | ||
860 | QString KSyncManager::getPassword( ) | 854 | QString KSyncManager::getPassword( ) |
861 | { | 855 | { |
862 | QString retfile = ""; | 856 | QString retfile = ""; |
863 | QDialog dia ( mParent, "input-dialog", true ); | 857 | QDialog dia ( mParent, "input-dialog", true ); |
864 | QLineEdit lab ( &dia ); | 858 | QLineEdit lab ( &dia ); |
865 | lab.setEchoMode( QLineEdit::Password ); | 859 | lab.setEchoMode( QLineEdit::Password ); |
866 | QVBoxLayout lay( &dia ); | 860 | QVBoxLayout lay( &dia ); |
867 | lay.setMargin(7); | 861 | lay.setMargin(7); |
868 | lay.setSpacing(7); | 862 | lay.setSpacing(7); |
869 | lay.addWidget( &lab); | 863 | lay.addWidget( &lab); |
870 | dia.setFixedSize( 230,50 ); | 864 | dia.setFixedSize( 230,50 ); |
871 | dia.setCaption( i18n("Enter password") ); | 865 | dia.setCaption( i18n("Enter password") ); |
872 | QPushButton pb ( "OK", &dia); | 866 | QPushButton pb ( "OK", &dia); |
873 | lay.addWidget( &pb ); | 867 | lay.addWidget( &pb ); |
874 | connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) ); | 868 | connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) ); |
875 | dia.show(); | 869 | dia.show(); |
876 | int res = dia.exec(); | 870 | int res = dia.exec(); |
877 | if ( res ) | 871 | if ( res ) |
878 | retfile = lab.text(); | 872 | retfile = lab.text(); |
879 | dia.hide(); | 873 | dia.hide(); |
880 | qApp->processEvents(); | 874 | qApp->processEvents(); |
881 | return retfile; | 875 | return retfile; |
882 | 876 | ||
883 | } | 877 | } |
884 | 878 | ||
885 | 879 | ||
886 | void KSyncManager::confSync() | 880 | void KSyncManager::confSync() |
887 | { | 881 | { |
888 | static KSyncPrefsDialog* sp = 0; | 882 | static KSyncPrefsDialog* sp = 0; |
889 | if ( ! sp ) { | 883 | if ( ! sp ) { |
890 | sp = new KSyncPrefsDialog( mParent, "syncprefs", true ); | 884 | sp = new KSyncPrefsDialog( mParent, "syncprefs", true ); |
891 | } | 885 | } |
892 | sp->usrReadConfig(); | 886 | sp->usrReadConfig(); |
893 | #ifndef DESKTOP_VERSION | 887 | #ifndef DESKTOP_VERSION |
894 | sp->showMaximized(); | 888 | sp->showMaximized(); |
895 | #else | 889 | #else |
896 | sp->show(); | 890 | sp->show(); |
897 | #endif | 891 | #endif |
898 | sp->exec(); | 892 | sp->exec(); |
899 | QStringList oldSyncProfileNames = mSyncProfileNames; | 893 | QStringList oldSyncProfileNames = mSyncProfileNames; |
900 | mSyncProfileNames = sp->getSyncProfileNames(); | 894 | mSyncProfileNames = sp->getSyncProfileNames(); |
901 | mLocalMachineName = sp->getLocalMachineName (); | 895 | mLocalMachineName = sp->getLocalMachineName (); |
902 | int ii; | 896 | int ii; |
903 | for ( ii = 0; ii < oldSyncProfileNames.count(); ++ii ) { | 897 | for ( ii = 0; ii < oldSyncProfileNames.count(); ++ii ) { |
904 | if ( ! mSyncProfileNames.contains( oldSyncProfileNames[ii] ) ) | 898 | if ( ! mSyncProfileNames.contains( oldSyncProfileNames[ii] ) ) |
905 | mImplementation->removeSyncInfo( oldSyncProfileNames[ii] ); | 899 | mImplementation->removeSyncInfo( oldSyncProfileNames[ii] ); |
906 | } | 900 | } |
907 | QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); | 901 | QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); |
908 | } | 902 | } |
909 | void KSyncManager::syncKDE() | 903 | void KSyncManager::syncKDE() |
910 | { | 904 | { |
911 | mSyncWithDesktop = true; | 905 | mSyncWithDesktop = true; |
912 | emit save(); | 906 | emit save(); |
913 | switch(mTargetApp) | 907 | switch(mTargetApp) |
914 | { | 908 | { |
915 | case (KAPI): | 909 | case (KAPI): |
916 | { | 910 | { |
917 | #ifdef DESKTOP_VERSION | 911 | #ifdef DESKTOP_VERSION |
918 | QString command = qApp->applicationDirPath () + "/kdeabdump"; | 912 | QString command = qApp->applicationDirPath () + "/kdeabdump"; |
919 | #else | 913 | #else |
920 | QString command = "kdeabdump"; | 914 | QString command = "kdeabdump"; |
921 | #endif | 915 | #endif |
922 | if ( ! QFile::exists ( command ) ) | 916 | if ( ! QFile::exists ( command ) ) |
923 | command = "kdeabdump"; | 917 | command = "kdeabdump"; |
924 | QString fileName = QDir::homeDirPath ()+"/.kdeaddressbookdump.vcf"; | 918 | QString fileName = QDir::homeDirPath ()+"/.kdeaddressbookdump.vcf"; |
925 | int result = system ( command.latin1()); | 919 | int result = system ( command.latin1()); |
926 | qDebug("AB dump command call result: %d ", result); | 920 | qDebug("AB dump command call result: %d ", result); |
927 | if ( result != 0 ) { | 921 | if ( result != 0 ) { |
928 | KMessageBox::error( 0, i18n("Error accessing KDE addressbook data.\nMake sure the file\n/opt/kdepimpi/kdeabdump\nexists.The standard version of this file\nis for syncing with KDE 3.4.x.\nIf you are running KDE 3.3.x please\ndownload the KDE 3.3.x version of this file\nat http://sourceforge.net/projects/kdepimpi/\nsection: general files for KDE/Pim.")); | 922 | KMessageBox::error( 0, i18n("Error accessing KDE addressbook data.\nMake sure the file\n/opt/kdepimpi/kdeabdump\nexists.The standard version of this file\nis for syncing with KDE 3.4.x.\nIf you are running KDE 3.3.x please\ndownload the KDE 3.3.x version of this file\nat http://sourceforge.net/projects/kdepimpi/\nsection: general files for KDE/Pim.")); |
929 | return; | 923 | return; |
930 | } | 924 | } |
931 | if ( syncWithFile( fileName,true ) ) { | 925 | if ( syncWithFile( fileName,true ) ) { |
932 | if ( mWriteBackFile ) { | 926 | if ( mWriteBackFile ) { |
933 | command += " --read"; | 927 | command += " --read"; |
934 | system ( command.latin1()); | 928 | system ( command.latin1()); |
935 | } | 929 | } |
936 | } | 930 | } |
937 | 931 | ||
938 | } | 932 | } |
939 | break; | 933 | break; |
940 | case (KOPI): | 934 | case (KOPI): |
941 | { | 935 | { |
942 | #ifdef DESKTOP_VERSION | 936 | #ifdef DESKTOP_VERSION |
943 | QString command = qApp->applicationDirPath () + "/kdecaldump"; | 937 | QString command = qApp->applicationDirPath () + "/kdecaldump"; |
944 | #else | 938 | #else |
945 | QString command = "kdecaldump"; | 939 | QString command = "kdecaldump"; |
946 | #endif | 940 | #endif |
947 | if ( ! QFile::exists ( command ) ) | 941 | if ( ! QFile::exists ( command ) ) |
948 | command = "kdecaldump"; | 942 | command = "kdecaldump"; |
949 | QString fileName = QDir::homeDirPath ()+"/.kdecalendardump.ics"; | 943 | QString fileName = QDir::homeDirPath ()+"/.kdecalendardump.ics"; |
950 | int result = system ( command.latin1()); | 944 | int result = system ( command.latin1()); |
951 | qDebug("Cal dump command call result result: %d ", result); | 945 | qDebug("Cal dump command call result result: %d ", result); |
952 | if ( result != 0 ) { | 946 | if ( result != 0 ) { |
953 | KMessageBox::error( 0, i18n("Error accessing KDE calendar data.\nMake sure the file\n/opt/kdepimpi/kdecaldump\nexists.The standard version of this file\nis for syncing with KDE 3.4.x.\nIf you are running KDE 3.3.x please\ndownload the KDE 3.3.x version of this file\nat http://sourceforge.net/projects/kdepimpi/\nsection: general files for KDE/Pim.")); | 947 | KMessageBox::error( 0, i18n("Error accessing KDE calendar data.\nMake sure the file\n/opt/kdepimpi/kdecaldump\nexists.The standard version of this file\nis for syncing with KDE 3.4.x.\nIf you are running KDE 3.3.x please\ndownload the KDE 3.3.x version of this file\nat http://sourceforge.net/projects/kdepimpi/\nsection: general files for KDE/Pim.")); |
954 | return; | 948 | return; |
955 | } | 949 | } |
956 | if ( syncWithFile( fileName,true ) ) { | 950 | if ( syncWithFile( fileName,true ) ) { |
957 | if ( mWriteBackFile ) { | 951 | if ( mWriteBackFile ) { |
958 | command += " --read"; | 952 | command += " --read"; |
959 | system ( command.latin1()); | 953 | system ( command.latin1()); |
960 | } | 954 | } |
961 | } | 955 | } |
962 | 956 | ||
963 | } | 957 | } |
964 | break; | 958 | break; |
965 | case (PWMPI): | 959 | case (PWMPI): |
966 | 960 | ||
967 | break; | 961 | break; |
968 | default: | 962 | default: |
969 | qDebug("KSM::slotSyncMenu: invalid apptype selected"); | 963 | qDebug("KSM::slotSyncMenu: invalid apptype selected"); |
970 | break; | 964 | break; |
971 | 965 | ||
972 | } | 966 | } |
973 | } | 967 | } |
974 | 968 | ||
975 | void KSyncManager::syncSharp() | 969 | void KSyncManager::syncSharp() |
976 | { | 970 | { |
977 | 971 | ||
978 | if ( ! syncExternalApplication("sharp") ) | 972 | if ( ! syncExternalApplication("sharp") ) |
979 | qDebug("KSM::ERROR sync sharp "); | 973 | qDebug("KSM::ERROR sync sharp "); |
980 | } | 974 | } |
981 | 975 | ||
982 | bool KSyncManager::syncExternalApplication(QString resource) | 976 | bool KSyncManager::syncExternalApplication(QString resource) |
983 | { | 977 | { |
984 | 978 | ||
985 | emit save(); | 979 | emit save(); |
986 | 980 | ||
987 | if ( mAskForPreferences ) | 981 | if ( mAskForPreferences ) |
988 | if ( !edit_sync_options()) { | 982 | if ( !edit_sync_options()) { |
989 | mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") ); | 983 | mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") ); |
990 | return false; | 984 | return false; |
991 | } | 985 | } |
992 | 986 | ||
993 | qDebug("KSM::Sync extern %s", resource.latin1()); | 987 | qDebug("KSM::Sync extern %s", resource.latin1()); |
994 | 988 | ||
995 | bool syncOK = mImplementation->syncExternal(this, resource); | 989 | bool syncOK = mImplementation->syncExternal(this, resource); |
996 | 990 | ||
997 | return syncOK; | 991 | return syncOK; |
998 | 992 | ||
999 | } | 993 | } |
1000 | 994 | ||
1001 | void KSyncManager::syncPhone() | 995 | void KSyncManager::syncPhone() |
1002 | { | 996 | { |
1003 | 997 | ||
1004 | syncExternalApplication("phone"); | 998 | syncExternalApplication("phone"); |
1005 | 999 | ||
1006 | } | 1000 | } |
1007 | 1001 | ||
1008 | void KSyncManager::showProgressBar(int percentage, QString caption, int total) | 1002 | void KSyncManager::showProgressBar(int percentage, QString caption, int total) |
1009 | { | 1003 | { |
1010 | if (!bar->isVisible()) | 1004 | if (!bar->isVisible()) |
1011 | { | 1005 | { |
1006 | int w = 300; | ||
1007 | if ( QApplication::desktop()->width() < 320 ) | ||
1008 | w = 220; | ||
1009 | int h = bar->sizeHint().height() ; | ||
1010 | int dw = QApplication::desktop()->width(); | ||
1011 | int dh = QApplication::desktop()->height(); | ||
1012 | bar->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | ||
1012 | bar->setCaption (caption); | 1013 | bar->setCaption (caption); |
1013 | bar->setTotalSteps ( total ) ; | 1014 | bar->setTotalSteps ( total ) ; |
1014 | bar->show(); | 1015 | bar->show(); |
1015 | } | 1016 | } |
1016 | bar->raise(); | 1017 | bar->raise(); |
1017 | bar->setProgress( percentage ); | 1018 | bar->setProgress( percentage ); |
1018 | qApp->processEvents(); | 1019 | qApp->processEvents(); |
1019 | } | 1020 | } |
1020 | 1021 | ||
1021 | void KSyncManager::hideProgressBar() | 1022 | void KSyncManager::hideProgressBar() |
1022 | { | 1023 | { |
1023 | bar->hide(); | 1024 | bar->hide(); |
1024 | qApp->processEvents(); | 1025 | qApp->processEvents(); |
1025 | } | 1026 | } |
1026 | 1027 | ||
1027 | bool KSyncManager::isProgressBarCanceled() | 1028 | bool KSyncManager::isProgressBarCanceled() |
1028 | { | 1029 | { |
1029 | return !bar->isVisible(); | 1030 | return !bar->isVisible(); |
1030 | } | 1031 | } |
1031 | 1032 | ||
1032 | QString KSyncManager::syncFileName() | 1033 | QString KSyncManager::syncFileName() |
1033 | { | 1034 | { |
1034 | 1035 | ||
1035 | QString fn = "tempfile"; | 1036 | QString fn = "tempfile"; |
1036 | switch(mTargetApp) | 1037 | switch(mTargetApp) |
1037 | { | 1038 | { |
1038 | case (KAPI): | 1039 | case (KAPI): |
1039 | fn = "tempsyncab.vcf"; | 1040 | fn = "tempsyncab.vcf"; |
1040 | break; | 1041 | break; |
1041 | case (KOPI): | 1042 | case (KOPI): |
1042 | fn = "tempsynccal.ics"; | 1043 | fn = "tempsynccal.ics"; |
1043 | break; | 1044 | break; |
1044 | case (PWMPI): | 1045 | case (PWMPI): |
1045 | fn = "tempsyncpw.pwm"; | 1046 | fn = "tempsyncpw.pwm"; |
1046 | break; | 1047 | break; |
1047 | default: | 1048 | default: |
1048 | break; | 1049 | break; |
1049 | } | 1050 | } |
1050 | #ifdef _WIN32_ | 1051 | #ifdef _WIN32_ |
1051 | return locateLocal( "tmp", fn ); | 1052 | return locateLocal( "tmp", fn ); |
1052 | #else | 1053 | #else |
1053 | return (QString( "/tmp/" )+ fn ); | 1054 | return (QString( "/tmp/" )+ fn ); |
1054 | #endif | 1055 | #endif |
1055 | } | 1056 | } |
1056 | 1057 | ||
1057 | void KSyncManager::syncPi() | 1058 | void KSyncManager::syncPi() |
1058 | { | 1059 | { |
1059 | mIsKapiFile = true; | 1060 | mIsKapiFile = true; |
1060 | mPisyncFinished = false; | 1061 | mPisyncFinished = false; |
1061 | qApp->processEvents(); | 1062 | qApp->processEvents(); |
1062 | if ( mAskForPreferences ) | 1063 | if ( mAskForPreferences ) |
1063 | if ( !edit_pisync_options()) { | 1064 | if ( !edit_pisync_options()) { |
1064 | mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") ); | 1065 | mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") ); |
1065 | mPisyncFinished = true; | 1066 | mPisyncFinished = true; |
1066 | return; | 1067 | return; |
1067 | } | 1068 | } |
1068 | bool ok; | 1069 | bool ok; |
1069 | Q_UINT16 port = mActiveSyncPort.toUInt(&ok); | 1070 | Q_UINT16 port = mActiveSyncPort.toUInt(&ok); |
1070 | if ( ! ok ) { | 1071 | if ( ! ok ) { |
1071 | mParent->topLevelWidget()->setCaption( i18n("Sorry, no valid port.Syncing cancelled.") ); | 1072 | mParent->topLevelWidget()->setCaption( i18n("Sorry, no valid port.Syncing cancelled.") ); |
1072 | mPisyncFinished = true; | 1073 | mPisyncFinished = true; |
1073 | return; | 1074 | return; |
1074 | } | 1075 | } |
1075 | KCommandSocket* commandSocket = new KCommandSocket( mPassWordPiSync, port, mActiveSyncIP, this, mParent->topLevelWidget() ); | 1076 | KCommandSocket* commandSocket = new KCommandSocket( mPassWordPiSync, port, mActiveSyncIP, this, mParent->topLevelWidget() ); |
1076 | connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int )), this, SLOT(deleteCommandSocket(KCommandSocket*, int)) ); | 1077 | connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int )), this, SLOT(deleteCommandSocket(KCommandSocket*, int)) ); |
1077 | commandSocket->readFile( syncFileName() ); | 1078 | commandSocket->readFile( syncFileName() ); |
1078 | } | 1079 | } |
1079 | 1080 | ||
1080 | void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state) | 1081 | void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state) |
1081 | { | 1082 | { |
1082 | //enum { success, errorW, errorR, quiet }; | 1083 | //enum { success, errorW, errorR, quiet }; |
1083 | 1084 | ||
1084 | 1085 | ||
1085 | 1086 | ||
1086 | if ( state == KCommandSocket::errorR ||state == KCommandSocket::errorTO ||state == KCommandSocket::errorPW || | 1087 | if ( state == KCommandSocket::errorR ||state == KCommandSocket::errorTO ||state == KCommandSocket::errorPW || |
1087 | state == KCommandSocket::errorCA ||state == KCommandSocket::errorFI ||state == KCommandSocket::errorUN||state == KCommandSocket::errorED ) { | 1088 | state == KCommandSocket::errorCA ||state == KCommandSocket::errorFI ||state == KCommandSocket::errorUN||state == KCommandSocket::errorED ) { |
1088 | if ( state == KCommandSocket::errorPW ) | 1089 | if ( state == KCommandSocket::errorPW ) |
1089 | mParent->topLevelWidget()->setCaption( i18n("Wrong password: Receiving remote file failed.") ); | 1090 | mParent->topLevelWidget()->setCaption( i18n("Wrong password: Receiving remote file failed.") ); |
1090 | else if ( state == KCommandSocket::errorR ||state == KCommandSocket::errorTO ) | 1091 | else if ( state == KCommandSocket::errorR ||state == KCommandSocket::errorTO ) |
1091 | mParent->topLevelWidget()->setCaption( i18n("ERROR: Receiving remote file failed.") ); | 1092 | mParent->topLevelWidget()->setCaption( i18n("ERROR: Receiving remote file failed.") ); |
1092 | else if ( state == KCommandSocket::errorCA ) | 1093 | else if ( state == KCommandSocket::errorCA ) |
1093 | mParent->topLevelWidget()->setCaption( i18n("Sync cancelled from remote.") ); | 1094 | mParent->topLevelWidget()->setCaption( i18n("Sync cancelled from remote.") ); |
1094 | else if ( state == KCommandSocket::errorFI ) | 1095 | else if ( state == KCommandSocket::errorFI ) |
1095 | mParent->topLevelWidget()->setCaption( i18n("File error on remote.") ); | 1096 | mParent->topLevelWidget()->setCaption( i18n("File error on remote.") ); |
1096 | else if ( state == KCommandSocket::errorED ) | 1097 | else if ( state == KCommandSocket::errorED ) |
1097 | mParent->topLevelWidget()->setCaption( i18n("Please close error dialog on remote.") ); | 1098 | mParent->topLevelWidget()->setCaption( i18n("Please close error dialog on remote.") ); |
1098 | else if ( state == KCommandSocket::errorUN ) | 1099 | else if ( state == KCommandSocket::errorUN ) |
1099 | mParent->topLevelWidget()->setCaption( i18n("Unknown error on remote.") ); | 1100 | mParent->topLevelWidget()->setCaption( i18n("Unknown error on remote.") ); |
1100 | delete s; | 1101 | delete s; |
1101 | if ( state == KCommandSocket::errorR ) { | 1102 | if ( state == KCommandSocket::errorR ) { |
1102 | KCommandSocket* commandSocket = new KCommandSocket( mPassWordPiSync, mActiveSyncPort.toUInt(), mActiveSyncIP, this, mParent->topLevelWidget()); | 1103 | KCommandSocket* commandSocket = new KCommandSocket( mPassWordPiSync, mActiveSyncPort.toUInt(), mActiveSyncIP, this, mParent->topLevelWidget()); |
1103 | connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int)), this, SLOT(deleteCommandSocket(KCommandSocket*, int )) ); | 1104 | connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int)), this, SLOT(deleteCommandSocket(KCommandSocket*, int )) ); |
1104 | commandSocket->sendStop(); | 1105 | commandSocket->sendStop(); |
1105 | } | 1106 | } |
1106 | mPisyncFinished = true; | 1107 | mPisyncFinished = true; |
1107 | return; | 1108 | return; |
1108 | 1109 | ||
1109 | } else if ( state == KCommandSocket::errorW ) { | 1110 | } else if ( state == KCommandSocket::errorW ) { |
1110 | mParent->topLevelWidget()->setCaption( i18n("ERROR:Writing back file failed.") ); | 1111 | mParent->topLevelWidget()->setCaption( i18n("ERROR:Writing back file failed.") ); |
1111 | mPisyncFinished = true; | 1112 | mPisyncFinished = true; |
1112 | 1113 | ||
1113 | } else if ( state == KCommandSocket::successR ) { | 1114 | } else if ( state == KCommandSocket::successR ) { |
1114 | QTimer::singleShot( 1, this , SLOT ( readFileFromSocket())); | 1115 | QTimer::singleShot( 1, this , SLOT ( readFileFromSocket())); |
1115 | 1116 | ||
1116 | } else if ( state == KCommandSocket::successW ) { | 1117 | } else if ( state == KCommandSocket::successW ) { |
1117 | mParent->topLevelWidget()->setCaption( i18n("Pi-Sync successful!") ); | 1118 | mParent->topLevelWidget()->setCaption( i18n("Pi-Sync successful!") ); |
1118 | mPisyncFinished = true; | 1119 | mPisyncFinished = true; |
1119 | } else if ( state == KCommandSocket::quiet ){ | 1120 | } else if ( state == KCommandSocket::quiet ){ |
1120 | qDebug("KSS: quiet "); | 1121 | qDebug("KSS: quiet "); |
1121 | mPisyncFinished = true; | 1122 | mPisyncFinished = true; |
1122 | } else { | 1123 | } else { |
1123 | qDebug("KSS: Error: unknown state: %d ", state); | 1124 | qDebug("KSS: Error: unknown state: %d ", state); |
1124 | mPisyncFinished = true; | 1125 | mPisyncFinished = true; |
1125 | } | 1126 | } |
1126 | 1127 | ||
1127 | delete s; | 1128 | delete s; |
1128 | } | 1129 | } |
1129 | 1130 | ||
1130 | void KSyncManager::readFileFromSocket() | 1131 | void KSyncManager::readFileFromSocket() |
1131 | { | 1132 | { |
1132 | QString fileName = syncFileName(); | 1133 | QString fileName = syncFileName(); |
1133 | bool syncOK = true; | 1134 | bool syncOK = true; |
1134 | mParent->topLevelWidget()->setCaption( i18n("Remote file saved to temp file.") ); | 1135 | mParent->topLevelWidget()->setCaption( i18n("Remote file saved to temp file.") ); |
1135 | if ( ! syncWithFile( fileName , true ) ) { | 1136 | if ( ! syncWithFile( fileName , true ) ) { |
1136 | mParent->topLevelWidget()->setCaption( i18n("Syncing failed.") ); | 1137 | mParent->topLevelWidget()->setCaption( i18n("Syncing failed.") ); |
1137 | syncOK = false; | 1138 | syncOK = false; |
1138 | } | 1139 | } |
1139 | KCommandSocket* commandSocket = new KCommandSocket( mPassWordPiSync, mActiveSyncPort.toUInt(), mActiveSyncIP, this, mParent->topLevelWidget() ); | 1140 | KCommandSocket* commandSocket = new KCommandSocket( mPassWordPiSync, mActiveSyncPort.toUInt(), mActiveSyncIP, this, mParent->topLevelWidget() ); |
1140 | connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int)), this, SLOT(deleteCommandSocket(KCommandSocket*, int )) ); | 1141 | connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int)), this, SLOT(deleteCommandSocket(KCommandSocket*, int )) ); |
1141 | if ( mWriteBackFile && syncOK ) | 1142 | if ( mWriteBackFile && syncOK ) |
1142 | commandSocket->writeFile( fileName ); | 1143 | commandSocket->writeFile( fileName ); |
1143 | else { | 1144 | else { |
1144 | commandSocket->sendStop(); | 1145 | commandSocket->sendStop(); |
1145 | if ( syncOK ) | 1146 | if ( syncOK ) |
1146 | mParent->topLevelWidget()->setCaption( i18n("Pi-Sync succesful!") ); | 1147 | mParent->topLevelWidget()->setCaption( i18n("Pi-Sync succesful!") ); |
1147 | mPisyncFinished = true; | 1148 | mPisyncFinished = true; |
1148 | } | 1149 | } |
1149 | } | 1150 | } |
1150 | 1151 | ||
1151 | KServerSocket:: KServerSocket ( QString pw, Q_UINT16 port, int backlog, QObject * parent, const char * name ) : QServerSocket( port, backlog, parent, name ) | 1152 | KServerSocket:: KServerSocket ( QString pw, Q_UINT16 port, int backlog, QObject * parent, const char * name ) : QServerSocket( port, backlog, parent, name ) |
1152 | { | 1153 | { |
1153 | mPassWord = pw; | 1154 | mPassWord = pw; |
1154 | mSocket = 0; | 1155 | mSocket = 0; |
1155 | mSyncActionDialog = 0; | 1156 | mSyncActionDialog = 0; |
1156 | blockRC = false; | 1157 | blockRC = false; |
1157 | mErrorMessage = 0; | 1158 | mErrorMessage = 0; |
1158 | } | 1159 | } |
1159 | 1160 | ||
1160 | void KServerSocket::newConnection ( int socket ) | 1161 | void KServerSocket::newConnection ( int socket ) |
1161 | { | 1162 | { |
1162 | // qDebug("KServerSocket:New connection %d ", socket); | 1163 | // qDebug("KServerSocket:New connection %d ", socket); |
1163 | if ( mSocket ) { | 1164 | if ( mSocket ) { |
1164 | qDebug("KSS::newConnection Socket deleted! "); | 1165 | qDebug("KSS::newConnection Socket deleted! "); |
1165 | delete mSocket; | 1166 | delete mSocket; |
1166 | mSocket = 0; | 1167 | mSocket = 0; |
1167 | } | 1168 | } |
1168 | mSocket = new QSocket( this ); | 1169 | mSocket = new QSocket( this ); |
1169 | connect( mSocket , SIGNAL(readyRead()), this, SLOT(readClient()) ); | 1170 | connect( mSocket , SIGNAL(readyRead()), this, SLOT(readClient()) ); |
1170 | connect( mSocket , SIGNAL(delayedCloseFinished()), this, SLOT(discardClient()) ); | 1171 | connect( mSocket , SIGNAL(delayedCloseFinished()), this, SLOT(discardClient()) ); |
1171 | mSocket->setSocket( socket ); | 1172 | mSocket->setSocket( socket ); |
1172 | } | 1173 | } |
1173 | 1174 | ||
1174 | void KServerSocket::discardClient() | 1175 | void KServerSocket::discardClient() |
1175 | { | 1176 | { |
1176 | QTimer::singleShot( 10, this , SLOT ( deleteSocket())); | 1177 | QTimer::singleShot( 10, this , SLOT ( deleteSocket())); |
1177 | } | 1178 | } |
1178 | void KServerSocket::deleteSocket() | 1179 | void KServerSocket::deleteSocket() |
1179 | { | 1180 | { |
1180 | qDebug("KSS::deleteSocket"); | 1181 | qDebug("KSS::deleteSocket"); |
1181 | if ( mSocket ) { | 1182 | if ( mSocket ) { |
1182 | delete mSocket; | 1183 | delete mSocket; |
1183 | mSocket = 0; | 1184 | mSocket = 0; |
1184 | } | 1185 | } |
1185 | if ( mErrorMessage ) | 1186 | if ( mErrorMessage ) |
1186 | QTimer::singleShot( 10, this , SLOT ( displayErrorMessage())); | 1187 | QTimer::singleShot( 10, this , SLOT ( displayErrorMessage())); |
1187 | } | 1188 | } |
1188 | void KServerSocket::readClient() | 1189 | void KServerSocket::readClient() |
1189 | { | 1190 | { |
1190 | if ( blockRC ) | 1191 | if ( blockRC ) |
1191 | return; | 1192 | return; |
1192 | if ( mSocket == 0 ) { | 1193 | if ( mSocket == 0 ) { |
1193 | qDebug("ERROR::KSS::readClient(): mSocket == 0 "); | 1194 | qDebug("ERROR::KSS::readClient(): mSocket == 0 "); |
1194 | return; | 1195 | return; |
1195 | } | 1196 | } |
1196 | if ( mErrorMessage ) { | 1197 | if ( mErrorMessage ) { |
1197 | mErrorMessage = 999; | 1198 | mErrorMessage = 999; |
1198 | error_connect("ERROR_ED\r\n\r\n"); | 1199 | error_connect("ERROR_ED\r\n\r\n"); |
1199 | return; | 1200 | return; |
1200 | } | 1201 | } |
1201 | mErrorMessage = 0; | 1202 | mErrorMessage = 0; |
1202 | //qDebug("KServerSocket::readClient()"); | 1203 | //qDebug("KServerSocket::readClient()"); |
1203 | if ( mSocket->canReadLine() ) { | 1204 | if ( mSocket->canReadLine() ) { |
diff --git a/microkde/kglobalsettings.cpp b/microkde/kglobalsettings.cpp index e57defe..b6d2feb 100644 --- a/microkde/kglobalsettings.cpp +++ b/microkde/kglobalsettings.cpp | |||
@@ -1,44 +1,50 @@ | |||
1 | #include "kglobalsettings.h" | 1 | #include "kglobalsettings.h" |
2 | #include "kconfig.h" | 2 | #include "kconfig.h" |
3 | #include "kglobal.h" | 3 | #include "kglobal.h" |
4 | #include "kconfigbase.h" | 4 | #include "kconfigbase.h" |
5 | 5 | ||
6 | #include <qapplication.h> | 6 | #include <qapplication.h> |
7 | 7 | ||
8 | QFont KGlobalSettings::generalFont() | 8 | QFont KGlobalSettings::generalFont() |
9 | { | 9 | { |
10 | int size = 12; | 10 | int size = 12; |
11 | if (QApplication::desktop()->width() < 480 ) | 11 | if (QApplication::desktop()->width() < 480 ) { |
12 | size = 10; | 12 | size = 10; |
13 | } | ||
14 | #ifndef DESKTOP_VERSION | ||
15 | else | ||
16 | if (QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) | ||
17 | size = 18; | ||
18 | #endif | ||
13 | QFont f = QApplication::font(); | 19 | QFont f = QApplication::font(); |
14 | //qDebug("pointsize %d %s", f.pointSize(),f.family().latin1()); | 20 | //qDebug("pointsize %d %s", f.pointSize(),f.family().latin1()); |
15 | f.setPointSize( size ); | 21 | f.setPointSize( size ); |
16 | return f; | 22 | return f; |
17 | } | 23 | } |
18 | QFont KGlobalSettings::toolBarFont() | 24 | QFont KGlobalSettings::toolBarFont() |
19 | { | 25 | { |
20 | return QApplication::font(); | 26 | return QApplication::font(); |
21 | } | 27 | } |
22 | 28 | ||
23 | QColor KGlobalSettings::toolBarHighlightColor() | 29 | QColor KGlobalSettings::toolBarHighlightColor() |
24 | { | 30 | { |
25 | return QColor( "black" ); | 31 | return QColor( "black" ); |
26 | } | 32 | } |
27 | 33 | ||
28 | QRect KGlobalSettings::desktopGeometry( QWidget * ) | 34 | QRect KGlobalSettings::desktopGeometry( QWidget * ) |
29 | { | 35 | { |
30 | return QApplication::desktop()->rect(); | 36 | return QApplication::desktop()->rect(); |
31 | } | 37 | } |
32 | 38 | ||
33 | /** | 39 | /** |
34 | * Returns whether KDE runs in single (default) or double click | 40 | * Returns whether KDE runs in single (default) or double click |
35 | * mode. | 41 | * mode. |
36 | * see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html | 42 | * see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html |
37 | * @return true if single click mode, or false if double click mode. | 43 | * @return true if single click mode, or false if double click mode. |
38 | **/ | 44 | **/ |
39 | bool KGlobalSettings::singleClick() | 45 | bool KGlobalSettings::singleClick() |
40 | { | 46 | { |
41 | KConfig *c = KGlobal::config(); | 47 | KConfig *c = KGlobal::config(); |
42 | KConfigGroupSaver cgs( c, "KDE" ); | 48 | KConfigGroupSaver cgs( c, "KDE" ); |
43 | return c->readBoolEntry("SingleClick", KDE_DEFAULT_SINGLECLICK); | 49 | return c->readBoolEntry("SingleClick", KDE_DEFAULT_SINGLECLICK); |
44 | } | 50 | } |