author | zautrix <zautrix> | 2005-10-27 23:22:36 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-10-27 23:22:36 (UTC) |
commit | cbda16d4966c7483d20d1b6b5a64c8af367ea732 (patch) (unidiff) | |
tree | 47099fd5b318c47eb1d8fff3d8a3eef6e34f6f23 | |
parent | d6d384e50cfd511866958e58cdd3adeb35ed1c4e (diff) | |
download | kdepimpi-cbda16d4966c7483d20d1b6b5a64c8af367ea732.zip kdepimpi-cbda16d4966c7483d20d1b6b5a64c8af367ea732.tar.gz kdepimpi-cbda16d4966c7483d20d1b6b5a64c8af367ea732.tar.bz2 |
us fix
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 5 | ||||
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 1 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 14 | ||||
-rw-r--r-- | libkdepim/kdatepicker.cpp | 8 | ||||
-rw-r--r-- | microkde/kdatetbl.cpp | 32 |
5 files changed, 34 insertions, 26 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index edf7eb1..681e433 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,82 +1,87 @@ | |||
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.2.6 ************ | ||
4 | |||
5 | KO/Pi: | ||
6 | Made navigation in datepicker more userfriendly when using keyboard for scrolling. | ||
7 | |||
3 | ********** VERSION 2.2.5 ************ | 8 | ********** VERSION 2.2.5 ************ |
4 | 9 | ||
5 | Bugfixes in KO/Pi, KA/Pi and OM/Pi. | 10 | Bugfixes in KO/Pi, KA/Pi and OM/Pi. |
6 | Added possibility to disable auto saving in KO/Pi. | 11 | Added possibility to disable auto saving in KO/Pi. |
7 | How to disable it? Good question! Next question, please? | 12 | How to disable it? Good question! Next question, please? |
8 | Added info about count of events/todos/journals to calendar info. | 13 | Added info about count of events/todos/journals to calendar info. |
9 | 14 | ||
10 | 15 | ||
11 | ********** VERSION 2.2.4 ************ | 16 | ********** VERSION 2.2.4 ************ |
12 | 17 | ||
13 | KO/Pi alarm applet: Made font smaller and added a dealy before starting KO/Pi to avoid problems accessing data storage when an alarm did wake up the Z. | 18 | KO/Pi alarm applet: Made font smaller and added a dealy before starting KO/Pi to avoid problems accessing data storage when an alarm did wake up the Z. |
14 | Added 3 sec notification about a started timer. | 19 | Added 3 sec notification about a started timer. |
15 | 20 | ||
16 | KO/Pi: | 21 | KO/Pi: |
17 | Added export option for all data to File->Export menu. | 22 | Added export option for all data to File->Export menu. |
18 | Better management if a save error occours. | 23 | Better management if a save error occours. |
19 | Added 15 sec delay in automatic saving when Z wake up from suspend and the automatic save timer did expire - to avoid problems accessing data storage directly after wake up. | 24 | Added 15 sec delay in automatic saving when Z wake up from suspend and the automatic save timer did expire - to avoid problems accessing data storage directly after wake up. |
20 | Fix for displaying month names of an utf8 translated language (like Russian). I hope a Russian version of KO/Pi will be available soon. | 25 | Fix for displaying month names of an utf8 translated language (like Russian). I hope a Russian version of KO/Pi will be available soon. |
21 | 26 | ||
22 | Added duration info about multiday events. | 27 | Added duration info about multiday events. |
23 | Changed behaviour of "Set complete" in Todo viewer: Now Todo viewer closes not automatically. | 28 | Changed behaviour of "Set complete" in Todo viewer: Now Todo viewer closes not automatically. |
24 | 29 | ||
25 | KA/Pi: | 30 | KA/Pi: |
26 | Added for vCard import the option to import contact data in Latin1 format. | 31 | Added for vCard import the option to import contact data in Latin1 format. |
27 | 32 | ||
28 | ********** VERSION 2.2.3 ************ | 33 | ********** VERSION 2.2.3 ************ |
29 | 34 | ||
30 | KO/Pi: | 35 | KO/Pi: |
31 | Fixed a problem with (non empty) exception dates in the exception date edit dialog of recurring events for newly created events. | 36 | Fixed a problem with (non empty) exception dates in the exception date edit dialog of recurring events for newly created events. |
32 | 37 | ||
33 | Fixed usability problem in KA/Pi: | 38 | Fixed usability problem in KA/Pi: |
34 | Now searching works for "all phone numbers and all addresses" if "all fields" is selected as search option. | 39 | Now searching works for "all phone numbers and all addresses" if "all fields" is selected as search option. |
35 | 40 | ||
36 | Changed some behaviour in OM/Pi mail management to make it more usable. | 41 | Changed some behaviour in OM/Pi mail management to make it more usable. |
37 | 42 | ||
38 | 43 | ||
39 | ********** VERSION 2.2.2 ************ | 44 | ********** VERSION 2.2.2 ************ |
40 | 45 | ||
41 | KO/Pi: | 46 | KO/Pi: |
42 | Fixed a problem with the sort order of last modified date in list view. | 47 | Fixed a problem with the sort order of last modified date in list view. |
43 | KA/Pi: | 48 | KA/Pi: |
44 | Fixed a resource config read problem on windows. | 49 | Fixed a resource config read problem on windows. |
45 | 50 | ||
46 | 51 | ||
47 | ********** VERSION 2.2.1 ************ | 52 | ********** VERSION 2.2.1 ************ |
48 | 53 | ||
49 | KO/Pi: | 54 | KO/Pi: |
50 | Fixed a problem displaying very long allday events in agenda view in single day mode. | 55 | Fixed a problem displaying very long allday events in agenda view in single day mode. |
51 | Fixed a problem with the default settings for new todos. | 56 | Fixed a problem with the default settings for new todos. |
52 | Added an error message dialog if saving of calendar files is not possible. | 57 | Added an error message dialog if saving of calendar files is not possible. |
53 | Made it impossible to close KO/Pi if saving fails. | 58 | Made it impossible to close KO/Pi if saving fails. |
54 | Fixed a problem adding calendars on windows such that these calendars can be used on the memory stick. | 59 | Fixed a problem adding calendars on windows such that these calendars can be used on the memory stick. |
55 | Added config options for conflict detection. | 60 | Added config options for conflict detection. |
56 | 61 | ||
57 | KA/Pi: | 62 | KA/Pi: |
58 | Added a config option to turn on asking before a contact is deleted. | 63 | Added a config option to turn on asking before a contact is deleted. |
59 | Fixed a problem with the default view and view selection at startup. | 64 | Fixed a problem with the default view and view selection at startup. |
60 | Formatted name is now set on import, if formatted name is empty. | 65 | Formatted name is now set on import, if formatted name is empty. |
61 | Fixed a problem of displaying images in the contact details view: | 66 | Fixed a problem of displaying images in the contact details view: |
62 | Now the wid/hei ratio is not changed. | 67 | Now the wid/hei ratio is not changed. |
63 | I a picture is larger than 128 pixels in wid or hei it is downscaled to | 68 | I a picture is larger than 128 pixels in wid or hei it is downscaled to |
64 | max 128 pixels wid/hei. | 69 | max 128 pixels wid/hei. |
65 | 70 | ||
66 | ********** VERSION 2.2.0 ************ | 71 | ********** VERSION 2.2.0 ************ |
67 | 72 | ||
68 | New stable release! | 73 | New stable release! |
69 | Fixed some minor usability problems. | 74 | Fixed some minor usability problems. |
70 | Added writing of next alarm to a file for usage on pdaXrom. | 75 | Added writing of next alarm to a file for usage on pdaXrom. |
71 | 76 | ||
72 | 77 | ||
73 | ************************************* | 78 | ************************************* |
74 | 79 | ||
75 | You can find the complete changelog | 80 | You can find the complete changelog |
76 | from version 1.7.7 to 2.2.0 | 81 | from version 1.7.7 to 2.2.0 |
77 | in the source package or on | 82 | in the source package or on |
78 | 83 | ||
79 | http://www.pi-sync.net/html/changelog.html | 84 | http://www.pi-sync.net/html/changelog.html |
80 | 85 | ||
81 | 86 | ||
82 | 87 | ||
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 288ce4b..767e243 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1453,129 +1453,128 @@ | |||
1453 | { "KO/Pi import information!","KO/Pi Import Information!" }, | 1453 | { "KO/Pi import information!","KO/Pi Import Information!" }, |
1454 | { "Start this todo\nand stop all running","Starte dieses Todo\nund stoppe alle Laufenden" }, | 1454 | { "Start this todo\nand stop all running","Starte dieses Todo\nund stoppe alle Laufenden" }, |
1455 | { "Cancel - do not start"," Abbrechen - Todo nicht starten" }, | 1455 | { "Cancel - do not start"," Abbrechen - Todo nicht starten" }, |
1456 | { "The timezone has changed!\nShould the calendar be reloaded\nto shift the time of the events?\nPlease read Menu: Help->FAQ:\n"How do I change the timezone?"\nas well!","Die Zeitzone wurde geändert!\nSollen die Kalender neu geladen\nwerden num die Zeiten\nder Termine zu ändern?\nBitte lesen Sie auch\nMenu: Help->FAQ:\n"How do I change the timezone?"" }, | 1456 | { "The timezone has changed!\nShould the calendar be reloaded\nto shift the time of the events?\nPlease read Menu: Help->FAQ:\n"How do I change the timezone?"\nas well!","Die Zeitzone wurde geändert!\nSollen die Kalender neu geladen\nwerden num die Zeiten\nder Termine zu ändern?\nBitte lesen Sie auch\nMenu: Help->FAQ:\n"How do I change the timezone?"" }, |
1457 | { "Reload","Neu laden" }, | 1457 | { "Reload","Neu laden" }, |
1458 | { "Timezone settings","Zeitzoneneinstellung" }, | 1458 | { "Timezone settings","Zeitzoneneinstellung" }, |
1459 | { "Title: ","Titel: " }, | 1459 | { "Title: ","Titel: " }, |
1460 | { "Journal from: ","Journal vom: " }, | 1460 | { "Journal from: ","Journal vom: " }, |
1461 | { "Journal: %1 from ","Journal: %1 vom " }, | 1461 | { "Journal: %1 from ","Journal: %1 vom " }, |
1462 | { "<b>Click here to edit categories: </b>","<b>Klicke hier um Kategorien zu ändern: </b>" }, | 1462 | { "<b>Click here to edit categories: </b>","<b>Klicke hier um Kategorien zu ändern: </b>" }, |
1463 | { "Selected Item","Ausgewähltes Item" }, | 1463 | { "Selected Item","Ausgewähltes Item" }, |
1464 | { "Select Date...","Wähle Datum..." }, | 1464 | { "Select Date...","Wähle Datum..." }, |
1465 | { "After importing/loading/syncing there may be new categories in events or todos which are not added automatically to the category list. Please choose what to do <b>now</b>:","Nach dem Importieren/Laden/Syncen kann es neue Kategorien in den Terminen oder Todos geben, die nicht automatisch der Kategorieliste hinzugefügt werden. Bitte wählen Sie, was <b>jetzt</b> passieren soll:" }, | 1465 | { "After importing/loading/syncing there may be new categories in events or todos which are not added automatically to the category list. Please choose what to do <b>now</b>:","Nach dem Importieren/Laden/Syncen kann es neue Kategorien in den Terminen oder Todos geben, die nicht automatisch der Kategorieliste hinzugefügt werden. Bitte wählen Sie, was <b>jetzt</b> passieren soll:" }, |
1466 | { "Change category list now!","Ändere Kategorieliste jetzt!" }, | 1466 | { "Change category list now!","Ändere Kategorieliste jetzt!" }, |
1467 | { "Edit category list...","Ändere Kategorieliste..." }, | 1467 | { "Edit category list...","Ändere Kategorieliste..." }, |
1468 | { "Toolbar changes needs a restart!","Neustart benötigt für Toolbaränderungen!" }, | 1468 | { "Toolbar changes needs a restart!","Neustart benötigt für Toolbaränderungen!" }, |
1469 | { "Filepath: ","Dateipfad: " }, | 1469 | { "Filepath: ","Dateipfad: " }, |
1470 | { "You can try to reload the calendar in the Resource View!","In der Resourcenansicht können Sie erneut versuchen den Kalender zu laden!" }, | 1470 | { "You can try to reload the calendar in the Resource View!","In der Resourcenansicht können Sie erneut versuchen den Kalender zu laden!" }, |
1471 | { "<b>WARNING:</b> There is a pending suspended alarm!","<b>WARNUNG:</b> Es gibt einen laufenden Suspendalarm!" }, | 1471 | { "<b>WARNING:</b> There is a pending suspended alarm!","<b>WARNUNG:</b> Es gibt einen laufenden Suspendalarm!" }, |
1472 | { "Pending Suspend Alarm","Laufender Suspend Alarm" }, | 1472 | { "Pending Suspend Alarm","Laufender Suspend Alarm" }, |
1473 | { "Error loading calendar %1","Fehler beim Laden von Kalender %1" }, | 1473 | { "Error loading calendar %1","Fehler beim Laden von Kalender %1" }, |
1474 | { "Calendar(s) not loaded:","Nicht geladene(r) Kalender:" }, | 1474 | { "Calendar(s) not loaded:","Nicht geladene(r) Kalender:" }, |
1475 | { "Loading of calendar(s) failed","Laden von Kalendern fehlgeschlagen" }, | 1475 | { "Loading of calendar(s) failed","Laden von Kalendern fehlgeschlagen" }, |
1476 | { "Alarm Options","Alarm Einstellungen" }, | 1476 | { "Alarm Options","Alarm Einstellungen" }, |
1477 | { "Delete selected...","Lösche Ausgewählte..." }, | 1477 | { "Delete selected...","Lösche Ausgewählte..." }, |
1478 | { "None","Nichts" }, | 1478 | { "None","Nichts" }, |
1479 | { "Selection","Auswahl" }, | 1479 | { "Selection","Auswahl" }, |
1480 | { "Set categories","Setze Kategorien" }, | 1480 | { "Set categories","Setze Kategorien" }, |
1481 | { "This adds the selected\nitems to the calendar\n%1\nand removes them from\ntheir current calendar!","Das fügt die ausgewählten\nEinträge dem Kalender\n%1\nhinzu und entfernt sie von\nihrem aktuellen Kalender!" }, | 1481 | { "This adds the selected\nitems to the calendar\n%1\nand removes them from\ntheir current calendar!","Das fügt die ausgewählten\nEinträge dem Kalender\n%1\nhinzu und entfernt sie von\nihrem aktuellen Kalender!" }, |
1482 | { "Reset","Neu setzen" }, | 1482 | { "Reset","Neu setzen" }, |
1483 | { "Do you want to <b>add</b> categories to the selected items or <b>reset</b> the list (i.e. remove current categories)?","Möchten Sie Kategorien zu den ausgewählten Einträgen <b>hinzufügen</b> oder die Liste <b>neu setzen</b> (d.h. vorhandene Kategorien löschen)?" }, | 1483 | { "Do you want to <b>add</b> categories to the selected items or <b>reset</b> the list (i.e. remove current categories)?","Möchten Sie Kategorien zu den ausgewählten Einträgen <b>hinzufügen</b> oder die Liste <b>neu setzen</b> (d.h. vorhandene Kategorien löschen)?" }, |
1484 | { "The file\n%1\ndoes not exist!\nShall I create it for you?","Die Datei\n%1\nexistiert nicht!\nSoll sie neu angelegt werden?" }, | 1484 | { "The file\n%1\ndoes not exist!\nShall I create it for you?","Die Datei\n%1\nexistiert nicht!\nSoll sie neu angelegt werden?" }, |
1485 | { "Sorry, cannot create the file\n%1!\nNo calendar added!","Kann leider die Datei\n%1\nnicht anlegen!\nKein Kalender hinzugefügt!" }, | 1485 | { "Sorry, cannot create the file\n%1!\nNo calendar added!","Kann leider die Datei\n%1\nnicht anlegen!\nKein Kalender hinzugefügt!" }, |
1486 | { "\nNO\n WRITEABLE\n CALENDAR\n FOUND!\n\nPlease fix your calendar settings!\n","\nKEIN\n SCHREIBBARER\n KALENDER\n GEFUNDEN!\n\nBitte korrigieren Sie\nihre Kalendereinstellungen!\n" }, | 1486 | { "\nNO\n WRITEABLE\n CALENDAR\n FOUND!\n\nPlease fix your calendar settings!\n","\nKEIN\n SCHREIBBARER\n KALENDER\n GEFUNDEN!\n\nBitte korrigieren Sie\nihre Kalendereinstellungen!\n" }, |
1487 | { "\nThe file\n%1\non disk has changed!\nFile size: %2 bytes.\nLast modified: %3\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n","\nDie Datei\n%1\nwurde verändert!\nDatei Grösse: %2 Bytes.\nZuletzt geändert: %3\nMöchten Sie:\n\n - Speichern und die Datei überschreiben?\n - Mit Datei Synchronisieren, dann speichern?\n - Abbrechen ohne zu speichern? \n" }, | 1487 | { "\nThe file\n%1\non disk has changed!\nFile size: %2 bytes.\nLast modified: %3\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n","\nDie Datei\n%1\nwurde verändert!\nDatei Grösse: %2 Bytes.\nZuletzt geändert: %3\nMöchten Sie:\n\n - Speichern und die Datei überschreiben?\n - Mit Datei Synchronisieren, dann speichern?\n - Abbrechen ohne zu speichern? \n" }, |
1488 | { "Edit","Edit" }, | 1488 | { "Edit","Edit" }, |
1489 | { "Last Modified","Zuletzt geändert" }, | 1489 | { "Last Modified","Zuletzt geändert" }, |
1490 | { "Journal viewer","Journal Anzeige" }, | 1490 | { "Journal viewer","Journal Anzeige" }, |
1491 | { "Configure Calendar Files...","Konfiguriere Kalenderdateien..." }, | 1491 | { "Configure Calendar Files...","Konfiguriere Kalenderdateien..." }, |
1492 | { "You can use and display <b>more than one</b> calendar file in KO/Pi. A calendar file is called a <b>resource</b>. To add a calendar or change calendar settings please use menu: <b>View -> Toggle Resource View</b>.","Sie können <b>mehr als eine</b> Kalenderdatei in KO/Pi darstellen und benutzen. Eine Kalenderdatei wird <b>Resource</b> genannt. Um einen Kalender hinzuzufügen oder die Kalendereinstellungen zu ändern benutzen Sie bitte das Menu: <b>Ansicht -> Resourcenansicht umschalten</b>." }, | 1492 | { "You can use and display <b>more than one</b> calendar file in KO/Pi. A calendar file is called a <b>resource</b>. To add a calendar or change calendar settings please use menu: <b>View -> Toggle Resource View</b>.","Sie können <b>mehr als eine</b> Kalenderdatei in KO/Pi darstellen und benutzen. Eine Kalenderdatei wird <b>Resource</b> genannt. Um einen Kalender hinzuzufügen oder die Kalendereinstellungen zu ändern benutzen Sie bitte das Menu: <b>Ansicht -> Resourcenansicht umschalten</b>." }, |
1493 | { "Hide Completed","Verstecke erledigte Todos" }, | 1493 | { "Hide Completed","Verstecke erledigte Todos" }, |
1494 | { "Show not Running","Zeige nicht Laufende" }, | 1494 | { "Show not Running","Zeige nicht Laufende" }, |
1495 | { "Click to add new Todo","Klick für neues Todo!" }, | 1495 | { "Click to add new Todo","Klick für neues Todo!" }, |
1496 | { "Show next conflict for","Zeige nächsten Konflikt für" }, | 1496 | { "Show next conflict for","Zeige nächsten Konflikt für" }, |
1497 | { "All events","Alle Termine" }, | 1497 | { "All events","Alle Termine" }, |
1498 | { "Allday events","Ganztagestermine" }, | 1498 | { "Allday events","Ganztagestermine" }, |
1499 | { "Events with time","Termine mit Zeit" }, | 1499 | { "Events with time","Termine mit Zeit" }, |
1500 | { "No conflict found","Kein Konflikt gefunden" }, | 1500 | { "No conflict found","Kein Konflikt gefunden" }, |
1501 | { "Conflict %1 <-> %2","Konflikt %1 <-> %2" }, | 1501 | { "Conflict %1 <-> %2","Konflikt %1 <-> %2" }, |
1502 | { "<p><b>Q</b>: Show next date with conflicting events\n ","<p><b>Q</b>: Zeige nächstes Datum mit Terminen im Konflikt\n " }, | 1502 | { "<p><b>Q</b>: Show next date with conflicting events\n ","<p><b>Q</b>: Zeige nächstes Datum mit Terminen im Konflikt\n " }, |
1503 | { "Week view mode uses row layout","Wochenansicht Modus nutzt Reihenlayout" }, | 1503 | { "Week view mode uses row layout","Wochenansicht Modus nutzt Reihenlayout" }, |
1504 | { "The event\n%1\nconflicts with event\n%2\nat date\n%3.\n","Der Termin\n%1\nist im Konflikt mit Termin\n%2\nam Datum\n%3.\n" }, | 1504 | { "The event\n%1\nconflicts with event\n%2\nat date\n%3.\n","Der Termin\n%1\nist im Konflikt mit Termin\n%2\nam Datum\n%3.\n" }, |
1505 | { "KO/Pi Conflict detected","KO/Pi Konflikt erkannt" }, | 1505 | { "KO/Pi Conflict detected","KO/Pi Konflikt erkannt" }, |
1506 | { "Show date","Zeige Datum" }, | 1506 | { "Show date","Zeige Datum" }, |
1507 | { "No problem!","Null Problemo!" }, | 1507 | { "No problem!","Null Problemo!" }, |
1508 | { "Automatically sync with KDE-Desktop\nwhen receiving sync request","Synce automatisch mit KDE-Desktop\nwenn eine Sync-Anforderung kommt" }, | 1508 | { "Automatically sync with KDE-Desktop\nwhen receiving sync request","Synce automatisch mit KDE-Desktop\nwenn eine Sync-Anforderung kommt" }, |
1509 | { "Pi-Sync Port Error","Pi-Sync Port Fehler" }, | 1509 | { "Pi-Sync Port Error","Pi-Sync Port Fehler" }, |
1510 | { "<b>Enabling Pi-Sync failed!</b> Failed to bind or listen to the port %1! Is another instance already listening to that port?","<b>Anschalten von Pi-Sync fehlgeschlagen!</b> Fehler beim Ansprechen des Ports %1! Ist bereits eine andere Anwendung dabei diesen Port zu nutzen?" }, | 1510 | { "<b>Enabling Pi-Sync failed!</b> Failed to bind or listen to the port %1! Is another instance already listening to that port?","<b>Anschalten von Pi-Sync fehlgeschlagen!</b> Fehler beim Ansprechen des Ports %1! Ist bereits eine andere Anwendung dabei diesen Port zu nutzen?" }, |
1511 | { "No valid port number:\n%1","Keine gültige Port Nummer:\n%1" }, | 1511 | { "No valid port number:\n%1","Keine gültige Port Nummer:\n%1" }, |
1512 | { "Port number (Default: %1)\nValid range from 1 to 65535","Port Nummer (Standard: %1)\nGültiger Bereich von 1 bis 65535" }, | 1512 | { "Port number (Default: %1)\nValid range from 1 to 65535","Port Nummer (Standard: %1)\nGültiger Bereich von 1 bis 65535" }, |
1513 | { "Pi-Sync Error","Pi-Sync Fehler" }, | 1513 | { "Pi-Sync Error","Pi-Sync Fehler" }, |
1514 | { "Got send file request\nwith invalid password","Erhielt "sende Datei" Anfrage\nmit ungültigem Passwort" }, | 1514 | { "Got send file request\nwith invalid password","Erhielt "sende Datei" Anfrage\nmit ungültigem Passwort" }, |
1515 | { "Got receive file request\nwith invalid password","Erhielt "empfange Datei" Anfrage\nmit ungültigem Passwort" }, | 1515 | { "Got receive file request\nwith invalid password","Erhielt "empfange Datei" Anfrage\nmit ungültigem Passwort" }, |
1516 | { "Wrong password: Receiving remote file failed.","Falsches Passwort: Empfangen von entfernter Datei fehlgeschlagen." }, | 1516 | { "Wrong password: Receiving remote file failed.","Falsches Passwort: Empfangen von entfernter Datei fehlgeschlagen." }, |
1517 | { "Please close error dialog on remote.","Bitte schließe Fehler-Dialog am entfernten Rechner" }, | 1517 | { "Please close error dialog on remote.","Bitte schließe Fehler-Dialog am entfernten Rechner" }, |
1518 | { "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" }, | 1518 | { "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" }, |
1519 | { "Pi-Sync: Connected!","Pi-Sync: Verbunden!" }, | 1519 | { "Pi-Sync: Connected!","Pi-Sync: Verbunden!" }, |
1520 | { "Receiving file from remote...","Empfange entfernte Datei..." }, | 1520 | { "Receiving file from remote...","Empfange entfernte Datei..." }, |
1521 | { "Sending back synced file...","Sende synchronisierte Datei zurück..." }, | 1521 | { "Sending back synced file...","Sende synchronisierte Datei zurück..." }, |
1522 | { "Do you want to\nclear all sync info\nof all profiles?","Möchten Sie wirklich\ndie Sync-Info\nfür alle Profile\nlöschen?" }, | 1522 | { "Do you want to\nclear all sync info\nof all profiles?","Möchten Sie wirklich\ndie Sync-Info\nfür alle Profile\nlöschen?" }, |
1523 | { "Do you want to\nclear the sync\ninfo of profile\n%1?\n","Möchten Sie wirklich\ndie Sync-Info für Profil\n%1?\nlöschen" }, | 1523 | { "Do you want to\nclear the sync\ninfo of profile\n%1?\n","Möchten Sie wirklich\ndie Sync-Info für Profil\n%1?\nlöschen" }, |
1524 | { "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." }, | 1524 | { "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." }, |
1525 | { "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" }, | 1525 | { "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" }, |
1526 | { "Writing back file ...","Schreibe Datei zurück..." }, | 1526 | { "Writing back file ...","Schreibe Datei zurück..." }, |
1527 | { "Sending back file ...","Sende Datei zurück..." }, | 1527 | { "Sending back file ...","Sende Datei zurück..." }, |
1528 | { "Eeek, there I am ticklish!","Hihi, da bin ich kitzlig!" }, | 1528 | { "Eeek, there I am ticklish!","Hihi, da bin ich kitzlig!" }, |
1529 | { "Created","Angelegt" }, | 1529 | { "Created","Angelegt" }, |
1530 | { "Last Modified Sub","Zuletzt geändertes Sub" }, | 1530 | { "Last Modified Sub","Zuletzt geändertes Sub" }, |
1531 | { "Checking conflicts ... please wait","Überprüfe Konflikte ... bitte warten" }, | 1531 | { "Checking conflicts ... please wait","Überprüfe Konflikte ... bitte warten" }, |
1532 | { "Show times on two lines","Zeige Zeiten auf zwei Zeilen" }, | 1532 | { "Show times on two lines","Zeige Zeiten auf zwei Zeilen" }, |
1533 | { "Save using LOCAL storage","Speichere nutze LOCAL Pfad" }, | 1533 | { "Save using LOCAL storage","Speichere nutze LOCAL Pfad" }, |
1534 | { "Duration","Dauer" }, | 1534 | { "Duration","Dauer" }, |
1535 | { " day"," Tag" }, | 1535 | { " day"," Tag" }, |
1536 | { "Click this button to display all todos in a <b>flat</b> hierarchy","Klicke diesen Knopf um alle Todos in einer <b>flachen</b> Hierarchie darzustellen" }, | 1536 | { "Click this button to display all todos in a <b>flat</b> hierarchy","Klicke diesen Knopf um alle Todos in einer <b>flachen</b> Hierarchie darzustellen" }, |
1537 | { "Click this button to display all todos <b>openend</b>","Klicke diesen Knopf um alle Todos <b>geöffnet</b> darzustellen" }, | 1537 | { "Click this button to display all todos <b>openend</b>","Klicke diesen Knopf um alle Todos <b>geöffnet</b> darzustellen" }, |
1538 | { "Click this button to display all todos <b>closed</b>","Klicke diesen Knopf um alle Todos <b>geschlossen</b> darzustellen" }, | 1538 | { "Click this button to display all todos <b>closed</b>","Klicke diesen Knopf um alle Todos <b>geschlossen</b> darzustellen" }, |
1539 | { "Click this button to toggle show/hide <b>running</b> todos","Klicke diesen Knopf um <b>zeige Laufende</b> umzuschalten" }, | 1539 | { "Click this button to toggle show/hide <b>running</b> todos","Klicke diesen Knopf um <b>zeige Laufende</b> umzuschalten" }, |
1540 | { "Click this button to toggle show/hide <b>completed</b> todos","Klicke diesen Knopf um <b>zeige Erledigte</b> umzuschalten" }, | 1540 | { "Click this button to toggle show/hide <b>completed</b> todos","Klicke diesen Knopf um <b>zeige Erledigte</b> umzuschalten" }, |
1541 | { "Click this button to add a new subtodo to the currently selected todo","Klicke diesen Knopf um ein Untertodo zu dem gerade selektierten Todo hinzuzufügen" }, | 1541 | { "Click this button to add a new subtodo to the currently selected todo","Klicke diesen Knopf um ein Untertodo zu dem gerade selektierten Todo hinzuzufügen" }, |
1542 | { "In this column you can <b>set a calendar to be visible</b>. If a calendar is not visible its entries are not displayed in the views. You can add items to it and it is loaded/saved as usual.","In dieser Spalte kann man einen <b>Kalender auf sichtbar schalten</b>. Wenn ein Kalender nicht sichtbar ist werden seine Einträge nicht in den Ansichten angezeigt. Man kann Einträge hinzufügen und laden/speichern wie gewöhnlich." }, | 1542 | { "In this column you can <b>set a calendar to be visible</b>. If a calendar is not visible its entries are not displayed in the views. You can add items to it and it is loaded/saved as usual.","In dieser Spalte kann man einen <b>Kalender auf sichtbar schalten</b>. Wenn ein Kalender nicht sichtbar ist werden seine Einträge nicht in den Ansichten angezeigt. Man kann Einträge hinzufügen und laden/speichern wie gewöhnlich." }, |
1543 | { "In this column you can see the <b>name of the calendar</b>. If you click on the name button you will get an information box about the loaded calendar file. If the file was not loaded at startup you can try to load it here again.","In dieser Spalte wird der <b>Name des Kalenders</b> angezeigt. Wenn Sie auf den Namen klicken wird Information über die Kalenderdatei angezeigt. Wenn die Datei beim Start nicht geladen wurde können Sie hier erneut versuchen sie zu laden." }, | 1543 | { "In this column you can see the <b>name of the calendar</b>. If you click on the name button you will get an information box about the loaded calendar file. If the file was not loaded at startup you can try to load it here again.","In dieser Spalte wird der <b>Name des Kalenders</b> angezeigt. Wenn Sie auf den Namen klicken wird Information über die Kalenderdatei angezeigt. Wenn die Datei beim Start nicht geladen wurde können Sie hier erneut versuchen sie zu laden." }, |
1544 | { "In this column you can <b>disable the alarms of a calendar all together</b>. The alarm data in the calendar itself is not changed, the alarms are marked internally as "do not use". Useful if you load a calendar of another person but do not want to get notified about alarms of that person.","In dieser Spalte können die <b>Alarme eines Kalenders alle zusammen abgeschaltet werden</b>. Die Alarmdaten im Kalender selbst werden nicht verändert, es werde die Alarme intern als "nicht beachten" markiert. Nützlich wenn Sie den Kalender einer anderen Person laden aber nicht über dessen Alarme unterrichtet werden wollen." }, | 1544 | { "In this column you can <b>disable the alarms of a calendar all together</b>. The alarm data in the calendar itself is not changed, the alarms are marked internally as "do not use". Useful if you load a calendar of another person but do not want to get notified about alarms of that person.","In dieser Spalte können die <b>Alarme eines Kalenders alle zusammen abgeschaltet werden</b>. Die Alarmdaten im Kalender selbst werden nicht verändert, es werde die Alarme intern als "nicht beachten" markiert. Nützlich wenn Sie den Kalender einer anderen Person laden aber nicht über dessen Alarme unterrichtet werden wollen." }, |
1545 | { "In this column you can <b>set a calendar and all entries of the calendar to read only</b>. If a calendar is readonly the entries cannot be edited and no items can be added to the calendar. If you change a setting of a calendar to readonly in this column all data will be saved because the data of a readonly calendar is not saved later.","In dieser Spalte können Sie einen <b>Kalender und alle Einträge auf schreibgeschützt setzen</b>. Einträge eines schreibgeschützten Kalenders können nicht verändert werden und es können keine Einträge zum Kalender hinzugefügt werden. Wenn Sie die Einstellung eines Kalenders in dieser Spalte auf schreibgeschützt setzen werden alle Daten automatisch abgespeichert, da die Daten eines schreibgeschützten Kalenders später nicht mehr gespeichert werden." }, | 1545 | { "In this column you can <b>set a calendar and all entries of the calendar to read only</b>. If a calendar is readonly the entries cannot be edited and no items can be added to the calendar. If you change a setting of a calendar to readonly in this column all data will be saved because the data of a readonly calendar is not saved later.","In dieser Spalte können Sie einen <b>Kalender und alle Einträge auf schreibgeschützt setzen</b>. Einträge eines schreibgeschützten Kalenders können nicht verändert werden und es können keine Einträge zum Kalender hinzugefügt werden. Wenn Sie die Einstellung eines Kalenders in dieser Spalte auf schreibgeschützt setzen werden alle Daten automatisch abgespeichert, da die Daten eines schreibgeschützten Kalenders später nicht mehr gespeichert werden." }, |
1546 | { "Click this button to <b>add a calendar</b>. You can add an existing calendar file or you can add a new calendar and KO/Pi creates a new empty calendar file for you.","Klicken Sie diesen Knopf <b>um einen Kalender hinzuzufügen</b>. Sie können eine existierende Kalenderdatei hinzufügen oder einen neuen Kalender und KO/Pi legt dann eine neue leere Kalenderdatei für Sie an." }, | 1546 | { "Click this button to <b>add a calendar</b>. You can add an existing calendar file or you can add a new calendar and KO/Pi creates a new empty calendar file for you.","Klicken Sie diesen Knopf <b>um einen Kalender hinzuzufügen</b>. Sie können eine existierende Kalenderdatei hinzufügen oder einen neuen Kalender und KO/Pi legt dann eine neue leere Kalenderdatei für Sie an." }, |
1547 | { "<b>iCal (*.ics) file on disk:</b><br>(will be created, if not existing)","<b>iCal (*.ics) Datei:</b><br>(Datei wird angelegt, wenn sie nicht existiert)" }, | 1547 | { "<b>iCal (*.ics) file on disk:</b><br>(will be created, if not existing)","<b>iCal (*.ics) Datei:</b><br>(Datei wird angelegt, wenn sie nicht existiert)" }, |
1548 | { "Error saving data","Fehler beim Abspeichern" }, | 1548 | { "Error saving data","Fehler beim Abspeichern" }, |
1549 | { "Calendar(s) not saved:","Nicht gespeicherte Kalender:" }, | 1549 | { "Calendar(s) not saved:","Nicht gespeicherte Kalender:" }, |
1550 | { "Enable conflict detection","Schalte Konflikterkennung an" }, | 1550 | { "Enable conflict detection","Schalte Konflikterkennung an" }, |
1551 | { "Filter for the edited event","Filter für den bearbeiteten Termin" }, | 1551 | { "Filter for the edited event","Filter für den bearbeiteten Termin" }, |
1552 | { "Filter for other events","Filter für die anderen Termine" }, | 1552 | { "Filter for other events","Filter für die anderen Termine" }, |
1553 | { "Check Allday with Allday","Prüfe GanzTag mit GanzTag" }, | 1553 | { "Check Allday with Allday","Prüfe GanzTag mit GanzTag" }, |
1554 | { "Check Allday with NonAllday","Prüfe GanzTag mit NichtGanzTag" }, | 1554 | { "Check Allday with NonAllday","Prüfe GanzTag mit NichtGanzTag" }, |
1555 | { "Check NonAllday with Allday","Prüfe NichtGanzTag mit GanzTag" }, | 1555 | { "Check NonAllday with Allday","Prüfe NichtGanzTag mit GanzTag" }, |
1556 | { "Check NonAllday with NonAllday","Prüfe NichtGanzTag mit NichtGanzTag" }, | 1556 | { "Check NonAllday with NonAllday","Prüfe NichtGanzTag mit NichtGanzTag" }, |
1557 | { "Conflict detection","Konflikterkennung" }, | 1557 | { "Conflict detection","Konflikterkennung" }, |
1558 | { "Loading calendar files ... please wait","Lade Kalenderdateien ... bitte warten" }, | 1558 | { "Loading calendar files ... please wait","Lade Kalenderdateien ... bitte warten" }, |
1559 | { "Show multiday allday ev. in date nav.","Zeige Multi-Ganzt.Term.in Datums Nav." }, | 1559 | { "Show multiday allday ev. in date nav.","Zeige Multi-Ganzt.Term.in Datums Nav." }, |
1560 | { "Include events which "show as free"","Inklusive Termine mit "Zeige Zeit als frei"" }, | 1560 | { "Include events which "show as free"","Inklusive Termine mit "Zeige Zeit als frei"" }, |
1561 | { "Conflict detection checks an <b>edited event</b> with <b>other events</b> for overlapping.","Konflikterkennung prüft einen <b>bearbeiteten Termin</b> auf Überschneidungen mit <b>anderen Terminen</b>." }, | 1561 | { "Conflict detection checks an <b>edited event</b> with <b>other events</b> for overlapping.","Konflikterkennung prüft einen <b>bearbeiteten Termin</b> auf Überschneidungen mit <b>anderen Terminen</b>." }, |
1562 | { " Yes, close "," Ja, beenden " }, | 1562 | { " Yes, close "," Ja, beenden " }, |
1563 | { "Export All Data","Exportiere alle Daten" }, | 1563 | { "Export All Data","Exportiere alle Daten" }, |
1564 | { "You can save all data\nto another file via\nFile->Export->Export All Data","Sie können alle Daten in\neine andere Datei speichern unter\nDatei->Exportiere->Exportiere alle Daten" }, | 1564 | { "You can save all data\nto another file via\nFile->Export->Export All Data","Sie können alle Daten in\neine andere Datei speichern unter\nDatei->Exportiere->Exportiere alle Daten" }, |
1565 | { "<p><b>Duration:</b> %1 days</p>","<p><b>Dauer:</b> %1 Tage</p>" }, | 1565 | { "<p><b>Duration:</b> %1 days</p>","<p><b>Dauer:</b> %1 Tage</p>" }, |
1566 | { " (Duration: %1 days)"," (Dauer: %1 Tage)" }, | 1566 | { " (Duration: %1 days)"," (Dauer: %1 Tage)" }, |
1567 | { "Autosave enabled!","Auto-Speichern angeschaltet!" }, | 1567 | { "Autosave enabled!","Auto-Speichern angeschaltet!" }, |
1568 | { "Autosave disabled! Save timer stopped!","Auto-Speichern ausgeschaltet! Speicher Timer gestoppt!" }, | 1568 | { "Autosave disabled! Save timer stopped!","Auto-Speichern ausgeschaltet! Speicher Timer gestoppt!" }, |
1569 | { "Autosave disabled!","Auto-Speichern ist ausgeschaltet!" }, | 1569 | { "Autosave disabled!","Auto-Speichern ist ausgeschaltet!" }, |
1570 | { "Yes, Save!","Ja, Speichern!" }, | 1570 | { "Yes, Save!","Ja, Speichern!" }, |
1571 | { "Calendar is modified\nbut Autosave is disabled!\nDo you want\nto save the data?","Der Kalender wurde verändert,\naber Auto-Speichern ist\nabgeschaltet. Möchten Sie\ndie Daten speichern?" }, | 1571 | { "Calendar is modified\nbut Autosave is disabled!\nDo you want\nto save the data?","Der Kalender wurde verändert,\naber Auto-Speichern ist\nabgeschaltet. Möchten Sie\ndie Daten speichern?" }, |
1572 | { "<p><b>C+ctrl</b>: Dis/enable automatic saving</p>\n","<p><b>C+ctrl</b>: Auto-Speichern ab/anschalten</p>\n" }, | 1572 | { "<p><b>C+ctrl</b>: Dis/enable automatic saving</p>\n","<p><b>C+ctrl</b>: Auto-Speichern ab/anschalten</p>\n" }, |
1573 | { "<br>The calendar contains<br><b>%1 events<br>%2 todos<br>%3 journals</b>","<br>Der Kalender enthält<br><b>%1 Termine<br>%2 Todos<br>%3 Journale</b>" }, | 1573 | { "<br>The calendar contains<br><b>%1 events<br>%2 todos<br>%3 journals</b>","<br>Der Kalender enthält<br><b>%1 Termine<br>%2 Todos<br>%3 Journale</b>" }, |
1574 | { "","" }, | 1574 | { "","" }, |
1575 | { "","" }, | 1575 | { "","" }, |
1576 | { "","" }, | 1576 | { "","" }, |
1577 | { "","" }, | 1577 | { "","" }, |
1578 | { "","" }, | 1578 | { "","" }, |
1579 | { "","" }, | 1579 | { "","" }, |
1580 | { "","" }, | 1580 | { "","" }, |
1581 | { "","" }, | ||
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 610aae6..85e9166 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -612,263 +612,271 @@ QPalette MonthViewCell::getPalette () | |||
612 | } | 612 | } |
613 | } | 613 | } |
614 | return mNonPrimaryPalette; | 614 | return mNonPrimaryPalette; |
615 | } | 615 | } |
616 | bool MonthViewCell::isPrimary() const | 616 | bool MonthViewCell::isPrimary() const |
617 | { | 617 | { |
618 | return mPrimary; | 618 | return mPrimary; |
619 | } | 619 | } |
620 | 620 | ||
621 | void MonthViewCell::setHoliday( bool holiday ) | 621 | void MonthViewCell::setHoliday( bool holiday ) |
622 | { | 622 | { |
623 | mHoliday = holiday; | 623 | mHoliday = holiday; |
624 | //setMyPalette(); | 624 | //setMyPalette(); |
625 | } | 625 | } |
626 | 626 | ||
627 | void MonthViewCell::setHoliday( const QString &holiday ) | 627 | void MonthViewCell::setHoliday( const QString &holiday ) |
628 | { | 628 | { |
629 | mHolidayString = holiday; | 629 | mHolidayString = holiday; |
630 | 630 | ||
631 | if ( !holiday.isEmpty() ) { | 631 | if ( !holiday.isEmpty() ) { |
632 | setHoliday( true ); | 632 | setHoliday( true ); |
633 | } | 633 | } |
634 | } | 634 | } |
635 | 635 | ||
636 | void MonthViewCell::startUpdateCell() | 636 | void MonthViewCell::startUpdateCell() |
637 | { | 637 | { |
638 | blockSignals( true ); | 638 | blockSignals( true ); |
639 | mdayCount = 0; | 639 | mdayCount = 0; |
640 | setFocusPolicy(NoFocus); | 640 | setFocusPolicy(NoFocus); |
641 | if ( !mMonthView->isUpdatePossible() ) | 641 | if ( !mMonthView->isUpdatePossible() ) |
642 | return; | 642 | return; |
643 | MonthViewItem *mitem = (MonthViewItem*) firstItem (); | 643 | MonthViewItem *mitem = (MonthViewItem*) firstItem (); |
644 | while ( mitem ) { | 644 | while ( mitem ) { |
645 | mitem->setBlockRepaint( true ); | 645 | mitem->setBlockRepaint( true ); |
646 | mitem = (MonthViewItem *)mitem->next(); | 646 | mitem = (MonthViewItem *)mitem->next(); |
647 | } | 647 | } |
648 | if ( mAvailItemList.count() > 20 ) { | 648 | if ( mAvailItemList.count() > 20 ) { |
649 | mAvailItemList.setAutoDelete( true ); | 649 | mAvailItemList.setAutoDelete( true ); |
650 | mAvailItemList.clear(); | 650 | mAvailItemList.clear(); |
651 | mAvailItemList.setAutoDelete( false ); | 651 | mAvailItemList.setAutoDelete( false ); |
652 | clear(); | 652 | clear(); |
653 | } | 653 | } |
654 | 654 | ||
655 | setPrimary( mDate.month()%2 ); | 655 | setPrimary( mDate.month()%2 ); |
656 | setHoliday( KOGlobals::self()->calendarSystem()->dayOfWeek(mDate) == KOGlobals::self()->calendarSystem()->weekDayOfPray() || ( mDate.dayOfWeek() == 6 ) && KOPrefs::instance()-> mExcludeSaturdays); | 656 | setHoliday( KOGlobals::self()->calendarSystem()->dayOfWeek(mDate) == KOGlobals::self()->calendarSystem()->weekDayOfPray() || ( mDate.dayOfWeek() == 6 ) && KOPrefs::instance()-> mExcludeSaturdays); |
657 | if ( mDate == QDate::currentDate() ) { | 657 | if ( mDate == QDate::currentDate() ) { |
658 | setLineWidth( 3 ); | 658 | setLineWidth( 3 ); |
659 | } else { | 659 | } else { |
660 | setLineWidth( 1 ); | 660 | setLineWidth( 1 ); |
661 | } | 661 | } |
662 | MonthViewItem* CurrentAvailItem = (MonthViewItem*) firstItem (); | 662 | MonthViewItem* CurrentAvailItem = (MonthViewItem*) firstItem (); |
663 | //clear(); | 663 | //clear(); |
664 | while ( CurrentAvailItem ) { | 664 | while ( CurrentAvailItem ) { |
665 | MonthViewItem *item = CurrentAvailItem; | 665 | MonthViewItem *item = CurrentAvailItem; |
666 | //item->setHighlightedFalse(); | 666 | //item->setHighlightedFalse(); |
667 | item->recycle( 0, ""); | 667 | item->recycle( 0, ""); |
668 | CurrentAvailItem = (MonthViewItem *)item->next(); | 668 | CurrentAvailItem = (MonthViewItem *)item->next(); |
669 | mAvailItemList.append( item ); | 669 | mAvailItemList.append( item ); |
670 | takeItem ( item ); | 670 | takeItem ( item ); |
671 | } | 671 | } |
672 | 672 | ||
673 | #ifdef DESKTOP_VERSION | 673 | #ifdef DESKTOP_VERSION |
674 | QToolTip::remove(this); | 674 | QToolTip::remove(this); |
675 | #endif | 675 | #endif |
676 | mToolTip.clear(); | 676 | mToolTip.clear(); |
677 | //qApp->processEvents(); | 677 | //qApp->processEvents(); |
678 | #if 0 | 678 | #if 0 |
679 | if ( !mHolidayString.isEmpty() ) { | 679 | if ( !mHolidayString.isEmpty() ) { |
680 | MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString ); | 680 | MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString ); |
681 | item->setPalette( mHolidayPalette ); | 681 | item->setPalette( mHolidayPalette ); |
682 | insertItem( item ); | 682 | insertItem( item ); |
683 | mToolTip.append ( mHolidayString ); | 683 | mToolTip.append ( mHolidayString ); |
684 | } | 684 | } |
685 | #endif | 685 | #endif |
686 | } | 686 | } |
687 | 687 | ||
688 | int MonthViewCell::insertEvent(Event *event) | 688 | int MonthViewCell::insertEvent(Event *event) |
689 | { | 689 | { |
690 | bool useToolTips = true; | 690 | bool useToolTips = true; |
691 | #ifndef DESKTOP_VERSION | 691 | #ifndef DESKTOP_VERSION |
692 | useToolTips = false; | 692 | useToolTips = false; |
693 | #endif | 693 | #endif |
694 | QString mToolTipText; | 694 | QString mToolTipText; |
695 | setFocusPolicy(WheelFocus); | 695 | setFocusPolicy(WheelFocus); |
696 | if ( !(event->doesRecur() == Recurrence::rNone) ) { | 696 | if ( !(event->doesRecur() == Recurrence::rNone) ) { |
697 | if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) | 697 | if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) |
698 | return mdayCount; | 698 | return mdayCount; |
699 | else | 699 | else |
700 | if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) | 700 | if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) |
701 | return mdayCount; | 701 | return mdayCount; |
702 | } | 702 | } |
703 | 703 | ||
704 | if ( event->isHoliday()) { | 704 | if ( event->isHoliday()) { |
705 | setHoliday( true ); | 705 | setHoliday( true ); |
706 | if ( mDate.dayOfWeek() == 7 ) | 706 | if ( mDate.dayOfWeek() == 7 ) |
707 | setLineWidth( 3 ); | 707 | setLineWidth( 3 ); |
708 | } | 708 | } |
709 | QString text; | 709 | QString text; |
710 | int multiday = 0;// 1 = start, 2 = midddle, 3 = end day | 710 | int multiday = 0;// 1 = start, 2 = midddle, 3 = end day |
711 | if (event->isMultiDay()) { | 711 | if (event->isMultiDay()) { |
712 | QString prefix = "<->";multiday = 2; | 712 | QString prefix = "<->";multiday = 2; |
713 | QString time; | 713 | QString time; |
714 | if ( event->doesRecur() ) { | 714 | if ( event->doesRecur() ) { |
715 | if ( event->recursOn( mDate) ) { | 715 | if ( event->recursOn( mDate) ) { |
716 | prefix ="->" ;multiday = 1; | 716 | prefix ="->" ;multiday = 1; |
717 | } | 717 | } |
718 | else { | 718 | else { |
719 | int days = event->dtStart().date().daysTo ( event->dtEnd().date() ); | 719 | int days = event->dtStart().date().daysTo ( event->dtEnd().date() ); |
720 | if ( event->recursOn( mDate.addDays( -days)) ) { | 720 | if ( event->recursOn( mDate.addDays( -days)) ) { |
721 | prefix ="<-" ;multiday = 3; | 721 | prefix ="<-" ;multiday = 3; |
722 | } | 722 | } |
723 | } | 723 | } |
724 | 724 | ||
725 | } else { | 725 | } else { |
726 | if (mDate == event->dtStart().date()) { | 726 | if (mDate == event->dtStart().date()) { |
727 | prefix ="->" ;multiday = 1; | 727 | prefix ="->" ;multiday = 1; |
728 | } else if (mDate == event->dtEnd().date()) { | 728 | } else if (mDate == event->dtEnd().date()) { |
729 | prefix ="<-" ;multiday = 3; | 729 | prefix ="<-" ;multiday = 3; |
730 | } | 730 | } |
731 | } | 731 | } |
732 | if ( !event->doesFloat() ) { | 732 | if ( !event->doesFloat() ) { |
733 | if ( mDate == event->dtStart().date () ) | 733 | if ( mDate == event->dtStart().date () ) |
734 | time = KGlobal::locale()->formatTime(event->dtStart().time())+" "; | 734 | time = KGlobal::locale()->formatTime(event->dtStart().time())+" "; |
735 | else if ( mDate == event->dtEnd().date () ) | 735 | else if ( mDate == event->dtEnd().date () ) |
736 | time = KGlobal::locale()->formatTime(event->dtEnd().time())+" "; | 736 | time = KGlobal::locale()->formatTime(event->dtEnd().time())+" "; |
737 | 737 | ||
738 | } | 738 | } |
739 | text = time + event->summary(); | 739 | text = time + event->summary(); |
740 | |||
741 | int dur = 0; | ||
742 | if ( event->doesFloat() ) { | ||
743 | dur = event->dtStart().daysTo(event->dtEnd())+1; | ||
744 | |||
745 | } | ||
740 | if ( useToolTips ) { | 746 | if ( useToolTips ) { |
741 | mToolTipText += prefix + text; | 747 | mToolTipText += prefix + text; |
742 | if ( event->doesFloat() ) { | 748 | if ( dur ) { |
743 | mToolTipText += i18n(" (Duration: %1 days)" ).arg ( event->dtStart().daysTo(event->dtEnd())+1); | 749 | mToolTipText += i18n(" (Duration: %1 days)" ).arg ( dur ); |
744 | |||
745 | } | 750 | } |
746 | } | 751 | } |
752 | if ( dur ) { | ||
753 | text += " ("+ QString::number( dur ) + i18n(" days" ) + ")"; | ||
754 | } | ||
747 | } else { | 755 | } else { |
748 | if (event->doesFloat()) { | 756 | if (event->doesFloat()) { |
749 | text = event->summary(); | 757 | text = event->summary(); |
750 | if ( useToolTips ) | 758 | if ( useToolTips ) |
751 | mToolTipText += text; | 759 | mToolTipText += text; |
752 | } | 760 | } |
753 | else { | 761 | else { |
754 | text = KGlobal::locale()->formatTime(event->dtStart().time()); | 762 | text = KGlobal::locale()->formatTime(event->dtStart().time()); |
755 | text += " " + event->summary(); | 763 | text += " " + event->summary(); |
756 | if ( useToolTips ) | 764 | if ( useToolTips ) |
757 | mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); | 765 | mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); |
758 | } | 766 | } |
759 | } | 767 | } |
760 | if ( useToolTips && ! event->location().isEmpty() ) { | 768 | if ( useToolTips && ! event->location().isEmpty() ) { |
761 | mToolTipText += " (" + event->location() +")"; | 769 | mToolTipText += " (" + event->location() +")"; |
762 | } | 770 | } |
763 | MonthViewItem *item ; | 771 | MonthViewItem *item ; |
764 | 772 | ||
765 | if ( mAvailItemList.count() ) { | 773 | if ( mAvailItemList.count() ) { |
766 | item = mAvailItemList.first(); | 774 | item = mAvailItemList.first(); |
767 | mAvailItemList.remove( item ); | 775 | mAvailItemList.remove( item ); |
768 | item->recycle( event, text ); | 776 | item->recycle( event, text ); |
769 | } else { | 777 | } else { |
770 | item = new MonthViewItem( event, text ); | 778 | item = new MonthViewItem( event, text ); |
771 | } | 779 | } |
772 | 780 | ||
773 | QPalette pal; | 781 | QPalette pal; |
774 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { | 782 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { |
775 | QStringList categories = event->categories(); | 783 | QStringList categories = event->categories(); |
776 | QString cat = categories.first(); | 784 | QString cat = categories.first(); |
777 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { | 785 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { |
778 | pal = getPalette(); | 786 | pal = getPalette(); |
779 | if (cat.isEmpty()) { | 787 | if (cat.isEmpty()) { |
780 | //pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); | 788 | //pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); |
781 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->defaultColor( event->calID() )); | 789 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->defaultColor( event->calID() )); |
782 | } else { | 790 | } else { |
783 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); | 791 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); |
784 | } | 792 | } |
785 | 793 | ||
786 | } else { | 794 | } else { |
787 | if (cat.isEmpty()) { | 795 | if (cat.isEmpty()) { |
788 | //pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); | 796 | //pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); |
789 | pal = QPalette( KOPrefs::instance()->defaultColor( event->calID() ), KOPrefs::instance()->defaultColor( event->calID() )); | 797 | pal = QPalette( KOPrefs::instance()->defaultColor( event->calID() ), KOPrefs::instance()->defaultColor( event->calID() )); |
790 | } else { | 798 | } else { |
791 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); | 799 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); |
792 | } | 800 | } |
793 | } | 801 | } |
794 | 802 | ||
795 | } else { | 803 | } else { |
796 | pal = mStandardPalette ; | 804 | pal = mStandardPalette ; |
797 | } | 805 | } |
798 | pal.setColor(QColorGroup::Highlight, KOPrefs::instance()->mHighlightColor); | 806 | pal.setColor(QColorGroup::Highlight, KOPrefs::instance()->mHighlightColor); |
799 | item->setPalette( pal ); | 807 | item->setPalette( pal ); |
800 | item->setRecur( event->doesRecur() ); | 808 | item->setRecur( event->doesRecur() ); |
801 | item->setAlarm( event->isAlarmEnabled() && multiday < 2 && event->alarmEnabled() ); | 809 | item->setAlarm( event->isAlarmEnabled() && multiday < 2 && event->alarmEnabled() ); |
802 | item->setMoreInfo( event->description().length() > 0 ); | 810 | item->setMoreInfo( event->description().length() > 0 ); |
803 | #ifdef DESKTOP_VERSION | 811 | #ifdef DESKTOP_VERSION |
804 | Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails, | 812 | Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails, |
805 | KOPrefs::instance()->email()); | 813 | KOPrefs::instance()->email()); |
806 | if ( me != 0 ) { | 814 | if ( me != 0 ) { |
807 | if ( me->status() == Attendee::NeedsAction && me->RSVP()) | 815 | if ( me->status() == Attendee::NeedsAction && me->RSVP()) |
808 | item->setReply(true && multiday < 2); | 816 | item->setReply(true && multiday < 2); |
809 | else | 817 | else |
810 | item->setReply(false); | 818 | item->setReply(false); |
811 | } else | 819 | } else |
812 | item->setReply(false); | 820 | item->setReply(false); |
813 | #endif | 821 | #endif |
814 | 822 | ||
815 | item->setMultiDay( multiday ); | 823 | item->setMultiDay( multiday ); |
816 | if ( multiday ) { | 824 | if ( multiday ) { |
817 | insertItem( item ,mdayCount); | 825 | insertItem( item ,mdayCount); |
818 | ++mdayCount; | 826 | ++mdayCount; |
819 | } else { | 827 | } else { |
820 | uint i = mdayCount; | 828 | uint i = mdayCount; |
821 | uint pos = mdayCount; | 829 | uint pos = mdayCount; |
822 | uint itcount = count(); | 830 | uint itcount = count(); |
823 | if ( itcount > 1000 ) { | 831 | if ( itcount > 1000 ) { |
824 | qDebug("KO: Bug in MonthViewCell::insertEvent %u ", itcount); | 832 | qDebug("KO: Bug in MonthViewCell::insertEvent %u ", itcount); |
825 | itcount = 0; | 833 | itcount = 0; |
826 | } | 834 | } |
827 | for ( i = pos; i < itcount;++i ) { | 835 | for ( i = pos; i < itcount;++i ) { |
828 | // qDebug("i %d mday %u count %d ",i,itcount,mdayCount ); | 836 | // qDebug("i %d mday %u count %d ",i,itcount,mdayCount ); |
829 | QListBoxItem* it = this->item ( i ); | 837 | QListBoxItem* it = this->item ( i ); |
830 | if ( it && text < it->text() ) { | 838 | if ( it && text < it->text() ) { |
831 | pos = i; | 839 | pos = i; |
832 | break; | 840 | break; |
833 | } | 841 | } |
834 | ++pos; | 842 | ++pos; |
835 | } | 843 | } |
836 | insertItem( item ,pos); | 844 | insertItem( item ,pos); |
837 | } | 845 | } |
838 | if ( useToolTips ) { | 846 | if ( useToolTips ) { |
839 | mToolTip.append( mToolTipText ); | 847 | mToolTip.append( mToolTipText ); |
840 | } | 848 | } |
841 | return mdayCount; | 849 | return mdayCount; |
842 | } | 850 | } |
843 | void MonthViewCell::insertTodo(Todo *todo) | 851 | void MonthViewCell::insertTodo(Todo *todo) |
844 | { | 852 | { |
845 | setFocusPolicy(WheelFocus); | 853 | setFocusPolicy(WheelFocus); |
846 | QString text; | 854 | QString text; |
847 | if (todo->hasDueDate()) { | 855 | if (todo->hasDueDate()) { |
848 | if (!todo->doesFloat()) { | 856 | if (!todo->doesFloat()) { |
849 | text += KGlobal::locale()->formatTime(todo->dtDue().time()); | 857 | text += KGlobal::locale()->formatTime(todo->dtDue().time()); |
850 | text += " "; | 858 | text += " "; |
851 | } | 859 | } |
852 | } | 860 | } |
853 | text += todo->summary(); | 861 | text += todo->summary(); |
854 | MonthViewItem *item ; | 862 | MonthViewItem *item ; |
855 | if ( mAvailItemList.count() ) { | 863 | if ( mAvailItemList.count() ) { |
856 | item = mAvailItemList.first(); | 864 | item = mAvailItemList.first(); |
857 | mAvailItemList.remove( item ); | 865 | mAvailItemList.remove( item ); |
858 | item->recycle( todo, text ); | 866 | item->recycle( todo, text ); |
859 | } else { | 867 | } else { |
860 | item = new MonthViewItem( todo, text ); | 868 | item = new MonthViewItem( todo, text ); |
861 | } | 869 | } |
862 | //MonthViewItem *item = new MonthViewItem( todo, mDate, text ); | 870 | //MonthViewItem *item = new MonthViewItem( todo, mDate, text ); |
863 | //item->setPalette( mStandardPalette ); | 871 | //item->setPalette( mStandardPalette ); |
864 | QPalette pal; | 872 | QPalette pal; |
865 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { | 873 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { |
866 | QStringList categories = todo->categories(); | 874 | QStringList categories = todo->categories(); |
867 | QString cat = categories.first(); | 875 | QString cat = categories.first(); |
868 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { | 876 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { |
869 | pal = getPalette(); | 877 | pal = getPalette(); |
870 | if (cat.isEmpty()) { | 878 | if (cat.isEmpty()) { |
871 | //pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); | 879 | //pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); |
872 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->defaultColor( todo->calID() )); | 880 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->defaultColor( todo->calID() )); |
873 | } else { | 881 | } else { |
874 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); | 882 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); |
diff --git a/libkdepim/kdatepicker.cpp b/libkdepim/kdatepicker.cpp index 25b4e81..68ef943 100644 --- a/libkdepim/kdatepicker.cpp +++ b/libkdepim/kdatepicker.cpp | |||
@@ -27,256 +27,260 @@ | |||
27 | #include <qpainter.h> | 27 | #include <qpainter.h> |
28 | #include <qdialog.h> | 28 | #include <qdialog.h> |
29 | #include <qtoolbutton.h> | 29 | #include <qtoolbutton.h> |
30 | #include <qfont.h> | 30 | #include <qfont.h> |
31 | #include <qapplication.h> | 31 | #include <qapplication.h> |
32 | #include <qlineedit.h> | 32 | #include <qlineedit.h> |
33 | #include <qvalidator.h> | 33 | #include <qvalidator.h> |
34 | #include <kdebug.h> | 34 | #include <kdebug.h> |
35 | #include <knotifyclient.h> | 35 | #include <knotifyclient.h> |
36 | #include <kglobalsettings.h> | 36 | #include <kglobalsettings.h> |
37 | #include "kdatetbl.h" | 37 | #include "kdatetbl.h" |
38 | #include "kdateedit.h" | 38 | #include "kdateedit.h" |
39 | //#include "kdatepicker.moc" | 39 | //#include "kdatepicker.moc" |
40 | 40 | ||
41 | 41 | ||
42 | KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name) | 42 | KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name) |
43 | : QFrame(parent,name), | 43 | : QFrame(parent,name), |
44 | yearForward(new QToolButton(this)), | 44 | yearForward(new QToolButton(this)), |
45 | yearBackward(new QToolButton(this)), | 45 | yearBackward(new QToolButton(this)), |
46 | monthForward(new QToolButton(this)), | 46 | monthForward(new QToolButton(this)), |
47 | monthBackward(new QToolButton(this)), | 47 | monthBackward(new QToolButton(this)), |
48 | selectMonth(new QToolButton(this)), | 48 | selectMonth(new QToolButton(this)), |
49 | selectYear(new QToolButton(this)), | 49 | selectYear(new QToolButton(this)), |
50 | todayBut(new QToolButton(this)), | 50 | todayBut(new QToolButton(this)), |
51 | //line(new QLineEdit(this)), | 51 | //line(new QLineEdit(this)), |
52 | val(new KDateValidator(this)) | 52 | val(new KDateValidator(this)) |
53 | //table(new KDateTable(this)), | 53 | //table(new KDateTable(this)), |
54 | //fontsize(1) | 54 | //fontsize(1) |
55 | { | 55 | { |
56 | QFont fo = KGlobalSettings::generalFont(); | 56 | QFont fo = KGlobalSettings::generalFont(); |
57 | int add = 2; | 57 | int add = 2; |
58 | if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) | 58 | if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) |
59 | add += 4; | 59 | add += 4; |
60 | fo.setPointSize(fo.pointSize()+add ); | 60 | fo.setPointSize(fo.pointSize()+add ); |
61 | setFont( fo ); | 61 | setFont( fo ); |
62 | table = new KDateTable(this); | 62 | table = new KDateTable(this); |
63 | setFontSize(font().pointSize()); | 63 | setFontSize(font().pointSize()); |
64 | //line->setValidator(val); | 64 | //line->setValidator(val); |
65 | lineDate = new KDateEdit( this, "dateediipicker", true ); | 65 | lineDate = new KDateEdit( this, "dateediipicker", true ); |
66 | yearForward->setPixmap(SmallIcon("3rightarrowB")); | 66 | yearForward->setPixmap(SmallIcon("3rightarrowB")); |
67 | yearBackward->setPixmap(SmallIcon("3leftarrowB")); | 67 | yearBackward->setPixmap(SmallIcon("3leftarrowB")); |
68 | monthForward->setPixmap(SmallIcon("2rightarrowB")); | 68 | monthForward->setPixmap(SmallIcon("2rightarrowB")); |
69 | monthBackward->setPixmap(SmallIcon("2leftarrowB")); | 69 | monthBackward->setPixmap(SmallIcon("2leftarrowB")); |
70 | todayBut->setPixmap(SmallIcon("today")); | 70 | todayBut->setPixmap(SmallIcon("today")); |
71 | setDate(dt); // set button texts | 71 | setDate(dt); // set button texts |
72 | connect(table, SIGNAL(dateChanged(QDate)), SLOT(dateChangedSlot(QDate))); | 72 | connect(table, SIGNAL(dateChanged(QDate)), SLOT(dateChangedSlot(QDate))); |
73 | connect(table, SIGNAL(tableClicked()), SLOT(tableClickedSlot())); | 73 | connect(table, SIGNAL(tableClicked()), SLOT(tableClickedSlot())); |
74 | connect(monthForward, SIGNAL(clicked()), SLOT(monthForwardClicked())); | 74 | connect(monthForward, SIGNAL(clicked()), SLOT(monthForwardClicked())); |
75 | connect(monthBackward, SIGNAL(clicked()), SLOT(monthBackwardClicked())); | 75 | connect(monthBackward, SIGNAL(clicked()), SLOT(monthBackwardClicked())); |
76 | connect(yearForward, SIGNAL(clicked()), SLOT(yearForwardClicked())); | 76 | connect(yearForward, SIGNAL(clicked()), SLOT(yearForwardClicked())); |
77 | connect(yearBackward, SIGNAL(clicked()), SLOT(yearBackwardClicked())); | 77 | connect(yearBackward, SIGNAL(clicked()), SLOT(yearBackwardClicked())); |
78 | connect(selectMonth, SIGNAL(clicked()), SLOT(selectMonthClicked())); | 78 | connect(selectMonth, SIGNAL(clicked()), SLOT(selectMonthClicked())); |
79 | connect(selectYear, SIGNAL(clicked()), SLOT(selectYearClicked())); | 79 | connect(selectYear, SIGNAL(clicked()), SLOT(selectYearClicked())); |
80 | connect(todayBut, SIGNAL(clicked()), SLOT(goToday())); | 80 | connect(todayBut, SIGNAL(clicked()), SLOT(goToday())); |
81 | //connect(line, SIGNAL(returnPressed()), SLOT(lineEnterPressed())); | 81 | //connect(line, SIGNAL(returnPressed()), SLOT(lineEnterPressed())); |
82 | connect(lineDate, SIGNAL(dateChanged(QDate)), SLOT(slotSetDate(QDate))); | 82 | connect(lineDate, SIGNAL(dateChanged(QDate)), SLOT(slotSetDate(QDate))); |
83 | connect(lineDate, SIGNAL(returnPressed()), SLOT(lineEnterPressed())); | 83 | connect(lineDate, SIGNAL(returnPressed()), SLOT(lineEnterPressed())); |
84 | table->setFocus(); | 84 | table->setFocus(); |
85 | 85 | ||
86 | } | 86 | } |
87 | 87 | ||
88 | KDatePicker::~KDatePicker() | 88 | KDatePicker::~KDatePicker() |
89 | { | 89 | { |
90 | } | 90 | } |
91 | 91 | ||
92 | void | 92 | void |
93 | KDatePicker::resizeEvent(QResizeEvent*) | 93 | KDatePicker::resizeEvent(QResizeEvent*) |
94 | { | 94 | { |
95 | QWidget *buttons[] = { | 95 | QWidget *buttons[] = { |
96 | yearBackward, | 96 | yearBackward, |
97 | monthBackward, | 97 | monthBackward, |
98 | selectMonth, | 98 | selectMonth, |
99 | selectYear, | 99 | selectYear, |
100 | monthForward, | 100 | monthForward, |
101 | yearForward }; | 101 | yearForward }; |
102 | const int NoOfButtons=sizeof(buttons)/sizeof(buttons[0]); | 102 | const int NoOfButtons=sizeof(buttons)/sizeof(buttons[0]); |
103 | QSize sizes[NoOfButtons]; | 103 | QSize sizes[NoOfButtons]; |
104 | int buttonHeight=0; | 104 | int buttonHeight=0; |
105 | int count; | 105 | int count; |
106 | int w; | 106 | int w; |
107 | int x=0; | 107 | int x=0; |
108 | // ----- calculate button row height: | 108 | // ----- calculate button row height: |
109 | for(count=0; count<NoOfButtons; ++count) { | 109 | for(count=0; count<NoOfButtons; ++count) { |
110 | int xS = buttons[count]->sizeHint().width(); | 110 | int xS = buttons[count]->sizeHint().width(); |
111 | int yS = buttons[count]->sizeHint().height(); | 111 | int yS = buttons[count]->sizeHint().height(); |
112 | if ( QApplication::desktop()->width() < 320 ) | 112 | if ( QApplication::desktop()->width() < 320 ) |
113 | sizes[count]=QSize ( xS+4, yS ); | 113 | sizes[count]=QSize ( xS+4, yS ); |
114 | else | 114 | else |
115 | sizes[count]=QSize ( xS+10, yS ); | 115 | sizes[count]=QSize ( xS+10, yS ); |
116 | 116 | ||
117 | buttonHeight=QMAX(buttonHeight, sizes[count].height()); | 117 | buttonHeight=QMAX(buttonHeight, sizes[count].height()); |
118 | } | 118 | } |
119 | buttonHeight += 10; | 119 | buttonHeight += 10; |
120 | // ----- calculate size of the month button: | 120 | // ----- calculate size of the month button: |
121 | w=0; | 121 | w=0; |
122 | for(count=0; count<NoOfButtons; ++count) { | 122 | for(count=0; count<NoOfButtons; ++count) { |
123 | if(buttons[count]!=selectMonth) | 123 | if(buttons[count]!=selectMonth) |
124 | { | 124 | { |
125 | w+=sizes[count].width(); | 125 | w+=sizes[count].width(); |
126 | } else { | 126 | } else { |
127 | x=count; | 127 | x=count; |
128 | } | 128 | } |
129 | } | 129 | } |
130 | sizes[x].setWidth(width()-w); // stretch the month button | 130 | sizes[x].setWidth(width()-w); // stretch the month button |
131 | // ----- place the buttons: | 131 | // ----- place the buttons: |
132 | x=0; | 132 | x=0; |
133 | for(count=0; count<NoOfButtons; ++count) | 133 | for(count=0; count<NoOfButtons; ++count) |
134 | { | 134 | { |
135 | w=sizes[count].width(); | 135 | w=sizes[count].width(); |
136 | buttons[count]->setGeometry(x, 0, w, buttonHeight); | 136 | buttons[count]->setGeometry(x, 0, w, buttonHeight); |
137 | x+=w; | 137 | x+=w; |
138 | } | 138 | } |
139 | // ----- place the line edit for direct input: | 139 | // ----- place the line edit for direct input: |
140 | sizes[0]=lineDate->sizeHint(); | 140 | sizes[0]=lineDate->sizeHint(); |
141 | //line->setGeometry(0, height()-sizes[0].height(), width(), sizes[0].height()); | 141 | //line->setGeometry(0, height()-sizes[0].height(), width(), sizes[0].height()); |
142 | int todaywid = todayBut->sizeHint().width(); | 142 | int todaywid = todayBut->sizeHint().width(); |
143 | todayBut->setGeometry(0, height()-sizes[0].height(),todaywid, sizes[0].height()); | 143 | todayBut->setGeometry(0, height()-sizes[0].height(),todaywid, sizes[0].height()); |
144 | lineDate->setGeometry(0+todaywid, height()-sizes[0].height(), width()-todaywid, sizes[0].height()); | 144 | lineDate->setGeometry(0+todaywid, height()-sizes[0].height(), width()-todaywid, sizes[0].height()); |
145 | // ----- adjust the table: | 145 | // ----- adjust the table: |
146 | table->setGeometry(0, buttonHeight, width(), | 146 | table->setGeometry(0, buttonHeight, width(), |
147 | height()-buttonHeight-sizes[0].height()); | 147 | height()-buttonHeight-sizes[0].height()); |
148 | } | 148 | } |
149 | 149 | ||
150 | void | 150 | void |
151 | KDatePicker::dateChangedSlot(QDate date) | 151 | KDatePicker::dateChangedSlot(QDate date) |
152 | { | 152 | { |
153 | lineDate->setDate( date );//(KGlobal::locale()->formatDate(date, true)); | 153 | lineDate->setDate( date );//(KGlobal::locale()->formatDate(date, true)); |
154 | //line->setText(KGlobal::locale()->formatDate(date, true)); | 154 | //line->setText(KGlobal::locale()->formatDate(date, true)); |
155 | QString temp; | ||
156 | selectMonth->setText(KGlobal::locale()->monthName(date.month(), false)); | ||
157 | temp.setNum(date.year()); | ||
158 | selectYear->setText(temp); | ||
155 | emit(dateChanged(date)); | 159 | emit(dateChanged(date)); |
156 | } | 160 | } |
157 | 161 | ||
158 | void | 162 | void |
159 | KDatePicker::tableClickedSlot() | 163 | KDatePicker::tableClickedSlot() |
160 | { | 164 | { |
161 | 165 | ||
162 | emit(dateSelected(table->getDate())); | 166 | emit(dateSelected(table->getDate())); |
163 | emit(tableClicked()); | 167 | emit(tableClicked()); |
164 | } | 168 | } |
165 | 169 | ||
166 | const QDate& | 170 | const QDate& |
167 | KDatePicker::getDate() const | 171 | KDatePicker::getDate() const |
168 | { | 172 | { |
169 | return table->getDate(); | 173 | return table->getDate(); |
170 | } | 174 | } |
171 | 175 | ||
172 | const QDate & | 176 | const QDate & |
173 | KDatePicker::date() const | 177 | KDatePicker::date() const |
174 | { | 178 | { |
175 | return table->getDate(); | 179 | return table->getDate(); |
176 | } | 180 | } |
177 | 181 | ||
178 | void KDatePicker::goToday() | 182 | void KDatePicker::goToday() |
179 | { | 183 | { |
180 | slotSetDate( QDate::currentDate() ); | 184 | slotSetDate( QDate::currentDate() ); |
181 | 185 | ||
182 | } | 186 | } |
183 | void KDatePicker::slotSetDate( QDate date ) | 187 | void KDatePicker::slotSetDate( QDate date ) |
184 | { | 188 | { |
185 | 189 | ||
186 | if(date.isValid()) { | 190 | if(date.isValid()) { |
187 | QString temp; | 191 | QString temp; |
188 | // ----- | 192 | // ----- |
189 | table->setDate(date); | 193 | table->setDate(date); |
190 | selectMonth->setText(KGlobal::locale()->monthName(date.month(), false)); | 194 | selectMonth->setText(KGlobal::locale()->monthName(date.month(), false)); |
191 | temp.setNum(date.year()); | 195 | temp.setNum(date.year()); |
192 | selectYear->setText(temp); | 196 | selectYear->setText(temp); |
193 | //line->setText(KGlobal::locale()->formatDate(date, true)); | 197 | //line->setText(KGlobal::locale()->formatDate(date, true)); |
194 | lineDate->setDate( date ); | 198 | lineDate->setDate( date ); |
195 | } | 199 | } |
196 | 200 | ||
197 | } | 201 | } |
198 | bool | 202 | bool |
199 | KDatePicker::setDate(const QDate& date) | 203 | KDatePicker::setDate(const QDate& date) |
200 | { | 204 | { |
201 | table->setFocus(); | 205 | table->setFocus(); |
202 | if(date.isValid()) { | 206 | if(date.isValid()) { |
203 | QString temp; | 207 | QString temp; |
204 | // ----- | 208 | // ----- |
205 | table->setDate(date); | 209 | table->setDate(date); |
206 | selectMonth->setText(KGlobal::locale()->monthName(date.month(), false)); | 210 | selectMonth->setText(KGlobal::locale()->monthName(date.month(), false)); |
207 | temp.setNum(date.year()); | 211 | temp.setNum(date.year()); |
208 | selectYear->setText(temp); | 212 | selectYear->setText(temp); |
209 | //line->setText(KGlobal::locale()->formatDate(date, true)); | 213 | //line->setText(KGlobal::locale()->formatDate(date, true)); |
210 | lineDate->setDate( date ); | 214 | lineDate->setDate( date ); |
211 | return true; | 215 | return true; |
212 | } else { | 216 | } else { |
213 | 217 | ||
214 | return false; | 218 | return false; |
215 | } | 219 | } |
216 | 220 | ||
217 | 221 | ||
218 | } | 222 | } |
219 | 223 | ||
220 | void | 224 | void |
221 | KDatePicker::monthForwardClicked() | 225 | KDatePicker::monthForwardClicked() |
222 | { | 226 | { |
223 | QDate temp=table->getDate(); | 227 | QDate temp=table->getDate(); |
224 | int day=temp.day(); | 228 | int day=temp.day(); |
225 | // ----- | 229 | // ----- |
226 | if(temp.month()==12) { | 230 | if(temp.month()==12) { |
227 | temp.setYMD(temp.year()+1, 1, 1); | 231 | temp.setYMD(temp.year()+1, 1, 1); |
228 | } else { | 232 | } else { |
229 | temp.setYMD(temp.year(), temp.month()+1, 1); | 233 | temp.setYMD(temp.year(), temp.month()+1, 1); |
230 | } | 234 | } |
231 | if(temp.daysInMonth()<day) { | 235 | if(temp.daysInMonth()<day) { |
232 | temp.setYMD(temp.year(), temp.month(), temp.daysInMonth()); | 236 | temp.setYMD(temp.year(), temp.month(), temp.daysInMonth()); |
233 | } else { | 237 | } else { |
234 | temp.setYMD(temp.year(), temp.month(), day); | 238 | temp.setYMD(temp.year(), temp.month(), day); |
235 | } | 239 | } |
236 | // assert(temp.isValid()); | 240 | // assert(temp.isValid()); |
237 | setDate(temp); | 241 | setDate(temp); |
238 | } | 242 | } |
239 | 243 | ||
240 | void | 244 | void |
241 | KDatePicker::monthBackwardClicked() | 245 | KDatePicker::monthBackwardClicked() |
242 | { | 246 | { |
243 | QDate temp=table->getDate(); | 247 | QDate temp=table->getDate(); |
244 | int day=temp.day(); | 248 | int day=temp.day(); |
245 | // ----- | 249 | // ----- |
246 | if(temp.month()==1) | 250 | if(temp.month()==1) |
247 | { | 251 | { |
248 | temp.setYMD(temp.year()-1, 12, 1); | 252 | temp.setYMD(temp.year()-1, 12, 1); |
249 | } else { | 253 | } else { |
250 | temp.setYMD(temp.year(), temp.month()-1, 1); | 254 | temp.setYMD(temp.year(), temp.month()-1, 1); |
251 | } | 255 | } |
252 | if(temp.daysInMonth()<day) | 256 | if(temp.daysInMonth()<day) |
253 | { | 257 | { |
254 | temp.setYMD(temp.year(), temp.month(), temp.daysInMonth()); | 258 | temp.setYMD(temp.year(), temp.month(), temp.daysInMonth()); |
255 | } else { | 259 | } else { |
256 | temp.setYMD(temp.year(), temp.month(), day); | 260 | temp.setYMD(temp.year(), temp.month(), day); |
257 | } | 261 | } |
258 | // assert(temp.isValid()); | 262 | // assert(temp.isValid()); |
259 | setDate(temp); | 263 | setDate(temp); |
260 | } | 264 | } |
261 | 265 | ||
262 | void | 266 | void |
263 | KDatePicker::yearForwardClicked() | 267 | KDatePicker::yearForwardClicked() |
264 | { | 268 | { |
265 | QDate temp=table->getDate(); | 269 | QDate temp=table->getDate(); |
266 | int day=temp.day(); | 270 | int day=temp.day(); |
267 | // ----- | 271 | // ----- |
268 | temp.setYMD(temp.year()+1, temp.month(), 1); | 272 | temp.setYMD(temp.year()+1, temp.month(), 1); |
269 | if(temp.daysInMonth()<day) | 273 | if(temp.daysInMonth()<day) |
270 | { | 274 | { |
271 | temp.setYMD(temp.year(), temp.month(), temp.daysInMonth()); | 275 | temp.setYMD(temp.year(), temp.month(), temp.daysInMonth()); |
272 | } else { | 276 | } else { |
273 | temp.setYMD(temp.year(), temp.month(), day); | 277 | temp.setYMD(temp.year(), temp.month(), day); |
274 | } | 278 | } |
275 | // assert(temp.isValid()); | 279 | // assert(temp.isValid()); |
276 | setDate(temp); | 280 | setDate(temp); |
277 | } | 281 | } |
278 | 282 | ||
279 | void | 283 | void |
280 | KDatePicker::yearBackwardClicked() | 284 | KDatePicker::yearBackwardClicked() |
281 | { | 285 | { |
282 | QDate temp=table->getDate(); | 286 | QDate temp=table->getDate(); |
@@ -350,141 +354,145 @@ KDatePicker::selectYearClicked() | |||
350 | } else { | 354 | } else { |
351 | KNotifyClient::beep(); | 355 | KNotifyClient::beep(); |
352 | } | 356 | } |
353 | delete popup; | 357 | delete popup; |
354 | } | 358 | } |
355 | 359 | ||
356 | void | 360 | void |
357 | KDatePicker::setEnabled(bool enable) | 361 | KDatePicker::setEnabled(bool enable) |
358 | { | 362 | { |
359 | QWidget *widgets[]= { | 363 | QWidget *widgets[]= { |
360 | yearForward, yearBackward, monthForward, monthBackward, | 364 | yearForward, yearBackward, monthForward, monthBackward, |
361 | selectMonth, selectYear, | 365 | selectMonth, selectYear, |
362 | lineDate, table }; | 366 | lineDate, table }; |
363 | const int Size=sizeof(widgets)/sizeof(widgets[0]); | 367 | const int Size=sizeof(widgets)/sizeof(widgets[0]); |
364 | int count; | 368 | int count; |
365 | // ----- | 369 | // ----- |
366 | for(count=0; count<Size; ++count) | 370 | for(count=0; count<Size; ++count) |
367 | { | 371 | { |
368 | widgets[count]->setEnabled(enable); | 372 | widgets[count]->setEnabled(enable); |
369 | } | 373 | } |
370 | } | 374 | } |
371 | 375 | ||
372 | void | 376 | void |
373 | KDatePicker::lineEnterPressed() | 377 | KDatePicker::lineEnterPressed() |
374 | { | 378 | { |
375 | QDate temp; | 379 | QDate temp; |
376 | // ----- | 380 | // ----- |
377 | temp = lineDate->date(); | 381 | temp = lineDate->date(); |
378 | //if(val->date(line->text(), temp)==QValidator::Acceptable) | 382 | //if(val->date(line->text(), temp)==QValidator::Acceptable) |
379 | //{ | 383 | //{ |
380 | emit(dateEntered(temp)); | 384 | emit(dateEntered(temp)); |
381 | setDate(temp); | 385 | setDate(temp); |
382 | // } else { | 386 | // } else { |
383 | // KNotifyClient::beep(); | 387 | // KNotifyClient::beep(); |
384 | // } | 388 | // } |
385 | } | 389 | } |
386 | 390 | ||
387 | QSize | 391 | QSize |
388 | KDatePicker::sizeHint() const | 392 | KDatePicker::sizeHint() const |
389 | { | 393 | { |
390 | QSize tableSize=table->sizeHint(); | 394 | QSize tableSize=table->sizeHint(); |
391 | QWidget *buttons[]={ | 395 | QWidget *buttons[]={ |
392 | yearBackward, | 396 | yearBackward, |
393 | monthBackward, | 397 | monthBackward, |
394 | selectMonth, | 398 | selectMonth, |
395 | selectYear, | 399 | selectYear, |
396 | monthForward, | 400 | monthForward, |
397 | yearForward }; | 401 | yearForward }; |
398 | const int NoOfButtons=sizeof(buttons)/sizeof(buttons[0]); | 402 | const int NoOfButtons=sizeof(buttons)/sizeof(buttons[0]); |
399 | QSize sizes[NoOfButtons]; | 403 | QSize sizes[NoOfButtons]; |
400 | int cx=0, cy=0, count; | 404 | int cx=0, cy=0, count; |
401 | // ----- store the size hints: | 405 | // ----- store the size hints: |
402 | for(count=0; count<NoOfButtons; ++count) | 406 | for(count=0; count<NoOfButtons; ++count) |
403 | { | 407 | { |
404 | sizes[count]=buttons[count]->sizeHint(); | 408 | sizes[count]=buttons[count]->sizeHint(); |
405 | if(buttons[count]==selectMonth) | 409 | if(buttons[count]==selectMonth) |
406 | { | 410 | { |
407 | cx+=maxMonthRect.width()+15; | 411 | cx+=maxMonthRect.width()+15; |
408 | } else { | 412 | } else { |
409 | cx+=sizes[count].width()+15; | 413 | cx+=sizes[count].width()+15; |
410 | } | 414 | } |
411 | cy=QMAX(sizes[count].height(), cy); | 415 | cy=QMAX(sizes[count].height(), cy); |
412 | } | 416 | } |
413 | // ----- calculate width hint: | 417 | // ----- calculate width hint: |
414 | cx=QMAX(cx, tableSize.width()); // line edit ignored | 418 | cx=QMAX(cx, tableSize.width()); // line edit ignored |
415 | if ( cx > QApplication::desktop()->width() -5 ) | 419 | if ( cx > QApplication::desktop()->width() -5 ) |
416 | cx = QApplication::desktop()->width() -5; | 420 | cx = QApplication::desktop()->width() -5; |
417 | // ----- calculate height hint: | 421 | // ----- calculate height hint: |
418 | cy+=tableSize.height()+lineDate->sizeHint().height(); | 422 | cy+=tableSize.height()+lineDate->sizeHint().height(); |
419 | 423 | ||
420 | return QSize(cx, cy); | 424 | return QSize(cx, cy); |
421 | } | 425 | } |
422 | 426 | ||
423 | void | 427 | void |
424 | KDatePicker::setFontSize(int s) | 428 | KDatePicker::setFontSize(int s) |
425 | { | 429 | { |
426 | QWidget *buttons[]= { | 430 | QWidget *buttons[]= { |
427 | // yearBackward, | 431 | // yearBackward, |
428 | // monthBackward, | 432 | // monthBackward, |
429 | selectMonth, | 433 | selectMonth, |
430 | selectYear, | 434 | selectYear, |
431 | // monthForward, | 435 | // monthForward, |
432 | // yearForward | 436 | // yearForward |
433 | }; | 437 | }; |
434 | const int NoOfButtons=sizeof(buttons)/sizeof(buttons[0]); | 438 | const int NoOfButtons=sizeof(buttons)/sizeof(buttons[0]); |
435 | int count; | 439 | int count; |
436 | QFont font; | 440 | QFont font; |
437 | QRect r; | 441 | QRect r; |
438 | // ----- | 442 | // ----- |
439 | fontsize=s; | 443 | fontsize=s; |
440 | for(count=0; count<NoOfButtons; ++count) | 444 | for(count=0; count<NoOfButtons; ++count) |
441 | { | 445 | { |
442 | font=buttons[count]->font(); | 446 | font=buttons[count]->font(); |
443 | font.setPointSize(s); | 447 | font.setPointSize(s); |
444 | buttons[count]->setFont(font); | 448 | buttons[count]->setFont(font); |
445 | } | 449 | } |
446 | QFontMetrics metrics(selectMonth->fontMetrics()); | 450 | QFontMetrics metrics(selectMonth->fontMetrics()); |
447 | for(int i=1; i <= 12; ++i) | 451 | for(int i=1; i <= 12; ++i) |
448 | { // maxMonthRect is used by sizeHint() | 452 | { // maxMonthRect is used by sizeHint() |
449 | r=metrics.boundingRect(KGlobal::locale()->monthName(i, false)); | 453 | r=metrics.boundingRect(KGlobal::locale()->monthName(i, false)); |
450 | maxMonthRect.setWidth(QMAX(r.width(), maxMonthRect.width())); | 454 | maxMonthRect.setWidth(QMAX(r.width(), maxMonthRect.width())); |
451 | maxMonthRect.setHeight(QMAX(r.height(), maxMonthRect.height())); | 455 | maxMonthRect.setHeight(QMAX(r.height(), maxMonthRect.height())); |
452 | } | 456 | } |
453 | table->setFontSize(s); | 457 | table->setFontSize(s); |
454 | } | 458 | } |
455 | 459 | ||
456 | void KDatePicker::virtual_hook( int id, void* data ) | 460 | void KDatePicker::virtual_hook( int id, void* data ) |
457 | { /*BASE::virtual_hook( id, data );*/ } | 461 | { /*BASE::virtual_hook( id, data );*/ } |
458 | 462 | ||
459 | void KDatePicker::keyPressEvent ( QKeyEvent * e ) | 463 | void KDatePicker::keyPressEvent ( QKeyEvent * e ) |
460 | { | 464 | { |
461 | switch ( e->key() ) { | 465 | switch ( e->key() ) { |
462 | case Qt::Key_Right: | 466 | case Qt::Key_Right: |
463 | monthForwardClicked(); | 467 | monthForwardClicked(); |
464 | break; | 468 | break; |
465 | case Qt::Key_Left: | 469 | case Qt::Key_Left: |
466 | monthBackwardClicked(); | 470 | monthBackwardClicked(); |
467 | break; | 471 | break; |
468 | 472 | ||
469 | case Qt::Key_Down: | 473 | case Qt::Key_Down: |
470 | yearForwardClicked(); | 474 | yearForwardClicked(); |
471 | 475 | ||
472 | break; | 476 | break; |
473 | 477 | ||
474 | case Qt::Key_Up: | 478 | case Qt::Key_Up: |
475 | yearBackwardClicked(); | 479 | yearBackwardClicked(); |
476 | break; | 480 | break; |
477 | 481 | ||
482 | case Qt::Key_T: | ||
483 | goToday(); | ||
484 | break; | ||
485 | |||
478 | case Qt::Key_Return: | 486 | case Qt::Key_Return: |
479 | case Qt::Key_Enter: | 487 | case Qt::Key_Enter: |
480 | case Qt::Key_Space: | 488 | case Qt::Key_Space: |
481 | tableClickedSlot(); | 489 | tableClickedSlot(); |
482 | break; | 490 | break; |
483 | case Qt::Key_Escape: | 491 | case Qt::Key_Escape: |
484 | e->ignore(); | 492 | e->ignore(); |
485 | break; | 493 | break; |
486 | default: | 494 | default: |
487 | break; | 495 | break; |
488 | } | 496 | } |
489 | 497 | ||
490 | } | 498 | } |
diff --git a/microkde/kdatetbl.cpp b/microkde/kdatetbl.cpp index 4271b55..353f78d 100644 --- a/microkde/kdatetbl.cpp +++ b/microkde/kdatetbl.cpp | |||
@@ -115,297 +115,285 @@ KDateTable::paintCell(QPainter *painter, int row, int col) | |||
115 | if(row==0) | 115 | if(row==0) |
116 | { // we are drawing the headline | 116 | { // we are drawing the headline |
117 | _font.setBold(true); | 117 | _font.setBold(true); |
118 | painter->setFont(_font); | 118 | painter->setFont(_font); |
119 | bool normalday = true; | 119 | bool normalday = true; |
120 | QString daystr; | 120 | QString daystr; |
121 | if (KGlobal::locale()->weekStartsMonday()) | 121 | if (KGlobal::locale()->weekStartsMonday()) |
122 | { | 122 | { |
123 | daystr = KGlobal::locale()->weekDayName(col+1, true); | 123 | daystr = KGlobal::locale()->weekDayName(col+1, true); |
124 | if (col == 5 || col == 6) | 124 | if (col == 5 || col == 6) |
125 | normalday = false; | 125 | normalday = false; |
126 | } else { | 126 | } else { |
127 | daystr = KGlobal::locale()->weekDayName(col==0? 7 : col, true); | 127 | daystr = KGlobal::locale()->weekDayName(col==0? 7 : col, true); |
128 | if (col == 0 || col == 6) | 128 | if (col == 0 || col == 6) |
129 | normalday = false; | 129 | normalday = false; |
130 | } | 130 | } |
131 | if (!normalday) | 131 | if (!normalday) |
132 | { | 132 | { |
133 | painter->setPen(QColor(220,245,255)); | 133 | painter->setPen(QColor(220,245,255)); |
134 | painter->setBrush(brushLightblue); | 134 | painter->setBrush(brushLightblue); |
135 | painter->drawRect(0, 0, w, h); | 135 | painter->drawRect(0, 0, w, h); |
136 | painter->setPen(blue); | 136 | painter->setPen(blue); |
137 | } else { | 137 | } else { |
138 | painter->setPen(blue); | 138 | painter->setPen(blue); |
139 | painter->setBrush(brushBlue); | 139 | painter->setBrush(brushBlue); |
140 | painter->drawRect(0, 0, w, h); | 140 | painter->drawRect(0, 0, w, h); |
141 | painter->setPen(white); | 141 | painter->setPen(white); |
142 | } | 142 | } |
143 | painter->drawText(0, 0, w, h-1, AlignCenter, | 143 | painter->drawText(0, 0, w, h-1, AlignCenter, |
144 | daystr, -1, &rect); | 144 | daystr, -1, &rect); |
145 | painter->setPen(black); | 145 | painter->setPen(black); |
146 | painter->moveTo(0, h-1); | 146 | painter->moveTo(0, h-1); |
147 | painter->lineTo(w-1, h-1); | 147 | painter->lineTo(w-1, h-1); |
148 | // ----- draw the weekday: | 148 | // ----- draw the weekday: |
149 | } else { | 149 | } else { |
150 | painter->setFont(_font); | 150 | painter->setFont(_font); |
151 | pos=7*(row-1)+col; | 151 | pos=7*(row-1)+col; |
152 | if (KGlobal::locale()->weekStartsMonday()) | 152 | if (KGlobal::locale()->weekStartsMonday()) |
153 | pos++; | 153 | pos++; |
154 | if(pos<firstday || (firstday+numdays<=pos)) | 154 | if(pos<firstday || (firstday+numdays<=pos)) |
155 | { // we are either | 155 | { // we are either |
156 | // ° painting a day of the previous month or | 156 | // ° painting a day of the previous month or |
157 | // ° painting a day of the following month | 157 | // ° painting a day of the following month |
158 | if(pos<firstday) | 158 | if(pos<firstday) |
159 | { // previous month | 159 | { // previous month |
160 | text.setNum(numDaysPrevMonth+pos-firstday+1); | 160 | text.setNum(numDaysPrevMonth+pos-firstday+1); |
161 | } else { // following month | 161 | } else { // following month |
162 | text.setNum(pos-firstday-numdays+1); | 162 | text.setNum(pos-firstday-numdays+1); |
163 | } | 163 | } |
164 | painter->setPen(gray); | 164 | painter->setPen(gray); |
165 | } else { // paint a day of the current month | 165 | } else { // paint a day of the current month |
166 | text.setNum(pos-firstday+1); | 166 | text.setNum(pos-firstday+1); |
167 | painter->setPen(black); | 167 | painter->setPen(black); |
168 | } | 168 | } |
169 | 169 | ||
170 | pen=painter->pen(); | 170 | pen=painter->pen(); |
171 | if(firstday+date.day()-1==pos) | 171 | if(firstday+date.day()-1==pos) |
172 | { | 172 | { |
173 | if(mMarkCurrent && firstday+QDate::currentDate().day()-1==pos) | 173 | if(mMarkCurrent && firstday+QDate::currentDate().day()-1==pos) |
174 | painter->setPen(green); | 174 | painter->setPen(green); |
175 | else | 175 | else |
176 | painter->setPen(red); | 176 | painter->setPen(red); |
177 | if(hasFocus()) | 177 | if(hasFocus()) |
178 | { | 178 | { |
179 | painter->setBrush(darkRed); | 179 | painter->setBrush(darkRed); |
180 | pen=white; | 180 | pen=white; |
181 | } else { | 181 | } else { |
182 | painter->setBrush(darkGray); | 182 | painter->setBrush(darkGray); |
183 | pen=white; | 183 | pen=white; |
184 | } | 184 | } |
185 | } else { | 185 | } else { |
186 | if(mMarkCurrent && firstday+QDate::currentDate().day()-1==pos) | 186 | if(mMarkCurrent && firstday+QDate::currentDate().day()-1==pos) |
187 | { | 187 | { |
188 | painter->setPen(green); | 188 | painter->setPen(green); |
189 | painter->setBrush(darkGreen); | 189 | painter->setBrush(darkGreen); |
190 | pen=white; | 190 | pen=white; |
191 | } else { | 191 | } else { |
192 | painter->setBrush(QColor(220,245,255)); | 192 | painter->setBrush(QColor(220,245,255)); |
193 | painter->setPen(QColor(220,245,255)); | 193 | painter->setPen(QColor(220,245,255)); |
194 | } | 194 | } |
195 | } | 195 | } |
196 | painter->drawRect(0, 0, w, h); | 196 | painter->drawRect(0, 0, w, h); |
197 | painter->setPen(pen); | 197 | painter->setPen(pen); |
198 | painter->drawText(0, 0, w, h, AlignCenter, text, -1, &rect); | 198 | painter->drawText(0, 0, w, h, AlignCenter, text, -1, &rect); |
199 | } | 199 | } |
200 | /* | 200 | /* |
201 | if(rect.width()>maxCell.width()) maxCell.setWidth(rect.width()); | 201 | if(rect.width()>maxCell.width()) maxCell.setWidth(rect.width()); |
202 | if(rect.height()>maxCell.height()) { | 202 | if(rect.height()>maxCell.height()) { |
203 | maxCell.setHeight(rect.height()); | 203 | maxCell.setHeight(rect.height()); |
204 | } | 204 | } |
205 | */ | 205 | */ |
206 | } | 206 | } |
207 | 207 | ||
208 | void | 208 | void |
209 | KDateTable::keyPressEvent( QKeyEvent *e ) | 209 | KDateTable::keyPressEvent( QKeyEvent *e ) |
210 | { | 210 | { |
211 | /* | 211 | /* |
212 | // not working properly | 212 | // not working properly |
213 | if ( e->key() == Qt::Key_Prior ) { | 213 | if ( e->key() == Qt::Key_Prior ) { |
214 | if ( date.month() == 1 ) { | 214 | if ( date.month() == 1 ) { |
215 | KNotifyClient::beep(); | 215 | KNotifyClient::beep(); |
216 | return; | 216 | return; |
217 | } | 217 | } |
218 | int day = date.day(); | 218 | int day = date.day(); |
219 | if ( day > 27 ) | 219 | if ( day > 27 ) |
220 | while ( !QDate::isValid( date.year(), date.month()-1, day ) ) | 220 | while ( !QDate::isValid( date.year(), date.month()-1, day ) ) |
221 | day--; | 221 | day--; |
222 | setDate(QDate(date.year(), date.month()-1, day)); | 222 | setDate(QDate(date.year(), date.month()-1, day)); |
223 | return; | 223 | return; |
224 | } | 224 | } |
225 | if ( e->key() == Qt::Key_Next ) { | 225 | if ( e->key() == Qt::Key_Next ) { |
226 | if ( date.month() == 12 ) { | 226 | if ( date.month() == 12 ) { |
227 | KNotifyClient::beep(); | 227 | KNotifyClient::beep(); |
228 | return; | 228 | return; |
229 | } | 229 | } |
230 | int day = date.day(); | 230 | int day = date.day(); |
231 | if ( day > 27 ) | 231 | if ( day > 27 ) |
232 | while ( !QDate::isValid( date.year(), date.month()+1, day ) ) | 232 | while ( !QDate::isValid( date.year(), date.month()+1, day ) ) |
233 | day--; | 233 | day--; |
234 | setDate(QDate(date.year(), date.month()+1, day)); | 234 | setDate(QDate(date.year(), date.month()+1, day)); |
235 | return; | 235 | return; |
236 | } | 236 | } |
237 | */ | 237 | */ |
238 | int dayoff = KGlobal::locale()->weekStartsMonday() ? 1 : 0; | 238 | int dayoff = KGlobal::locale()->weekStartsMonday() ? 1 : 0; |
239 | 239 | ||
240 | int temp=firstday+date.day()-dayoff; | 240 | int temp=firstday+date.day()-dayoff; |
241 | int pos = temp; | 241 | int pos = temp; |
242 | bool irgnore = true; | 242 | bool irgnore = true; |
243 | int add = 0; | ||
243 | if ( e->state() != Qt::ControlButton ) { | 244 | if ( e->state() != Qt::ControlButton ) { |
244 | if ( e->key() == Qt::Key_Up ) { | 245 | if ( e->key() == Qt::Key_Up ) { |
245 | pos -= 7; | 246 | add -= 7; |
246 | irgnore = false; | 247 | irgnore = false; |
247 | } | 248 | } |
248 | if ( e->key() == Qt::Key_Down ) { | 249 | if ( e->key() == Qt::Key_Down ) { |
249 | pos += 7; | 250 | add += 7; |
250 | irgnore = false; | 251 | irgnore = false; |
251 | } | 252 | } |
252 | if ( e->key() == Qt::Key_Left ) { | 253 | if ( e->key() == Qt::Key_Left ) { |
253 | pos--; | 254 | --add; |
254 | irgnore = false; | 255 | irgnore = false; |
255 | } | 256 | } |
256 | if ( e->key() == Qt::Key_Right ) { | 257 | if ( e->key() == Qt::Key_Right ) { |
257 | pos++; | 258 | ++add; |
258 | irgnore = false; | 259 | irgnore = false; |
259 | } | 260 | } |
260 | } | 261 | } |
261 | if ( irgnore ) | 262 | if ( irgnore ) { |
262 | e->ignore(); | 263 | e->ignore(); |
263 | |||
264 | if(pos+dayoff<=firstday) | ||
265 | { // this day is in the previous month | ||
266 | KNotifyClient::beep(); | ||
267 | return; | ||
268 | } | ||
269 | if(firstday+numdays<pos+dayoff) | ||
270 | { // this date is in the next month | ||
271 | KNotifyClient::beep(i18n( "Month not long enough" )); | ||
272 | return; | ||
273 | } | ||
274 | |||
275 | if ( pos == temp ) | ||
276 | return; | 264 | return; |
265 | } | ||
277 | 266 | ||
278 | setDate(QDate(date.year(), date.month(), pos-firstday+dayoff)); | 267 | pos += add; |
268 | setDate(date.addDays( add )); | ||
279 | updateCell(temp/7+1, temp%7); // Update the previously selected cell | 269 | updateCell(temp/7+1, temp%7); // Update the previously selected cell |
280 | updateCell(pos/7+1, pos%7); // Update the selected cell | 270 | updateCell(pos/7+1, pos%7); // Update the selected cell |
281 | assert(QDate(date.year(), date.month(), pos-firstday+dayoff).isValid()); | 271 | |
282 | |||
283 | |||
284 | } | 272 | } |
285 | 273 | ||
286 | void | 274 | void |
287 | KDateTable::viewportResizeEvent(QResizeEvent * e) | 275 | KDateTable::viewportResizeEvent(QResizeEvent * e) |
288 | { | 276 | { |
289 | QGridView::viewportResizeEvent(e); | 277 | QGridView::viewportResizeEvent(e); |
290 | 278 | ||
291 | setCellWidth(viewport()->width()/7); | 279 | setCellWidth(viewport()->width()/7); |
292 | setCellHeight(viewport()->height()/7); | 280 | setCellHeight(viewport()->height()/7); |
293 | } | 281 | } |
294 | 282 | ||
295 | void | 283 | void |
296 | KDateTable::setFontSize(int size) | 284 | KDateTable::setFontSize(int size) |
297 | { | 285 | { |
298 | int count; | 286 | int count; |
299 | QRect rect; | 287 | QRect rect; |
300 | // ----- store rectangles: | 288 | // ----- store rectangles: |
301 | fontsize=size; | 289 | fontsize=size; |
302 | QFont _font = font(); | 290 | QFont _font = font(); |
303 | _font.setPointSize(fontsize); | 291 | _font.setPointSize(fontsize); |
304 | setFont( _font ); | 292 | setFont( _font ); |
305 | _font.setBold( true ); | 293 | _font.setBold( true ); |
306 | QFontMetrics metrics(_font); | 294 | QFontMetrics metrics(_font); |
307 | 295 | ||
308 | // ----- find largest day name: | 296 | // ----- find largest day name: |
309 | maxCell.setWidth(0); | 297 | maxCell.setWidth(0); |
310 | maxCell.setHeight(0); | 298 | maxCell.setHeight(0); |
311 | for(count=0; count<7; ++count) | 299 | for(count=0; count<7; ++count) |
312 | { | 300 | { |
313 | rect=metrics.boundingRect(KGlobal::locale()->weekDayName(count+1, true)); | 301 | rect=metrics.boundingRect(KGlobal::locale()->weekDayName(count+1, true)); |
314 | maxCell.setWidth(QMAX(maxCell.width(), rect.width())); | 302 | maxCell.setWidth(QMAX(maxCell.width(), rect.width())); |
315 | maxCell.setHeight(QMAX(maxCell.height(), rect.height())); | 303 | maxCell.setHeight(QMAX(maxCell.height(), rect.height())); |
316 | } | 304 | } |
317 | // ----- compare with a real wide number and add some space: | 305 | // ----- compare with a real wide number and add some space: |
318 | rect=metrics.boundingRect(QString::fromLatin1("88")); | 306 | rect=metrics.boundingRect(QString::fromLatin1("88")); |
319 | maxCell.setWidth(QMAX(maxCell.width()+2, rect.width())); | 307 | maxCell.setWidth(QMAX(maxCell.width()+2, rect.width())); |
320 | #ifdef DESKTOP_VERSION | 308 | #ifdef DESKTOP_VERSION |
321 | maxCell.setHeight(QMAX(maxCell.height()+8, rect.height())); | 309 | maxCell.setHeight(QMAX(maxCell.height()+8, rect.height())); |
322 | #else | 310 | #else |
323 | maxCell.setHeight(QMAX(maxCell.height()+4, rect.height())); | 311 | maxCell.setHeight(QMAX(maxCell.height()+4, rect.height())); |
324 | #endif | 312 | #endif |
325 | if ( maxCell.width() * 1000 / maxCell.height() > 1900 ) { | 313 | if ( maxCell.width() * 1000 / maxCell.height() > 1900 ) { |
326 | maxCell.setHeight(maxCell.width() * 1000 / 1900 ); | 314 | maxCell.setHeight(maxCell.width() * 1000 / 1900 ); |
327 | //qDebug("setmax "); | 315 | //qDebug("setmax "); |
328 | } | 316 | } |
329 | } | 317 | } |
330 | 318 | ||
331 | void | 319 | void |
332 | KDateTable::contentsMousePressEvent(QMouseEvent *e) | 320 | KDateTable::contentsMousePressEvent(QMouseEvent *e) |
333 | { | 321 | { |
334 | if(e->type()!=QEvent::MouseButtonPress) | 322 | if(e->type()!=QEvent::MouseButtonPress) |
335 | { // the KDatePicker only reacts on mouse press events: | 323 | { // the KDatePicker only reacts on mouse press events: |
336 | return; | 324 | return; |
337 | } | 325 | } |
338 | if(!isEnabled()) | 326 | if(!isEnabled()) |
339 | { | 327 | { |
340 | KNotifyClient::beep(); | 328 | KNotifyClient::beep(); |
341 | return; | 329 | return; |
342 | } | 330 | } |
343 | 331 | ||
344 | int dayoff = KGlobal::locale()->weekStartsMonday() ? 1 : 0; | 332 | int dayoff = KGlobal::locale()->weekStartsMonday() ? 1 : 0; |
345 | // ----- | 333 | // ----- |
346 | int row, col, pos, temp; | 334 | int row, col, pos, temp; |
347 | QPoint mouseCoord; | 335 | QPoint mouseCoord; |
348 | // ----- | 336 | // ----- |
349 | mouseCoord = e->pos(); | 337 | mouseCoord = e->pos(); |
350 | row=rowAt(mouseCoord.y()); | 338 | row=rowAt(mouseCoord.y()); |
351 | col=columnAt(mouseCoord.x()); | 339 | col=columnAt(mouseCoord.x()); |
352 | if(row<0 || col<0) | 340 | if(row<0 || col<0) |
353 | { // the user clicked on the frame of the table | 341 | { // the user clicked on the frame of the table |
354 | return; | 342 | return; |
355 | } | 343 | } |
356 | pos=7*(row-1)+col+1; | 344 | pos=7*(row-1)+col+1; |
357 | #if 0 | 345 | #if 0 |
358 | if(pos+dayoff<=firstday) | 346 | if(pos+dayoff<=firstday) |
359 | { // this day is in the previous month | 347 | { // this day is in the previous month |
360 | KNotifyClient::beep(); | 348 | KNotifyClient::beep(); |
361 | return; | 349 | return; |
362 | } | 350 | } |
363 | if(firstday+numdays<pos+dayoff) | 351 | if(firstday+numdays<pos+dayoff) |
364 | { // this date is in the next month | 352 | { // this date is in the next month |
365 | KNotifyClient::beep(); | 353 | KNotifyClient::beep(); |
366 | return; | 354 | return; |
367 | } | 355 | } |
368 | #endif | 356 | #endif |
369 | temp=firstday+date.day()-dayoff-1; | 357 | temp=firstday+date.day()-dayoff-1; |
370 | QDate da = QDate(date.year(), date.month(),1); | 358 | QDate da = QDate(date.year(), date.month(),1); |
371 | setDate(da.addDays( pos-firstday+dayoff-1)); | 359 | setDate(da.addDays( pos-firstday+dayoff-1)); |
372 | updateCell(temp/7+1, temp%7); // Update the previously selected cell | 360 | updateCell(temp/7+1, temp%7); // Update the previously selected cell |
373 | updateCell(row, col); // Update the selected cell | 361 | updateCell(row, col); // Update the selected cell |
374 | // assert(QDate(date.year(), date.month(), pos-firstday+dayoff).isValid()); | 362 | // assert(QDate(date.year(), date.month(), pos-firstday+dayoff).isValid()); |
375 | emit(tableClicked()); | 363 | emit(tableClicked()); |
376 | } | 364 | } |
377 | 365 | ||
378 | bool | 366 | bool |
379 | KDateTable::setDate(const QDate& date_) | 367 | KDateTable::setDate(const QDate& date_) |
380 | { | 368 | { |
381 | bool changed=false; | 369 | bool changed=false; |
382 | QDate temp; | 370 | QDate temp; |
383 | mMarkCurrent = false; | 371 | mMarkCurrent = false; |
384 | // ----- | 372 | // ----- |
385 | if(!date_.isValid()) | 373 | if(!date_.isValid()) |
386 | { | 374 | { |
387 | kdDebug() << "KDateTable::setDate: refusing to set invalid date." << endl; | 375 | kdDebug() << "KDateTable::setDate: refusing to set invalid date." << endl; |
388 | return false; | 376 | return false; |
389 | } | 377 | } |
390 | if(date!=date_) | 378 | if(date!=date_) |
391 | { | 379 | { |
392 | date=date_; | 380 | date=date_; |
393 | changed=true; | 381 | changed=true; |
394 | } | 382 | } |
395 | mMarkCurrent = ( date.month() == QDate::currentDate().month() && date.year() == QDate::currentDate().year() ); | 383 | mMarkCurrent = ( date.month() == QDate::currentDate().month() && date.year() == QDate::currentDate().year() ); |
396 | temp.setYMD(date.year(), date.month(), 1); | 384 | temp.setYMD(date.year(), date.month(), 1); |
397 | firstday=temp.dayOfWeek(); | 385 | firstday=temp.dayOfWeek(); |
398 | if(firstday==1) firstday=8; | 386 | if(firstday==1) firstday=8; |
399 | numdays=date.daysInMonth(); | 387 | numdays=date.daysInMonth(); |
400 | if(date.month()==1) | 388 | if(date.month()==1) |
401 | { // set to december of previous year | 389 | { // set to december of previous year |
402 | temp.setYMD(date.year()-1, 12, 1); | 390 | temp.setYMD(date.year()-1, 12, 1); |
403 | } else { // set to previous month | 391 | } else { // set to previous month |
404 | temp.setYMD(date.year(), date.month()-1, 1); | 392 | temp.setYMD(date.year(), date.month()-1, 1); |
405 | } | 393 | } |
406 | numDaysPrevMonth=temp.daysInMonth(); | 394 | numDaysPrevMonth=temp.daysInMonth(); |
407 | if(changed) | 395 | if(changed) |
408 | { | 396 | { |
409 | repaintContents(false); | 397 | repaintContents(false); |
410 | } | 398 | } |
411 | emit(dateChanged(date)); | 399 | emit(dateChanged(date)); |