author | zautrix <zautrix> | 2005-02-21 12:28:31 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-21 12:28:31 (UTC) |
commit | b4ebc9c227f986369fe9b0193158f3893a29df08 (patch) (unidiff) | |
tree | 6f117a4927fae9142b036751509925b3641b9c3f | |
parent | bb74ffa01010ca364e101e05a6b3e090ae363a0e (diff) | |
download | kdepimpi-b4ebc9c227f986369fe9b0193158f3893a29df08.zip kdepimpi-b4ebc9c227f986369fe9b0193158f3893a29df08.tar.gz kdepimpi-b4ebc9c227f986369fe9b0193158f3893a29df08.tar.bz2 |
search fixes
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 6 | ||||
-rw-r--r-- | desktop/rpm/kdepim_rpm | 2 | ||||
-rw-r--r-- | korganizer/searchdialog.cpp | 20 | ||||
-rw-r--r-- | libkdepim/kdateedit.cpp | 12 | ||||
-rw-r--r-- | version | 2 |
5 files changed, 27 insertions, 15 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 3179845..1073fe7 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1197,104 +1197,110 @@ | |||
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.net --- 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.net --- 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.net --- 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.net --- 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" }, | ||
1294 | { "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." }, | ||
1295 | { "","" }, | ||
1296 | { "","" }, | ||
1297 | { "","" }, | ||
1298 | { "","" }, | ||
1293 | { "","" }, | 1299 | { "","" }, |
1294 | { "","" }, | 1300 | { "","" }, |
1295 | { "","" }, | 1301 | { "","" }, |
1296 | { "","" }, | 1302 | { "","" }, |
1297 | { "","" }, | 1303 | { "","" }, |
1298 | { "","" }, | 1304 | { "","" }, |
1299 | { "","" }, | 1305 | { "","" }, |
1300 | 1306 | ||
diff --git a/desktop/rpm/kdepim_rpm b/desktop/rpm/kdepim_rpm index 05f61c4..5d85cb3 100644 --- a/desktop/rpm/kdepim_rpm +++ b/desktop/rpm/kdepim_rpm | |||
@@ -1,84 +1,84 @@ | |||
1 | Summary: A collection of PIM programs | 1 | Summary: A collection of PIM programs |
2 | Name: KDE-Pim-Pi | 2 | Name: KDE-Pim-Pi |
3 | Version: 2.0.9 | 3 | Version: 2.0.10 |
4 | Release: SuSE_9.2 | 4 | Release: SuSE_9.2 |
5 | Copyright:GPL | 5 | Copyright:GPL |
6 | Group: Productivity/Pim | 6 | Group: Productivity/Pim |
7 | Source:http://sourceforge.net/projects/kdepimpi/ | 7 | Source:http://sourceforge.net/projects/kdepimpi/ |
8 | URL:http://sourceforge.net/projects/kdepimpi/ | 8 | URL:http://sourceforge.net/projects/kdepimpi/ |
9 | Packager: zautrix | 9 | Packager: zautrix |
10 | 10 | ||
11 | %description | 11 | %description |
12 | This package contains the platform-independent PIM programs from | 12 | This package contains the platform-independent PIM programs from |
13 | www.pi-sync.net, compiled for SuSE 9.2: | 13 | www.pi-sync.net, compiled for SuSE 9.2: |
14 | KTimeTacker/Pi | 14 | KTimeTacker/Pi |
15 | KPhone/Pi | 15 | KPhone/Pi |
16 | KAddressbook/Pi | 16 | KAddressbook/Pi |
17 | KOrganizer/Pi | 17 | KOrganizer/Pi |
18 | PasswordManager/Pi | 18 | PasswordManager/Pi |
19 | KOPieMail/Pi | 19 | KOPieMail/Pi |
20 | 20 | ||
21 | These applications do not need anything from the KDE-desktop | 21 | These applications do not need anything from the KDE-desktop |
22 | at all to run on Linux. However, there is a dependency from | 22 | at all to run on Linux. However, there is a dependency from |
23 | two KDE libs, because a small command line program is included | 23 | two KDE libs, because a small command line program is included |
24 | to make it possible to sync with the KDE-desktop applications. | 24 | to make it possible to sync with the KDE-desktop applications. |
25 | 25 | ||
26 | These applications are independent from the KDE-desktop | 26 | These applications are independent from the KDE-desktop |
27 | environment. That means, nothing of your existing | 27 | environment. That means, nothing of your existing |
28 | KDE-desktop setup will be changed, or any data | 28 | KDE-desktop setup will be changed, or any data |
29 | (calendar-addressbook) used by the KDE-desktop | 29 | (calendar-addressbook) used by the KDE-desktop |
30 | applications will be changed or accessed. | 30 | applications will be changed or accessed. |
31 | These applications stores their data and config in | 31 | These applications stores their data and config in |
32 | $HOME/kdepim/ | 32 | $HOME/kdepim/ |
33 | However, because the same file format is used, | 33 | However, because the same file format is used, |
34 | an easy exchange of data with the KDE-desktop | 34 | an easy exchange of data with the KDE-desktop |
35 | is possible. | 35 | is possible. |
36 | A small command line program is included | 36 | A small command line program is included |
37 | to make it possible to sync with the KDE-desktop applications. | 37 | to make it possible to sync with the KDE-desktop applications. |
38 | You do not need to call this program from the commandline, | 38 | You do not need to call this program from the commandline, |
39 | it is called from the KDE-Pim/Pi apps when you choose there: | 39 | it is called from the KDE-Pim/Pi apps when you choose there: |
40 | Sync with KDE_Desktop. | 40 | Sync with KDE_Desktop. |
41 | If something is going wrong, please start the | 41 | If something is going wrong, please start the |
42 | KDE-Pim/Pi program itself from the console to get detailed output. | 42 | KDE-Pim/Pi program itself from the console to get detailed output. |
43 | 43 | ||
44 | After installation, you should have a | 44 | After installation, you should have a |
45 | PIM-pi | 45 | PIM-pi |
46 | folder in your KDE start menu, where you can | 46 | folder in your KDE start menu, where you can |
47 | start the applications from. | 47 | start the applications from. |
48 | 48 | ||
49 | These programs makes it possible to sync your Zaurus easily | 49 | These programs makes it possible to sync your Zaurus easily |
50 | (with the KDE-Pim/Pi programs running on the Zaurus) | 50 | (with the KDE-Pim/Pi programs running on the Zaurus) |
51 | with the KDE-desktop calendar/addressbook data. | 51 | with the KDE-desktop calendar/addressbook data. |
52 | If you want to use that, you have to update your | 52 | If you want to use that, you have to update your |
53 | KDE-desktop to version 3.3.0 or higher. | 53 | KDE-desktop to version 3.3.0 or higher. |
54 | SuSE 9.2 contains KDE 3.3.0 such that no update is needed. | 54 | SuSE 9.2 contains KDE 3.3.0 such that no update is needed. |
55 | Actually - after the (non difficult) configuration is set up - | 55 | Actually - after the (non difficult) configuration is set up - |
56 | with two mouseklicks on the Zaurus, | 56 | with two mouseklicks on the Zaurus, |
57 | the Zaurus syncs with the corresponding KDE-Pim/Pi | 57 | the Zaurus syncs with the corresponding KDE-Pim/Pi |
58 | program on the Linux Desktop which syncs automatically | 58 | program on the Linux Desktop which syncs automatically |
59 | with the KDE-desktop data. | 59 | with the KDE-desktop data. |
60 | 60 | ||
61 | If you want to use the KDE-desktop calendar/addressbook applications, | 61 | If you want to use the KDE-desktop calendar/addressbook applications, |
62 | just install these apps in this package and use them as a syncing tool for the | 62 | just install these apps in this package and use them as a syncing tool for the |
63 | Zaurus <-> KDE-desktop sync. | 63 | Zaurus <-> KDE-desktop sync. |
64 | The sync requires a network connection from your Zaurus to | 64 | The sync requires a network connection from your Zaurus to |
65 | the PC. A detailed Sync HowTo is available in the | 65 | the PC. A detailed Sync HowTo is available in the |
66 | Help menu of the applications. | 66 | Help menu of the applications. |
67 | 67 | ||
68 | These applications makes it also possible, that you can sync | 68 | These applications makes it also possible, that you can sync |
69 | (or just export the data to) your mobile phone with your | 69 | (or just export the data to) your mobile phone with your |
70 | data of the KDE-desktop calendar/addressbook applications. | 70 | data of the KDE-desktop calendar/addressbook applications. |
71 | This is tested and working for Nokia mobile phones, | 71 | This is tested and working for Nokia mobile phones, |
72 | it may work with others as well. | 72 | it may work with others as well. |
73 | (More info about that: -> Sync HowTo) | 73 | (More info about that: -> Sync HowTo) |
74 | 74 | ||
75 | NOTE: | 75 | NOTE: |
76 | When using SuSE 9.1 you have to update your KDE to 3.3.x | 76 | When using SuSE 9.1 you have to update your KDE to 3.3.x |
77 | and you have to make an online update in SuSE 9.1 to make it | 77 | and you have to make an online update in SuSE 9.1 to make it |
78 | possible to get the infrared connection working, such that | 78 | possible to get the infrared connection working, such that |
79 | you can sync your (Nokia) mobile phone via infrared. | 79 | you can sync your (Nokia) mobile phone via infrared. |
80 | 80 | ||
81 | %files | 81 | %files |
82 | /opt/kde3/share/applnk/PIM-pi/ | 82 | /opt/kde3/share/applnk/PIM-pi/ |
83 | /opt/kdepimpi/ | 83 | /opt/kdepimpi/ |
84 | /usr/lib/libmicro* | 84 | /usr/lib/libmicro* |
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp index 3a95978..3fd9740 100644 --- a/korganizer/searchdialog.cpp +++ b/korganizer/searchdialog.cpp | |||
@@ -1,341 +1,345 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 1998 Preston Brown | 3 | Copyright (c) 1998 Preston Brown |
4 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> | 4 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published by | 7 | it under the terms of the GNU General Public License as published by |
8 | the Free Software Foundation; either version 2 of the License, or | 8 | the Free Software Foundation; either version 2 of the License, or |
9 | (at your option) any later version. | 9 | (at your option) any later version. |
10 | 10 | ||
11 | This program is distributed in the hope that it will be useful, | 11 | This program is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | GNU General Public License for more details. | 14 | GNU General Public License for more details. |
15 | 15 | ||
16 | You should have received a copy of the GNU General Public License | 16 | You should have received a copy of the GNU General Public License |
17 | along with this program; if not, write to the Free Software | 17 | along with this program; if not, write to the Free Software |
18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
19 | 19 | ||
20 | As a special exception, permission is given to link this program | 20 | As a special exception, permission is given to link this program |
21 | with any edition of Qt, and distribute the resulting executable, | 21 | with any edition of Qt, and distribute the resulting executable, |
22 | without including the source code for Qt in the source distribution. | 22 | without including the source code for Qt in the source distribution. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <qlayout.h> | 25 | #include <qlayout.h> |
26 | #include <qcheckbox.h> | 26 | #include <qcheckbox.h> |
27 | #include <qgroupbox.h> | 27 | #include <qgroupbox.h> |
28 | #include <qlabel.h> | 28 | #include <qlabel.h> |
29 | #include <qlineedit.h> | 29 | #include <qlineedit.h> |
30 | #include <qpushbutton.h> | 30 | #include <qpushbutton.h> |
31 | 31 | ||
32 | #include <klocale.h> | 32 | #include <klocale.h> |
33 | #include <kmessagebox.h> | 33 | #include <kmessagebox.h> |
34 | 34 | ||
35 | #include <libkdepim/kdateedit.h> | 35 | #include <libkdepim/kdateedit.h> |
36 | 36 | ||
37 | #include "koglobals.h" | 37 | #include "koglobals.h" |
38 | #include "koprefs.h" | 38 | #include "koprefs.h" |
39 | 39 | ||
40 | #include "calendarview.h" | 40 | #include "calendarview.h" |
41 | #include "koviewmanager.h" | 41 | #include "koviewmanager.h" |
42 | #include "searchdialog.h" | 42 | #include "searchdialog.h" |
43 | 43 | ||
44 | SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) | 44 | SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) |
45 | : KDialogBase(Plain,i18n("KO/Pi Find "),User1|Close,User1,parent,0,false,false, | 45 | : KDialogBase(Plain,i18n("KO/Pi Find "),User1|Close,User1,parent,0,false,false, |
46 | i18n("&Find")) | 46 | i18n("&Find")) |
47 | { | 47 | { |
48 | mCalendar = calendar; | 48 | mCalendar = calendar; |
49 | QFrame *topFrame = plainPage(); | 49 | QFrame *topFrame = plainPage(); |
50 | QVBoxLayout *layout = new QVBoxLayout(topFrame,0,spacingHint()); | 50 | QVBoxLayout *layout = new QVBoxLayout(topFrame,0,spacingHint()); |
51 | 51 | ||
52 | // Search expression | 52 | // Search expression |
53 | QHBoxLayout *subLayout = new QHBoxLayout(); | 53 | QHBoxLayout *subLayout = new QHBoxLayout(); |
54 | layout->addLayout(subLayout); | 54 | layout->addLayout(subLayout); |
55 | 55 | ||
56 | searchLabel = new QLabel(topFrame); | 56 | searchLabel = new QLabel(topFrame); |
57 | searchLabel->setText(i18n("Search for:")); | 57 | searchLabel->setText(i18n("Search for:")); |
58 | subLayout->addWidget(searchLabel); | 58 | subLayout->addWidget(searchLabel); |
59 | 59 | ||
60 | searchEdit = new QLineEdit(topFrame); | 60 | searchEdit = new QLineEdit(topFrame); |
61 | subLayout->addWidget(searchEdit); | 61 | subLayout->addWidget(searchEdit); |
62 | searchEdit->setText("*"); // Find all events by default | 62 | searchEdit->setText("*"); // Find all events by default |
63 | searchEdit->setFocus(); | 63 | searchEdit->setFocus(); |
64 | connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & ))); | 64 | connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & ))); |
65 | connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch())); | 65 | connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch())); |
66 | // Subjects to search | 66 | // Subjects to search |
67 | // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"), | 67 | // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"), |
68 | // topFrame); | 68 | // topFrame); |
69 | 69 | ||
70 | 70 | ||
71 | 71 | ||
72 | QHBox *incidenceGroup = new QHBox( topFrame ); | 72 | QHBox *incidenceGroup = new QHBox( topFrame ); |
73 | layout->addWidget(incidenceGroup); | 73 | layout->addWidget(incidenceGroup); |
74 | 74 | ||
75 | mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup); | 75 | mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup); |
76 | mSearchEvent->setChecked(true); | 76 | mSearchEvent->setChecked(true); |
77 | mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup); | 77 | mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup); |
78 | mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup); | 78 | mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup); |
79 | 79 | ||
80 | QHBox *subjectGroup = new QHBox( topFrame ); | 80 | QHBox *subjectGroup = new QHBox( topFrame ); |
81 | layout->addWidget(subjectGroup); | 81 | layout->addWidget(subjectGroup); |
82 | 82 | ||
83 | mSummaryCheck = new QCheckBox(i18n("Summaries"),subjectGroup); | 83 | mSummaryCheck = new QCheckBox(i18n("Summary/Loc."),subjectGroup); |
84 | mSummaryCheck->setChecked(true); | 84 | mSummaryCheck->setChecked(true); |
85 | mDescriptionCheck = new QCheckBox(i18n("Descriptions"),subjectGroup); | 85 | mDescriptionCheck = new QCheckBox(i18n("Descriptions"),subjectGroup); |
86 | mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup); | 86 | mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup); |
87 | 87 | ||
88 | QHBox *attendeeGroup = new QHBox( topFrame ); | 88 | QHBox *attendeeGroup = new QHBox( topFrame ); |
89 | layout->addWidget(attendeeGroup ); | 89 | layout->addWidget(attendeeGroup ); |
90 | new QLabel( i18n("Attendee:"),attendeeGroup ); | 90 | new QLabel( i18n("Attendee:"),attendeeGroup ); |
91 | mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup ); | 91 | mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup ); |
92 | mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup ); | 92 | mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup ); |
93 | // Date range | 93 | // Date range |
94 | // QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"), | 94 | // QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"), |
95 | // topFrame); | 95 | // topFrame); |
96 | // layout->addWidget(rangeGroup); | 96 | // layout->addWidget(rangeGroup); |
97 | 97 | ||
98 | QWidget *rangeWidget = new QWidget(topFrame); | 98 | QWidget *rangeWidget = new QWidget(topFrame); |
99 | QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,spacingHint()); | 99 | QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,spacingHint()); |
100 | 100 | ||
101 | rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget)); | 101 | rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget)); |
102 | mStartDate = new KDateEdit(rangeWidget); | 102 | mStartDate = new KDateEdit(rangeWidget); |
103 | rangeLayout->addWidget(mStartDate); | 103 | rangeLayout->addWidget(mStartDate); |
104 | rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget)); | 104 | rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget)); |
105 | mEndDate = new KDateEdit(rangeWidget); | 105 | mEndDate = new KDateEdit(rangeWidget); |
106 | mEndDate->setDate(QDate::currentDate().addDays(365)); | 106 | mEndDate->setDate(QDate::currentDate().addDays(365)); |
107 | rangeLayout->addWidget(mEndDate); | 107 | rangeLayout->addWidget(mEndDate); |
108 | 108 | ||
109 | // mInclusiveCheck = new QCheckBox(i18n("Events have to be completely included"), topFrame); | 109 | // mInclusiveCheck = new QCheckBox(i18n("Events have to be completely included"), topFrame); |
110 | //mInclusiveCheck->setChecked(false); | 110 | //mInclusiveCheck->setChecked(false); |
111 | layout->addWidget(rangeWidget); | 111 | layout->addWidget(rangeWidget); |
112 | //layout->addWidget(mInclusiveCheck); | 112 | //layout->addWidget(mInclusiveCheck); |
113 | // Subjects to search | 113 | // Subjects to search |
114 | 114 | ||
115 | 115 | ||
116 | // Results list view | 116 | // Results list view |
117 | listView = new KOListView(mCalendar,topFrame); | 117 | listView = new KOListView(mCalendar,topFrame); |
118 | //listView->showDates(); | 118 | //listView->showDates(); |
119 | 119 | ||
120 | 120 | ||
121 | layout->addWidget(listView); | 121 | layout->addWidget(listView); |
122 | 122 | ||
123 | // if ( KOPrefs::instance()->mCompactDialogs ) { | 123 | // if ( KOPrefs::instance()->mCompactDialogs ) { |
124 | // KOGlobals::fitDialogToScreen( this, true ); | 124 | // KOGlobals::fitDialogToScreen( this, true ); |
125 | // } | 125 | // } |
126 | 126 | ||
127 | listView->readSettings(KOGlobals::config(),"SearchListView Layout"); | 127 | listView->readSettings(KOGlobals::config(),"SearchListView Layout"); |
128 | connect(this,SIGNAL(user1Clicked()),SLOT(doSearch())); | 128 | connect(this,SIGNAL(user1Clicked()),SLOT(doSearch())); |
129 | QPushButton *CloseButton = findButton( Close ); | 129 | QPushButton *CloseButton = findButton( Close ); |
130 | //connect(CloseButton,SIGNAL(clicked()),listView, SLOT(clear())); | 130 | //connect(CloseButton,SIGNAL(clicked()),listView, SLOT(clear())); |
131 | 131 | ||
132 | #ifndef DESKTOP_VERSION | 132 | #ifndef DESKTOP_VERSION |
133 | setCaption(i18n("Click OK to search ->")); | 133 | setCaption(i18n("Click OK to search ->")); |
134 | hideButtons(); | 134 | hideButtons(); |
135 | #endif | 135 | #endif |
136 | } | 136 | } |
137 | 137 | ||
138 | SearchDialog::~SearchDialog() | 138 | SearchDialog::~SearchDialog() |
139 | { | 139 | { |
140 | 140 | ||
141 | } | 141 | } |
142 | void SearchDialog::accept() | 142 | void SearchDialog::accept() |
143 | { | 143 | { |
144 | doSearch(); | 144 | doSearch(); |
145 | } | 145 | } |
146 | void SearchDialog::updateList() | 146 | void SearchDialog::updateList() |
147 | { | 147 | { |
148 | //listView->updateList(); | 148 | //listView->updateList(); |
149 | if ( isVisible() ) { | 149 | if ( isVisible() ) { |
150 | updateView(); | 150 | updateView(); |
151 | //qDebug("SearchDialog::updated "); | 151 | //qDebug("SearchDialog::updated "); |
152 | } | 152 | } |
153 | else { | 153 | else { |
154 | listView->clear(); | 154 | listView->clear(); |
155 | //qDebug("SearchDialog::cleared "); | 155 | //qDebug("SearchDialog::cleared "); |
156 | 156 | ||
157 | } | 157 | } |
158 | } | 158 | } |
159 | void SearchDialog::searchTextChanged( const QString &_text ) | 159 | void SearchDialog::searchTextChanged( const QString &_text ) |
160 | { | 160 | { |
161 | enableButton( KDialogBase::User1, !_text.isEmpty() ); | 161 | enableButton( KDialogBase::User1, !_text.isEmpty() ); |
162 | } | 162 | } |
163 | 163 | ||
164 | void SearchDialog::doSearch() | 164 | void SearchDialog::doSearch() |
165 | { | 165 | { |
166 | QRegExp re; | 166 | QRegExp re; |
167 | 167 | ||
168 | re.setWildcard(true); // most people understand these better. | 168 | re.setWildcard(true); // most people understand these better. |
169 | re.setCaseSensitive(false); | 169 | re.setCaseSensitive(false); |
170 | re.setPattern(searchEdit->text()); | 170 | re.setPattern(searchEdit->text()); |
171 | if (!re.isValid() ) { | 171 | if (!re.isValid() ) { |
172 | KMessageBox::sorry(this, | 172 | KMessageBox::sorry(this, |
173 | i18n("Invalid search expression,\ncannot perform " | 173 | i18n("Invalid search expression,\ncannot perform " |
174 | "the search.\nPlease enter a search expression\n" | 174 | "the search.\nPlease enter a search expression\n" |
175 | "using the wildcard characters\n '*' and '?'" | 175 | "using the wildcard characters\n '*' and '?'" |
176 | "where needed.")); | 176 | "where needed.")); |
177 | return; | 177 | return; |
178 | } | 178 | } |
179 | 179 | ||
180 | search(re); | 180 | search(re); |
181 | 181 | ||
182 | listView->setStartDate( mStartDate->date() ); | 182 | listView->setStartDate( mStartDate->date() ); |
183 | listView->showEvents(mMatchedEvents); | 183 | listView->showEvents(mMatchedEvents); |
184 | listView->addTodos(mMatchedTodos); | 184 | listView->addTodos(mMatchedTodos); |
185 | listView->addJournals(mMatchedJournals); | 185 | listView->addJournals(mMatchedJournals); |
186 | 186 | ||
187 | if (mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() == 0) { | 187 | if (mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() == 0) { |
188 | KMessageBox::information(this, | 188 | setCaption(i18n("No items found. Use '*' and '?' where needed.")); |
189 | i18n("No items were found matching\nyour search expression.\nUse the wildcard characters\n'*' and '?' where needed.")); | ||
190 | #ifndef DESKTOP_VERSION | ||
191 | setCaption(i18n("Click OK to search ->")); | ||
192 | #else | ||
193 | setCaption(i18n("KO/Pi Find ")); | ||
194 | #endif | ||
195 | } else { | 189 | } else { |
196 | QString mess; | 190 | QString mess; |
197 | mess = mess.sprintf( i18n("%d item(s) found."), mMatchedEvents.count()+ mMatchedJournals.count() + mMatchedTodos.count() ); | 191 | mess = mess.sprintf( i18n("%d item(s) found."), mMatchedEvents.count()+ mMatchedJournals.count() + mMatchedTodos.count() ); |
198 | setCaption( i18n("KO/Pi Find: ") + mess); | 192 | setCaption( i18n("KO/Pi Find: ") + mess); |
199 | 193 | ||
200 | } | 194 | } |
195 | searchEdit->setFocus(); | ||
201 | } | 196 | } |
202 | void SearchDialog::updateConfig() | 197 | void SearchDialog::updateConfig() |
203 | { | 198 | { |
204 | listView->updateConfig(); | 199 | listView->updateConfig(); |
205 | } | 200 | } |
206 | void SearchDialog::updateView() | 201 | void SearchDialog::updateView() |
207 | { | 202 | { |
208 | 203 | ||
209 | QRegExp re; | 204 | QRegExp re; |
210 | re.setWildcard(true); // most people understand these better. | 205 | re.setWildcard(true); // most people understand these better. |
211 | re.setCaseSensitive(false); | 206 | re.setCaseSensitive(false); |
212 | re.setPattern(searchEdit->text()); | 207 | re.setPattern(searchEdit->text()); |
213 | if (re.isValid()) { | 208 | if (re.isValid()) { |
214 | search(re); | 209 | search(re); |
215 | } else { | 210 | } else { |
216 | mMatchedEvents.clear(); | 211 | mMatchedEvents.clear(); |
217 | mMatchedTodos.clear(); | 212 | mMatchedTodos.clear(); |
218 | mMatchedJournals.clear(); | 213 | mMatchedJournals.clear(); |
219 | } | 214 | } |
220 | listView->setStartDate( mStartDate->date() ); | 215 | listView->setStartDate( mStartDate->date() ); |
221 | listView->showEvents(mMatchedEvents); | 216 | listView->showEvents(mMatchedEvents); |
222 | listView->addTodos(mMatchedTodos); | 217 | listView->addTodos(mMatchedTodos); |
223 | listView->addJournals(mMatchedJournals); | 218 | listView->addJournals(mMatchedJournals); |
224 | } | 219 | } |
225 | 220 | ||
226 | void SearchDialog::search(const QRegExp &re) | 221 | void SearchDialog::search(const QRegExp &re) |
227 | { | 222 | { |
228 | QPtrList<Event> events = mCalendar->events( mStartDate->date(), | 223 | QPtrList<Event> events = mCalendar->events( mStartDate->date(), |
229 | mEndDate->date(), | 224 | mEndDate->date(), |
230 | false /*mInclusiveCheck->isChecked()*/ ); | 225 | false /*mInclusiveCheck->isChecked()*/ ); |
231 | 226 | ||
232 | mMatchedEvents.clear(); | 227 | mMatchedEvents.clear(); |
233 | if ( mSearchEvent->isChecked() ) { | 228 | if ( mSearchEvent->isChecked() ) { |
234 | Event *ev; | 229 | Event *ev; |
235 | for(ev=events.first();ev;ev=events.next()) { | 230 | for(ev=events.first();ev;ev=events.next()) { |
236 | if (mSummaryCheck->isChecked()) { | 231 | if (mSummaryCheck->isChecked()) { |
237 | #if QT_VERSION >= 0x030000 | 232 | #if QT_VERSION >= 0x030000 |
238 | if (re.search(ev->summary()) != -1) | 233 | if (re.search(ev->summary()) != -1) |
239 | #else | 234 | #else |
240 | if (re.match(ev->summary()) != -1) | 235 | if (re.match(ev->summary()) != -1) |
241 | #endif | 236 | #endif |
242 | { | 237 | { |
243 | mMatchedEvents.append(ev); | 238 | mMatchedEvents.append(ev); |
244 | continue; | 239 | continue; |
245 | } | 240 | } |
241 | #if QT_VERSION >= 0x030000 | ||
242 | if (re.search(ev->location()) != -1) | ||
243 | #else | ||
244 | if (re.match(ev->location()) != -1) | ||
245 | #endif | ||
246 | { | ||
247 | mMatchedEvents.append(ev); | ||
248 | continue; | ||
249 | } | ||
246 | } | 250 | } |
247 | if (mDescriptionCheck->isChecked()) { | 251 | if (mDescriptionCheck->isChecked()) { |
248 | #if QT_VERSION >= 0x030000 | 252 | #if QT_VERSION >= 0x030000 |
249 | if (re.search(ev->description()) != -1) | 253 | if (re.search(ev->description()) != -1) |
250 | #else | 254 | #else |
251 | if (re.match(ev->description()) != -1) | 255 | if (re.match(ev->description()) != -1) |
252 | #endif | 256 | #endif |
253 | { | 257 | { |
254 | mMatchedEvents.append(ev); | 258 | mMatchedEvents.append(ev); |
255 | continue; | 259 | continue; |
256 | } | 260 | } |
257 | } | 261 | } |
258 | if (mCategoryCheck->isChecked()) { | 262 | if (mCategoryCheck->isChecked()) { |
259 | #if QT_VERSION >= 0x030000 | 263 | #if QT_VERSION >= 0x030000 |
260 | if (re.search(ev->categoriesStr()) != -1) | 264 | if (re.search(ev->categoriesStr()) != -1) |
261 | #else | 265 | #else |
262 | if (re.match(ev->categoriesStr()) != -1) | 266 | if (re.match(ev->categoriesStr()) != -1) |
263 | #endif | 267 | #endif |
264 | { | 268 | { |
265 | mMatchedEvents.append(ev); | 269 | mMatchedEvents.append(ev); |
266 | continue; | 270 | continue; |
267 | } | 271 | } |
268 | } | 272 | } |
269 | if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { | 273 | if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { |
270 | QPtrList<Attendee> tmpAList = ev->attendees(); | 274 | QPtrList<Attendee> tmpAList = ev->attendees(); |
271 | Attendee *a; | 275 | Attendee *a; |
272 | for (a = tmpAList.first(); a; a = tmpAList.next()) { | 276 | for (a = tmpAList.first(); a; a = tmpAList.next()) { |
273 | if (mSearchAName->isChecked()) { | 277 | if (mSearchAName->isChecked()) { |
274 | #if QT_VERSION >= 0x030000 | 278 | #if QT_VERSION >= 0x030000 |
275 | if (re.search(a->name()) != -1) | 279 | if (re.search(a->name()) != -1) |
276 | #else | 280 | #else |
277 | if (re.match(a->name()) != -1) | 281 | if (re.match(a->name()) != -1) |
278 | #endif | 282 | #endif |
279 | { | 283 | { |
280 | mMatchedEvents.append(ev); | 284 | mMatchedEvents.append(ev); |
281 | break; | 285 | break; |
282 | } | 286 | } |
283 | } | 287 | } |
284 | if (mSearchAEmail->isChecked()) { | 288 | if (mSearchAEmail->isChecked()) { |
285 | #if QT_VERSION >= 0x030000 | 289 | #if QT_VERSION >= 0x030000 |
286 | if (re.search(a->email()) != -1) | 290 | if (re.search(a->email()) != -1) |
287 | #else | 291 | #else |
288 | if (re.match(a->email()) != -1) | 292 | if (re.match(a->email()) != -1) |
289 | #endif | 293 | #endif |
290 | { | 294 | { |
291 | mMatchedEvents.append(ev); | 295 | mMatchedEvents.append(ev); |
292 | break; | 296 | break; |
293 | } | 297 | } |
294 | } | 298 | } |
295 | } | 299 | } |
296 | } | 300 | } |
297 | } | 301 | } |
298 | } | 302 | } |
299 | QPtrList<Todo> todos = mCalendar->todos( ); | 303 | QPtrList<Todo> todos = mCalendar->todos( ); |
300 | mMatchedTodos.clear(); | 304 | mMatchedTodos.clear(); |
301 | if ( mSearchTodo->isChecked() ) { | 305 | if ( mSearchTodo->isChecked() ) { |
302 | Todo *tod; | 306 | Todo *tod; |
303 | for(tod=todos.first();tod;tod=todos.next()) { | 307 | for(tod=todos.first();tod;tod=todos.next()) { |
304 | if (mSummaryCheck->isChecked()) { | 308 | if (mSummaryCheck->isChecked()) { |
305 | #if QT_VERSION >= 0x030000 | 309 | #if QT_VERSION >= 0x030000 |
306 | if (re.search(tod->summary()) != -1) | 310 | if (re.search(tod->summary()) != -1) |
307 | #else | 311 | #else |
308 | if (re.match(tod->summary()) != -1) | 312 | if (re.match(tod->summary()) != -1) |
309 | #endif | 313 | #endif |
310 | { | 314 | { |
311 | mMatchedTodos.append(tod); | 315 | mMatchedTodos.append(tod); |
312 | continue; | 316 | continue; |
313 | } | 317 | } |
314 | } | 318 | } |
315 | if (mDescriptionCheck->isChecked()) { | 319 | if (mDescriptionCheck->isChecked()) { |
316 | #if QT_VERSION >= 0x030000 | 320 | #if QT_VERSION >= 0x030000 |
317 | if (re.search(tod->description()) != -1) | 321 | if (re.search(tod->description()) != -1) |
318 | #else | 322 | #else |
319 | if (re.match(tod->description()) != -1) | 323 | if (re.match(tod->description()) != -1) |
320 | #endif | 324 | #endif |
321 | { | 325 | { |
322 | mMatchedTodos.append(tod); | 326 | mMatchedTodos.append(tod); |
323 | continue; | 327 | continue; |
324 | } | 328 | } |
325 | } | 329 | } |
326 | if (mCategoryCheck->isChecked()) { | 330 | if (mCategoryCheck->isChecked()) { |
327 | #if QT_VERSION >= 0x030000 | 331 | #if QT_VERSION >= 0x030000 |
328 | if (re.search(tod->categoriesStr()) != -1) | 332 | if (re.search(tod->categoriesStr()) != -1) |
329 | #else | 333 | #else |
330 | if (re.match(tod->categoriesStr()) != -1) | 334 | if (re.match(tod->categoriesStr()) != -1) |
331 | #endif | 335 | #endif |
332 | { | 336 | { |
333 | mMatchedTodos.append(tod); | 337 | mMatchedTodos.append(tod); |
334 | continue; | 338 | continue; |
335 | } | 339 | } |
336 | } | 340 | } |
337 | if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { | 341 | if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { |
338 | QPtrList<Attendee> tmpAList = tod->attendees(); | 342 | QPtrList<Attendee> tmpAList = tod->attendees(); |
339 | Attendee *a; | 343 | Attendee *a; |
340 | for (a = tmpAList.first(); a; a = tmpAList.next()) { | 344 | for (a = tmpAList.first(); a; a = tmpAList.next()) { |
341 | if (mSearchAName->isChecked()) { | 345 | if (mSearchAName->isChecked()) { |
diff --git a/libkdepim/kdateedit.cpp b/libkdepim/kdateedit.cpp index 2c78ea3..946fc0d 100644 --- a/libkdepim/kdateedit.cpp +++ b/libkdepim/kdateedit.cpp | |||
@@ -1,216 +1,216 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libkdepim. | 2 | This file is part of libkdepim. |
3 | 3 | ||
4 | Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> | 4 | Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published by | 7 | it under the terms of the GNU General Public License as published by |
8 | the Free Software Foundation; either version 2 of the License, or | 8 | the Free Software Foundation; either version 2 of the License, or |
9 | (at your option) any later version. | 9 | (at your option) any later version. |
10 | 10 | ||
11 | This program is distributed in the hope that it will be useful, | 11 | This program is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | GNU General Public License for more details. | 14 | GNU General Public License for more details. |
15 | 15 | ||
16 | You should have received a copy of the GNU General Public License | 16 | You should have received a copy of the GNU General Public License |
17 | along with this program; if not, write to the Free Software | 17 | along with this program; if not, write to the Free Software |
18 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 18 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 | 19 | ||
20 | As a special exception, permission is given to link this program | 20 | As a special exception, permission is given to link this program |
21 | with any edition of Qt, and distribute the resulting executable, | 21 | with any edition of Qt, and distribute the resulting executable, |
22 | without including the source code for Qt in the source distribution. | 22 | without including the source code for Qt in the source distribution. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <qapplication.h> | 25 | #include <qapplication.h> |
26 | #include <qevent.h> | 26 | #include <qevent.h> |
27 | #include <qlineedit.h> | 27 | #include <qlineedit.h> |
28 | #include <qpixmap.h> | 28 | #include <qpixmap.h> |
29 | #include <qpushbutton.h> | 29 | #include <qpushbutton.h> |
30 | 30 | ||
31 | #include <kdatepicker.h> | 31 | #include <kdatepicker.h> |
32 | #include <kdebug.h> | 32 | #include <kdebug.h> |
33 | #include <kglobal.h> | 33 | #include <kglobal.h> |
34 | #include <kiconloader.h> | 34 | #include <kiconloader.h> |
35 | #include <klocale.h> | 35 | #include <klocale.h> |
36 | #include <kmessagebox.h> | 36 | #include <kmessagebox.h> |
37 | #include <knotifyclient.h> | 37 | #include <knotifyclient.h> |
38 | #include <qpalette.h> | 38 | #include <qpalette.h> |
39 | 39 | ||
40 | #include "kdateedit.h" | 40 | #include "kdateedit.h" |
41 | //#include "kdateedit.moc" | 41 | //#include "kdateedit.moc" |
42 | 42 | ||
43 | KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP ) | 43 | KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP ) |
44 | : QHBox(parent, name) | 44 | : QHBox(parent, name) |
45 | { | 45 | { |
46 | dateFormShort = true; | 46 | dateFormShort = true; |
47 | withoutDp = withoutDP; | 47 | withoutDp = withoutDP; |
48 | mDateEdit = new QLineEdit(this); | 48 | mDateEdit = new QLineEdit(this); |
49 | mDateEdit->setText(KGlobal::locale()->formatDate(QDate::currentDate(),dateFormShort)); | 49 | mDateEdit->setText(KGlobal::locale()->formatDate(QDate::currentDate(),dateFormShort)); |
50 | setFocusProxy(mDateEdit); | 50 | setFocusProxy(mDateEdit); |
51 | mDateEdit->installEventFilter(this); | 51 | mDateEdit->installEventFilter(this); |
52 | 52 | ||
53 | // Highlight Background and Textcolor | 53 | // Highlight Background and Textcolor |
54 | QPalette palette = QWidget::palette(); | 54 | QPalette palette = QWidget::palette(); |
55 | unsigned char red, green, blue; | 55 | unsigned char red, green, blue; |
56 | red = palette.color( QPalette::Normal , QColorGroup::Background ).red() - 10; | 56 | red = palette.color( QPalette::Normal , QColorGroup::Background ).red() - 10; |
57 | green = palette.color( QPalette::Normal , QColorGroup::Background ).green() - 10; | 57 | green = palette.color( QPalette::Normal , QColorGroup::Background ).green() - 10; |
58 | blue = palette.color( QPalette::Normal , QColorGroup::Background ).blue() - 10; | 58 | blue = palette.color( QPalette::Normal , QColorGroup::Background ).blue() - 10; |
59 | palette.setColor( QColorGroup::Highlight, QColor(red,green,blue) ); | 59 | palette.setColor( QColorGroup::Highlight, QColor(red,green,blue) ); |
60 | palette.setColor( QColorGroup::HighlightedText, palette.color( QPalette::Normal , QColorGroup::Foreground ) ); | 60 | palette.setColor( QColorGroup::HighlightedText, palette.color( QPalette::Normal , QColorGroup::Foreground ) ); |
61 | mDateEdit->setPalette( palette ); | 61 | mDateEdit->setPalette( palette ); |
62 | 62 | ||
63 | if ( withoutDP ) { | 63 | if ( withoutDP ) { |
64 | mDateFrame = 0; | 64 | mDateFrame = 0; |
65 | mDateButton = 0; | 65 | mDateButton = 0; |
66 | mDatePicker = 0; | 66 | mDatePicker = 0; |
67 | } else { | 67 | } else { |
68 | QPixmap pixmap = SmallIcon("smallcal"); | 68 | QPixmap pixmap = SmallIcon("smallcal"); |
69 | mDateButton = new QPushButton(this); | 69 | mDateButton = new QPushButton(this); |
70 | mDateButton->setPixmap(pixmap); | 70 | mDateButton->setPixmap(pixmap); |
71 | 71 | ||
72 | mDateFrame = new QVBox(0,0,WType_Popup); | 72 | mDateFrame = new QVBox(0,0,WType_Popup); |
73 | // mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); | 73 | // mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); |
74 | mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); | 74 | mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); |
75 | mDateFrame->setLineWidth(3); | 75 | mDateFrame->setLineWidth(3); |
76 | mDateFrame->hide(); | 76 | mDateFrame->hide(); |
77 | 77 | ||
78 | mDatePicker = new KDatePicker(mDateFrame,QDate::currentDate()); | 78 | mDatePicker = new KDatePicker(mDateFrame,QDate::currentDate()); |
79 | connect(mDatePicker,SIGNAL(dateEntered(QDate)),SLOT(setDate(QDate))); | 79 | connect(mDatePicker,SIGNAL(dateEntered(QDate)),SLOT(setDate(QDate))); |
80 | connect(mDatePicker,SIGNAL(dateEntered(QDate)),SIGNAL(dateChanged(QDate))); | 80 | connect(mDatePicker,SIGNAL(dateEntered(QDate)),SIGNAL(dateChanged(QDate))); |
81 | connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(setDate(QDate))); | 81 | connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(setDate(QDate))); |
82 | connect(mDatePicker,SIGNAL(dateSelected(QDate)),SIGNAL(dateChanged(QDate))); | 82 | connect(mDatePicker,SIGNAL(dateSelected(QDate)),SIGNAL(dateChanged(QDate))); |
83 | connect(mDatePicker,SIGNAL(dateSelected(QDate)),mDateFrame,SLOT(hide())); | 83 | connect(mDatePicker,SIGNAL(dateSelected(QDate)),mDateFrame,SLOT(hide())); |
84 | connect(mDateButton,SIGNAL(clicked()),SLOT(toggleDatePicker())); | 84 | connect(mDateButton,SIGNAL(clicked()),SLOT(toggleDatePicker())); |
85 | 85 | mDateButton->setFocusPolicy( QWidget::NoFocus ); | |
86 | //mDateFrame->resize( 400, 300 ); | 86 | //mDateFrame->resize( 400, 300 ); |
87 | 87 | ||
88 | } | 88 | } |
89 | connect(mDateEdit,SIGNAL(returnPressed()),SLOT(lineEnterPressed())); | 89 | connect(mDateEdit,SIGNAL(returnPressed()),SLOT(lineEnterPressed())); |
90 | connect(mDateEdit,SIGNAL(textChanged(const QString &)), | 90 | connect(mDateEdit,SIGNAL(textChanged(const QString &)), |
91 | SLOT(textChanged(const QString &))); | 91 | SLOT(textChanged(const QString &))); |
92 | 92 | ||
93 | // Create the keyword list. This will be used to match against when the user | 93 | // Create the keyword list. This will be used to match against when the user |
94 | // enters information. | 94 | // enters information. |
95 | mKeywordMap[i18n("tomorrow")] = 1; | 95 | mKeywordMap[i18n("tomorrow")] = 1; |
96 | mKeywordMap[i18n("today")] = 0; | 96 | mKeywordMap[i18n("today")] = 0; |
97 | mKeywordMap[i18n("yesterday")] = -1; | 97 | mKeywordMap[i18n("yesterday")] = -1; |
98 | 98 | ||
99 | /* | 99 | /* |
100 | * This loop uses some math tricks to figure out the offset in days | 100 | * This loop uses some math tricks to figure out the offset in days |
101 | * to the next date the given day of the week occurs. There | 101 | * to the next date the given day of the week occurs. There |
102 | * are two cases, that the new day is >= the current day, which means | 102 | * are two cases, that the new day is >= the current day, which means |
103 | * the new day has not occured yet or that the new day < the current day, | 103 | * the new day has not occured yet or that the new day < the current day, |
104 | * which means the new day is already passed (so we need to find the | 104 | * which means the new day is already passed (so we need to find the |
105 | * day in the next week). | 105 | * day in the next week). |
106 | */ | 106 | */ |
107 | QString dayName; | 107 | QString dayName; |
108 | int currentDay = QDate::currentDate().dayOfWeek(); | 108 | int currentDay = QDate::currentDate().dayOfWeek(); |
109 | for (int i = 1; i <= 7; ++i) | 109 | for (int i = 1; i <= 7; ++i) |
110 | { | 110 | { |
111 | dayName = KGlobal::locale()->weekDayName(i).lower(); | 111 | dayName = KGlobal::locale()->weekDayName(i).lower(); |
112 | if (i >= currentDay) | 112 | if (i >= currentDay) |
113 | mKeywordMap[dayName] = i - currentDay; | 113 | mKeywordMap[dayName] = i - currentDay; |
114 | else | 114 | else |
115 | mKeywordMap[dayName] = 7 - currentDay + i; | 115 | mKeywordMap[dayName] = 7 - currentDay + i; |
116 | } | 116 | } |
117 | 117 | ||
118 | mTextChanged = false; | 118 | mTextChanged = false; |
119 | mHandleInvalid = false; | 119 | mHandleInvalid = false; |
120 | QWidget::setTabOrder( mDateEdit, mDateButton ); | 120 | // QWidget::setTabOrder( mDateEdit, mDateButton ); |
121 | } | 121 | } |
122 | 122 | ||
123 | KDateEdit::~KDateEdit() | 123 | KDateEdit::~KDateEdit() |
124 | { | 124 | { |
125 | delete mDateFrame; | 125 | delete mDateFrame; |
126 | } | 126 | } |
127 | void KDateEdit::clear() | 127 | void KDateEdit::clear() |
128 | { | 128 | { |
129 | bool b = mDateEdit->signalsBlocked(); | 129 | bool b = mDateEdit->signalsBlocked(); |
130 | mDateEdit->blockSignals(true); | 130 | mDateEdit->blockSignals(true); |
131 | mDateEdit->setText(""); | 131 | mDateEdit->setText(""); |
132 | mDateEdit->blockSignals(b); | 132 | mDateEdit->blockSignals(b); |
133 | } | 133 | } |
134 | void KDateEdit::setDate(QDate newDate) | 134 | void KDateEdit::setDate(QDate newDate) |
135 | { | 135 | { |
136 | if (!newDate.isValid() && !mHandleInvalid) | 136 | if (!newDate.isValid() && !mHandleInvalid) |
137 | return; | 137 | return; |
138 | if ( readDate() == newDate ) | 138 | if ( readDate() == newDate ) |
139 | return; | 139 | return; |
140 | QString dateString = ""; | 140 | QString dateString = ""; |
141 | if(newDate.isValid()) | 141 | if(newDate.isValid()) |
142 | dateString = KGlobal::locale()->formatDate( newDate, dateFormShort ); | 142 | dateString = KGlobal::locale()->formatDate( newDate, dateFormShort ); |
143 | 143 | ||
144 | mTextChanged = false; | 144 | mTextChanged = false; |
145 | 145 | ||
146 | // We do not want to generate a signal here, since we explicity setting | 146 | // We do not want to generate a signal here, since we explicity setting |
147 | // the date | 147 | // the date |
148 | bool b = mDateEdit->signalsBlocked(); | 148 | bool b = mDateEdit->signalsBlocked(); |
149 | mDateEdit->blockSignals(true); | 149 | mDateEdit->blockSignals(true); |
150 | mDateEdit->setText(dateString); | 150 | mDateEdit->setText(dateString); |
151 | mDateEdit->blockSignals(b); | 151 | mDateEdit->blockSignals(b); |
152 | } | 152 | } |
153 | 153 | ||
154 | void KDateEdit::setDate( QDate date,int *cpos,const int key ,const bool dateFormShort) | 154 | void KDateEdit::setDate( QDate date,int *cpos,const int key ,const bool dateFormShort) |
155 | { | 155 | { |
156 | QString dateForm = dateFormShort ? | 156 | QString dateForm = dateFormShort ? |
157 | KGlobal::locale()->dateFormatShort() : | 157 | KGlobal::locale()->dateFormatShort() : |
158 | KGlobal::locale()->dateFormat(); | 158 | KGlobal::locale()->dateFormat(); |
159 | 159 | ||
160 | int begin = dateForm.find("%"); | 160 | int begin = dateForm.find("%"); |
161 | int space = 0; | 161 | int space = 0; |
162 | int allStrLength = 0; | 162 | int allStrLength = 0; |
163 | int strLength = 0; | 163 | int strLength = 0; |
164 | int repeat = 0; | 164 | int repeat = 0; |
165 | 165 | ||
166 | // witch? Day, Month or Year switch? | 166 | // witch? Day, Month or Year switch? |
167 | while(1){ | 167 | while(1){ |
168 | switch ( dateForm.at(begin + 1).latin1() ) | 168 | switch ( dateForm.at(begin + 1).latin1() ) |
169 | { | 169 | { |
170 | case 'd':// 16 (month day) | 170 | case 'd':// 16 (month day) |
171 | strLength = 2; //Ok | 171 | strLength = 2; //Ok |
172 | break; | 172 | break; |
173 | case 'm':// 01 (month) | 173 | case 'm':// 01 (month) |
174 | strLength = 2; //Ok | 174 | strLength = 2; //Ok |
175 | break; | 175 | break; |
176 | case 'a':// Mon (Weekday) | 176 | case 'a':// Mon (Weekday) |
177 | strLength = KGlobal::locale()->weekDayName(date.dayOfWeek(), true).length(); | 177 | strLength = KGlobal::locale()->weekDayName(date.dayOfWeek(), true).length(); |
178 | break; | 178 | break; |
179 | case 'A':// Monday (Weekday) | 179 | case 'A':// Monday (Weekday) |
180 | strLength = KGlobal::locale()->weekDayName(date.dayOfWeek(), false).length(); | 180 | strLength = KGlobal::locale()->weekDayName(date.dayOfWeek(), false).length(); |
181 | break; | 181 | break; |
182 | case 'b':// Jan (monthName) | 182 | case 'b':// Jan (monthName) |
183 | strLength = KGlobal::locale()->monthName(date.month(), true).length(); | 183 | strLength = KGlobal::locale()->monthName(date.month(), true).length(); |
184 | break; | 184 | break; |
185 | case 'B':// January (monthName) | 185 | case 'B':// January (monthName) |
186 | strLength = KGlobal::locale()->monthName(date.month(), false).length(); | 186 | strLength = KGlobal::locale()->monthName(date.month(), false).length(); |
187 | break; | 187 | break; |
188 | case 'y':// 04 (year short) | 188 | case 'y':// 04 (year short) |
189 | strLength = 2; //Ok | 189 | strLength = 2; //Ok |
190 | break; | 190 | break; |
191 | case 'Y':// 2004 (year) | 191 | case 'Y':// 2004 (year) |
192 | strLength = 4; //Ok | 192 | strLength = 4; //Ok |
193 | break; | 193 | break; |
194 | default: | 194 | default: |
195 | break; | 195 | break; |
196 | } | 196 | } |
197 | space = begin - (repeat++ * 2); | 197 | space = begin - (repeat++ * 2); |
198 | // all select? then dayswitch | 198 | // all select? then dayswitch |
199 | if( (mDateEdit->text().length() == mDateEdit->markedText().length() ) && | 199 | if( (mDateEdit->text().length() == mDateEdit->markedText().length() ) && |
200 | ( (dateForm.at(begin + 1).latin1() == 'd') || | 200 | ( (dateForm.at(begin + 1).latin1() == 'd') || |
201 | (dateForm.at(begin + 1).latin1() == 'a') || | 201 | (dateForm.at(begin + 1).latin1() == 'a') || |
202 | (dateForm.at(begin + 1).latin1() == 'A') ) ) { | 202 | (dateForm.at(begin + 1).latin1() == 'A') ) ) { |
203 | break; | 203 | break; |
204 | } | 204 | } |
205 | // mDateEdit-StringPos == CursorPosition(cpos) then break and set date | 205 | // mDateEdit-StringPos == CursorPosition(cpos) then break and set date |
206 | if( ( (space + allStrLength) <= *cpos && *cpos <= (space + allStrLength + strLength) ) || *cpos < begin ) { | 206 | if( ( (space + allStrLength) <= *cpos && *cpos <= (space + allStrLength + strLength) ) || *cpos < begin ) { |
207 | break; | 207 | break; |
208 | } | 208 | } |
209 | allStrLength += strLength; | 209 | allStrLength += strLength; |
210 | begin = dateForm.find("%", begin +1); | 210 | begin = dateForm.find("%", begin +1); |
211 | } | 211 | } |
212 | 212 | ||
213 | // set date | 213 | // set date |
214 | switch ( dateForm.at(begin + 1).latin1() ) { | 214 | switch ( dateForm.at(begin + 1).latin1() ) { |
215 | case 'd': | 215 | case 'd': |
216 | case 'a': | 216 | case 'a': |
@@ -369,130 +369,132 @@ void KDateEdit::keyPressEvent(QKeyEvent *e) | |||
369 | QHBox::keyPressEvent(e); | 369 | QHBox::keyPressEvent(e); |
370 | break; | 370 | break; |
371 | } // switch | 371 | } // switch |
372 | mDateEdit->setCursorPosition(cpos); | 372 | mDateEdit->setCursorPosition(cpos); |
373 | } | 373 | } |
374 | 374 | ||
375 | void KDateEdit::setSelect( int from, int to ) | 375 | void KDateEdit::setSelect( int from, int to ) |
376 | { | 376 | { |
377 | // return; | 377 | // return; |
378 | mDateEdit->setSelection( from , to ); | 378 | mDateEdit->setSelection( from , to ); |
379 | } | 379 | } |
380 | 380 | ||
381 | void KDateEdit::toggleDatePicker() | 381 | void KDateEdit::toggleDatePicker() |
382 | { | 382 | { |
383 | if( mDateFrame->isVisible() ) { | 383 | if( mDateFrame->isVisible() ) { |
384 | mDateFrame->hide(); | 384 | mDateFrame->hide(); |
385 | } else { | 385 | } else { |
386 | QPoint tmpPoint = mapToGlobal(mDateButton->geometry().bottomRight()); | 386 | QPoint tmpPoint = mapToGlobal(mDateButton->geometry().bottomRight()); |
387 | QSize datepickersize = mDatePicker->sizeHint(); | 387 | QSize datepickersize = mDatePicker->sizeHint(); |
388 | 388 | ||
389 | if ( tmpPoint.x() < 7+datepickersize.width() ) tmpPoint.setX( 7+datepickersize.width() ); | 389 | if ( tmpPoint.x() < 7+datepickersize.width() ) tmpPoint.setX( 7+datepickersize.width() ); |
390 | 390 | ||
391 | int h = QApplication::desktop()->height(); | 391 | int h = QApplication::desktop()->height(); |
392 | 392 | ||
393 | if ( tmpPoint.y() + datepickersize.height() > h ) tmpPoint.setY( h - datepickersize.height() ); | 393 | if ( tmpPoint.y() + datepickersize.height() > h ) tmpPoint.setY( h - datepickersize.height() ); |
394 | 394 | ||
395 | mDateFrame->setGeometry(tmpPoint.x()-datepickersize.width()-7, tmpPoint.y(), | 395 | mDateFrame->setGeometry(tmpPoint.x()-datepickersize.width()-7, tmpPoint.y(), |
396 | datepickersize.width()+2*mDateFrame->lineWidth(), datepickersize.height()+2*mDateFrame->lineWidth()); | 396 | datepickersize.width()+2*mDateFrame->lineWidth(), datepickersize.height()+2*mDateFrame->lineWidth()); |
397 | 397 | ||
398 | QDate date = readDate(); | 398 | QDate date = readDate(); |
399 | if(date.isValid()) { | 399 | if(date.isValid()) { |
400 | mDatePicker->setDate(date); | 400 | mDatePicker->setDate(date); |
401 | } else { | 401 | } else { |
402 | mDatePicker->setDate(QDate::currentDate()); | 402 | mDatePicker->setDate(QDate::currentDate()); |
403 | } | 403 | } |
404 | mDateFrame->show(); | 404 | mDateFrame->show(); |
405 | } | 405 | } |
406 | } | 406 | } |
407 | 407 | ||
408 | 408 | ||
409 | void KDateEdit::lineEnterPressed() | 409 | void KDateEdit::lineEnterPressed() |
410 | { | 410 | { |
411 | QDate date = readDate(); | 411 | QDate date = readDate(); |
412 | 412 | ||
413 | if(date.isValid()) | 413 | if(date.isValid()) |
414 | { | 414 | { |
415 | // Update the edit. This is needed if the user has entered a | 415 | // Update the edit. This is needed if the user has entered a |
416 | // word rather than the actual date. | 416 | // word rather than the actual date. |
417 | setDate(date); | 417 | setDate(date); |
418 | emit(dateChanged(date)); | 418 | emit(dateChanged(date)); |
419 | emit returnPressed(); | 419 | emit returnPressed(); |
420 | } | 420 | } |
421 | else | 421 | else |
422 | { | 422 | { |
423 | if ( withoutDp ) { | 423 | if ( withoutDp ) { |
424 | KNotifyClient::beep(); | 424 | KNotifyClient::beep(); |
425 | } else { | 425 | } else { |
426 | if ( !mDateEdit->text().isEmpty() ) { | 426 | if ( !mDateEdit->text().isEmpty() ) { |
427 | mTextChanged = false; | 427 | mTextChanged = false; |
428 | QString text = i18n( "You entered an invalid date!\n Will use current date instead." ); | 428 | QString text = i18n( "You entered an invalid date!\n Will use current date instead." ); |
429 | if ( isVisible() ) | 429 | if ( isVisible() ) |
430 | if ( KMessageBox::warningContinueCancel( 0, text ) == KMessageBox::Continue ) { | 430 | if ( KMessageBox::warningContinueCancel( 0, text ) == KMessageBox::Continue ) { |
431 | setDate( QDate::currentDate() ); | 431 | setDate( QDate::currentDate() ); |
432 | emit dateChanged( QDate::currentDate() ); | 432 | emit dateChanged( QDate::currentDate() ); |
433 | } | 433 | } |
434 | } | 434 | } |
435 | } | 435 | } |
436 | } | 436 | } |
437 | } | 437 | } |
438 | 438 | ||
439 | bool KDateEdit::inputIsValid() | 439 | bool KDateEdit::inputIsValid() |
440 | { | 440 | { |
441 | return readDate().isValid(); | 441 | return readDate().isValid(); |
442 | } | 442 | } |
443 | 443 | ||
444 | QDate KDateEdit::readDate() const | 444 | QDate KDateEdit::readDate() const |
445 | { | 445 | { |
446 | QString text = mDateEdit->text(); | 446 | QString text = mDateEdit->text(); |
447 | QDate date; | 447 | QDate date; |
448 | 448 | ||
449 | if (mKeywordMap.contains(text.lower())) | 449 | if (mKeywordMap.contains(text.lower())) |
450 | { | 450 | { |
451 | date = QDate::currentDate().addDays(mKeywordMap[text.lower()]); | 451 | date = QDate::currentDate().addDays(mKeywordMap[text.lower()]); |
452 | } | 452 | } |
453 | else | 453 | else |
454 | { | 454 | { |
455 | date = KGlobal::locale()->readDate(text); | 455 | date = KGlobal::locale()->readDate(text); |
456 | } | 456 | } |
457 | 457 | ||
458 | return date; | 458 | return date; |
459 | } | 459 | } |
460 | 460 | ||
461 | bool KDateEdit::eventFilter(QObject *, QEvent *e) | 461 | bool KDateEdit::eventFilter(QObject *, QEvent *e) |
462 | { | 462 | { |
463 | // We only process the focus out event if the text has changed | 463 | // We only process the focus out event if the text has changed |
464 | // since we got focus | 464 | // since we got focus |
465 | if ((e->type() == QEvent::FocusOut) && mTextChanged) | 465 | if ((e->type() == QEvent::FocusOut) ) |
466 | { | 466 | { |
467 | lineEnterPressed(); | 467 | if ( mTextChanged ) { |
468 | mTextChanged = false; | 468 | lineEnterPressed(); |
469 | mTextChanged = false; | ||
470 | } | ||
469 | } | 471 | } |
470 | // switch dateFormShort by double klick with mouse | 472 | // switch dateFormShort by double klick with mouse |
471 | else if (e->type() == QEvent::MouseButtonDblClick) | 473 | else if (e->type() == QEvent::MouseButtonDblClick) |
472 | { | 474 | { |
473 | toggleDateFormat(); | 475 | toggleDateFormat(); |
474 | } | 476 | } |
475 | else if (e->type() == QEvent::FocusIn) | 477 | else if (e->type() == QEvent::FocusIn) |
476 | { | 478 | { |
477 | maxDay = readDate().day(); | 479 | maxDay = readDate().day(); |
478 | } | 480 | } |
479 | 481 | ||
480 | return false; | 482 | return false; |
481 | } | 483 | } |
482 | void KDateEdit::toggleDateFormat() | 484 | void KDateEdit::toggleDateFormat() |
483 | { | 485 | { |
484 | dateFormShort = ! dateFormShort; | 486 | dateFormShort = ! dateFormShort; |
485 | mDateEdit->setText(KGlobal::locale()->formatDate(readDate(),dateFormShort)); | 487 | mDateEdit->setText(KGlobal::locale()->formatDate(readDate(),dateFormShort)); |
486 | 488 | ||
487 | } | 489 | } |
488 | 490 | ||
489 | void KDateEdit::textChanged(const QString &) | 491 | void KDateEdit::textChanged(const QString &) |
490 | { | 492 | { |
491 | if(mHandleInvalid && mDateEdit->text().stripWhiteSpace().isEmpty()) { | 493 | if(mHandleInvalid && mDateEdit->text().stripWhiteSpace().isEmpty()) { |
492 | QDate date; //invalid date | 494 | QDate date; //invalid date |
493 | emit(dateChanged(date)); | 495 | emit(dateChanged(date)); |
494 | } else { | 496 | } else { |
495 | mTextChanged = true; | 497 | mTextChanged = true; |
496 | } | 498 | } |
497 | maxDay = readDate().day(); | 499 | maxDay = readDate().day(); |
498 | } | 500 | } |
@@ -1 +1 @@ | |||
version = "2.0.9"; | version = "2.0.10"; | ||