-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 2 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 4 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 5 | ||||
-rw-r--r-- | korganizer/main.cpp | 4 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 64 | ||||
-rw-r--r-- | korganizer/mainwindow.h | 6 |
6 files changed, 62 insertions, 23 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index fcfa282..fbd262c 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1462,101 +1462,101 @@ | |||
1462 | { "Selected Item","Ausgewähltes Item" }, | 1462 | { "Selected Item","Ausgewähltes Item" }, |
1463 | { "Select Date...","Wähle Datum..." }, | 1463 | { "Select Date...","Wähle Datum..." }, |
1464 | { "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:" }, | 1464 | { "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 | { "Change category list now!","Ändere Kategorieliste jetzt!" }, | 1465 | { "Change category list now!","Ändere Kategorieliste jetzt!" }, |
1466 | { "Edit category list...","Ändere Kategorieliste..." }, | 1466 | { "Edit category list...","Ändere Kategorieliste..." }, |
1467 | { "Toolbar changes needs a restart!","Neustart benötigt für Toolbaränderungen!" }, | 1467 | { "Toolbar changes needs a restart!","Neustart benötigt für Toolbaränderungen!" }, |
1468 | { "Filepath: ","Dateipfad: " }, | 1468 | { "Filepath: ","Dateipfad: " }, |
1469 | { "You can try to reload the calendar in the Resource View!","In der Resourcenansicht können Sie erneut versuchen den Kalender zu laden!" }, | 1469 | { "You can try to reload the calendar in the Resource View!","In der Resourcenansicht können Sie erneut versuchen den Kalender zu laden!" }, |
1470 | { "<b>WARNING:</b> There is a pending suspended alarm!","<b>WARNUNG:</b> Es gibt einen laufenden Suspendalarm!" }, | 1470 | { "<b>WARNING:</b> There is a pending suspended alarm!","<b>WARNUNG:</b> Es gibt einen laufenden Suspendalarm!" }, |
1471 | { "Pending Suspend Alarm","Laufender Suspend Alarm" }, | 1471 | { "Pending Suspend Alarm","Laufender Suspend Alarm" }, |
1472 | { "Error loading calendar %1","Fehler beim Laden von Kalender %1" }, | 1472 | { "Error loading calendar %1","Fehler beim Laden von Kalender %1" }, |
1473 | { "Calendar(s) not loaded:","Nicht geladene(r) Kalender:" }, | 1473 | { "Calendar(s) not loaded:","Nicht geladene(r) Kalender:" }, |
1474 | { "Loading of calendar(s) failed","Laden von Kalendern fehlgeschlagen" }, | 1474 | { "Loading of calendar(s) failed","Laden von Kalendern fehlgeschlagen" }, |
1475 | { "Alarm Options","Alarm Einstellungen" }, | 1475 | { "Alarm Options","Alarm Einstellungen" }, |
1476 | { "Delete selected...","Lösche Ausgewählte..." }, | 1476 | { "Delete selected...","Lösche Ausgewählte..." }, |
1477 | { "None","Nichts" }, | 1477 | { "None","Nichts" }, |
1478 | { "Selection","Auswahl" }, | 1478 | { "Selection","Auswahl" }, |
1479 | { "Set categories","Setze Kategorien" }, | 1479 | { "Set categories","Setze Kategorien" }, |
1480 | { "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!" }, | 1480 | { "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 | { "Reset","Neu setzen" }, | 1481 | { "Reset","Neu setzen" }, |
1482 | { "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)?" }, | 1482 | { "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 | { "The file\n%1\ndoes not exist!\nShall I create it for you?","Die Datei\n%1\nexistiert nicht!\nSoll sie neu angelegt werden?" }, | 1483 | { "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 | { "Sorry, cannot create the file\n%1!\nNo calendar added!","Kann leider die Datei\n%1\nnicht anlegen!\nKein Kalender hinzugefügt!" }, | 1484 | { "Sorry, cannot create the file\n%1!\nNo calendar added!","Kann leider die Datei\n%1\nnicht anlegen!\nKein Kalender hinzugefügt!" }, |
1485 | { "\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" }, | 1485 | { "\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 | { "\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" }, | 1486 | { "\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 | { "Edit","Edit" }, | 1487 | { "Edit","Edit" }, |
1488 | { "Last Modified","Zuletzt geändert" }, | 1488 | { "Last Modified","Zuletzt geändert" }, |
1489 | { "Journal viewer","Journal Anzeige" }, | 1489 | { "Journal viewer","Journal Anzeige" }, |
1490 | { "Configure Calendar Files...","Konfiguriere Kalenderdateien..." }, | 1490 | { "Configure Calendar Files...","Konfiguriere Kalenderdateien..." }, |
1491 | { "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>." }, | 1491 | { "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 | { "Hide Completed","Verstecke erledigte Todos" }, | 1492 | { "Hide Completed","Verstecke erledigte Todos" }, |
1493 | { "Show not Running","Zeige nicht Laufende" }, | 1493 | { "Show not Running","Zeige nicht Laufende" }, |
1494 | { "Click to add new Todo","Klick für neues Todo!" }, | 1494 | { "Click to add new Todo","Klick für neues Todo!" }, |
1495 | { "Show next conflict for","Zeige nächsten Konflikt für" }, | 1495 | { "Show next conflict for","Zeige nächsten Konflikt für" }, |
1496 | { "All events","Alle Termine" }, | 1496 | { "All events","Alle Termine" }, |
1497 | { "Allday events","Ganztagestermine" }, | 1497 | { "Allday events","Ganztagestermine" }, |
1498 | { "Events with time","Termine mit Zeit" }, | 1498 | { "Events with time","Termine mit Zeit" }, |
1499 | { "No conflict found","Kein Konflikt gefunden" }, | 1499 | { "No conflict found","Kein Konflikt gefunden" }, |
1500 | { "Conflict %1 <-> %2","Konflikt %1 <-> %2" }, | 1500 | { "Conflict %1 <-> %2","Konflikt %1 <-> %2" }, |
1501 | { "<p><b>Q</b>: Show next date with conflicting events\n ","<p><b>Q</b>: Zeige nächstes Datum mit Terminen im Konflikt\n " }, | 1501 | { "<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 | { "Week view mode uses row layout","Wochenansicht Modus nutzt Reihenlayout" }, | 1502 | { "Week view mode uses row layout","Wochenansicht Modus nutzt Reihenlayout" }, |
1503 | { "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" }, | 1503 | { "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 | { "KO/Pi Conflict detected","KO/Pi Konflikt erkannt" }, | 1504 | { "KO/Pi Conflict detected","KO/Pi Konflikt erkannt" }, |
1505 | { "Show date","Zeige Datum" }, | 1505 | { "Show date","Zeige Datum" }, |
1506 | { "No problem!","Null Problemo!" }, | 1506 | { "No problem!","Null Problemo!" }, |
1507 | { "Automatically sync with KDE-Desktop\nwhen receiving sync request","Synce automatisch mit KDE-Desktop\nwenn eine Sync-Anforderung kommt" }, | 1507 | { "Automatically sync with KDE-Desktop\nwhen receiving sync request","Synce automatisch mit KDE-Desktop\nwenn eine Sync-Anforderung kommt" }, |
1508 | { "Pi-Sync Port Error","Pi-Sync Port Fehler" }, | 1508 | { "Pi-Sync Port Error","Pi-Sync Port Fehler" }, |
1509 | { "<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?" }, | 1509 | { "<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 | { "No valid port number:\n%1","Keine gültige Port Nummer:\n%1" }, | 1510 | { "No valid port number:\n%1","Keine gültige Port Nummer:\n%1" }, |
1511 | { "Port number (Default: %1)\nValid range from 1 to 65535","Port Nummer (Standard: %1)\nGültiger Bereich von 1 bis 65535" }, | 1511 | { "Port number (Default: %1)\nValid range from 1 to 65535","Port Nummer (Standard: %1)\nGültiger Bereich von 1 bis 65535" }, |
1512 | { "Pi-Sync Error","Pi-Sync Fehler" }, | 1512 | { "Pi-Sync Error","Pi-Sync Fehler" }, |
1513 | { "Got send file request\nwith invalid password","Erhielt "sende Datei" Anfrage\nmit ungültigem Passwort" }, | 1513 | { "Got send file request\nwith invalid password","Erhielt "sende Datei" Anfrage\nmit ungültigem Passwort" }, |
1514 | { "Got receive file request\nwith invalid password","Erhielt "empfange Datei" Anfrage\nmit ungültigem Passwort" }, | 1514 | { "Got receive file request\nwith invalid password","Erhielt "empfange Datei" Anfrage\nmit ungültigem Passwort" }, |
1515 | { "Wrong password: Receiving remote file failed.","Falsches Passwort: Empfangen von entfernter Datei fehlgeschlagen." }, | 1515 | { "Wrong password: Receiving remote file failed.","Falsches Passwort: Empfangen von entfernter Datei fehlgeschlagen." }, |
1516 | { "Please close error dialog on remote.","Bitte schließe Fehler-Dialog am entfernten Rechner" }, | 1516 | { "Please close error dialog on remote.","Bitte schließe Fehler-Dialog am entfernten Rechner" }, |
1517 | { "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" }, | 1517 | { "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" }, |
1518 | { "Pi-Sync: Connected!","Pi-Sync: Verbunden!" }, | 1518 | { "Pi-Sync: Connected!","Pi-Sync: Verbunden!" }, |
1519 | { "Receiving file from remote...","Empfange entfernte Datei..." }, | 1519 | { "Receiving file from remote...","Empfange entfernte Datei..." }, |
1520 | { "Sending back synced file...","Sende synchronisierte Datei zurück..." }, | 1520 | { "Sending back synced file...","Sende synchronisierte Datei zurück..." }, |
1521 | { "Do you want to\nclear all sync info\nof all profiles?","Möchten Sie wirklich\ndie Sync-Info\nfür alle Profile\nlöschen?" }, | 1521 | { "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 the sync\ninfo of profile\n%1?\n","Möchten Sie wirklich\ndie Sync-Info für Profil\n%1?\nlöschen" }, | 1522 | { "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 | { "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." }, | 1523 | { "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." }, |
1524 | { "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" }, | 1524 | { "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" }, |
1525 | { "Writing back file ...","Schreibe Datei zurück..." }, | 1525 | { "Writing back file ...","Schreibe Datei zurück..." }, |
1526 | { "Sending back file ...","Sende Datei zurück..." }, | 1526 | { "Sending back file ...","Sende Datei zurück..." }, |
1527 | { "Eeek, there I am ticklish!","Hihi, da bin ich kitzlig!" }, | 1527 | { "Eeek, there I am ticklish!","Hihi, da bin ich kitzlig!" }, |
1528 | { "Created","Angelegt" }, | 1528 | { "Created","Angelegt" }, |
1529 | { "Last Modified Sub","Zuletzt geändertes Sub" }, | 1529 | { "Last Modified Sub","Zuletzt geändertes Sub" }, |
1530 | { "Checking conflicts ... please wait","Überprüfe Konflikte ... bitte warten" }, | 1530 | { "Checking conflicts ... please wait","Überprüfe Konflikte ... bitte warten" }, |
1531 | { "Show times on two lines","Zeige Zeiten auf zwei Zeilen" }, | 1531 | { "Show times on two lines","Zeige Zeiten auf zwei Zeilen" }, |
1532 | { "Save using LOCAL storage","Speichere nutze LOCAL Pfad" }, | 1532 | { "Save using LOCAL storage","Speichere nutze LOCAL Pfad" }, |
1533 | { "Duration","Dauer" }, | 1533 | { "Duration","Dauer" }, |
1534 | { " day"," Tag" }, | 1534 | { " day"," Tag" }, |
1535 | { "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" }, | 1535 | { "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 <b>openend</b>","Klicke diesen Knopf um alle Todos <b>geöffnet</b> darzustellen" }, | 1536 | { "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>closed</b>","Klicke diesen Knopf um alle Todos <b>geschlossen</b> darzustellen" }, | 1537 | { "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 toggle show/hide <b>running</b> todos","Klicke diesen Knopf um <b>zeige Laufende</b> umzuschalten" }, | 1538 | { "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>completed</b> todos","Klicke diesen Knopf um <b>zeige Erledigte</b> umzuschalten" }, | 1539 | { "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 add a new subtodo to the currently selected todo","Klicke diesen Knopf um ein Untertodo zu dem gerade selektierten Todo hinzuzufügen" }, | 1540 | { "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 | { "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." }, | 1541 | { "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 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." }, | 1542 | { "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 <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." }, | 1543 | { "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>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." }, | 1544 | { "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 | { "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." }, | 1545 | { "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 | { "<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)" }, | 1546 | { "<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 | { "Error saving data","Fehler beim Abspeichern" }, | 1547 | { "Error saving data","Fehler beim Abspeichern" }, |
1548 | { "Calendar(s) not saved:","Nicht gespeicherte Kalender:" }, | 1548 | { "Calendar(s) not saved:","Nicht gespeicherte Kalender:" }, |
1549 | { "Enable conflict detection","Schalte Konflikterkennung an" }, | 1549 | { "Enable conflict detection","Schalte Konflikterkennung an" }, |
1550 | { "Conflict detection checks an <b>edited event</b> with other <b>existing events</b> for overlapping. You can define which events are checked:","Konflikterkennung prüft einen <b>bearbeiteten Termin</b> auf Überschneidungen mit <b>anderen Terminen</b>. Sie können einstellen welche Termine überprüft werden:" }, | 1550 | { "Conflict detection checks an <b>edited event</b> with other <b>existing events</b> for overlapping. You can define which events are checked:","Konflikterkennung prüft einen <b>bearbeiteten Termin</b> auf Überschneidungen mit <b>anderen Terminen</b>. Sie können einstellen welche Termine überprüft werden:" }, |
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 existing events","Filter für die anderen Termine" }, | 1552 | { "Filter for other existing 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 | { "","" }, | 1558 | { "Loading calendar files ... please wait","Lade Kalenderdateien ... bitte warten" }, |
1559 | { "","" }, | 1559 | { "","" }, |
1560 | { "","" }, | 1560 | { "","" }, |
1561 | { "","" }, | 1561 | { "","" }, |
1562 | { "","" }, | 1562 | { "","" }, |
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index e3b62de..9928b48 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -2298,194 +2298,194 @@ bool CalendarView::importQtopia( const QString &categories, | |||
2298 | delete calendar; | 2298 | delete calendar; |
2299 | updateView(); | 2299 | updateView(); |
2300 | return syncOK; | 2300 | return syncOK; |
2301 | 2301 | ||
2302 | 2302 | ||
2303 | #endif | 2303 | #endif |
2304 | 2304 | ||
2305 | } | 2305 | } |
2306 | 2306 | ||
2307 | void CalendarView::setSyncEventsReadOnly() | 2307 | void CalendarView::setSyncEventsReadOnly() |
2308 | { | 2308 | { |
2309 | mCalendar->setSyncEventsReadOnly(); | 2309 | mCalendar->setSyncEventsReadOnly(); |
2310 | } | 2310 | } |
2311 | 2311 | ||
2312 | bool CalendarView::loadCalendars() | 2312 | bool CalendarView::loadCalendars() |
2313 | { | 2313 | { |
2314 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; | 2314 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; |
2315 | KopiCalendarFile * cal = calendars.first(); | 2315 | KopiCalendarFile * cal = calendars.first(); |
2316 | mCalendar->setDefaultCalendar( 1 ); | 2316 | mCalendar->setDefaultCalendar( 1 ); |
2317 | openCalendar( MainWindow::defaultFileName(), false ); | 2317 | openCalendar( MainWindow::defaultFileName(), false ); |
2318 | cal = calendars.next(); | 2318 | cal = calendars.next(); |
2319 | while ( cal ) { | 2319 | while ( cal ) { |
2320 | addCalendar( cal ); | 2320 | addCalendar( cal ); |
2321 | cal = calendars.next(); | 2321 | cal = calendars.next(); |
2322 | } | 2322 | } |
2323 | restoreCalendarSettings(); | 2323 | restoreCalendarSettings(); |
2324 | return true; | 2324 | return true; |
2325 | } | 2325 | } |
2326 | bool CalendarView::restoreCalendarSettings() | 2326 | bool CalendarView::restoreCalendarSettings() |
2327 | { | 2327 | { |
2328 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; | 2328 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; |
2329 | KopiCalendarFile * cal = calendars.first(); | 2329 | KopiCalendarFile * cal = calendars.first(); |
2330 | while ( cal ) { | 2330 | while ( cal ) { |
2331 | mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled ); | 2331 | mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled ); |
2332 | mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled ); | 2332 | mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled ); |
2333 | mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly ); | 2333 | mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly ); |
2334 | if ( cal->isStandard ) | 2334 | if ( cal->isStandard ) |
2335 | mCalendar->setDefaultCalendar( cal->mCalNumber ); | 2335 | mCalendar->setDefaultCalendar( cal->mCalNumber ); |
2336 | cal = calendars.next(); | 2336 | cal = calendars.next(); |
2337 | } | 2337 | } |
2338 | setSyncEventsReadOnly(); | 2338 | setSyncEventsReadOnly(); |
2339 | mCalendar->reInitAlarmSettings(); | 2339 | mCalendar->reInitAlarmSettings(); |
2340 | updateUnmanagedViews(); | 2340 | updateUnmanagedViews(); |
2341 | updateView(); | 2341 | updateView(); |
2342 | return true; | 2342 | return true; |
2343 | } | 2343 | } |
2344 | void CalendarView::addCalendarId( int id ) | 2344 | void CalendarView::addCalendarId( int id ) |
2345 | { | 2345 | { |
2346 | KopiCalendarFile * cal = KOPrefs::instance()->getCalendar( id ); | 2346 | KopiCalendarFile * cal = KOPrefs::instance()->getCalendar( id ); |
2347 | if ( cal ) | 2347 | if ( cal ) |
2348 | addCalendar( cal ); | 2348 | addCalendar( cal ); |
2349 | } | 2349 | } |
2350 | bool CalendarView::addCalendar( KopiCalendarFile * cal ) | 2350 | bool CalendarView::addCalendar( KopiCalendarFile * cal ) |
2351 | { | 2351 | { |
2352 | cal->mErrorOnLoad = false; | 2352 | cal->mErrorOnLoad = false; |
2353 | if ( mCalendar->addCalendarFile( cal->mFileName, cal->mCalNumber )) { | 2353 | if ( mCalendar->addCalendarFile( cal->mFileName, cal->mCalNumber )) { |
2354 | cal->mLoadDt = QDateTime::currentDateTime(); | 2354 | cal->mLoadDt = QDateTime::currentDateTime(); |
2355 | return true; | 2355 | return true; |
2356 | } | 2356 | } |
2357 | qDebug("KO: Error adding calendar file %s ",cal->mFileName.latin1() ); | 2357 | qDebug("KO: Error adding calendar file %s ",cal->mFileName.latin1() ); |
2358 | cal->mErrorOnLoad = true; | 2358 | cal->mErrorOnLoad = true; |
2359 | return false; | 2359 | return false; |
2360 | } | 2360 | } |
2361 | bool CalendarView::openCalendar(QString filename, bool merge) | 2361 | bool CalendarView::openCalendar(QString filename, bool merge) |
2362 | { | 2362 | { |
2363 | 2363 | ||
2364 | if (filename.isEmpty()) { | 2364 | if (filename.isEmpty()) { |
2365 | return false; | 2365 | return false; |
2366 | } | 2366 | } |
2367 | 2367 | ||
2368 | if (!QFile::exists(filename)) { | 2368 | if (!QFile::exists(filename)) { |
2369 | KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename)); | 2369 | KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename)); |
2370 | return false; | 2370 | return false; |
2371 | } | 2371 | } |
2372 | 2372 | ||
2373 | globalFlagBlockAgenda = 1; | 2373 | globalFlagBlockAgenda = 1; |
2374 | clearAllViews(); | 2374 | clearAllViews(); |
2375 | if (!merge) { | 2375 | if (!merge) { |
2376 | mViewManager->setDocumentId( filename ); | 2376 | mViewManager->setDocumentId( filename ); |
2377 | mCalendar->close(); | 2377 | mCalendar->close(); |
2378 | } | 2378 | } |
2379 | mStorage->setFileName( filename ); | 2379 | mStorage->setFileName( filename ); |
2380 | 2380 | ||
2381 | if ( mStorage->load() ) { | 2381 | if ( mStorage->load() ) { |
2382 | if ( merge ) ;//setModified( true ); | 2382 | if ( merge ) ;//setModified( true ); |
2383 | else { | 2383 | else { |
2384 | //setModified( true ); | 2384 | //setModified( true ); |
2385 | mViewManager->setDocumentId( filename ); | 2385 | mViewManager->setDocumentId( filename ); |
2386 | mDialogManager->setDocumentId( filename ); | 2386 | mDialogManager->setDocumentId( filename ); |
2387 | mTodoList->setDocumentId( filename ); | 2387 | mTodoList->setDocumentId( filename ); |
2388 | } | 2388 | } |
2389 | globalFlagBlockAgenda = 2; | 2389 | globalFlagBlockAgenda = 2; |
2390 | // if ( getLastSyncEvent() ) | 2390 | // if ( getLastSyncEvent() ) |
2391 | // getLastSyncEvent()->setReadOnly( true ); | 2391 | // getLastSyncEvent()->setReadOnly( true ); |
2392 | mCalendar->reInitAlarmSettings(); | 2392 | mCalendar->reInitAlarmSettings(); |
2393 | setSyncEventsReadOnly(); | 2393 | setSyncEventsReadOnly(); |
2394 | updateUnmanagedViews(); | 2394 | //updateUnmanagedViews(); |
2395 | updateView(); | 2395 | //updateView(); |
2396 | if ( filename != MainWindow::defaultFileName() ) { | 2396 | if ( filename != MainWindow::defaultFileName() ) { |
2397 | saveCalendar( MainWindow::defaultFileName() ); | 2397 | saveCalendar( MainWindow::defaultFileName() ); |
2398 | } else { | 2398 | } else { |
2399 | QFileInfo finf ( MainWindow::defaultFileName()); | 2399 | QFileInfo finf ( MainWindow::defaultFileName()); |
2400 | if ( finf.exists() ) { | 2400 | if ( finf.exists() ) { |
2401 | setLoadedFileVersion( finf.lastModified () ); | 2401 | setLoadedFileVersion( finf.lastModified () ); |
2402 | } | 2402 | } |
2403 | } | 2403 | } |
2404 | return true; | 2404 | return true; |
2405 | } else { | 2405 | } else { |
2406 | // while failing to load, the calendar object could | 2406 | // while failing to load, the calendar object could |
2407 | // have become partially populated. Clear it out. | 2407 | // have become partially populated. Clear it out. |
2408 | if ( !merge ) { | 2408 | if ( !merge ) { |
2409 | mCalendar->close(); | 2409 | mCalendar->close(); |
2410 | mViewManager->setDocumentId( filename ); | 2410 | mViewManager->setDocumentId( filename ); |
2411 | mDialogManager->setDocumentId( filename ); | 2411 | mDialogManager->setDocumentId( filename ); |
2412 | mTodoList->setDocumentId( filename ); | 2412 | mTodoList->setDocumentId( filename ); |
2413 | } | 2413 | } |
2414 | 2414 | ||
2415 | //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename)); | 2415 | //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename)); |
2416 | 2416 | ||
2417 | QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) ); | 2417 | QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) ); |
2418 | globalFlagBlockAgenda = 2; | 2418 | globalFlagBlockAgenda = 2; |
2419 | mCalendar->reInitAlarmSettings(); | 2419 | mCalendar->reInitAlarmSettings(); |
2420 | setSyncEventsReadOnly(); | 2420 | setSyncEventsReadOnly(); |
2421 | updateUnmanagedViews(); | 2421 | updateUnmanagedViews(); |
2422 | updateView(); | 2422 | updateView(); |
2423 | } | 2423 | } |
2424 | return false; | 2424 | return false; |
2425 | } | 2425 | } |
2426 | void CalendarView::mergeFile( QString fn ) | 2426 | void CalendarView::mergeFile( QString fn ) |
2427 | { | 2427 | { |
2428 | clearAllViews(); | 2428 | clearAllViews(); |
2429 | mCalendar->mergeCalendarFile( fn ); | 2429 | mCalendar->mergeCalendarFile( fn ); |
2430 | mCalendar->reInitAlarmSettings(); | 2430 | mCalendar->reInitAlarmSettings(); |
2431 | setSyncEventsReadOnly(); | 2431 | setSyncEventsReadOnly(); |
2432 | updateUnmanagedViews(); | 2432 | updateUnmanagedViews(); |
2433 | updateView(); | 2433 | updateView(); |
2434 | } | 2434 | } |
2435 | void CalendarView::showOpenError() | 2435 | void CalendarView::showOpenError() |
2436 | { | 2436 | { |
2437 | KMessageBox::error(this,i18n("Couldn't load calendar\n.")); | 2437 | KMessageBox::error(this,i18n("Couldn't load calendar\n.")); |
2438 | } | 2438 | } |
2439 | void CalendarView::setLoadedFileVersion(QDateTime dt) | 2439 | void CalendarView::setLoadedFileVersion(QDateTime dt) |
2440 | { | 2440 | { |
2441 | loadedFileVersion = dt; | 2441 | loadedFileVersion = dt; |
2442 | } | 2442 | } |
2443 | bool CalendarView::checkFileChanged(QString fn) | 2443 | bool CalendarView::checkFileChanged(QString fn) |
2444 | { | 2444 | { |
2445 | QFileInfo finf ( fn ); | 2445 | QFileInfo finf ( fn ); |
2446 | if ( !finf.exists() ) | 2446 | if ( !finf.exists() ) |
2447 | return true; | 2447 | return true; |
2448 | QDateTime dt = finf.lastModified (); | 2448 | QDateTime dt = finf.lastModified (); |
2449 | if ( dt <= loadedFileVersion ) | 2449 | if ( dt <= loadedFileVersion ) |
2450 | return false; | 2450 | return false; |
2451 | return true; | 2451 | return true; |
2452 | 2452 | ||
2453 | } | 2453 | } |
2454 | void CalendarView::watchSavedFile() | 2454 | void CalendarView::watchSavedFile() |
2455 | { | 2455 | { |
2456 | QFileInfo finf ( MainWindow::defaultFileName()); | 2456 | QFileInfo finf ( MainWindow::defaultFileName()); |
2457 | if ( !finf.exists() ) | 2457 | if ( !finf.exists() ) |
2458 | return; | 2458 | return; |
2459 | QDateTime dt = finf.lastModified (); | 2459 | QDateTime dt = finf.lastModified (); |
2460 | if ( dt < loadedFileVersion ) { | 2460 | if ( dt < loadedFileVersion ) { |
2461 | //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1()); | 2461 | //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1()); |
2462 | QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) ); | 2462 | QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) ); |
2463 | return; | 2463 | return; |
2464 | } | 2464 | } |
2465 | loadedFileVersion = dt; | 2465 | loadedFileVersion = dt; |
2466 | } | 2466 | } |
2467 | bool CalendarView::checkAllFileVersions() | 2467 | bool CalendarView::checkAllFileVersions() |
2468 | { | 2468 | { |
2469 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; | 2469 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; |
2470 | KopiCalendarFile * cal = calendars.first(); | 2470 | KopiCalendarFile * cal = calendars.first(); |
2471 | mCalendar->setDefaultCalendar( 1 ); | 2471 | mCalendar->setDefaultCalendar( 1 ); |
2472 | mCalendar->setDefaultCalendarEnabledOnly(); | 2472 | mCalendar->setDefaultCalendarEnabledOnly(); |
2473 | if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { | 2473 | if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { |
2474 | if ( !checkFileVersion(MainWindow::defaultFileName())) { | 2474 | if ( !checkFileVersion(MainWindow::defaultFileName())) { |
2475 | restoreCalendarSettings(); | 2475 | restoreCalendarSettings(); |
2476 | return false; | 2476 | return false; |
2477 | } | 2477 | } |
2478 | } | 2478 | } |
2479 | cal = calendars.next(); | 2479 | cal = calendars.next(); |
2480 | QDateTime storeTemp = loadedFileVersion; | 2480 | QDateTime storeTemp = loadedFileVersion; |
2481 | while ( cal ) { | 2481 | while ( cal ) { |
2482 | if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { | 2482 | if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { |
2483 | mCalendar->setDefaultCalendar( cal->mCalNumber ); | 2483 | mCalendar->setDefaultCalendar( cal->mCalNumber ); |
2484 | mCalendar->setDefaultCalendarEnabledOnly(); | 2484 | mCalendar->setDefaultCalendarEnabledOnly(); |
2485 | loadedFileVersion = cal->mLoadDt.addSecs( 15 ); | 2485 | loadedFileVersion = cal->mLoadDt.addSecs( 15 ); |
2486 | if ( !checkFileVersion(cal->mFileName )) { | 2486 | if ( !checkFileVersion(cal->mFileName )) { |
2487 | loadedFileVersion = storeTemp; | 2487 | loadedFileVersion = storeTemp; |
2488 | restoreCalendarSettings(); | 2488 | restoreCalendarSettings(); |
2489 | return false; | 2489 | return false; |
2490 | } | 2490 | } |
2491 | } | 2491 | } |
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 17248dc..07bfdbf 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -411,192 +411,197 @@ void KOTodoListView::keyPressEvent ( QKeyEvent * e ) | |||
411 | // qDebug(" ignore %d",e->isAutoRepeat() ); | 411 | // qDebug(" ignore %d",e->isAutoRepeat() ); |
412 | return; | 412 | return; |
413 | } | 413 | } |
414 | if (! e->isAutoRepeat() ) | 414 | if (! e->isAutoRepeat() ) |
415 | mFlagKeyPressed = true; | 415 | mFlagKeyPressed = true; |
416 | QListViewItem* cn; | 416 | QListViewItem* cn; |
417 | if ( (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) && mName != "todolistsmall") { | 417 | if ( (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) && mName != "todolistsmall") { |
418 | cn = currentItem(); | 418 | cn = currentItem(); |
419 | if ( cn ) { | 419 | if ( cn ) { |
420 | KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); | 420 | KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); |
421 | if ( ci ){ | 421 | if ( ci ){ |
422 | if ( e->state() == ShiftButton ) | 422 | if ( e->state() == ShiftButton ) |
423 | ci->setOn( false ); | 423 | ci->setOn( false ); |
424 | else | 424 | else |
425 | ci->setOn( true ); | 425 | ci->setOn( true ); |
426 | cn = cn->itemBelow(); | 426 | cn = cn->itemBelow(); |
427 | if ( cn ) { | 427 | if ( cn ) { |
428 | setCurrentItem ( cn ); | 428 | setCurrentItem ( cn ); |
429 | ensureItemVisible ( cn ); | 429 | ensureItemVisible ( cn ); |
430 | } | 430 | } |
431 | 431 | ||
432 | } | 432 | } |
433 | } | 433 | } |
434 | 434 | ||
435 | e->accept(); | 435 | e->accept(); |
436 | return; | 436 | return; |
437 | } | 437 | } |
438 | 438 | ||
439 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) { | 439 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) { |
440 | switch ( e->key() ) { | 440 | switch ( e->key() ) { |
441 | case Qt::Key_Down: | 441 | case Qt::Key_Down: |
442 | case Qt::Key_Up: | 442 | case Qt::Key_Up: |
443 | QListView::keyPressEvent ( e ); | 443 | QListView::keyPressEvent ( e ); |
444 | e->accept(); | 444 | e->accept(); |
445 | break; | 445 | break; |
446 | case Qt::Key_Left: | 446 | case Qt::Key_Left: |
447 | case Qt::Key_Right: | 447 | case Qt::Key_Right: |
448 | QListView::keyPressEvent ( e ); | 448 | QListView::keyPressEvent ( e ); |
449 | e->accept(); | 449 | e->accept(); |
450 | return; | 450 | return; |
451 | break; | 451 | break; |
452 | default: | 452 | default: |
453 | e->ignore(); | 453 | e->ignore(); |
454 | break; | 454 | break; |
455 | } | 455 | } |
456 | return; | 456 | return; |
457 | } | 457 | } |
458 | e->ignore(); | 458 | e->ignore(); |
459 | } | 459 | } |
460 | void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e) | 460 | void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e) |
461 | { | 461 | { |
462 | QListView::contentsMouseReleaseEvent(e); | 462 | QListView::contentsMouseReleaseEvent(e); |
463 | mMousePressed = false; | 463 | mMousePressed = false; |
464 | } | 464 | } |
465 | 465 | ||
466 | void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e) | 466 | void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e) |
467 | { | 467 | { |
468 | if (!e) return; | 468 | if (!e) return; |
469 | 469 | ||
470 | QPoint vp = contentsToViewport(e->pos()); | 470 | QPoint vp = contentsToViewport(e->pos()); |
471 | 471 | ||
472 | QListViewItem *item = itemAt(vp); | 472 | QListViewItem *item = itemAt(vp); |
473 | 473 | ||
474 | emit double_Clicked(item); | 474 | emit double_Clicked(item); |
475 | if (!item) return; | 475 | if (!item) return; |
476 | 476 | ||
477 | emit doubleClicked(item,vp,0); | 477 | emit doubleClicked(item,vp,0); |
478 | } | 478 | } |
479 | 479 | ||
480 | ///////////////////////////////////////////////////////////////////////////// | 480 | ///////////////////////////////////////////////////////////////////////////// |
481 | 481 | ||
482 | KOQuickTodo::KOQuickTodo(QWidget *parent) : | 482 | KOQuickTodo::KOQuickTodo(QWidget *parent) : |
483 | QLineEdit(parent) | 483 | QLineEdit(parent) |
484 | { | 484 | { |
485 | setText(i18n("Click to add new Todo")); | 485 | setText(i18n("Click to add new Todo")); |
486 | setFocusPolicy ( QWidget::ClickFocus ); | 486 | setFocusPolicy ( QWidget::ClickFocus ); |
487 | } | 487 | } |
488 | 488 | ||
489 | void KOQuickTodo::focusInEvent(QFocusEvent *ev) | 489 | void KOQuickTodo::focusInEvent(QFocusEvent *ev) |
490 | { | 490 | { |
491 | if ( text()==i18n("Click to add new Todo") ) | 491 | if ( text()==i18n("Click to add new Todo") ) |
492 | setText(""); | 492 | setText(""); |
493 | QLineEdit::focusInEvent(ev); | 493 | QLineEdit::focusInEvent(ev); |
494 | } | 494 | } |
495 | 495 | ||
496 | void KOQuickTodo::focusOutEvent(QFocusEvent *ev) | 496 | void KOQuickTodo::focusOutEvent(QFocusEvent *ev) |
497 | { | 497 | { |
498 | setText(i18n("Click to add new Todo")); | 498 | setText(i18n("Click to add new Todo")); |
499 | QLineEdit::focusOutEvent(ev); | 499 | QLineEdit::focusOutEvent(ev); |
500 | } | 500 | } |
501 | 501 | ||
502 | ///////////////////////////////////////////////////////////////////////////// | 502 | ///////////////////////////////////////////////////////////////////////////// |
503 | 503 | ||
504 | KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | 504 | KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : |
505 | KOrg::BaseView(calendar,parent,name) | 505 | KOrg::BaseView(calendar,parent,name) |
506 | { | 506 | { |
507 | |||
508 | mCurItem = 0; | ||
509 | mCurItemRootParent = 0; | ||
510 | mCurItemParent = 0; | ||
511 | mCurItemAbove = 0; | ||
507 | mActiveItem = 0; | 512 | mActiveItem = 0; |
508 | mCategoryPopupMenu = 0; | 513 | mCategoryPopupMenu = 0; |
509 | mPendingUpdateBeforeRepaint = false; | 514 | mPendingUpdateBeforeRepaint = false; |
510 | isFlatDisplay = false; | 515 | isFlatDisplay = false; |
511 | mNavigator = 0; | 516 | mNavigator = 0; |
512 | QBoxLayout *topLayout = new QVBoxLayout(this); | 517 | QBoxLayout *topLayout = new QVBoxLayout(this); |
513 | mName = QString ( name ); | 518 | mName = QString ( name ); |
514 | mBlockUpdate = false; | 519 | mBlockUpdate = false; |
515 | mQuickBar = new QWidget( this ); | 520 | mQuickBar = new QWidget( this ); |
516 | topLayout->addWidget(mQuickBar); | 521 | topLayout->addWidget(mQuickBar); |
517 | 522 | ||
518 | mQuickAdd = new KOQuickTodo(mQuickBar); | 523 | mQuickAdd = new KOQuickTodo(mQuickBar); |
519 | QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar); | 524 | QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar); |
520 | quickLayout->addWidget( mQuickAdd ); | 525 | quickLayout->addWidget( mQuickAdd ); |
521 | mNewSubBut = new QPushButton( "sub",mQuickBar ); | 526 | mNewSubBut = new QPushButton( "sub",mQuickBar ); |
522 | QPushButton * s_done = new QPushButton( "D",mQuickBar ); | 527 | QPushButton * s_done = new QPushButton( "D",mQuickBar ); |
523 | QPushButton * s_run = new QPushButton( "R",mQuickBar ); | 528 | QPushButton * s_run = new QPushButton( "R",mQuickBar ); |
524 | QPushButton * allopen = new QPushButton( "O",mQuickBar ); | 529 | QPushButton * allopen = new QPushButton( "O",mQuickBar ); |
525 | QPushButton * allclose = new QPushButton( "C",mQuickBar ); | 530 | QPushButton * allclose = new QPushButton( "C",mQuickBar ); |
526 | QPushButton * flat = new QPushButton( "F",mQuickBar ); | 531 | QPushButton * flat = new QPushButton( "F",mQuickBar ); |
527 | 532 | ||
528 | int fixwid = mQuickAdd->sizeHint().height(); | 533 | int fixwid = mQuickAdd->sizeHint().height(); |
529 | int fixhei = fixwid; | 534 | int fixhei = fixwid; |
530 | if ( QApplication::desktop()->width() > 800 ) | 535 | if ( QApplication::desktop()->width() > 800 ) |
531 | fixwid = (fixwid*3)/2; | 536 | fixwid = (fixwid*3)/2; |
532 | connect ( flat, SIGNAL ( clicked()), SLOT ( setAllFlat())); | 537 | connect ( flat, SIGNAL ( clicked()), SLOT ( setAllFlat())); |
533 | connect ( allopen, SIGNAL ( clicked()), SLOT ( setAllOpen())); | 538 | connect ( allopen, SIGNAL ( clicked()), SLOT ( setAllOpen())); |
534 | connect ( allclose, SIGNAL ( clicked()), SLOT ( setAllClose())); | 539 | connect ( allclose, SIGNAL ( clicked()), SLOT ( setAllClose())); |
535 | s_done->setPixmap( SmallIcon("greenhook16")); | 540 | s_done->setPixmap( SmallIcon("greenhook16")); |
536 | connect ( s_done, SIGNAL ( clicked()), SLOT ( toggleCompleted())); | 541 | connect ( s_done, SIGNAL ( clicked()), SLOT ( toggleCompleted())); |
537 | s_run->setPixmap( SmallIcon("ko16old")); | 542 | s_run->setPixmap( SmallIcon("ko16old")); |
538 | connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning())); | 543 | connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning())); |
539 | 544 | ||
540 | connect ( mNewSubBut, SIGNAL ( clicked()), SLOT ( newSubTodo())); | 545 | connect ( mNewSubBut, SIGNAL ( clicked()), SLOT ( newSubTodo())); |
541 | 546 | ||
542 | mNewSubBut->setFixedWidth(mNewSubBut->sizeHint().width() ); | 547 | mNewSubBut->setFixedWidth(mNewSubBut->sizeHint().width() ); |
543 | mNewSubBut->setEnabled( false ); | 548 | mNewSubBut->setEnabled( false ); |
544 | flat->setFixedWidth( fixwid ); | 549 | flat->setFixedWidth( fixwid ); |
545 | s_done->setFixedWidth( fixwid ); | 550 | s_done->setFixedWidth( fixwid ); |
546 | allopen->setFixedWidth( fixwid ); | 551 | allopen->setFixedWidth( fixwid ); |
547 | allclose->setFixedWidth( fixwid ); | 552 | allclose->setFixedWidth( fixwid ); |
548 | s_run->setFixedWidth( fixwid ); | 553 | s_run->setFixedWidth( fixwid ); |
549 | 554 | ||
550 | flat->setFixedHeight(fixhei ); | 555 | flat->setFixedHeight(fixhei ); |
551 | s_done->setFixedHeight(fixhei ); | 556 | s_done->setFixedHeight(fixhei ); |
552 | allopen->setFixedHeight(fixhei ); | 557 | allopen->setFixedHeight(fixhei ); |
553 | allclose->setFixedHeight(fixhei ); | 558 | allclose->setFixedHeight(fixhei ); |
554 | s_run->setFixedHeight(fixhei ); | 559 | s_run->setFixedHeight(fixhei ); |
555 | mNewSubBut->setFixedHeight(fixhei ); | 560 | mNewSubBut->setFixedHeight(fixhei ); |
556 | 561 | ||
557 | flat->setFocusPolicy( NoFocus ); | 562 | flat->setFocusPolicy( NoFocus ); |
558 | s_done->setFocusPolicy( NoFocus ); | 563 | s_done->setFocusPolicy( NoFocus ); |
559 | allopen->setFocusPolicy( NoFocus ); | 564 | allopen->setFocusPolicy( NoFocus ); |
560 | allclose->setFocusPolicy( NoFocus ); | 565 | allclose->setFocusPolicy( NoFocus ); |
561 | s_run->setFocusPolicy( NoFocus ); | 566 | s_run->setFocusPolicy( NoFocus ); |
562 | mNewSubBut->setFocusPolicy( NoFocus ); | 567 | mNewSubBut->setFocusPolicy( NoFocus ); |
563 | 568 | ||
564 | QWhatsThis::add( flat, i18n("Click this button to display all todos in a <b>flat</b> hierarchy" ) ); | 569 | QWhatsThis::add( flat, i18n("Click this button to display all todos in a <b>flat</b> hierarchy" ) ); |
565 | QWhatsThis::add( allopen, i18n("Click this button to display all todos <b>openend</b>" ) ); | 570 | QWhatsThis::add( allopen, i18n("Click this button to display all todos <b>openend</b>" ) ); |
566 | QWhatsThis::add( allclose, i18n("Click this button to display all todos <b>closed</b>" ) ); | 571 | QWhatsThis::add( allclose, i18n("Click this button to display all todos <b>closed</b>" ) ); |
567 | QWhatsThis::add( s_run, i18n("Click this button to toggle show/hide <b>running</b> todos" ) ); | 572 | QWhatsThis::add( s_run, i18n("Click this button to toggle show/hide <b>running</b> todos" ) ); |
568 | QWhatsThis::add( mNewSubBut, i18n("Click this button to add a new subtodo to the currently selected todo" ) ); | 573 | QWhatsThis::add( mNewSubBut, i18n("Click this button to add a new subtodo to the currently selected todo" ) ); |
569 | QWhatsThis::add( s_done, i18n("Click this button to toggle show/hide <b>completed</b> todos" ) ); | 574 | QWhatsThis::add( s_done, i18n("Click this button to toggle show/hide <b>completed</b> todos" ) ); |
570 | 575 | ||
571 | quickLayout->addWidget( mNewSubBut ); | 576 | quickLayout->addWidget( mNewSubBut ); |
572 | quickLayout->addWidget( s_done ); | 577 | quickLayout->addWidget( s_done ); |
573 | quickLayout->addWidget( s_run ); | 578 | quickLayout->addWidget( s_run ); |
574 | quickLayout->addWidget( allopen ); | 579 | quickLayout->addWidget( allopen ); |
575 | quickLayout->addWidget( allclose ); | 580 | quickLayout->addWidget( allclose ); |
576 | quickLayout->addWidget( flat ); | 581 | quickLayout->addWidget( flat ); |
577 | 582 | ||
578 | if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickBar->hide(); | 583 | if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickBar->hide(); |
579 | 584 | ||
580 | mTodoListView = new KOTodoListView(calendar,this, name ); | 585 | mTodoListView = new KOTodoListView(calendar,this, name ); |
581 | topLayout->addWidget(mTodoListView); | 586 | topLayout->addWidget(mTodoListView); |
582 | //mTodoListView->header()->setMaximumHeight(30); | 587 | //mTodoListView->header()->setMaximumHeight(30); |
583 | mTodoListView->setRootIsDecorated(true); | 588 | mTodoListView->setRootIsDecorated(true); |
584 | mTodoListView->setAllColumnsShowFocus(true); | 589 | mTodoListView->setAllColumnsShowFocus(true); |
585 | 590 | ||
586 | mTodoListView->setShowSortIndicator(true); | 591 | mTodoListView->setShowSortIndicator(true); |
587 | 592 | ||
588 | mTodoListView->addColumn(i18n("Todo")); | 593 | mTodoListView->addColumn(i18n("Todo")); |
589 | mTodoListView->addColumn(i18n("Prio")); | 594 | mTodoListView->addColumn(i18n("Prio")); |
590 | mTodoListView->setColumnAlignment(1,AlignHCenter); | 595 | mTodoListView->setColumnAlignment(1,AlignHCenter); |
591 | mTodoListView->addColumn(i18n("Complete")); | 596 | mTodoListView->addColumn(i18n("Complete")); |
592 | mTodoListView->setColumnAlignment(2,AlignCenter); | 597 | mTodoListView->setColumnAlignment(2,AlignCenter); |
593 | 598 | ||
594 | mTodoListView->addColumn(i18n("Due Date")); | 599 | mTodoListView->addColumn(i18n("Due Date")); |
595 | mTodoListView->setColumnAlignment(3,AlignLeft); | 600 | mTodoListView->setColumnAlignment(3,AlignLeft); |
596 | mTodoListView->addColumn(i18n("Due Time")); | 601 | mTodoListView->addColumn(i18n("Due Time")); |
597 | mTodoListView->setColumnAlignment(4,AlignHCenter); | 602 | mTodoListView->setColumnAlignment(4,AlignHCenter); |
598 | 603 | ||
599 | mTodoListView->addColumn(i18n("Start Date")); | 604 | mTodoListView->addColumn(i18n("Start Date")); |
600 | mTodoListView->setColumnAlignment(5,AlignLeft); | 605 | mTodoListView->setColumnAlignment(5,AlignLeft); |
601 | mTodoListView->addColumn(i18n("Start Time")); | 606 | mTodoListView->addColumn(i18n("Start Time")); |
602 | mTodoListView->setColumnAlignment(6,AlignHCenter); | 607 | mTodoListView->setColumnAlignment(6,AlignHCenter); |
diff --git a/korganizer/main.cpp b/korganizer/main.cpp index c9d1345..6339370 100644 --- a/korganizer/main.cpp +++ b/korganizer/main.cpp | |||
@@ -1,115 +1,115 @@ | |||
1 | 1 | ||
2 | 2 | ||
3 | #ifndef DESKTOP_VERSION | 3 | #ifndef DESKTOP_VERSION |
4 | #include <qpe/qpeapplication.h> | 4 | #include <qpe/qpeapplication.h> |
5 | #include <qcopchannel_qws.h> | 5 | #include <qcopchannel_qws.h> |
6 | #include <qpe/global.h> | 6 | #include <qpe/global.h> |
7 | #include <stdlib.h> | 7 | #include <stdlib.h> |
8 | #else | 8 | #else |
9 | #include <qapplication.h> | 9 | #include <qapplication.h> |
10 | #include <qstring.h> | 10 | #include <qstring.h> |
11 | #include <qwindowsstyle.h> | 11 | #include <qwindowsstyle.h> |
12 | #include <qplatinumstyle.h> | 12 | #include <qplatinumstyle.h> |
13 | #include <qsgistyle.h> | 13 | #include <qsgistyle.h> |
14 | #include <stdlib.h> | 14 | #include <stdlib.h> |
15 | #endif | 15 | #endif |
16 | #include <qtextcodec.h> | 16 | #include <qtextcodec.h> |
17 | 17 | ||
18 | #include <qdir.h> | 18 | #include <qdir.h> |
19 | #include <kstandarddirs.h> | 19 | #include <kstandarddirs.h> |
20 | #include <kglobal.h> | 20 | #include <kglobal.h> |
21 | #include <stdio.h> | 21 | #include <stdio.h> |
22 | #include "mainwindow.h" | 22 | #include "mainwindow.h" |
23 | #include <libkdepim/kpimglobalprefs.h> | 23 | #include <libkdepim/kpimglobalprefs.h> |
24 | void dumpMissing(); | 24 | void dumpMissing(); |
25 | 25 | ||
26 | 26 | ||
27 | int main( int argc, char **argv ) | 27 | int main( int argc, char **argv ) |
28 | { | 28 | { |
29 | #ifndef DESKTOP_VERSION | 29 | #ifndef DESKTOP_VERSION |
30 | QPEApplication a( argc, argv ); | 30 | QPEApplication a( argc, argv ); |
31 | a.setKeepRunning (); | 31 | a.setKeepRunning (); |
32 | #else | 32 | #else |
33 | QApplication a( argc, argv ); | 33 | QApplication a( argc, argv ); |
34 | QApplication::setStyle( new QPlatinumStyle ()); | 34 | QApplication::setStyle( new QPlatinumStyle ()); |
35 | #ifdef _WIN32_ | 35 | #ifdef _WIN32_ |
36 | QString hdir ( getenv( "HOME") ); | 36 | QString hdir ( getenv( "HOME") ); |
37 | if ( hdir.isEmpty() ) { | 37 | if ( hdir.isEmpty() ) { |
38 | QString hd ("C:/" ); | 38 | QString hd ("C:/" ); |
39 | //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd ); | 39 | //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd ); |
40 | if ( QDir::homeDirPath().lower() == hd.lower() ) { | 40 | if ( QDir::homeDirPath().lower() == hd.lower() ) { |
41 | _putenv( "HOME=C:"); | 41 | _putenv( "HOME=C:"); |
42 | //QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) ); | 42 | //QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) ); |
43 | } | 43 | } |
44 | } else { | 44 | } else { |
45 | QDir app_dir; | 45 | QDir app_dir; |
46 | if ( !app_dir.exists(hdir) ) | 46 | if ( !app_dir.exists(hdir) ) |
47 | app_dir.mkdir (hdir); | 47 | app_dir.mkdir (hdir); |
48 | } | 48 | } |
49 | #endif | 49 | #endif |
50 | #endif | 50 | #endif |
51 | bool exitHelp = false; | 51 | bool exitHelp = false; |
52 | if ( argc > 1 ) { | 52 | if ( argc > 1 ) { |
53 | QString command = argv[1]; | 53 | QString command = argv[1]; |
54 | if ( command == "-help" ){ | 54 | if ( command == "-help" ){ |
55 | printf("KO/Pi command line commands:\n"); | 55 | printf("KO/Pi command line commands:\n"); |
56 | printf(" no command: Start KO/Pi in usual way\n"); | 56 | printf(" no command: Start KO/Pi in usual way\n"); |
57 | printf(" -help: This output\n"); | 57 | printf(" -help: This output\n"); |
58 | printf("Next Option: Open or Show after start:\n"); | 58 | printf("Next Option: Open or Show after start:\n"); |
59 | printf(" -newTodo: New Todo dialog\n"); | 59 | printf(" -newTodo: New Todo dialog\n"); |
60 | printf(" -newEvent: New Event dialog\n"); | 60 | printf(" -newEvent: New Event dialog\n"); |
61 | printf(" -showList: List view\n"); | 61 | printf(" -showList: List view\n"); |
62 | printf(" -showDay: Day view\n"); | 62 | printf(" -showDay: Day view\n"); |
63 | printf(" -showWWeek: Work Week view\n"); | 63 | printf(" -showWWeek: Work Week view\n"); |
64 | printf(" -showWeek: Week view\n"); | 64 | printf(" -showWeek: Week view\n"); |
65 | printf(" -showTodo: Todo view\n"); | 65 | printf(" -showTodo: Todo view\n"); |
66 | printf(" -showJournal: Journal view\n"); | 66 | printf(" -showJournal: Journal view\n"); |
67 | printf(" -showKO: Next Days view\n"); | 67 | printf(" -showKO: Next Days view\n"); |
68 | printf(" -showWNext: What's Next view\n"); | 68 | printf(" -showWNext: What's Next view\n"); |
69 | printf(" -showNextXView: Next X View\n"); | 69 | printf(" -showNextXView: Next X View\n"); |
70 | printf(" -new[Y] and -show[X] may be used togehther\n"); | 70 | printf(" -new[Y] and -show[X] may be used togehther\n"); |
71 | printf(" KO/Pi is exiting now. Bye!\n"); | 71 | printf(" KO/Pi is exiting now. Bye!\n"); |
72 | exitHelp = true; | 72 | exitHelp = true; |
73 | } | 73 | } |
74 | } | 74 | } |
75 | if ( ! exitHelp ) { | 75 | if ( ! exitHelp ) { |
76 | KGlobal::setAppName( "korganizer" ); | 76 | KGlobal::setAppName( "korganizer" ); |
77 | QString fileName ; | 77 | QString fileName ; |
78 | #ifndef DESKTOP_VERSION | 78 | #ifndef DESKTOP_VERSION |
79 | fileName = getenv("QPEDIR"); | 79 | fileName = getenv("QPEDIR"); |
80 | KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/"); | 80 | KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/"); |
81 | #else | 81 | #else |
82 | fileName = qApp->applicationDirPath () + "/kdepim/korganizer/"; | 82 | fileName = qApp->applicationDirPath () + "/kdepim/korganizer/"; |
83 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); | 83 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); |
84 | #endif | 84 | #endif |
85 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer"))); | 85 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer"))); |
86 | 86 | ||
87 | QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont ); | 87 | QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont ); |
88 | KPimGlobalPrefs::instance()->setGlobalConfig(); | 88 | KPimGlobalPrefs::instance()->setGlobalConfig(); |
89 | MainWindow m; | 89 | MainWindow m; |
90 | #ifndef DESKTOP_VERSION | 90 | #ifndef DESKTOP_VERSION |
91 | 91 | ||
92 | QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); | 92 | QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(receiveStart( const QCString&, const QByteArray& ))); |
93 | a.showMainWidget(&m ); | 93 | a.showMainWidget(&m ); |
94 | #else | 94 | #else |
95 | a.setMainWidget(&m ); | 95 | a.setMainWidget(&m ); |
96 | m.show(); | 96 | m.show(); |
97 | //m.resize( 800, 600 ); | 97 | //m.resize( 800, 600 ); |
98 | QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); | 98 | //QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); |
99 | #endif | 99 | #endif |
100 | if ( argc > 1 ) { | 100 | if ( argc > 1 ) { |
101 | QCString command = argv[1]; | 101 | QCString command = argv[1]; |
102 | if ( argc > 2 ) | 102 | if ( argc > 2 ) |
103 | command += argv[2]; | 103 | command += argv[2]; |
104 | qApp->processEvents(); | 104 | qApp->processEvents(); |
105 | m.recieve(command, QByteArray() ); | 105 | m.recieve(command, QByteArray() ); |
106 | 106 | ||
107 | } | 107 | } |
108 | 108 | ||
109 | a.exec(); | 109 | a.exec(); |
110 | dumpMissing(); | 110 | dumpMissing(); |
111 | 111 | ||
112 | KPimGlobalPrefs::instance()->writeConfig(); | 112 | KPimGlobalPrefs::instance()->writeConfig(); |
113 | } | 113 | } |
114 | qDebug("KO: Bye! "); | 114 | qDebug("KO: Bye! "); |
115 | } | 115 | } |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 9ae393d..8c72d89 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -253,387 +253,414 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) : | |||
253 | viewToolBar = iconToolBar ; | 253 | viewToolBar = iconToolBar ; |
254 | navigatorToolBar = iconToolBar ; | 254 | navigatorToolBar = iconToolBar ; |
255 | } else { | 255 | } else { |
256 | #ifndef DESKTOP_VERSION | 256 | #ifndef DESKTOP_VERSION |
257 | setToolBarsMovable( false ); | 257 | setToolBarsMovable( false ); |
258 | #endif | 258 | #endif |
259 | if ( p->mToolBarHorV ) { | 259 | if ( p->mToolBarHorV ) { |
260 | if ( p->mToolBarUpV ) | 260 | if ( p->mToolBarUpV ) |
261 | tbd = Bottom; | 261 | tbd = Bottom; |
262 | else | 262 | else |
263 | tbd = Top; | 263 | tbd = Top; |
264 | } | 264 | } |
265 | else { | 265 | else { |
266 | if ( p->mToolBarUpV ) | 266 | if ( p->mToolBarUpV ) |
267 | tbd = Right; | 267 | tbd = Right; |
268 | else | 268 | else |
269 | tbd = Left; | 269 | tbd = Left; |
270 | } | 270 | } |
271 | viewToolBar = new QPEToolBar( this ); | 271 | viewToolBar = new QPEToolBar( this ); |
272 | addToolBar (viewToolBar , tbd ); | 272 | addToolBar (viewToolBar , tbd ); |
273 | if ( p->mToolBarHorN ) { | 273 | if ( p->mToolBarHorN ) { |
274 | if ( p->mToolBarUpN ) | 274 | if ( p->mToolBarUpN ) |
275 | tbd = Bottom; | 275 | tbd = Bottom; |
276 | else | 276 | else |
277 | tbd = Top; | 277 | tbd = Top; |
278 | } | 278 | } |
279 | else { | 279 | else { |
280 | if ( p->mToolBarUpN ) | 280 | if ( p->mToolBarUpN ) |
281 | tbd = Right; | 281 | tbd = Right; |
282 | else | 282 | else |
283 | tbd = Left; | 283 | tbd = Left; |
284 | } | 284 | } |
285 | navigatorToolBar = new QPEToolBar( this ); | 285 | navigatorToolBar = new QPEToolBar( this ); |
286 | addToolBar (navigatorToolBar , tbd ); | 286 | addToolBar (navigatorToolBar , tbd ); |
287 | } | 287 | } |
288 | 288 | ||
289 | 289 | ||
290 | 290 | ||
291 | mCalendarModifiedFlag = false; | 291 | mCalendarModifiedFlag = false; |
292 | QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); | 292 | QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); |
293 | splash->setAlignment ( AlignCenter ); | 293 | splash->setAlignment ( AlignCenter ); |
294 | setCentralWidget( splash ); | 294 | setCentralWidget( splash ); |
295 | #ifndef DESKTOP_VERSION | 295 | #ifndef DESKTOP_VERSION |
296 | showMaximized(); | 296 | showMaximized(); |
297 | #endif | 297 | #endif |
298 | 298 | ||
299 | //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); | 299 | //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); |
300 | setDefaultPreferences(); | 300 | setDefaultPreferences(); |
301 | mCalendar = new CalendarLocal(); | 301 | mCalendar = new CalendarLocal(); |
302 | mView = new CalendarView( mCalendar, this,"mCalendar " ); | 302 | mView = new CalendarView( mCalendar, this,"mCalendar " ); |
303 | mView->hide(); | 303 | mView->hide(); |
304 | //mView->resize(splash->size() ); | 304 | //mView->resize(splash->size() ); |
305 | initActions(); | 305 | initActions(); |
306 | mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); | 306 | mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); |
307 | mSyncManager->setBlockSave(false); | 307 | mSyncManager->setBlockSave(false); |
308 | mView->setSyncManager(mSyncManager); | 308 | mView->setSyncManager(mSyncManager); |
309 | #ifndef DESKTOP_VERSION | 309 | #ifndef DESKTOP_VERSION |
310 | iconToolBar->show(); | 310 | iconToolBar->show(); |
311 | qApp->processEvents(); | 311 | qApp->processEvents(); |
312 | #endif | 312 | #endif |
313 | //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); | 313 | //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); |
314 | int vh = height() ; | 314 | int vh = height() ; |
315 | int vw = width(); | 315 | int vw = width(); |
316 | //qDebug("Toolbar hei %d ",iconToolBar->height() ); | 316 | //qDebug("Toolbar hei %d ",iconToolBar->height() ); |
317 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { | 317 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { |
318 | vh -= iconToolBar->height(); | 318 | vh -= iconToolBar->height(); |
319 | } else { | 319 | } else { |
320 | vw -= iconToolBar->height(); | 320 | vw -= iconToolBar->height(); |
321 | } | 321 | } |
322 | //mView->setMaximumSize( splash->size() ); | 322 | //mView->setMaximumSize( splash->size() ); |
323 | //mView->resize( splash->size() ); | 323 | //mView->resize( splash->size() ); |
324 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 324 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
325 | mView->readSettings(); | 325 | mView->readSettings(); |
326 | bool newFile = false; | 326 | bool newFile = false; |
327 | if( !QFile::exists( defaultFileName() ) ) { | 327 | if( !QFile::exists( defaultFileName() ) ) { |
328 | QFileInfo finfo ( defaultFileName() ); | 328 | QFileInfo finfo ( defaultFileName() ); |
329 | QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); | 329 | QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); |
330 | QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n"; | 330 | QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n"; |
331 | finfo.setFile( oldFile ); | 331 | finfo.setFile( oldFile ); |
332 | if (finfo.exists() ) { | 332 | if (finfo.exists() ) { |
333 | KMessageBox::information( this, message); | 333 | KMessageBox::information( this, message); |
334 | mView->openCalendar( oldFile ); | 334 | mView->openCalendar( oldFile ); |
335 | qApp->processEvents(); | 335 | qApp->processEvents(); |
336 | } else { | 336 | } else { |
337 | oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); | 337 | oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); |
338 | finfo.setFile( oldFile ); | 338 | finfo.setFile( oldFile ); |
339 | if (finfo.exists() ) { | 339 | if (finfo.exists() ) { |
340 | KMessageBox::information( this, message); | 340 | KMessageBox::information( this, message); |
341 | mView->openCalendar( oldFile ); | 341 | mView->openCalendar( oldFile ); |
342 | qApp->processEvents(); | 342 | qApp->processEvents(); |
343 | } | 343 | } |
344 | } | 344 | } |
345 | mView->saveCalendar( defaultFileName() ); | 345 | mView->saveCalendar( defaultFileName() ); |
346 | newFile = true; | 346 | newFile = true; |
347 | } | 347 | } |
348 | 348 | ||
349 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | 349 | //QTime neededSaveTime = QDateTime::currentDateTime().time(); |
350 | mView->loadCalendars(); | 350 | //mView->loadCalendars(); |
351 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | 351 | //int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |
352 | qDebug("KO: Calendar loading time: %d ms",msNeeded ); | 352 | //qDebug("KO: Calendar loading time: %d ms",msNeeded ); |
353 | 353 | ||
354 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { | 354 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { |
355 | KOPrefs::instance()->setAllDefaults(); | 355 | KOPrefs::instance()->setAllDefaults(); |
356 | } | 356 | } |
357 | processIncidenceSelection( 0 ); | ||
358 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), | ||
359 | SLOT( processIncidenceSelection( Incidence * ) ) ); | ||
360 | connect( mView, SIGNAL( modifiedChanged( bool ) ), | ||
361 | SLOT( slotModifiedChanged( bool ) ) ); | ||
362 | 357 | ||
363 | 358 | ||
364 | connect( mView, SIGNAL( tempDisableBR(bool) ), | 359 | connect( mView, SIGNAL( tempDisableBR(bool) ), |
365 | SLOT( disableBR(bool) ) ); | 360 | SLOT( disableBR(bool) ) ); |
366 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); | 361 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); |
367 | mView->setModified( false ); | ||
368 | mBlockAtStartup = false; | ||
369 | mView->setModified( false ); | ||
370 | setCentralWidget( mView ); | 362 | setCentralWidget( mView ); |
371 | globalFlagBlockStartup = 0; | 363 | globalFlagBlockStartup = 0; |
372 | mView->show(); | 364 | mView->show(); |
373 | delete splash; | 365 | delete splash; |
374 | if ( newFile ) | 366 | if ( newFile ) |
375 | mView->updateConfig(); | 367 | mView->updateConfig(); |
376 | // qApp->processEvents(); | 368 | // qApp->processEvents(); |
377 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 369 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
378 | //fillSyncMenu(); | 370 | //fillSyncMenu(); |
379 | 371 | ||
380 | 372 | ||
381 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); | 373 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); |
382 | connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); | ||
383 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); | 374 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); |
384 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); | 375 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); |
385 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); | 376 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); |
386 | mSyncManager->setDefaultFileName( sentSyncFile()); | 377 | mSyncManager->setDefaultFileName( sentSyncFile()); |
387 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); | 378 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); |
388 | mSyncManager->fillSyncMenu(); | 379 | mSyncManager->fillSyncMenu(); |
389 | 380 | ||
390 | 381 | ||
391 | 382 | ||
392 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); | 383 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); |
393 | if ( showWarning ) { | 384 | if ( showWarning ) { |
394 | KMessageBox::information( this, | 385 | KMessageBox::information( this, |
395 | "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); | 386 | "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); |
396 | qApp->processEvents(); | 387 | qApp->processEvents(); |
397 | mView->dialogManager()->showSyncOptions(); | 388 | mView->dialogManager()->showSyncOptions(); |
398 | } | 389 | } |
399 | 390 | ||
400 | //US listen for result adressed from Ka/Pi | 391 | //US listen for result adressed from Ka/Pi |
401 | #ifndef DESKTOP_VERSION | 392 | |
402 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | ||
403 | #endif | ||
404 | #ifndef DESKTOP_VERSION | 393 | #ifndef DESKTOP_VERSION |
405 | infrared = 0; | 394 | infrared = 0; |
406 | #endif | 395 | #endif |
407 | updateFilterToolbar(); | 396 | updateFilterToolbar(); |
408 | updateWeek( mView->startDate() ); | 397 | updateWeek( mView->startDate() ); |
409 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), | 398 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), |
410 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); | 399 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); |
411 | mBRdisabled = false; | 400 | mBRdisabled = false; |
412 | //toggleBeamReceive(); | 401 | //toggleBeamReceive(); |
413 | 402 | ||
414 | QTimer::singleShot( 1000, mView, SLOT ( checkFiles() )); | 403 | setCaption(i18n("Loading calendar files ... please wait" )); |
404 | QTimer::singleShot( 10, this, SLOT ( loadDataAfterStart() )); | ||
415 | } | 405 | } |
416 | MainWindow::~MainWindow() | 406 | MainWindow::~MainWindow() |
417 | { | 407 | { |
418 | //qDebug("MainWindow::~MainWindow() "); | 408 | //qDebug("MainWindow::~MainWindow() "); |
419 | //save toolbar location | 409 | //save toolbar location |
420 | delete mCalendar; | 410 | delete mCalendar; |
421 | delete mSyncManager; | 411 | delete mSyncManager; |
422 | #ifndef DESKTOP_VERSION | 412 | #ifndef DESKTOP_VERSION |
423 | if ( infrared ) | 413 | if ( infrared ) |
424 | delete infrared; | 414 | delete infrared; |
425 | #endif | 415 | #endif |
426 | 416 | ||
427 | 417 | ||
428 | } | 418 | } |
419 | |||
420 | void MainWindow::loadDataAfterStart() | ||
421 | { | ||
422 | |||
423 | qDebug("KO: Start loading files..." ); | ||
424 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | ||
425 | mView->loadCalendars(); | ||
426 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | ||
427 | qDebug("KO: Calendar loading time: %d ms",msNeeded ); | ||
428 | //QTimer::singleShot( 1000, mView, SLOT ( checkFiles() )); | ||
429 | mView->setModified( false ); | ||
430 | mBlockAtStartup = false; | ||
431 | mView->setModified( false ); | ||
432 | connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); | ||
433 | processIncidenceSelection( 0 ); | ||
434 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), | ||
435 | SLOT( processIncidenceSelection( Incidence * ) ) ); | ||
436 | connect( mView, SIGNAL( modifiedChanged( bool ) ), | ||
437 | SLOT( slotModifiedChanged( bool ) ) ); | ||
438 | |||
439 | #ifndef DESKTOP_VERSION | ||
440 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | ||
441 | connect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(recieve( const QCString&, const QByteArray& ))); | ||
442 | disconnect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(receiveStart( const QCString&, const QByteArray& ))); | ||
443 | if ( !mCStringMess.isEmpty() ) | ||
444 | recieve( mCStringMess, mByteData ); | ||
445 | #endif | ||
446 | |||
447 | |||
448 | QTimer::singleShot( 1000, mView, SLOT ( checkFiles() )); | ||
449 | } | ||
450 | |||
429 | void MainWindow::slotResetFocus() | 451 | void MainWindow::slotResetFocus() |
430 | { | 452 | { |
431 | //qDebug(" CalendarView::slotResetFocus() %x %x %x %x", qApp->focusWidget(), menuBar1, mView,iconToolBar); | 453 | //qDebug(" CalendarView::slotResetFocus() %x %x %x %x", qApp->focusWidget(), menuBar1, mView,iconToolBar); |
432 | mFocusLoop = 3; | 454 | mFocusLoop = 3; |
433 | QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() )); | 455 | QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() )); |
434 | } | 456 | } |
435 | void MainWindow::slotResetFocusLoop() | 457 | void MainWindow::slotResetFocusLoop() |
436 | { | 458 | { |
437 | --mFocusLoop; | 459 | --mFocusLoop; |
438 | QWidget* fw = mView->viewManager()->currentView(); | 460 | QWidget* fw = mView->viewManager()->currentView(); |
439 | if ( fw ) { | 461 | if ( fw ) { |
440 | //qDebug("loop "); | 462 | //qDebug("loop "); |
441 | fw->setFocus(); | 463 | fw->setFocus(); |
442 | if ( qApp->focusWidget() != fw && mFocusLoop > 0 ) | 464 | if ( qApp->focusWidget() != fw && mFocusLoop > 0 ) |
443 | QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() )); | 465 | QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() )); |
444 | } | 466 | } |
445 | 467 | ||
446 | } | 468 | } |
447 | void MainWindow::disableBR(bool b) | 469 | void MainWindow::disableBR(bool b) |
448 | { | 470 | { |
449 | #ifndef DESKTOP_VERSION | 471 | #ifndef DESKTOP_VERSION |
450 | if ( b ) { | 472 | if ( b ) { |
451 | if ( infrared ) { | 473 | if ( infrared ) { |
452 | toggleBeamReceive(); | 474 | toggleBeamReceive(); |
453 | mBRdisabled = true; | 475 | mBRdisabled = true; |
454 | } | 476 | } |
455 | mBRdisabled = true; | 477 | mBRdisabled = true; |
456 | } else { | 478 | } else { |
457 | if ( mBRdisabled ) { | 479 | if ( mBRdisabled ) { |
458 | mBRdisabled = false; | 480 | mBRdisabled = false; |
459 | //makes no sense,because other cal ap is probably running | 481 | //makes no sense,because other cal ap is probably running |
460 | // toggleBeamReceive(); | 482 | // toggleBeamReceive(); |
461 | } | 483 | } |
462 | } | 484 | } |
463 | #endif | 485 | #endif |
464 | 486 | ||
465 | } | 487 | } |
466 | bool MainWindow::beamReceiveEnabled() | 488 | bool MainWindow::beamReceiveEnabled() |
467 | { | 489 | { |
468 | #ifndef DESKTOP_VERSION | 490 | #ifndef DESKTOP_VERSION |
469 | return ( infrared != 0 ); | 491 | return ( infrared != 0 ); |
470 | #endif | 492 | #endif |
471 | return false; | 493 | return false; |
472 | } | 494 | } |
473 | 495 | ||
474 | void MainWindow::toggleBeamReceive() | 496 | void MainWindow::toggleBeamReceive() |
475 | { | 497 | { |
476 | if ( mBRdisabled ) | 498 | if ( mBRdisabled ) |
477 | return; | 499 | return; |
478 | #ifndef DESKTOP_VERSION | 500 | #ifndef DESKTOP_VERSION |
479 | if ( infrared ) { | 501 | if ( infrared ) { |
480 | qDebug("KO: Disable BeamReceive "); | 502 | qDebug("KO: Disable BeamReceive "); |
481 | delete infrared; | 503 | delete infrared; |
482 | infrared = 0; | 504 | infrared = 0; |
483 | brAction->setOn(false); | 505 | brAction->setOn(false); |
484 | return; | 506 | return; |
485 | } | 507 | } |
486 | qDebug("KO: Enable BeamReceive "); | 508 | qDebug("KO: Enable BeamReceive "); |
487 | brAction->setOn(true); | 509 | brAction->setOn(true); |
488 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; | 510 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; |
489 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); | 511 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); |
490 | #endif | 512 | #endif |
491 | } | 513 | } |
492 | void MainWindow::showMaximized () | 514 | void MainWindow::showMaximized () |
493 | { | 515 | { |
494 | #ifndef DESKTOP_VERSION | 516 | #ifndef DESKTOP_VERSION |
495 | if ( ! globalFlagBlockStartup ) | 517 | if ( ! globalFlagBlockStartup ) |
496 | if ( mClosed ) | 518 | if ( mClosed ) |
497 | mView->goToday(); | 519 | mView->goToday(); |
498 | #endif | 520 | #endif |
499 | QWidget::showMaximized () ; | 521 | QWidget::showMaximized () ; |
500 | mClosed = false; | 522 | mClosed = false; |
501 | } | 523 | } |
502 | void MainWindow::closeEvent( QCloseEvent* ce ) | 524 | void MainWindow::closeEvent( QCloseEvent* ce ) |
503 | { | 525 | { |
504 | 526 | ||
505 | 527 | ||
506 | 528 | ||
507 | if ( ! KOPrefs::instance()->mAskForQuit ) { | 529 | if ( ! KOPrefs::instance()->mAskForQuit ) { |
508 | saveOnClose(); | 530 | saveOnClose(); |
509 | if ( mCalendarModifiedFlag ) { | 531 | if ( mCalendarModifiedFlag ) { |
510 | ce->ignore(); | 532 | ce->ignore(); |
511 | return; | 533 | return; |
512 | } | 534 | } |
513 | mClosed = true; | 535 | mClosed = true; |
514 | ce->accept(); | 536 | ce->accept(); |
515 | return; | 537 | return; |
516 | 538 | ||
517 | } | 539 | } |
518 | 540 | ||
519 | switch( QMessageBox::information( this, "KO/Pi", | 541 | switch( QMessageBox::information( this, "KO/Pi", |
520 | i18n("Do you really want\nto close KO/Pi?"), | 542 | i18n("Do you really want\nto close KO/Pi?"), |
521 | i18n("Close"), i18n("No"), | 543 | i18n("Close"), i18n("No"), |
522 | 0, 0 ) ) { | 544 | 0, 0 ) ) { |
523 | case 0: | 545 | case 0: |
524 | saveOnClose(); | 546 | saveOnClose(); |
525 | if ( mCalendarModifiedFlag ) { | 547 | if ( mCalendarModifiedFlag ) { |
526 | ce->ignore(); | 548 | ce->ignore(); |
527 | return; | 549 | return; |
528 | } | 550 | } |
529 | mClosed = true; | 551 | mClosed = true; |
530 | ce->accept(); | 552 | ce->accept(); |
531 | break; | 553 | break; |
532 | case 1: | 554 | case 1: |
533 | ce->ignore(); | 555 | ce->ignore(); |
534 | break; | 556 | break; |
535 | case 2: | 557 | case 2: |
536 | 558 | ||
537 | default: | 559 | default: |
538 | break; | 560 | break; |
539 | } | 561 | } |
540 | 562 | ||
541 | 563 | ||
542 | } | 564 | } |
543 | 565 | void MainWindow::receiveStart( const QCString& cmsg, const QByteArray& data ) | |
566 | { | ||
567 | qDebug("KO: QCOP start message received: %s ", cmsg.data() ); | ||
568 | mCStringMess = cmsg; | ||
569 | mByteData = data; | ||
570 | } | ||
544 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | 571 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) |
545 | { | 572 | { |
546 | QDataStream stream( data, IO_ReadOnly ); | 573 | QDataStream stream( data, IO_ReadOnly ); |
547 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); | 574 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); |
548 | //QString datamess; | 575 | //QString datamess; |
549 | //qDebug("message "); | 576 | //qDebug("message "); |
550 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); | 577 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); |
551 | 578 | ||
552 | if ( cmsg == "setDocument(QString)" ) { | 579 | if ( cmsg == "setDocument(QString)" ) { |
553 | QDataStream stream( data, IO_ReadOnly ); | 580 | QDataStream stream( data, IO_ReadOnly ); |
554 | QString fileName; | 581 | QString fileName; |
555 | stream >> fileName; | 582 | stream >> fileName; |
556 | //qDebug("filename %s ", fileName.latin1()); | 583 | //qDebug("filename %s ", fileName.latin1()); |
557 | showMaximized(); | 584 | showMaximized(); |
558 | raise(); | 585 | raise(); |
559 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; | 586 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; |
560 | mSyncManager->slotSyncMenu( 1002 ); | 587 | mSyncManager->slotSyncMenu( 1002 ); |
561 | return; | 588 | return; |
562 | } | 589 | } |
563 | 590 | ||
564 | if ( cmsg == "-writeFile" ) { | 591 | if ( cmsg == "-writeFile" ) { |
565 | // I made from the "-writeFile" an "-writeAlarm" | 592 | // I made from the "-writeFile" an "-writeAlarm" |
566 | mView->viewManager()->showWhatsNextView(); | 593 | mView->viewManager()->showWhatsNextView(); |
567 | mCalendar->checkAlarmForIncidence( 0, true); | 594 | mCalendar->checkAlarmForIncidence( 0, true); |
568 | showMaximized(); | 595 | showMaximized(); |
569 | raise(); | 596 | raise(); |
570 | return; | 597 | return; |
571 | 598 | ||
572 | } | 599 | } |
573 | if ( cmsg == "-writeFileSilent" ) { | 600 | if ( cmsg == "-writeFileSilent" ) { |
574 | // I made from the "-writeFile" an "-writeAlarm" | 601 | // I made from the "-writeFile" an "-writeAlarm" |
575 | // mView->viewManager()->showWhatsNextView(); | 602 | // mView->viewManager()->showWhatsNextView(); |
576 | mCalendar->checkAlarmForIncidence( 0, true); | 603 | mCalendar->checkAlarmForIncidence( 0, true); |
577 | //showMaximized(); | 604 | //showMaximized(); |
578 | //raise(); | 605 | //raise(); |
579 | hide(); | 606 | hide(); |
580 | return; | 607 | return; |
581 | } | 608 | } |
582 | if ( cmsg == "-newCountdown" ) { | 609 | if ( cmsg == "-newCountdown" ) { |
583 | qDebug("newCountdown "); | 610 | qDebug("newCountdown "); |
584 | 611 | ||
585 | } | 612 | } |
586 | QString msg ; | 613 | QString msg ; |
587 | QString allmsg = cmsg; | 614 | QString allmsg = cmsg; |
588 | while ( allmsg.length() > 0 ) { | 615 | while ( allmsg.length() > 0 ) { |
589 | int nextC = allmsg.find( "-", 1 ); | 616 | int nextC = allmsg.find( "-", 1 ); |
590 | if ( nextC == -1 ) { | 617 | if ( nextC == -1 ) { |
591 | msg = allmsg; | 618 | msg = allmsg; |
592 | allmsg = ""; | 619 | allmsg = ""; |
593 | } else{ | 620 | } else{ |
594 | msg = allmsg.left( nextC ); | 621 | msg = allmsg.left( nextC ); |
595 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); | 622 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); |
596 | } | 623 | } |
597 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); | 624 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); |
598 | if ( msg == "-newEvent" ) { | 625 | if ( msg == "-newEvent" ) { |
599 | QTimer::singleShot( 0, mView, SLOT ( newEvent())); | 626 | QTimer::singleShot( 0, mView, SLOT ( newEvent())); |
600 | } | 627 | } |
601 | if ( msg == "-newTodo" ) { | 628 | if ( msg == "-newTodo" ) { |
602 | QTimer::singleShot( 0, mView, SLOT ( newTodo())); | 629 | QTimer::singleShot( 0, mView, SLOT ( newTodo())); |
603 | } | 630 | } |
604 | if ( msg == "-showWN" ) { | 631 | if ( msg == "-showWN" ) { |
605 | mView->viewManager()->showWhatsNextView(); | 632 | mView->viewManager()->showWhatsNextView(); |
606 | } | 633 | } |
607 | if ( msg == "-showTodo" ) { | 634 | if ( msg == "-showTodo" ) { |
608 | mView->viewManager()->showTodoView(); | 635 | mView->viewManager()->showTodoView(); |
609 | } | 636 | } |
610 | if ( msg == "-showList" ) { | 637 | if ( msg == "-showList" ) { |
611 | mView->viewManager()->showListView(); | 638 | mView->viewManager()->showListView(); |
612 | } | 639 | } |
613 | else if ( msg == "-showDay" ) { | 640 | else if ( msg == "-showDay" ) { |
614 | mView->viewManager()->showDayView(); | 641 | mView->viewManager()->showDayView(); |
615 | } | 642 | } |
616 | else if ( msg == "-showWWeek" ) { | 643 | else if ( msg == "-showWWeek" ) { |
617 | mView->viewManager()->showWorkWeekView(); | 644 | mView->viewManager()->showWorkWeekView(); |
618 | } | 645 | } |
619 | else if ( msg == "-ringSync" ) { | 646 | else if ( msg == "-ringSync" ) { |
620 | QTimer::singleShot( 0, this, SLOT (startMultiSync())); | 647 | QTimer::singleShot( 0, this, SLOT (startMultiSync())); |
621 | } | 648 | } |
622 | else if ( msg == "-showWeek" ) { | 649 | else if ( msg == "-showWeek" ) { |
623 | mView->viewManager()->showWeekView(); | 650 | mView->viewManager()->showWeekView(); |
624 | } | 651 | } |
625 | else if ( msg == "-showTodo" ) { | 652 | else if ( msg == "-showTodo" ) { |
626 | mView->viewManager()->showTodoView(); | 653 | mView->viewManager()->showTodoView(); |
627 | } | 654 | } |
628 | else if ( msg == "-showJournal" ) { | 655 | else if ( msg == "-showJournal" ) { |
629 | mView->dateNavigator()->selectDates( 1 ); | 656 | mView->dateNavigator()->selectDates( 1 ); |
630 | mView->dateNavigator()->selectToday(); | 657 | mView->dateNavigator()->selectToday(); |
631 | mView->viewManager()->showJournalView(); | 658 | mView->viewManager()->showJournalView(); |
632 | } | 659 | } |
633 | else if ( msg == "-showKO" ) { | 660 | else if ( msg == "-showKO" ) { |
634 | mView->viewManager()->showNextXView(); | 661 | mView->viewManager()->showNextXView(); |
635 | } | 662 | } |
636 | else if ( msg == "-showWNext" ) { | 663 | else if ( msg == "-showWNext" ) { |
637 | mView->viewManager()->showWhatsNextView(); | 664 | mView->viewManager()->showWhatsNextView(); |
638 | } | 665 | } |
639 | else if ( msg == "nextView()" ) { | 666 | else if ( msg == "nextView()" ) { |
@@ -2423,192 +2450,193 @@ void MainWindow::showConfigureAgenda( ) | |||
2423 | } | 2450 | } |
2424 | configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); | 2451 | configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); |
2425 | } | 2452 | } |
2426 | void MainWindow::configureAgenda( int item ) | 2453 | void MainWindow::configureAgenda( int item ) |
2427 | { | 2454 | { |
2428 | if ( KOPrefs::instance()->mHourSize == item ) | 2455 | if ( KOPrefs::instance()->mHourSize == item ) |
2429 | return; | 2456 | return; |
2430 | KOPrefs::instance()->mHourSize=item; | 2457 | KOPrefs::instance()->mHourSize=item; |
2431 | mView->viewManager()->agendaView()->updateConfig(); | 2458 | mView->viewManager()->agendaView()->updateConfig(); |
2432 | } | 2459 | } |
2433 | 2460 | ||
2434 | void MainWindow::saveCalendar() | 2461 | void MainWindow::saveCalendar() |
2435 | { | 2462 | { |
2436 | QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; | 2463 | QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; |
2437 | if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) | 2464 | if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) |
2438 | bupDir = KGlobalSettings::backupDataDir(); | 2465 | bupDir = KGlobalSettings::backupDataDir(); |
2439 | bupDir = KGlobal::formatMessage ( bupDir, 0 ); | 2466 | bupDir = KGlobal::formatMessage ( bupDir, 0 ); |
2440 | QString bupHint; | 2467 | QString bupHint; |
2441 | if ( !KPimGlobalPrefs::instance()->mBackupEnabled ) | 2468 | if ( !KPimGlobalPrefs::instance()->mBackupEnabled ) |
2442 | bupHint = i18n("(Hint: You can enable automatic backup in the global settings!)"); | 2469 | bupHint = i18n("(Hint: You can enable automatic backup in the global settings!)"); |
2443 | if ( KMessageBox::warningContinueCancel( this, i18n("This will <b>backup all calendar files</b> to the directory %1 %2").arg(bupDir).arg(bupHint),i18n("Information") ) != KMessageBox::Continue ) return; | 2470 | if ( KMessageBox::warningContinueCancel( this, i18n("This will <b>backup all calendar files</b> to the directory %1 %2").arg(bupDir).arg(bupHint),i18n("Information") ) != KMessageBox::Continue ) return; |
2444 | bool enabled = KPimGlobalPrefs::instance()->mBackupEnabled; | 2471 | bool enabled = KPimGlobalPrefs::instance()->mBackupEnabled; |
2445 | KPimGlobalPrefs::instance()->mBackupEnabled = false; | 2472 | KPimGlobalPrefs::instance()->mBackupEnabled = false; |
2446 | save(); | 2473 | save(); |
2447 | KPimGlobalPrefs::instance()->mBackupEnabled = enabled; | 2474 | KPimGlobalPrefs::instance()->mBackupEnabled = enabled; |
2448 | backupAllFiles(); | 2475 | backupAllFiles(); |
2449 | } | 2476 | } |
2450 | void MainWindow::loadCalendar() | 2477 | void MainWindow::loadCalendar() |
2451 | { | 2478 | { |
2452 | 2479 | ||
2453 | 2480 | ||
2454 | #if 0 | 2481 | #if 0 |
2455 | QString fn = KOPrefs::instance()->mLastLoadFile; | 2482 | QString fn = KOPrefs::instance()->mLastLoadFile; |
2456 | fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); | 2483 | fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); |
2457 | 2484 | ||
2458 | if ( fn == "" ) | 2485 | if ( fn == "" ) |
2459 | return; | 2486 | return; |
2460 | QFileInfo info; | 2487 | QFileInfo info; |
2461 | info.setFile( fn ); | 2488 | info.setFile( fn ); |
2462 | QString mess; | 2489 | QString mess; |
2463 | bool loadbup = true; | 2490 | bool loadbup = true; |
2464 | if ( info. exists() ) { | 2491 | if ( info. exists() ) { |
2465 | mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); | 2492 | mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); |
2466 | int result = QMessageBox::warning( this, "KO/Pi: Warning!", | 2493 | int result = QMessageBox::warning( this, "KO/Pi: Warning!", |
2467 | mess, | 2494 | mess, |
2468 | i18n("Load!"), i18n("Cancel"), 0, | 2495 | i18n("Load!"), i18n("Cancel"), 0, |
2469 | 0, 1 ); | 2496 | 0, 1 ); |
2470 | if ( result != 0 ) { | 2497 | if ( result != 0 ) { |
2471 | loadbup = false; | 2498 | loadbup = false; |
2472 | } | 2499 | } |
2473 | } else { | 2500 | } else { |
2474 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 2501 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
2475 | i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, | 2502 | i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, |
2476 | 0, 1 ); | 2503 | 0, 1 ); |
2477 | 2504 | ||
2478 | return; | 2505 | return; |
2479 | } | 2506 | } |
2480 | if ( loadbup ) { | 2507 | if ( loadbup ) { |
2481 | mView->openCalendar( fn ); | 2508 | mView->openCalendar( fn ); |
2482 | KOPrefs::instance()->mLastLoadFile = fn; | 2509 | KOPrefs::instance()->mLastLoadFile = fn; |
2483 | mess = i18n("KO/Pi:Loaded %1").arg(fn) ; | 2510 | mess = i18n("KO/Pi:Loaded %1").arg(fn) ; |
2484 | setCaption(mess); | 2511 | setCaption(mess); |
2485 | } | 2512 | } |
2486 | #endif | 2513 | #endif |
2487 | 2514 | ||
2488 | } | 2515 | } |
2489 | void MainWindow::quickImportIcal() | 2516 | void MainWindow::quickImportIcal() |
2490 | { | 2517 | { |
2491 | importFile( KOPrefs::instance()->mLastImportFile, false ); | 2518 | importFile( KOPrefs::instance()->mLastImportFile, false ); |
2492 | } | 2519 | } |
2493 | void MainWindow::importFile( QString fn, bool quick ) | 2520 | void MainWindow::importFile( QString fn, bool quick ) |
2494 | { | 2521 | { |
2495 | QFileInfo info; | 2522 | QFileInfo info; |
2496 | info.setFile( fn ); | 2523 | info.setFile( fn ); |
2497 | QString mess; | 2524 | QString mess; |
2498 | if ( !info. exists() ) { | 2525 | if ( !info. exists() ) { |
2499 | mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); | 2526 | mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); |
2500 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 2527 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
2501 | mess ); | 2528 | mess ); |
2502 | return; | 2529 | return; |
2503 | } | 2530 | } |
2504 | int result = 0; | 2531 | int result = 0; |
2505 | if ( !quick ) { | 2532 | if ( !quick ) { |
2506 | mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); | 2533 | mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); |
2507 | result = QMessageBox::warning( this, "KO/Pi: Warning!", | 2534 | result = QMessageBox::warning( this, "KO/Pi: Warning!", |
2508 | mess, | 2535 | mess, |
2509 | "Import", "Cancel", 0, | 2536 | "Import", "Cancel", 0, |
2510 | 0, 1 ); | 2537 | 0, 1 ); |
2511 | } | 2538 | } |
2512 | if ( result == 0 ) { | 2539 | if ( result == 0 ) { |
2513 | if ( mView->openCalendar( fn, true )) { | 2540 | if ( mView->openCalendar( fn, true )) { |
2514 | KOPrefs::instance()->mLastImportFile = fn; | 2541 | KOPrefs::instance()->mLastImportFile = fn; |
2515 | setCaption(i18n("Imported file successfully")); | 2542 | setCaption(i18n("Imported file successfully")); |
2516 | } else { | 2543 | } else { |
2517 | setCaption(i18n("Error importing file")); | 2544 | setCaption(i18n("Error importing file")); |
2518 | } | 2545 | } |
2546 | mView->updateView(); | ||
2519 | } | 2547 | } |
2520 | } | 2548 | } |
2521 | 2549 | ||
2522 | void MainWindow::importIcal() | 2550 | void MainWindow::importIcal() |
2523 | { | 2551 | { |
2524 | 2552 | ||
2525 | QString fn =KOPrefs::instance()->mLastImportFile; | 2553 | QString fn =KOPrefs::instance()->mLastImportFile; |
2526 | 2554 | ||
2527 | fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); | 2555 | fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); |
2528 | if ( fn == "" ) | 2556 | if ( fn == "" ) |
2529 | return; | 2557 | return; |
2530 | importFile( fn, true ); | 2558 | importFile( fn, true ); |
2531 | 2559 | ||
2532 | } | 2560 | } |
2533 | 2561 | ||
2534 | void MainWindow::exportVCalendar() | 2562 | void MainWindow::exportVCalendar() |
2535 | { | 2563 | { |
2536 | QString fn = KOPrefs::instance()->mLastVcalFile; | 2564 | QString fn = KOPrefs::instance()->mLastVcalFile; |
2537 | fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); | 2565 | fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); |
2538 | if ( fn == "" ) | 2566 | if ( fn == "" ) |
2539 | return; | 2567 | return; |
2540 | QFileInfo info; | 2568 | QFileInfo info; |
2541 | info.setFile( fn ); | 2569 | info.setFile( fn ); |
2542 | QString mes; | 2570 | QString mes; |
2543 | bool createbup = true; | 2571 | bool createbup = true; |
2544 | if ( info. exists() ) { | 2572 | if ( info. exists() ) { |
2545 | mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); | 2573 | mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); |
2546 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, | 2574 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, |
2547 | i18n("Overwrite!"), i18n("Cancel"), 0, | 2575 | i18n("Overwrite!"), i18n("Cancel"), 0, |
2548 | 0, 1 ); | 2576 | 0, 1 ); |
2549 | if ( result != 0 ) { | 2577 | if ( result != 0 ) { |
2550 | createbup = false; | 2578 | createbup = false; |
2551 | } | 2579 | } |
2552 | } | 2580 | } |
2553 | if ( createbup ) { | 2581 | if ( createbup ) { |
2554 | if ( mView->exportVCalendar( fn ) ) { | 2582 | if ( mView->exportVCalendar( fn ) ) { |
2555 | KOPrefs::instance()->mLastVcalFile = fn; | 2583 | KOPrefs::instance()->mLastVcalFile = fn; |
2556 | if ( fn.length() > 20 ) | 2584 | if ( fn.length() > 20 ) |
2557 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; | 2585 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; |
2558 | else | 2586 | else |
2559 | mes = i18n("KO/Pi:Exported to %1").arg(fn ); | 2587 | mes = i18n("KO/Pi:Exported to %1").arg(fn ); |
2560 | setCaption(mes); | 2588 | setCaption(mes); |
2561 | } | 2589 | } |
2562 | } | 2590 | } |
2563 | 2591 | ||
2564 | } | 2592 | } |
2565 | QString MainWindow::sentSyncFile() | 2593 | QString MainWindow::sentSyncFile() |
2566 | { | 2594 | { |
2567 | #ifdef DESKTOP_VERSION | 2595 | #ifdef DESKTOP_VERSION |
2568 | return QDir::convertSeparators( locateLocal( "tmp", "copysynccal.ics" ) ); | 2596 | return QDir::convertSeparators( locateLocal( "tmp", "copysynccal.ics" ) ); |
2569 | #else | 2597 | #else |
2570 | return QString( "/tmp/copysynccal.ics" ); | 2598 | return QString( "/tmp/copysynccal.ics" ); |
2571 | #endif | 2599 | #endif |
2572 | } | 2600 | } |
2573 | 2601 | ||
2574 | void MainWindow::syncFileRequest() | 2602 | void MainWindow::syncFileRequest() |
2575 | { | 2603 | { |
2576 | while ( mSyncManager->blockSave() ) { | 2604 | while ( mSyncManager->blockSave() ) { |
2577 | qApp->processEvents(); | 2605 | qApp->processEvents(); |
2578 | } | 2606 | } |
2579 | mSyncManager->setBlockSave(true); | 2607 | mSyncManager->setBlockSave(true); |
2580 | 2608 | ||
2581 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { | 2609 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { |
2582 | mSyncManager->slotSyncMenu( 999 ); | 2610 | mSyncManager->slotSyncMenu( 999 ); |
2583 | } | 2611 | } |
2584 | 2612 | ||
2585 | setCaption(i18n("Saving Data to temp file ..." )); | 2613 | setCaption(i18n("Saving Data to temp file ..." )); |
2586 | mView->saveCalendar( sentSyncFile() ); | 2614 | mView->saveCalendar( sentSyncFile() ); |
2587 | setCaption(i18n("Data saved to temp file!" )); | 2615 | setCaption(i18n("Data saved to temp file!" )); |
2588 | mSyncManager->setBlockSave( false ); | 2616 | mSyncManager->setBlockSave( false ); |
2589 | 2617 | ||
2590 | } | 2618 | } |
2591 | void MainWindow::getFile( bool success ) | 2619 | void MainWindow::getFile( bool success ) |
2592 | { | 2620 | { |
2593 | if ( ! success ) { | 2621 | if ( ! success ) { |
2594 | setCaption( i18n("Error receiving file. Nothing changed!") ); | 2622 | setCaption( i18n("Error receiving file. Nothing changed!") ); |
2595 | return; | 2623 | return; |
2596 | } | 2624 | } |
2597 | mView->mergeFile( sentSyncFile() ); | 2625 | mView->mergeFile( sentSyncFile() ); |
2598 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { | 2626 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { |
2599 | mSyncManager->slotSyncMenu( 999 ); | 2627 | mSyncManager->slotSyncMenu( 999 ); |
2600 | } | 2628 | } |
2601 | setCaption( i18n("Pi-Sync successful!") ); | 2629 | setCaption( i18n("Pi-Sync successful!") ); |
2602 | } | 2630 | } |
2603 | void MainWindow::printListView() | 2631 | void MainWindow::printListView() |
2604 | { | 2632 | { |
2605 | 2633 | ||
2606 | QString message = i18n("You can make a printout of the <b>List View</b> and the list view in the <b>Search Dialog</b>! To do this, please go to the <b>List View/Search Dialog</b>. Right click on the list. Select in the popup menu the entry <b>Print complete list</b>. That prints the list as you see it. You can remove items from the list before printing without deleting the corresponding event/todo! Simply select all items you do not want to print out. Then right click on one of the items and choose <b>Hide selected items</b>. After that you can print the list without these items."); | 2634 | QString message = i18n("You can make a printout of the <b>List View</b> and the list view in the <b>Search Dialog</b>! To do this, please go to the <b>List View/Search Dialog</b>. Right click on the list. Select in the popup menu the entry <b>Print complete list</b>. That prints the list as you see it. You can remove items from the list before printing without deleting the corresponding event/todo! Simply select all items you do not want to print out. Then right click on one of the items and choose <b>Hide selected items</b>. After that you can print the list without these items."); |
2607 | 2635 | ||
2608 | KMessageBox::information( this, message); | 2636 | KMessageBox::information( this, message); |
2609 | } | 2637 | } |
2610 | void MainWindow::printSel( ) | 2638 | void MainWindow::printSel( ) |
2611 | { | 2639 | { |
2612 | mView->viewManager()->agendaView()->agenda()->printSelection(); | 2640 | mView->viewManager()->agendaView()->agenda()->printSelection(); |
2613 | } | 2641 | } |
2614 | 2642 | ||
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index 7d3d492..fdcf7c4 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h | |||
@@ -1,178 +1,184 @@ | |||
1 | #ifndef KORGE_MAINWINDOW_H | 1 | #ifndef KORGE_MAINWINDOW_H |
2 | #define KORGE_MAINWINDOW_H | 2 | #define KORGE_MAINWINDOW_H |
3 | 3 | ||
4 | #include <qmainwindow.h> | 4 | #include <qmainwindow.h> |
5 | #include <qtimer.h> | 5 | #include <qtimer.h> |
6 | #include <qdict.h> | 6 | #include <qdict.h> |
7 | #include <qfile.h> | 7 | #include <qfile.h> |
8 | #include <qmenubar.h> | 8 | #include <qmenubar.h> |
9 | #include <qtextstream.h> | 9 | #include <qtextstream.h> |
10 | #include <qregexp.h> | 10 | #include <qregexp.h> |
11 | 11 | ||
12 | #include <libkcal/incidence.h> | 12 | #include <libkcal/incidence.h> |
13 | #include <ksyncmanager.h> | 13 | #include <ksyncmanager.h> |
14 | #include <kpopupmenu.h> | 14 | #include <kpopupmenu.h> |
15 | #ifndef DESKTOP_VERSION | 15 | #ifndef DESKTOP_VERSION |
16 | #include <qcopchannel_qws.h> | 16 | #include <qcopchannel_qws.h> |
17 | #endif | 17 | #endif |
18 | class QAction; | 18 | class QAction; |
19 | class CalendarView; | 19 | class CalendarView; |
20 | class KSyncProfile; | 20 | class KSyncProfile; |
21 | #ifdef DESKTOP_VERSION | 21 | #ifdef DESKTOP_VERSION |
22 | 22 | ||
23 | #define QPEToolBar QToolBar | 23 | #define QPEToolBar QToolBar |
24 | #endif | 24 | #endif |
25 | class QPEToolBar; | 25 | class QPEToolBar; |
26 | 26 | ||
27 | 27 | ||
28 | namespace KCal { | 28 | namespace KCal { |
29 | class CalendarLocal; | 29 | class CalendarLocal; |
30 | } | 30 | } |
31 | 31 | ||
32 | using namespace KCal; | 32 | using namespace KCal; |
33 | 33 | ||
34 | class MainWindow : public QMainWindow | 34 | class MainWindow : public QMainWindow |
35 | { | 35 | { |
36 | Q_OBJECT | 36 | Q_OBJECT |
37 | public: | 37 | public: |
38 | MainWindow( QWidget *parent = 0, const char *name = 0 ); | 38 | MainWindow( QWidget *parent = 0, const char *name = 0 ); |
39 | ~MainWindow(); | 39 | ~MainWindow(); |
40 | bool beamReceiveEnabled(); | 40 | bool beamReceiveEnabled(); |
41 | static QString defaultFileName(); | 41 | static QString defaultFileName(); |
42 | static QString syncFileName(); | 42 | static QString syncFileName(); |
43 | static QString resourcePath(); | 43 | static QString resourcePath(); |
44 | public slots: | 44 | public slots: |
45 | void setUsesBigPixmaps ( bool ); | 45 | void setUsesBigPixmaps ( bool ); |
46 | void setCaption ( const QString & ); | 46 | void setCaption ( const QString & ); |
47 | void updateWeekNum(const KCal::DateList &); | 47 | void updateWeekNum(const KCal::DateList &); |
48 | void updateWeek(QDate); | 48 | void updateWeek(QDate); |
49 | void updateFilterToolbar(); | 49 | void updateFilterToolbar(); |
50 | virtual void showMaximized (); | 50 | virtual void showMaximized (); |
51 | void configureAgenda( int ); | 51 | void configureAgenda( int ); |
52 | void recieve( const QCString& msg, const QByteArray& data ); | 52 | void recieve( const QCString& msg, const QByteArray& data ); |
53 | void receiveStart( const QCString& msg, const QByteArray& data ); | ||
53 | protected slots: | 54 | protected slots: |
55 | void loadDataAfterStart(); | ||
54 | void calHint(); | 56 | void calHint(); |
55 | void startMultiSync(); | 57 | void startMultiSync(); |
56 | void setCaptionToDates(); | 58 | void setCaptionToDates(); |
57 | void weekAction(); | 59 | void weekAction(); |
58 | void about(); | 60 | void about(); |
59 | void licence(); | 61 | void licence(); |
60 | void faq(); | 62 | void faq(); |
61 | void usertrans(); | 63 | void usertrans(); |
62 | void features(); | 64 | void features(); |
63 | void synchowto(); | 65 | void synchowto(); |
64 | void storagehowto(); | 66 | void storagehowto(); |
65 | void timetrackinghowto(); | 67 | void timetrackinghowto(); |
66 | void kdesynchowto(); | 68 | void kdesynchowto(); |
67 | void multisynchowto(); | 69 | void multisynchowto(); |
68 | void whatsNew(); | 70 | void whatsNew(); |
69 | void keyBindings(); | 71 | void keyBindings(); |
70 | void aboutAutoSaving();; | 72 | void aboutAutoSaving();; |
71 | void aboutKnownBugs(); | 73 | void aboutKnownBugs(); |
72 | 74 | ||
73 | void processIncidenceSelection( Incidence * ); | 75 | void processIncidenceSelection( Incidence * ); |
74 | 76 | ||
75 | void importQtopia(); | 77 | void importQtopia(); |
76 | void importBday(); | 78 | void importBday(); |
77 | void importOL(); | 79 | void importOL(); |
78 | void importIcal(); | 80 | void importIcal(); |
79 | void importFile( QString, bool ); | 81 | void importFile( QString, bool ); |
80 | void quickImportIcal(); | 82 | void quickImportIcal(); |
81 | 83 | ||
82 | void slotModifiedChanged( bool ); | 84 | void slotModifiedChanged( bool ); |
83 | 85 | ||
84 | void save(); | 86 | void save(); |
85 | void backupAllFiles(); | 87 | void backupAllFiles(); |
86 | void saveStopTimer(); | 88 | void saveStopTimer(); |
87 | void configureToolBar( int ); | 89 | void configureToolBar( int ); |
88 | void printSel(); | 90 | void printSel(); |
89 | void printCal(); | 91 | void printCal(); |
90 | void printListView(); | 92 | void printListView(); |
91 | void saveCalendar(); | 93 | void saveCalendar(); |
92 | void loadCalendar(); | 94 | void loadCalendar(); |
93 | void exportVCalendar(); | 95 | void exportVCalendar(); |
94 | void fillFilterMenu(); | 96 | void fillFilterMenu(); |
95 | void fillFilterMenuTB(); | 97 | void fillFilterMenuTB(); |
96 | void selectFilter( int ); | 98 | void selectFilter( int ); |
97 | void fillFilterMenuPopup(); | 99 | void fillFilterMenuPopup(); |
98 | void selectFilterPopup( int ); | 100 | void selectFilterPopup( int ); |
99 | void exportToPhone( int ); | 101 | void exportToPhone( int ); |
100 | void toggleBeamReceive(); | 102 | void toggleBeamReceive(); |
101 | void disableBR(bool); | 103 | void disableBR(bool); |
102 | signals: | 104 | signals: |
103 | void selectWeek ( int ); | 105 | void selectWeek ( int ); |
104 | private slots: | 106 | private slots: |
105 | void slotResetFocus(); | 107 | void slotResetFocus(); |
106 | void slotResetFocusLoop(); | 108 | void slotResetFocusLoop(); |
107 | void showConfigureAgenda(); | 109 | void showConfigureAgenda(); |
108 | void getFile( bool ); | 110 | void getFile( bool ); |
109 | void syncFileRequest(); | 111 | void syncFileRequest(); |
110 | 112 | ||
111 | protected: | 113 | protected: |
112 | int mFocusLoop; | 114 | int mFocusLoop; |
113 | void hideEvent ( QHideEvent * ); | 115 | void hideEvent ( QHideEvent * ); |
114 | QString sentSyncFile(); | 116 | QString sentSyncFile(); |
115 | void displayText( QString, QString); | 117 | void displayText( QString, QString); |
116 | void enableIncidenceActions( bool ); | 118 | void enableIncidenceActions( bool ); |
117 | 119 | ||
118 | private: | 120 | private: |
121 | |||
122 | QCString mCStringMess; | ||
123 | QByteArray mByteData; | ||
124 | |||
119 | //void setMenuBar( QMenuBar * ); | 125 | //void setMenuBar( QMenuBar * ); |
120 | bool mBRdisabled; | 126 | bool mBRdisabled; |
121 | #ifndef DESKTOP_VERSION | 127 | #ifndef DESKTOP_VERSION |
122 | QCopChannel* infrared; | 128 | QCopChannel* infrared; |
123 | #endif | 129 | #endif |
124 | QAction* brAction; | 130 | QAction* brAction; |
125 | KSyncManager* mSyncManager; | 131 | KSyncManager* mSyncManager; |
126 | bool mClosed; | 132 | bool mClosed; |
127 | void saveOnClose(); | 133 | void saveOnClose(); |
128 | bool mFlagKeyPressed; | 134 | bool mFlagKeyPressed; |
129 | bool mBlockAtStartup; | 135 | bool mBlockAtStartup; |
130 | KMenuBar *menuBar1; | 136 | KMenuBar *menuBar1; |
131 | QPEToolBar *iconToolBar; | 137 | QPEToolBar *iconToolBar; |
132 | QPEToolBar *viewToolBar; | 138 | QPEToolBar *viewToolBar; |
133 | QPEToolBar *navigatorToolBar; | 139 | QPEToolBar *navigatorToolBar; |
134 | QPEToolBar *filterToolBar; | 140 | QPEToolBar *filterToolBar; |
135 | KMenuBar *filterMenubar; | 141 | KMenuBar *filterMenubar; |
136 | QPopupMenu * filterPopupMenu; | 142 | QPopupMenu * filterPopupMenu; |
137 | QPopupMenu * mCurrentItemMenu; | 143 | QPopupMenu * mCurrentItemMenu; |
138 | void initActions(); | 144 | void initActions(); |
139 | void setDefaultPreferences(); | 145 | void setDefaultPreferences(); |
140 | void resizeEvent( QResizeEvent* e); | 146 | void resizeEvent( QResizeEvent* e); |
141 | void keyPressEvent ( QKeyEvent * ) ; | 147 | void keyPressEvent ( QKeyEvent * ) ; |
142 | void keyReleaseEvent ( QKeyEvent * ) ; | 148 | void keyReleaseEvent ( QKeyEvent * ) ; |
143 | QPopupMenu *configureToolBarMenu; | 149 | QPopupMenu *configureToolBarMenu; |
144 | QPopupMenu *selectFilterMenu; | 150 | QPopupMenu *selectFilterMenu; |
145 | QPopupMenu *selectFilterMenuTB; | 151 | QPopupMenu *selectFilterMenuTB; |
146 | QPopupMenu *configureAgendaMenu, *syncMenu; | 152 | QPopupMenu *configureAgendaMenu, *syncMenu; |
147 | CalendarLocal *mCalendar; | 153 | CalendarLocal *mCalendar; |
148 | CalendarView *mView; | 154 | CalendarView *mView; |
149 | QAction *mNewSubTodoAction; | 155 | QAction *mNewSubTodoAction; |
150 | QAction *mWeekAction; | 156 | QAction *mWeekAction; |
151 | QFont mWeekFont; | 157 | QFont mWeekFont; |
152 | QPixmap mWeekPixmap; | 158 | QPixmap mWeekPixmap; |
153 | QColor mWeekBgColor; | 159 | QColor mWeekBgColor; |
154 | 160 | ||
155 | QAction *mShowAction; | 161 | QAction *mShowAction; |
156 | QAction *mEditAction; | 162 | QAction *mEditAction; |
157 | QAction *mDeleteAction; | 163 | QAction *mDeleteAction; |
158 | QAction *mCloneAction; | 164 | QAction *mCloneAction; |
159 | QAction *mMoveAction; | 165 | QAction *mMoveAction; |
160 | QAction *mBeamAction; | 166 | QAction *mBeamAction; |
161 | QAction *mCancelAction; | 167 | QAction *mCancelAction; |
162 | QAction *mPrintSelAction; | 168 | QAction *mPrintSelAction; |
163 | 169 | ||
164 | QAction *mToggleNav; | 170 | QAction *mToggleNav; |
165 | QAction *mToggleFilter; | 171 | QAction *mToggleFilter; |
166 | QAction *mToggleAllday; | 172 | QAction *mToggleAllday; |
167 | QAction *actionFilterMenuTB; | 173 | QAction *actionFilterMenuTB; |
168 | 174 | ||
169 | void closeEvent( QCloseEvent* ce ); | 175 | void closeEvent( QCloseEvent* ce ); |
170 | QTimer mSaveTimer; | 176 | QTimer mSaveTimer; |
171 | //bool mBlockSaveFlag; | 177 | //bool mBlockSaveFlag; |
172 | bool mCalendarModifiedFlag; | 178 | bool mCalendarModifiedFlag; |
173 | QPixmap loadPixmap( QString ); | 179 | QPixmap loadPixmap( QString ); |
174 | QPixmap listviewPix, listviewPix0, listviewPix20, listviewPix40, listviewPix60, listviewPix80, journalPix; | 180 | QPixmap listviewPix, listviewPix0, listviewPix20, listviewPix40, listviewPix60, listviewPix80, journalPix; |
175 | }; | 181 | }; |
176 | 182 | ||
177 | 183 | ||
178 | #endif | 184 | #endif |