summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-10-22 16:49:42 (UTC)
committer zautrix <zautrix>2005-10-22 16:49:42 (UTC)
commit3ec18dd19fdf4eb7e763b8022f90de83249facfd (patch) (unidiff)
treeabc6c8568c33b70afd8abc46ae9495e5d862cba1
parentc643664ae97e757afda1012dc998b49e6cc2d575 (diff)
downloadkdepimpi-3ec18dd19fdf4eb7e763b8022f90de83249facfd.zip
kdepimpi-3ec18dd19fdf4eb7e763b8022f90de83249facfd.tar.gz
kdepimpi-3ec18dd19fdf4eb7e763b8022f90de83249facfd.tar.bz2
fixxx
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt1
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt2
-rw-r--r--korganizer/calendarview.cpp16
-rw-r--r--korganizer/calendarview.h1
-rw-r--r--korganizer/kofilterview.cpp6
-rw-r--r--korganizer/kofilterview.h1
-rw-r--r--libkcal/calendar.h2
-rw-r--r--libkcal/calendarlocal.cpp26
-rw-r--r--libkcal/calendarlocal.h1
9 files changed, 52 insertions, 4 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 6c1f664..edf7eb1 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,55 +1,56 @@
1Info about the changes in new versions of KDE-Pim/Pi 1Info about the changes in new versions of KDE-Pim/Pi
2 2
3********** VERSION 2.2.5 ************ 3********** VERSION 2.2.5 ************
4 4
5Bugfixes in KO/Pi, KA/Pi and OM/Pi. 5Bugfixes in KO/Pi, KA/Pi and OM/Pi.
6Added possibility to disable auto saving in KO/Pi. 6Added possibility to disable auto saving in KO/Pi.
7How to disable it? Good question! Next question, please? 7How to disable it? Good question! Next question, please?
8Added info about count of events/todos/journals to calendar info.
8 9
9 10
10********** VERSION 2.2.4 ************ 11********** VERSION 2.2.4 ************
11 12
12KO/Pi alarm applet: Made font smaller and added a dealy before starting KO/Pi to avoid problems accessing data storage when an alarm did wake up the Z. 13KO/Pi alarm applet: Made font smaller and added a dealy before starting KO/Pi to avoid problems accessing data storage when an alarm did wake up the Z.
13Added 3 sec notification about a started timer. 14Added 3 sec notification about a started timer.
14 15
15KO/Pi: 16KO/Pi:
16Added export option for all data to File->Export menu. 17Added export option for all data to File->Export menu.
17Better management if a save error occours. 18Better management if a save error occours.
18Added 15 sec delay in automatic saving when Z wake up from suspend and the automatic save timer did expire - to avoid problems accessing data storage directly after wake up. 19Added 15 sec delay in automatic saving when Z wake up from suspend and the automatic save timer did expire - to avoid problems accessing data storage directly after wake up.
19Fix for displaying month names of an utf8 translated language (like Russian). I hope a Russian version of KO/Pi will be available soon. 20Fix for displaying month names of an utf8 translated language (like Russian). I hope a Russian version of KO/Pi will be available soon.
20 21
21Added duration info about multiday events. 22Added duration info about multiday events.
22Changed behaviour of "Set complete" in Todo viewer: Now Todo viewer closes not automatically. 23Changed behaviour of "Set complete" in Todo viewer: Now Todo viewer closes not automatically.
23 24
24KA/Pi: 25KA/Pi:
25Added for vCard import the option to import contact data in Latin1 format. 26Added for vCard import the option to import contact data in Latin1 format.
26 27
27********** VERSION 2.2.3 ************ 28********** VERSION 2.2.3 ************
28 29
29KO/Pi: 30KO/Pi:
30Fixed a problem with (non empty) exception dates in the exception date edit dialog of recurring events for newly created events. 31Fixed a problem with (non empty) exception dates in the exception date edit dialog of recurring events for newly created events.
31 32
32Fixed usability problem in KA/Pi: 33Fixed usability problem in KA/Pi:
33Now searching works for "all phone numbers and all addresses" if "all fields" is selected as search option. 34Now searching works for "all phone numbers and all addresses" if "all fields" is selected as search option.
34 35
35Changed some behaviour in OM/Pi mail management to make it more usable. 36Changed some behaviour in OM/Pi mail management to make it more usable.
36 37
37 38
38********** VERSION 2.2.2 ************ 39********** VERSION 2.2.2 ************
39 40
40KO/Pi: 41KO/Pi:
41Fixed a problem with the sort order of last modified date in list view. 42Fixed a problem with the sort order of last modified date in list view.
42KA/Pi: 43KA/Pi:
43Fixed a resource config read problem on windows. 44Fixed a resource config read problem on windows.
44 45
45 46
46********** VERSION 2.2.1 ************ 47********** VERSION 2.2.1 ************
47 48
48KO/Pi: 49KO/Pi:
49Fixed a problem displaying very long allday events in agenda view in single day mode. 50Fixed a problem displaying very long allday events in agenda view in single day mode.
50Fixed a problem with the default settings for new todos. 51Fixed a problem with the default settings for new todos.
51Added an error message dialog if saving of calendar files is not possible. 52Added an error message dialog if saving of calendar files is not possible.
52Made it impossible to close KO/Pi if saving fails. 53Made it impossible to close KO/Pi if saving fails.
53Fixed a problem adding calendars on windows such that these calendars can be used on the memory stick. 54Fixed a problem adding calendars on windows such that these calendars can be used on the memory stick.
54Added config options for conflict detection. 55Added config options for conflict detection.
55 56
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index e8b54fd..288ce4b 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1525,57 +1525,57 @@
1525{ "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" }, 1525{ "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" },
1526{ "Writing back file ...","Schreibe Datei zurück..." }, 1526{ "Writing back file ...","Schreibe Datei zurück..." },
1527{ "Sending back file ...","Sende Datei zurück..." }, 1527{ "Sending back file ...","Sende Datei zurück..." },
1528{ "Eeek, there I am ticklish!","Hihi, da bin ich kitzlig!" }, 1528{ "Eeek, there I am ticklish!","Hihi, da bin ich kitzlig!" },
1529{ "Created","Angelegt" }, 1529{ "Created","Angelegt" },
1530{ "Last Modified Sub","Zuletzt geändertes Sub" }, 1530{ "Last Modified Sub","Zuletzt geändertes Sub" },
1531{ "Checking conflicts ... please wait","Überprüfe Konflikte ... bitte warten" }, 1531{ "Checking conflicts ... please wait","Überprüfe Konflikte ... bitte warten" },
1532{ "Show times on two lines","Zeige Zeiten auf zwei Zeilen" }, 1532{ "Show times on two lines","Zeige Zeiten auf zwei Zeilen" },
1533{ "Save using LOCAL storage","Speichere nutze LOCAL Pfad" }, 1533{ "Save using LOCAL storage","Speichere nutze LOCAL Pfad" },
1534{ "Duration","Dauer" }, 1534{ "Duration","Dauer" },
1535{ " day"," Tag" }, 1535{ " day"," Tag" },
1536{ "Click this button to display all todos in a <b>flat</b> hierarchy","Klicke diesen Knopf um alle Todos in einer <b>flachen</b> Hierarchie darzustellen" }, 1536{ "Click this button to display all todos in a <b>flat</b> hierarchy","Klicke diesen Knopf um alle Todos in einer <b>flachen</b> Hierarchie darzustellen" },
1537{ "Click this button to display all todos <b>openend</b>","Klicke diesen Knopf um alle Todos <b>geöffnet</b> darzustellen" }, 1537{ "Click this button to display all todos <b>openend</b>","Klicke diesen Knopf um alle Todos <b>geöffnet</b> darzustellen" },
1538{ "Click this button to display all todos <b>closed</b>","Klicke diesen Knopf um alle Todos <b>geschlossen</b> darzustellen" }, 1538{ "Click this button to display all todos <b>closed</b>","Klicke diesen Knopf um alle Todos <b>geschlossen</b> darzustellen" },
1539{ "Click this button to toggle show/hide <b>running</b> todos","Klicke diesen Knopf um <b>zeige Laufende</b> umzuschalten" }, 1539{ "Click this button to toggle show/hide <b>running</b> todos","Klicke diesen Knopf um <b>zeige Laufende</b> umzuschalten" },
1540{ "Click this button to toggle show/hide <b>completed</b> todos","Klicke diesen Knopf um <b>zeige Erledigte</b> umzuschalten" }, 1540{ "Click this button to toggle show/hide <b>completed</b> todos","Klicke diesen Knopf um <b>zeige Erledigte</b> umzuschalten" },
1541{ "Click this button to add a new subtodo to the currently selected todo","Klicke diesen Knopf um ein Untertodo zu dem gerade selektierten Todo hinzuzufügen" }, 1541{ "Click this button to add a new subtodo to the currently selected todo","Klicke diesen Knopf um ein Untertodo zu dem gerade selektierten Todo hinzuzufügen" },
1542{ "In this column you can <b>set a calendar to be visible</b>. If a calendar is not visible its entries are not displayed in the views. You can add items to it and it is loaded/saved as usual.","In dieser Spalte kann man einen <b>Kalender auf sichtbar schalten</b>. Wenn ein Kalender nicht sichtbar ist werden seine Einträge nicht in den Ansichten angezeigt. Man kann Einträge hinzufügen und laden/speichern wie gewöhnlich." }, 1542{ "In this column you can <b>set a calendar to be visible</b>. If a calendar is not visible its entries are not displayed in the views. You can add items to it and it is loaded/saved as usual.","In dieser Spalte kann man einen <b>Kalender auf sichtbar schalten</b>. Wenn ein Kalender nicht sichtbar ist werden seine Einträge nicht in den Ansichten angezeigt. Man kann Einträge hinzufügen und laden/speichern wie gewöhnlich." },
1543{ "In this column you can see the <b>name of the calendar</b>. If you click on the name button you will get an information box about the loaded calendar file. If the file was not loaded at startup you can try to load it here again.","In dieser Spalte wird der <b>Name des Kalenders</b> angezeigt. Wenn Sie auf den Namen klicken wird Information über die Kalenderdatei angezeigt. Wenn die Datei beim Start nicht geladen wurde können Sie hier erneut versuchen sie zu laden." }, 1543{ "In this column you can see the <b>name of the calendar</b>. If you click on the name button you will get an information box about the loaded calendar file. If the file was not loaded at startup you can try to load it here again.","In dieser Spalte wird der <b>Name des Kalenders</b> angezeigt. Wenn Sie auf den Namen klicken wird Information über die Kalenderdatei angezeigt. Wenn die Datei beim Start nicht geladen wurde können Sie hier erneut versuchen sie zu laden." },
1544{ "In this column you can <b>disable the alarms of a calendar all together</b>. The alarm data in the calendar itself is not changed, the alarms are marked internally as "do not use". Useful if you load a calendar of another person but do not want to get notified about alarms of that person.","In dieser Spalte können die <b>Alarme eines Kalenders alle zusammen abgeschaltet werden</b>. Die Alarmdaten im Kalender selbst werden nicht verändert, es werde die Alarme intern als "nicht beachten" markiert. Nützlich wenn Sie den Kalender einer anderen Person laden aber nicht über dessen Alarme unterrichtet werden wollen." }, 1544{ "In this column you can <b>disable the alarms of a calendar all together</b>. The alarm data in the calendar itself is not changed, the alarms are marked internally as "do not use". Useful if you load a calendar of another person but do not want to get notified about alarms of that person.","In dieser Spalte können die <b>Alarme eines Kalenders alle zusammen abgeschaltet werden</b>. Die Alarmdaten im Kalender selbst werden nicht verändert, es werde die Alarme intern als "nicht beachten" markiert. Nützlich wenn Sie den Kalender einer anderen Person laden aber nicht über dessen Alarme unterrichtet werden wollen." },
1545{ "In this column you can <b>set a calendar and all entries of the calendar to read only</b>. If a calendar is readonly the entries cannot be edited and no items can be added to the calendar. If you change a setting of a calendar to readonly in this column all data will be saved because the data of a readonly calendar is not saved later.","In dieser Spalte können Sie einen <b>Kalender und alle Einträge auf schreibgeschützt setzen</b>. Einträge eines schreibgeschützten Kalenders können nicht verändert werden und es können keine Einträge zum Kalender hinzugefügt werden. Wenn Sie die Einstellung eines Kalenders in dieser Spalte auf schreibgeschützt setzen werden alle Daten automatisch abgespeichert, da die Daten eines schreibgeschützten Kalenders später nicht mehr gespeichert werden." }, 1545{ "In this column you can <b>set a calendar and all entries of the calendar to read only</b>. If a calendar is readonly the entries cannot be edited and no items can be added to the calendar. If you change a setting of a calendar to readonly in this column all data will be saved because the data of a readonly calendar is not saved later.","In dieser Spalte können Sie einen <b>Kalender und alle Einträge auf schreibgeschützt setzen</b>. Einträge eines schreibgeschützten Kalenders können nicht verändert werden und es können keine Einträge zum Kalender hinzugefügt werden. Wenn Sie die Einstellung eines Kalenders in dieser Spalte auf schreibgeschützt setzen werden alle Daten automatisch abgespeichert, da die Daten eines schreibgeschützten Kalenders später nicht mehr gespeichert werden." },
1546{ "Click this button to <b>add a calendar</b>. You can add an existing calendar file or you can add a new calendar and KO/Pi creates a new empty calendar file for you.","Klicken Sie diesen Knopf <b>um einen Kalender hinzuzufügen</b>. Sie können eine existierende Kalenderdatei hinzufügen oder einen neuen Kalender und KO/Pi legt dann eine neue leere Kalenderdatei für Sie an." }, 1546{ "Click this button to <b>add a calendar</b>. You can add an existing calendar file or you can add a new calendar and KO/Pi creates a new empty calendar file for you.","Klicken Sie diesen Knopf <b>um einen Kalender hinzuzufügen</b>. Sie können eine existierende Kalenderdatei hinzufügen oder einen neuen Kalender und KO/Pi legt dann eine neue leere Kalenderdatei für Sie an." },
1547{ "<b>iCal (*.ics) file on disk:</b><br>(will be created, if not existing)","<b>iCal (*.ics) Datei:</b><br>(Datei wird angelegt, wenn sie nicht existiert)" }, 1547{ "<b>iCal (*.ics) file on disk:</b><br>(will be created, if not existing)","<b>iCal (*.ics) Datei:</b><br>(Datei wird angelegt, wenn sie nicht existiert)" },
1548{ "Error saving data","Fehler beim Abspeichern" }, 1548{ "Error saving data","Fehler beim Abspeichern" },
1549{ "Calendar(s) not saved:","Nicht gespeicherte Kalender:" }, 1549{ "Calendar(s) not saved:","Nicht gespeicherte Kalender:" },
1550{ "Enable conflict detection","Schalte Konflikterkennung an" }, 1550{ "Enable conflict detection","Schalte Konflikterkennung an" },
1551{ "Filter for the edited event","Filter für den bearbeiteten Termin" }, 1551{ "Filter for the edited event","Filter für den bearbeiteten Termin" },
1552{ "Filter for other events","Filter für die anderen Termine" }, 1552{ "Filter for other events","Filter für die anderen Termine" },
1553{ "Check Allday with Allday","Prüfe GanzTag mit GanzTag" }, 1553{ "Check Allday with Allday","Prüfe GanzTag mit GanzTag" },
1554{ "Check Allday with NonAllday","Prüfe GanzTag mit NichtGanzTag" }, 1554{ "Check Allday with NonAllday","Prüfe GanzTag mit NichtGanzTag" },
1555{ "Check NonAllday with Allday","Prüfe NichtGanzTag mit GanzTag" }, 1555{ "Check NonAllday with Allday","Prüfe NichtGanzTag mit GanzTag" },
1556{ "Check NonAllday with NonAllday","Prüfe NichtGanzTag mit NichtGanzTag" }, 1556{ "Check NonAllday with NonAllday","Prüfe NichtGanzTag mit NichtGanzTag" },
1557{ "Conflict detection","Konflikterkennung" }, 1557{ "Conflict detection","Konflikterkennung" },
1558{ "Loading calendar files ... please wait","Lade Kalenderdateien ... bitte warten" }, 1558{ "Loading calendar files ... please wait","Lade Kalenderdateien ... bitte warten" },
1559{ "Show multiday allday ev. in date nav.","Zeige Multi-Ganzt.Term.in Datums Nav." }, 1559{ "Show multiday allday ev. in date nav.","Zeige Multi-Ganzt.Term.in Datums Nav." },
1560{ "Include events which "show as free"","Inklusive Termine mit "Zeige Zeit als frei"" }, 1560{ "Include events which "show as free"","Inklusive Termine mit "Zeige Zeit als frei"" },
1561{ "Conflict detection checks an <b>edited event</b> with <b>other events</b> for overlapping.","Konflikterkennung prüft einen <b>bearbeiteten Termin</b> auf Überschneidungen mit <b>anderen Terminen</b>." }, 1561{ "Conflict detection checks an <b>edited event</b> with <b>other events</b> for overlapping.","Konflikterkennung prüft einen <b>bearbeiteten Termin</b> auf Überschneidungen mit <b>anderen Terminen</b>." },
1562{ " Yes, close "," Ja, beenden " }, 1562{ " Yes, close "," Ja, beenden " },
1563{ "Export All Data","Exportiere alle Daten" }, 1563{ "Export All Data","Exportiere alle Daten" },
1564{ "You can save all data\nto another file via\nFile->Export->Export All Data","Sie können alle Daten in\neine andere Datei speichern unter\nDatei->Exportiere->Exportiere alle Daten" }, 1564{ "You can save all data\nto another file via\nFile->Export->Export All Data","Sie können alle Daten in\neine andere Datei speichern unter\nDatei->Exportiere->Exportiere alle Daten" },
1565{ "<p><b>Duration:</b> %1 days</p>","<p><b>Dauer:</b> %1 Tage</p>" }, 1565{ "<p><b>Duration:</b> %1 days</p>","<p><b>Dauer:</b> %1 Tage</p>" },
1566{ " (Duration: %1 days)"," (Dauer: %1 Tage)" }, 1566{ " (Duration: %1 days)"," (Dauer: %1 Tage)" },
1567{ "Autosave enabled!","Auto-Speichern angeschaltet!" }, 1567{ "Autosave enabled!","Auto-Speichern angeschaltet!" },
1568{ "Autosave disabled! Save timer stopped!","Auto-Speichern ausgeschaltet! Speicher Timer gestoppt!" }, 1568{ "Autosave disabled! Save timer stopped!","Auto-Speichern ausgeschaltet! Speicher Timer gestoppt!" },
1569{ "Autosave disabled!","Auto-Speichern ist ausgeschaltet!" }, 1569{ "Autosave disabled!","Auto-Speichern ist ausgeschaltet!" },
1570{ "Yes, Save!","Ja, Speichern!" }, 1570{ "Yes, Save!","Ja, Speichern!" },
1571{ "Calendar is modified\nbut Autosave is disabled!\nDo you want\nto save the data?","Der Kalender wurde verändert,\naber Auto-Speichern ist\nabgeschaltet. Möchten Sie\ndie Daten speichern?" }, 1571{ "Calendar is modified\nbut Autosave is disabled!\nDo you want\nto save the data?","Der Kalender wurde verändert,\naber Auto-Speichern ist\nabgeschaltet. Möchten Sie\ndie Daten speichern?" },
1572{ "<p><b>C+ctrl</b>: Dis/enable automatic saving</p>\n","<p><b>C+ctrl</b>: Auto-Speichern ab/anschalten</p>\n" }, 1572{ "<p><b>C+ctrl</b>: Dis/enable automatic saving</p>\n","<p><b>C+ctrl</b>: Auto-Speichern ab/anschalten</p>\n" },
1573{ "","" }, 1573{ "<br>The calendar contains<br><b>%1 events<br>%2 todos<br>%3 journals</b>","<br>Der Kalender enthält<br><b>%1 Termine<br>%2 Todos<br>%3 Journale</b>" },
1574{ "","" }, 1574{ "","" },
1575{ "","" }, 1575{ "","" },
1576{ "","" }, 1576{ "","" },
1577{ "","" }, 1577{ "","" },
1578{ "","" }, 1578{ "","" },
1579{ "","" }, 1579{ "","" },
1580{ "","" }, 1580{ "","" },
1581{ "","" }, 1581{ "","" },
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index e31a6e1..28b17a5 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -432,96 +432,98 @@ void CalendarView::init()
432 if ( KOPrefs::instance()->mVerticalScreen ) { 432 if ( KOPrefs::instance()->mVerticalScreen ) {
433 //mainBoxLayout = new QVBoxLayout(mainBox); 433 //mainBoxLayout = new QVBoxLayout(mainBox);
434 //leftFrameLayout = new QHBoxLayout(leftFrame ); 434 //leftFrameLayout = new QHBoxLayout(leftFrame );
435 mMainFrame = new KDGanttMinimizeSplitter( Qt::Vertical, this ); 435 mMainFrame = new KDGanttMinimizeSplitter( Qt::Vertical, this );
436 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); 436 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
437 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mMainFrame);; 437 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mMainFrame);;
438 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 438 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
439 } else { 439 } else {
440 //mainBoxLayout = new QHBoxLayout(mainBox); 440 //mainBoxLayout = new QHBoxLayout(mainBox);
441 //leftFrameLayout = new QVBoxLayout(leftFrame ); 441 //leftFrameLayout = new QVBoxLayout(leftFrame );
442 mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 442 mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
443 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left); 443 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left);
444 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame); 444 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame);
445 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); 445 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
446 } 446 }
447 mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); 447 mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) );
448 //QBoxLayout * leftFrameLayout; 448 //QBoxLayout * leftFrameLayout;
449 topLayout->addWidget( mMainFrame ); 449 topLayout->addWidget( mMainFrame );
450#ifdef DESKTOP_VERSION 450#ifdef DESKTOP_VERSION
451 mDateScrollBar = new QScrollBar ( 1, 365, 1,30, 200,QScrollBar::Horizontal, this ); 451 mDateScrollBar = new QScrollBar ( 1, 365, 1,30, 200,QScrollBar::Horizontal, this );
452 topLayout->addWidget( mDateScrollBar ); 452 topLayout->addWidget( mDateScrollBar );
453 connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) ); 453 connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) );
454 if ( QApplication::desktop()->width() < 800 ) 454 if ( QApplication::desktop()->width() < 800 )
455 mDateScrollBar->hide(); 455 mDateScrollBar->hide();
456#endif 456#endif
457 //mainBoxLayout->addWidget (mLeftFrame); 457 //mainBoxLayout->addWidget (mLeftFrame);
458 mDateNavigator = new DateNavigatorContainer( mLeftFrame, 458 mDateNavigator = new DateNavigatorContainer( mLeftFrame,
459 "CalendarView::DateNavigator" ); 459 "CalendarView::DateNavigator" );
460#if 0 460#if 0
461 // FIXME 461 // FIXME
462 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, 462 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE,
463 "CalendarView::DateNavigator", QDate::currentDate()); 463 "CalendarView::DateNavigator", QDate::currentDate());
464#endif 464#endif
465 // mDateNavigator->blockSignals( true ); 465 // mDateNavigator->blockSignals( true );
466 //leftFrameLayout->addWidget( mDateNavigator ); 466 //leftFrameLayout->addWidget( mDateNavigator );
467 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); 467 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall");
468 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); 468 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView");
469 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView"); 469 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView");
470 connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) ); 470 connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) );
471 connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) ); 471 connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) );
472 connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),this, SLOT( setCalReadOnly(int,bool)) ); 472 connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),this, SLOT( setCalReadOnly(int,bool)) );
473 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) ); 473 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) );
474 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) ); 474 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) );
475 connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) ); 475 connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) );
476 connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) ); 476 connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) );
477 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) ); 477 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) );
478 connect( mCalEditView, SIGNAL( checkCalendar() ),this, SLOT( checkFiles() )); 478 connect( mCalEditView, SIGNAL( checkCalendar() ),this, SLOT( checkFiles() ));
479 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) ); 479 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) );
480 connect( mCalEditView, SIGNAL( requestCalendarInfo( int ) ),this, SLOT( displayCalendarInfo( int ) ) );
481
480 482
481 mTodoList->setNavigator( mNavigator ); 483 mTodoList->setNavigator( mNavigator );
482#if 0 484#if 0
483 if ( QApplication::desktop()->width() < 480 ) { 485 if ( QApplication::desktop()->width() < 480 ) {
484 leftFrameLayout->addWidget(mFilterView); 486 leftFrameLayout->addWidget(mFilterView);
485 leftFrameLayout->addWidget(mTodoList, 2 ); 487 leftFrameLayout->addWidget(mTodoList, 2 );
486 488
487 } else { 489 } else {
488 leftFrameLayout->addWidget(mTodoList,2 ); 490 leftFrameLayout->addWidget(mTodoList,2 );
489 leftFrameLayout->addWidget(mFilterView ); 491 leftFrameLayout->addWidget(mFilterView );
490 } 492 }
491#endif 493#endif
492 mFilterView->hide(); 494 mFilterView->hide();
493 mCalEditView->hide(); 495 mCalEditView->hide();
494 QWidget *rightBox = new QWidget( mMainFrame ); 496 QWidget *rightBox = new QWidget( mMainFrame );
495 //mainBoxLayout->addWidget ( rightBox, 10 ); 497 //mainBoxLayout->addWidget ( rightBox, 10 );
496 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 498 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
497 mRightFrame = new QWidgetStack( rightBox ); 499 mRightFrame = new QWidgetStack( rightBox );
498 rightLayout->addWidget( mRightFrame, 10 ); 500 rightLayout->addWidget( mRightFrame, 10 );
499 501
500 //mLeftFrame = (QWidget *)leftFrame; 502 //mLeftFrame = (QWidget *)leftFrame;
501 if ( KOPrefs::instance()->mVerticalScreen ) { 503 if ( KOPrefs::instance()->mVerticalScreen ) {
502 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); 504 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() );
503 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); 505 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() );
504 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); 506 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() );
505 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); 507 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() );
506 } else { 508 } else {
507 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() ); 509 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() );
508 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); 510 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() );
509 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); 511 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() );
510 } 512 }
511 if ( !KOPrefs::instance()->mShowDateNavigator) 513 if ( !KOPrefs::instance()->mShowDateNavigator)
512 mDateNavigator->hide(); 514 mDateNavigator->hide();
513 //qDebug("Calendarview Size %d %d ", width(), height()); 515 //qDebug("Calendarview Size %d %d ", width(), height());
514#endif 516#endif
515 517
516 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 518 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
517 SLOT( showDates( const KCal::DateList & ) ) ); 519 SLOT( showDates( const KCal::DateList & ) ) );
518 520
519 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 521 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
520 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 522 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
521 523
522 524
523 525
524 connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ), 526 connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ),
525 mViewManager, SLOT( showMonth( const QDate & ) ) ); 527 mViewManager, SLOT( showMonth( const QDate & ) ) );
526 528
527 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), 529 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ),
@@ -5113,48 +5115,62 @@ void CalendarView::resetFocus()
5113} 5115}
5114 5116
5115void CalendarView::showNextAlarms() 5117void CalendarView::showNextAlarms()
5116{ 5118{
5117 QString message; 5119 QString message;
5118 QDateTime nextAl = mCalendar->nextAlarmEventDateTime(); 5120 QDateTime nextAl = mCalendar->nextAlarmEventDateTime();
5119 if ( nextAl.isValid() && mNextAlarmDateTime > QDateTime::currentDateTime() ) { 5121 if ( nextAl.isValid() && mNextAlarmDateTime > QDateTime::currentDateTime() ) {
5120 QString sum = mCalendar->nextSummary(); 5122 QString sum = mCalendar->nextSummary();
5121 QDateTime nextA = mNextAlarmDateTime; 5123 QDateTime nextA = mNextAlarmDateTime;
5122 QDateTime cur = QDateTime::currentDateTime(); 5124 QDateTime cur = QDateTime::currentDateTime();
5123 int secs = cur.secsTo( nextA ); 5125 int secs = cur.secsTo( nextA );
5124 int min = secs /60; 5126 int min = secs /60;
5125 int hours = min /60; 5127 int hours = min /60;
5126 min = min % 60; 5128 min = min % 60;
5127 int days = hours /24; 5129 int days = hours /24;
5128 hours = hours % 24; 5130 hours = hours % 24;
5129 5131
5130 //message = i18n("The next alarm is in:\n"); 5132 //message = i18n("The next alarm is in:\n");
5131 if ( days > 1 ) 5133 if ( days > 1 )
5132 message += i18n("%1 days\n").arg( days ); 5134 message += i18n("%1 days\n").arg( days );
5133 else if ( days == 1 ) 5135 else if ( days == 1 )
5134 message += i18n("1 day\n"); 5136 message += i18n("1 day\n");
5135 if ( hours > 1 ) 5137 if ( hours > 1 )
5136 message += i18n("%1 hours\n").arg( hours ); 5138 message += i18n("%1 hours\n").arg( hours );
5137 else if ( hours == 1 ) 5139 else if ( hours == 1 )
5138 message += i18n("1 hour\n"); 5140 message += i18n("1 hour\n");
5139 if ( min > 1 ) 5141 if ( min > 1 )
5140 message += i18n("%1 minutes\n").arg( min ); 5142 message += i18n("%1 minutes\n").arg( min );
5141 else if ( min == 1 ) 5143 else if ( min == 1 )
5142 message += i18n("1 minute\n"); 5144 message += i18n("1 minute\n");
5143 if ( message.isEmpty() ) 5145 if ( message.isEmpty() )
5144 message = i18n("The next alarm is in\nless than one minute!"); 5146 message = i18n("The next alarm is in\nless than one minute!");
5145 else 5147 else
5146 message = i18n("The next alarm is in:\n") + message; 5148 message = i18n("The next alarm is in:\n") + message;
5147 message += i18n("\n(%1)\n\n%2\n(%3)\n").arg( KGlobal::locale()->formatDateTime(nextA , false)).arg(sum ).arg( KGlobal::locale()->formatDateTime(nextAl , false)) ; 5149 message += i18n("\n(%1)\n\n%2\n(%3)\n").arg( KGlobal::locale()->formatDateTime(nextA , false)).arg(sum ).arg( KGlobal::locale()->formatDateTime(nextAl , false)) ;
5148 } else { 5150 } else {
5149 message = i18n("There is no next alarm."); 5151 message = i18n("There is no next alarm.");
5150 5152
5151 } 5153 }
5152#ifdef DESKTOP_VERSION 5154#ifdef DESKTOP_VERSION
5153 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { 5155 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) {
5154 message += i18n("\nThe internal alarm notification is disabled!\n"); 5156 message += i18n("\nThe internal alarm notification is disabled!\n");
5155 message += i18n("Enable it in the settings menu, TAB alarm."); 5157 message += i18n("Enable it in the settings menu, TAB alarm.");
5156 } 5158 }
5157 5159
5158#endif 5160#endif
5159 KMessageBox::information( this, message); 5161 KMessageBox::information( this, message);
5160} 5162}
5163
5164void CalendarView::displayCalendarInfo( int id )
5165{
5166 int e, t,j;
5167 KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id );
5168 QString name = kkf->mName;
5169 mCalendar->getIncidenceCount( id, e, t, j );
5170 QString file = KGlobal::formatMessage ( kkf->mFileName ,0 );
5171 QString mess = i18n("The calendar <b>%1</b> is displaying file <b>%2</b>").arg(name).arg(file);
5172 mess += i18n("<br>The calendar contains<br><b>%1 events<br>%2 todos<br>%3 journals</b>").arg( e ).arg( t ).arg( j );
5173 KMessageBox::information( this, mess );
5174
5175
5176}
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 8670832..0924f07 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -156,96 +156,97 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
156 void closingDown(); 156 void closingDown();
157 /** emitted right before we die */ 157 /** emitted right before we die */
158 void closed(QWidget *); 158 void closed(QWidget *);
159 159
160 /** Emitted when state of modified flag changes */ 160 /** Emitted when state of modified flag changes */
161 void modifiedChanged(bool); 161 void modifiedChanged(bool);
162 void signalmodified(); 162 void signalmodified();
163 163
164 /** Emitted when state of read-only flag changes */ 164 /** Emitted when state of read-only flag changes */
165 void readOnlyChanged(bool); 165 void readOnlyChanged(bool);
166 166
167 /** Emitted when the unit of navigation changes */ 167 /** Emitted when the unit of navigation changes */
168 void changeNavStringPrev(const QString &); 168 void changeNavStringPrev(const QString &);
169 void changeNavStringNext(const QString &); 169 void changeNavStringNext(const QString &);
170 170
171 /** Emitted when state of events selection has changed and user is organizer*/ 171 /** Emitted when state of events selection has changed and user is organizer*/
172 void organizerEventsSelected(bool); 172 void organizerEventsSelected(bool);
173 /** Emitted when state of events selection has changed and user is attendee*/ 173 /** Emitted when state of events selection has changed and user is attendee*/
174 void groupEventsSelected(bool); 174 void groupEventsSelected(bool);
175 /** 175 /**
176 Emitted when an incidence gets selected. If the selection is cleared the 176 Emitted when an incidence gets selected. If the selection is cleared the
177 signal is emitted with 0 as argument. 177 signal is emitted with 0 as argument.
178 */ 178 */
179 void incidenceSelected( Incidence * ); 179 void incidenceSelected( Incidence * );
180 /** Emitted, when a todoitem is selected or deselected. */ 180 /** Emitted, when a todoitem is selected or deselected. */
181 void todoSelected( bool ); 181 void todoSelected( bool );
182 182
183 /** 183 /**
184 Emitted, when clipboard content changes. Parameter indicates if paste 184 Emitted, when clipboard content changes. Parameter indicates if paste
185 is possible or not. 185 is possible or not.
186 */ 186 */
187 void pasteEnabled(bool); 187 void pasteEnabled(bool);
188 188
189 /** Emitted, when the number of incoming messages has changed. */ 189 /** Emitted, when the number of incoming messages has changed. */
190 void numIncomingChanged(int); 190 void numIncomingChanged(int);
191 191
192 /** Emitted, when the number of outgoing messages has changed. */ 192 /** Emitted, when the number of outgoing messages has changed. */
193 void numOutgoingChanged(int); 193 void numOutgoingChanged(int);
194 194
195 /** Send status message, which can e.g. be displayed in the status bar. */ 195 /** Send status message, which can e.g. be displayed in the status bar. */
196 void statusMessage(const QString &); 196 void statusMessage(const QString &);
197 197
198 void calendarViewExpanded( bool ); 198 void calendarViewExpanded( bool );
199 void updateSearchDialog(); 199 void updateSearchDialog();
200 void filtersUpdated(); 200 void filtersUpdated();
201 201
202 202
203 public slots: 203 public slots:
204 void displayCalendarInfo( int id );
204 void nextConflict( bool all, bool allday ); 205 void nextConflict( bool all, bool allday );
205 void conflictAll(); 206 void conflictAll();
206 void conflictAllday(); 207 void conflictAllday();
207 void conflictNotAll(); 208 void conflictNotAll();
208 void setCalReadOnly( int id, bool readO ); 209 void setCalReadOnly( int id, bool readO );
209 void checkAlarms(); 210 void checkAlarms();
210 void checkFiles(); 211 void checkFiles();
211 void slotprintSelInc(); 212 void slotprintSelInc();
212 void showNextAlarms(); 213 void showNextAlarms();
213 void showOpenError(); 214 void showOpenError();
214 void watchSavedFile(); 215 void watchSavedFile();
215 void recheckTimerAlarm(); 216 void recheckTimerAlarm();
216 void checkNextTimerAlarm(); 217 void checkNextTimerAlarm();
217 void addAlarm(const QDateTime &qdt, const QString &noti ); 218 void addAlarm(const QDateTime &qdt, const QString &noti );
218 void addSuspendAlarm(const QDateTime &qdt, const QString &noti ); 219 void addSuspendAlarm(const QDateTime &qdt, const QString &noti );
219 void removeAlarm(const QDateTime &qdt, const QString &noti ); 220 void removeAlarm(const QDateTime &qdt, const QString &noti );
220 221
221 /** options dialog made a changed to the configuration. we catch this 222 /** options dialog made a changed to the configuration. we catch this
222 * and notify all widgets which need to update their configuration. */ 223 * and notify all widgets which need to update their configuration. */
223 void updateConfig(); 224 void updateConfig();
224 225
225 void insertBirthdays(const QString& uid, const QStringList& birthdayList, 226 void insertBirthdays(const QString& uid, const QStringList& birthdayList,
226 const QStringList& anniversaryList, const QStringList& realNameList, 227 const QStringList& anniversaryList, const QStringList& realNameList,
227 const QStringList& emailList, const QStringList& assembledNameList, 228 const QStringList& emailList, const QStringList& assembledNameList,
228 const QStringList& uidList); 229 const QStringList& uidList);
229 230
230 /** 231 /**
231 Load calendar from file \a filename. If \a merge is true, load 232 Load calendar from file \a filename. If \a merge is true, load
232 calendar into existing one, if it is false, clear calendar, before 233 calendar into existing one, if it is false, clear calendar, before
233 loading. Return true, if calendar could be successfully loaded. 234 loading. Return true, if calendar could be successfully loaded.
234 */ 235 */
235 bool openCalendar(QString filename, bool merge=false); 236 bool openCalendar(QString filename, bool merge=false);
236 bool loadCalendars(); 237 bool loadCalendars();
237 bool saveCalendars(); 238 bool saveCalendars();
238 bool restoreCalendarSettings(); 239 bool restoreCalendarSettings();
239 bool addCalendar( KopiCalendarFile * ); 240 bool addCalendar( KopiCalendarFile * );
240 void addCalendarId( int id ); 241 void addCalendarId( int id );
241 bool syncCalendar(QString filename,int mode = 0 ); 242 bool syncCalendar(QString filename,int mode = 0 );
242 243
243 /** 244 /**
244 Save calendar data to file. Return true if calendar could be 245 Save calendar data to file. Return true if calendar could be
245 successfully saved. 246 successfully saved.
246 */ 247 */
247 bool saveCalendar(QString filename); 248 bool saveCalendar(QString filename);
248 249
249 /** 250 /**
250 Close calendar. Clear calendar data and reset views to display an empty 251 Close calendar. Clear calendar data and reset views to display an empty
251 calendar. 252 calendar.
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp
index ef25fd0..ee9c9f6 100644
--- a/korganizer/kofilterview.cpp
+++ b/korganizer/kofilterview.cpp
@@ -185,98 +185,100 @@ void KOCalEditView::findNewStandard()
185{ 185{
186 bool found = false; 186 bool found = false;
187 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 187 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
188 while ( kkf ) { 188 while ( kkf ) {
189 if (!kkf->isReadOnly && !kkf->mErrorOnLoad ) { 189 if (!kkf->isReadOnly && !kkf->mErrorOnLoad ) {
190 found = true; 190 found = true;
191 selectStdCal( kkf->mCalNumber ); 191 selectStdCal( kkf->mCalNumber );
192 break; 192 break;
193 } 193 }
194 kkf = KOPrefs::instance()->mCalendars.next(); 194 kkf = KOPrefs::instance()->mCalendars.next();
195 } 195 }
196 if ( !found ) { 196 if ( !found ) {
197 KMessageBox::error( this,i18n("\nNO\n WRITEABLE\n CALENDAR\n FOUND!\n\nPlease fix your calendar settings!\n"), 197 KMessageBox::error( this,i18n("\nNO\n WRITEABLE\n CALENDAR\n FOUND!\n\nPlease fix your calendar settings!\n"),
198 i18n("Houston, we have a problem!") ); 198 i18n("Houston, we have a problem!") );
199 199
200 } 200 }
201} 201}
202 202
203void KOCalEditView::setColor( const QColor& c, int id ) 203void KOCalEditView::setColor( const QColor& c, int id )
204{ 204{
205 KOPrefs::instance()->getCalendar( id )->mDefaultColor = c; 205 KOPrefs::instance()->getCalendar( id )->mDefaultColor = c;
206 emit needsUpdate(); 206 emit needsUpdate();
207} 207}
208void KOCalEditView::deleteCal( int id ) 208void KOCalEditView::deleteCal( int id )
209{ 209{
210 KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id ); 210 KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id );
211 QString name = kkf->mName; 211 QString name = kkf->mName;
212 QString file = KGlobal::formatMessage ( kkf->mFileName ,0 ); 212 QString file = KGlobal::formatMessage ( kkf->mFileName ,0 );
213 if ( KMessageBox::warningContinueCancel( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>. Do you want to remove this calendar from KO/Pi? (The file is not removed!)").arg(name).arg(file) ) != KMessageBox::Continue ) return; 213 if ( KMessageBox::warningContinueCancel( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>. Do you want to remove this calendar from KO/Pi? (The file is not removed!)").arg(name).arg(file) ) != KMessageBox::Continue ) return;
214 bool findnewstd = kkf->isStandard; 214 bool findnewstd = kkf->isStandard;
215 emit removeCalendar ( id ); 215 emit removeCalendar ( id );
216 KOPrefs::instance()->mCalendars.remove ( kkf ); 216 KOPrefs::instance()->mCalendars.remove ( kkf );
217 if ( findnewstd ) findNewStandard(); 217 if ( findnewstd ) findNewStandard();
218 emit needsUpdate(); 218 emit needsUpdate();
219 QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); 219 QTimer::singleShot( 0, this, SLOT ( readConfig() ) );
220} 220}
221void KOCalEditView::infoCal( int id ) 221void KOCalEditView::infoCal( int id )
222{ 222{
223 QString name = KOPrefs::instance()->getCalendar( id )->mName; 223 QString name = KOPrefs::instance()->getCalendar( id )->mName;
224 QString file = KGlobal::formatMessage ( KOPrefs::instance()->getCalendar( id )->mFileName, 0 ); 224 QString file = KGlobal::formatMessage ( KOPrefs::instance()->getCalendar( id )->mFileName, 0 );
225 if ( KOPrefs::instance()->getCalendar( id )->mErrorOnLoad ) { 225 if ( KOPrefs::instance()->getCalendar( id )->mErrorOnLoad ) {
226 if ( KMessageBox::Yes == KMessageBox::questionYesNo( this, i18n("The calendar <b>%1</b> is not loaded! Loading of file <b>%2</b> failed! <b>Try again to load the calendar?</b>").arg(name).arg(file) ) ) { 226 if ( KMessageBox::Yes == KMessageBox::questionYesNo( this, i18n("The calendar <b>%1</b> is not loaded! Loading of file <b>%2</b> failed! <b>Try again to load the calendar?</b>").arg(name).arg(file) ) ) {
227 emit calendarAdded( id ); 227 emit calendarAdded( id );
228 emit needsUpdate(); 228 emit needsUpdate();
229 QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); 229 QTimer::singleShot( 0, this, SLOT ( readConfig() ) );
230 QTimer::singleShot( 100, this, SIGNAL ( checkCalendar() ) ); 230 QTimer::singleShot( 100, this, SIGNAL ( checkCalendar() ) );
231 } 231 }
232 } 232 }
233 else 233 else {
234 KMessageBox::information( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>").arg(name).arg(file) ); 234 emit requestCalendarInfo( id );
235
236 }
235} 237}
236void KOCalEditView::readConfig() 238void KOCalEditView::readConfig()
237{ 239{
238 240
239 mStdandardB.clear(); 241 mStdandardB.clear();
240 mEnabledB.clear(); 242 mEnabledB.clear();
241 mAlarmB.clear(); 243 mAlarmB.clear();
242 mROB.clear(); 244 mROB.clear();
243 245
244 if ( mw ) delete mw; 246 if ( mw ) delete mw;
245 mw = new QWidget ( viewport() ); 247 mw = new QWidget ( viewport() );
246 addChild(mw); 248 addChild(mw);
247 int ii = 0; 249 int ii = 0;
248 mainLayout = new QGridLayout ( mw , 2, 8 ); 250 mainLayout = new QGridLayout ( mw , 2, 8 );
249 mainLayout->setMargin( 2 ); 251 mainLayout->setMargin( 2 );
250 mainLayout->setSpacing( 2 ); 252 mainLayout->setSpacing( 2 );
251 QPushButton * addButT = new QPushButton ( mw ); 253 QPushButton * addButT = new QPushButton ( mw );
252 addButT->setFocusPolicy(NoFocus); 254 addButT->setFocusPolicy(NoFocus);
253 mainLayout->addWidget( addButT,0,0 ); 255 mainLayout->addWidget( addButT,0,0 );
254 addButT->setText( "D"); 256 addButT->setText( "D");
255 connect(addButT,SIGNAL(clicked()),SLOT(defaultInfo())); 257 connect(addButT,SIGNAL(clicked()),SLOT(defaultInfo()));
256 QWhatsThis::add( addButT, i18n("Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.") ); 258 QWhatsThis::add( addButT, i18n("Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.") );
257 //addBut->setPixmap ( SmallIcon("greenhook16")); 259 //addBut->setPixmap ( SmallIcon("greenhook16"));
258 QPushButton *addBut = new QPushButton ( mw ); 260 QPushButton *addBut = new QPushButton ( mw );
259 addBut->setFocusPolicy(NoFocus); 261 addBut->setFocusPolicy(NoFocus);
260 mainLayout->addWidget( addBut,0,++ii ); 262 mainLayout->addWidget( addBut,0,++ii );
261 addBut->setPixmap ( SmallIcon("eye")); 263 addBut->setPixmap ( SmallIcon("eye"));
262 QWhatsThis::add( addBut, i18n("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.") ); 264 QWhatsThis::add( addBut, i18n("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.") );
263 connect(addBut,SIGNAL(clicked()),SLOT(enableAll())); 265 connect(addBut,SIGNAL(clicked()),SLOT(enableAll()));
264 int max = addBut->sizeHint().height(); 266 int max = addBut->sizeHint().height();
265 addBut->setMaximumWidth( max ); 267 addBut->setMaximumWidth( max );
266 addButT->setFixedSize( QSize( max, max ) ); 268 addButT->setFixedSize( QSize( max, max ) );
267 QLabel* lab = new QLabel (i18n(" Calendar \n Resource "), mw ); 269 QLabel* lab = new QLabel (i18n(" Calendar \n Resource "), mw );
268 mainLayout->addWidget( lab,0,++ii ); 270 mainLayout->addWidget( lab,0,++ii );
269 QWhatsThis::add( lab, i18n("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.") ); 271 QWhatsThis::add( lab, i18n("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.") );
270 //lab = new QLabel ( i18n(" "), mw ); 272 //lab = new QLabel ( i18n(" "), mw );
271 //mainLayout->addWidget( lab,0,++ii ); 273 //mainLayout->addWidget( lab,0,++ii );
272 //lab->setFixedWidth( 1 ); 274 //lab->setFixedWidth( 1 );
273 addBut = new QPushButton ( mw ); 275 addBut = new QPushButton ( mw );
274 addBut->setFocusPolicy(NoFocus); 276 addBut->setFocusPolicy(NoFocus);
275 mainLayout->addWidget( addBut,0,++ii ); 277 mainLayout->addWidget( addBut,0,++ii );
276 addBut->setPixmap ( SmallIcon("bell")); 278 addBut->setPixmap ( SmallIcon("bell"));
277 QWhatsThis::add( addBut, i18n("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.") ); 279 QWhatsThis::add( addBut, i18n("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.") );
278 connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm())); 280 connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm()));
279 addBut->setMaximumWidth( addBut->sizeHint().height() ); 281 addBut->setMaximumWidth( addBut->sizeHint().height() );
280 282
281 addBut = new QPushButton ( mw ); 283 addBut = new QPushButton ( mw );
282 addBut->setFocusPolicy(NoFocus); 284 addBut->setFocusPolicy(NoFocus);
diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h
index d534dbf..0dd423a 100644
--- a/korganizer/kofilterview.h
+++ b/korganizer/kofilterview.h
@@ -195,62 +195,63 @@ class KOFilterView : public KOFilterView_base
195 195
196 bool filtersEnabled(); 196 bool filtersEnabled();
197 void setFiltersEnabled(bool); 197 void setFiltersEnabled(bool);
198 CalFilter *selectedFilter(); 198 CalFilter *selectedFilter();
199 void setSelectedFilter(QString); 199 void setSelectedFilter(QString);
200 void setSelectedFilter( int ); 200 void setSelectedFilter( int );
201 201
202 signals: 202 signals:
203 void filterChanged(); 203 void filterChanged();
204 void editFilters(); 204 void editFilters();
205 205
206 private: 206 private:
207 QPtrList<CalFilter> *mFilters; 207 QPtrList<CalFilter> *mFilters;
208}; 208};
209 209
210class KOCalEditView : public QScrollView 210class KOCalEditView : public QScrollView
211{ 211{
212 Q_OBJECT 212 Q_OBJECT
213 public: 213 public:
214 KOCalEditView( QWidget* parent=0,const char* name=0); 214 KOCalEditView( QWidget* parent=0,const char* name=0);
215 ~KOCalEditView(); 215 ~KOCalEditView();
216 int addCalendar( QString calName, QString fileName, bool ask = true ); 216 int addCalendar( QString calName, QString fileName, bool ask = true );
217 int getBirtdayID(); 217 int getBirtdayID();
218 public slots: 218 public slots:
219 void addCal(); 219 void addCal();
220 void enableAll(); 220 void enableAll();
221 void enableAlarm(); 221 void enableAlarm();
222 void disableRO(); 222 void disableRO();
223 void deleteAll(); 223 void deleteAll();
224 void selectStdCal(int); 224 void selectStdCal(int);
225 void selectCal(int,bool ); 225 void selectCal(int,bool );
226 void selectCalAlarm(int,bool ); 226 void selectCalAlarm(int,bool );
227 void selectReadOnly(int,bool ); 227 void selectReadOnly(int,bool );
228 void setColor(const QColor &,int) ; 228 void setColor(const QColor &,int) ;
229 void deleteCal(int) ; 229 void deleteCal(int) ;
230 void infoCal(int) ; 230 void infoCal(int) ;
231 void readConfig(); 231 void readConfig();
232 void defaultInfo(); 232 void defaultInfo();
233 void findNewStandard(); 233 void findNewStandard();
234 signals: 234 signals:
235 void alarmEnabled ( int cal, bool enable ); 235 void alarmEnabled ( int cal, bool enable );
236 void calendarEnabled ( int cal, bool enable ); 236 void calendarEnabled ( int cal, bool enable );
237 void calendarReadonly ( int cal, bool readonly ); 237 void calendarReadonly ( int cal, bool readonly );
238 void setCalendarDefault ( int cal ); 238 void setCalendarDefault ( int cal );
239 void removeCalendar ( int cal ); 239 void removeCalendar ( int cal );
240 void calendarAdded( int ); 240 void calendarAdded( int );
241 void needsUpdate(); 241 void needsUpdate();
242 void checkCalendar(); 242 void checkCalendar();
243 void requestCalendarInfo( int id );
243 244
244 private: 245 private:
245 QWidget *mw; 246 QWidget *mw;
246 void toggleList ( QPtrList<KOCalCheckButton> , bool b = true ); 247 void toggleList ( QPtrList<KOCalCheckButton> , bool b = true );
247 QPtrList<KOCalRadioButton> mStdandardB; 248 QPtrList<KOCalRadioButton> mStdandardB;
248 QPtrList<KOCalCheckButton> mEnabledB; 249 QPtrList<KOCalCheckButton> mEnabledB;
249 QPtrList<KOCalCheckButton> mAlarmB; 250 QPtrList<KOCalCheckButton> mAlarmB;
250 QPtrList<KOCalCheckButton> mROB; 251 QPtrList<KOCalCheckButton> mROB;
251 QGridLayout* mainLayout; 252 QGridLayout* mainLayout;
252}; 253};
253 254
254 255
255 256
256#endif // KOFILTERVIEW_H 257#endif // KOFILTERVIEW_H
diff --git a/libkcal/calendar.h b/libkcal/calendar.h
index 3f6895d..4b8b3ff 100644
--- a/libkcal/calendar.h
+++ b/libkcal/calendar.h
@@ -274,96 +274,98 @@ public:
274 /** 274 /**
275 Set calendar filter, which filters events for the events() functions. 275 Set calendar filter, which filters events for the events() functions.
276 The Filter object is owned by the caller. 276 The Filter object is owned by the caller.
277 */ 277 */
278 void setFilter( CalFilter * ); 278 void setFilter( CalFilter * );
279 /** 279 /**
280 Return calendar filter. 280 Return calendar filter.
281 */ 281 */
282 CalFilter *filter(); 282 CalFilter *filter();
283 virtual QDateTime nextAlarm( int daysTo ) = 0; 283 virtual QDateTime nextAlarm( int daysTo ) = 0;
284 virtual QString nextSummary( ) const = 0; 284 virtual QString nextSummary( ) const = 0;
285 virtual void reInitAlarmSettings() = 0; 285 virtual void reInitAlarmSettings() = 0;
286 virtual QDateTime nextAlarmEventDateTime() const = 0; 286 virtual QDateTime nextAlarmEventDateTime() const = 0;
287 virtual void checkAlarmForIncidence( Incidence *, bool ) = 0; 287 virtual void checkAlarmForIncidence( Incidence *, bool ) = 0;
288 /** 288 /**
289 Return all alarms, which ocur in the given time interval. 289 Return all alarms, which ocur in the given time interval.
290 */ 290 */
291 virtual Alarm::List alarms( const QDateTime &from, 291 virtual Alarm::List alarms( const QDateTime &from,
292 const QDateTime &to ) = 0; 292 const QDateTime &to ) = 0;
293 293
294 class Observer { 294 class Observer {
295 public: 295 public:
296 virtual void calendarModified( bool, Calendar * ) = 0; 296 virtual void calendarModified( bool, Calendar * ) = 0;
297 }; 297 };
298 298
299 void registerObserver( Observer * ); 299 void registerObserver( Observer * );
300 300
301 void setModified( bool ); 301 void setModified( bool );
302 302
303 /** 303 /**
304 Set product id returned by loadedProductId(). This function is only 304 Set product id returned by loadedProductId(). This function is only
305 useful for the calendar loading code. 305 useful for the calendar loading code.
306 */ 306 */
307 void setLoadedProductId( const QString & ); 307 void setLoadedProductId( const QString & );
308 /** 308 /**
309 Return product id taken from file that has been loaded. Returns 309 Return product id taken from file that has been loaded. Returns
310 QString::null, if no calendar has been loaded. 310 QString::null, if no calendar has been loaded.
311 */ 311 */
312 QString loadedProductId(); 312 QString loadedProductId();
313 int defaultCalendar(); 313 int defaultCalendar();
314 void setDontDeleteIncidencesOnClose (); 314 void setDontDeleteIncidencesOnClose ();
315 public slots: 315 public slots:
316 void setDefaultCalendar( int ); 316 void setDefaultCalendar( int );
317 virtual void setCalendarEnabled( int id, bool enable ) = 0; 317 virtual void setCalendarEnabled( int id, bool enable ) = 0;
318 virtual void setAlarmEnabled( int id, bool enable ) = 0; 318 virtual void setAlarmEnabled( int id, bool enable ) = 0;
319 virtual void setReadOnly( int id, bool enable ) = 0; 319 virtual void setReadOnly( int id, bool enable ) = 0;
320 virtual void setDefaultCalendarEnabledOnly() = 0; 320 virtual void setDefaultCalendarEnabledOnly() = 0;
321 virtual void setCalendarRemove( int id ) = 0; 321 virtual void setCalendarRemove( int id ) = 0;
322 virtual void getIncidenceCount( int calId, int& events, int & todos, int & journals) = 0;
323
322 signals: 324 signals:
323 void calendarChanged(); 325 void calendarChanged();
324 void calendarSaved(); 326 void calendarSaved();
325 void calendarLoaded(); 327 void calendarLoaded();
326 void addAlarm(const QDateTime &qdt, const QString &noti ); 328 void addAlarm(const QDateTime &qdt, const QString &noti );
327 void removeAlarm(const QDateTime &qdt, const QString &noti ); 329 void removeAlarm(const QDateTime &qdt, const QString &noti );
328 330
329 protected: 331 protected:
330 /** 332 /**
331 Get unfiltered events, which occur on the given date. 333 Get unfiltered events, which occur on the given date.
332 */ 334 */
333 virtual QPtrList<Event> rawEventsForDate( const QDateTime &qdt ) = 0; 335 virtual QPtrList<Event> rawEventsForDate( const QDateTime &qdt ) = 0;
334 /** 336 /**
335 Get unfiltered events, which occur on the given date. 337 Get unfiltered events, which occur on the given date.
336 */ 338 */
337 virtual QPtrList<Event> rawEventsForDate( const QDate &date, 339 virtual QPtrList<Event> rawEventsForDate( const QDate &date,
338 bool sorted = false ) = 0; 340 bool sorted = false ) = 0;
339 /** 341 /**
340 Get events in a range of dates. If inclusive is set to true, only events 342 Get events in a range of dates. If inclusive is set to true, only events
341 are returned, which are completely included in the range. 343 are returned, which are completely included in the range.
342 */ 344 */
343 virtual QPtrList<Event> rawEvents( const QDate &start, const QDate &end, 345 virtual QPtrList<Event> rawEvents( const QDate &start, const QDate &end,
344 bool inclusive = false ) = 0; 346 bool inclusive = false ) = 0;
345 347
346 Incidence *mNextAlarmIncidence; 348 Incidence *mNextAlarmIncidence;
347 Incidence *mUndoIncidence; 349 Incidence *mUndoIncidence;
348 int mDefaultCalendar; 350 int mDefaultCalendar;
349 bool mDeleteIncidencesOnClose; 351 bool mDeleteIncidencesOnClose;
350 352
351private: 353private:
352 void init(); 354 void init();
353 355
354 QString mOwner; // who the calendar belongs to 356 QString mOwner; // who the calendar belongs to
355 QString mOwnerEmail; // email address of the owner 357 QString mOwnerEmail; // email address of the owner
356 int mTimeZone; // timezone OFFSET from GMT (MINUTES) 358 int mTimeZone; // timezone OFFSET from GMT (MINUTES)
357 bool mLocalTime; // use local time, not UTC or a time zone 359 bool mLocalTime; // use local time, not UTC or a time zone
358 360
359 361
360 CalFilter *mFilter; 362 CalFilter *mFilter;
361 CalFilter *mDefaultFilter; 363 CalFilter *mDefaultFilter;
362 364
363 365
364 QString mTimeZoneId; 366 QString mTimeZoneId;
365 367
366 Observer *mObserver; 368 Observer *mObserver;
367 bool mNewObserver; 369 bool mNewObserver;
368 370
369 bool mModified; 371 bool mModified;
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index 1a1c6be..0ddfeca 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -407,111 +407,135 @@ Todo *CalendarLocal::todo( QString syncProf, QString id )
407} 407}
408void CalendarLocal::removeSyncInfo( QString syncProfile) 408void CalendarLocal::removeSyncInfo( QString syncProfile)
409{ 409{
410 QPtrList<Incidence> all = rawIncidences() ; 410 QPtrList<Incidence> all = rawIncidences() ;
411 Incidence *inc; 411 Incidence *inc;
412 for ( inc = all.first(); inc; inc = all.next() ) { 412 for ( inc = all.first(); inc; inc = all.next() ) {
413 inc->removeID( syncProfile ); 413 inc->removeID( syncProfile );
414 } 414 }
415 if ( syncProfile.isEmpty() ) { 415 if ( syncProfile.isEmpty() ) {
416 QPtrList<Event> el; 416 QPtrList<Event> el;
417 Event *todo; 417 Event *todo;
418 for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { 418 for ( todo = mEventList.first(); todo; todo = mEventList.next() ) {
419 if ( todo->uid().left( 15 ) == QString("last-syncEvent-") ) 419 if ( todo->uid().left( 15 ) == QString("last-syncEvent-") )
420 el.append( todo ); 420 el.append( todo );
421 } 421 }
422 for ( todo = el.first(); todo; todo = el.next() ) { 422 for ( todo = el.first(); todo; todo = el.next() ) {
423 deleteIncidence ( todo ); 423 deleteIncidence ( todo );
424 } 424 }
425 } else { 425 } else {
426 Event *lse = event( "last-syncEvent-"+ syncProfile); 426 Event *lse = event( "last-syncEvent-"+ syncProfile);
427 if ( lse ) 427 if ( lse )
428 deleteIncidence ( lse ); 428 deleteIncidence ( lse );
429 } 429 }
430} 430}
431QPtrList<Event> CalendarLocal::getExternLastSyncEvents() 431QPtrList<Event> CalendarLocal::getExternLastSyncEvents()
432{ 432{
433 QPtrList<Event> el; 433 QPtrList<Event> el;
434 Event *todo; 434 Event *todo;
435 for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { 435 for ( todo = mEventList.first(); todo; todo = mEventList.next() ) {
436 if ( todo->uid().left( 15 ) == QString("last-syncEvent-") ) 436 if ( todo->uid().left( 15 ) == QString("last-syncEvent-") )
437 if ( todo->summary().left(3) == "E: " ) 437 if ( todo->summary().left(3) == "E: " )
438 el.append( todo ); 438 el.append( todo );
439 } 439 }
440 440
441 return el; 441 return el;
442 442
443} 443}
444Event *CalendarLocal::event( QString syncProf, QString id ) 444Event *CalendarLocal::event( QString syncProf, QString id )
445{ 445{
446 Event *todo; 446 Event *todo;
447 for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { 447 for ( todo = mEventList.first(); todo; todo = mEventList.next() ) {
448 if ( todo->calEnabled() && todo->getID( syncProf ) == id ) return todo; 448 if ( todo->calEnabled() && todo->getID( syncProf ) == id ) return todo;
449 } 449 }
450 450
451 return 0; 451 return 0;
452} 452}
453Todo *CalendarLocal::todo( const QString &uid ) 453Todo *CalendarLocal::todo( const QString &uid )
454{ 454{
455 Todo *todo;; 455 Todo *todo;
456 Todo *retVal = 0; 456 Todo *retVal = 0;
457 for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { 457 for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) {
458 if ( todo->calEnabled() && todo->uid() == uid ) { 458 if ( todo->calEnabled() && todo->uid() == uid ) {
459 if ( retVal ) { 459 if ( retVal ) {
460 if ( retVal->calID() > todo->calID() ) { 460 if ( retVal->calID() > todo->calID() ) {
461 retVal = todo; 461 retVal = todo;
462 } 462 }
463 } else { 463 } else {
464 retVal = todo; 464 retVal = todo;
465 } 465 }
466 } 466 }
467 } 467 }
468 return retVal; 468 return retVal;
469} 469}
470void CalendarLocal::getIncidenceCount( int calId, int& events, int & todos, int & journals)
471{
472 events = 0;
473 todos = 0;
474 journals = 0;
475 {
476 Todo *todo;
477 for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) {
478 if ( todo->calID() == calId )
479 ++todos;
480 }
481 }
482 {
483 Event *todo;
484 for ( todo = mEventList.first(); todo; todo = mEventList.next() ) {
485 if ( todo->calID() == calId )
486 ++events;
487
488 }
489 }
490 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() )
491 if ( it->calID() == calId ) ++journals;
492
493}
470QString CalendarLocal::nextSummary() const 494QString CalendarLocal::nextSummary() const
471{ 495{
472 return mNextSummary; 496 return mNextSummary;
473} 497}
474QDateTime CalendarLocal::nextAlarmEventDateTime() const 498QDateTime CalendarLocal::nextAlarmEventDateTime() const
475{ 499{
476 return mNextAlarmEventDateTime; 500 return mNextAlarmEventDateTime;
477} 501}
478void CalendarLocal::checkAlarmForIncidence( Incidence * incidence, bool deleted) 502void CalendarLocal::checkAlarmForIncidence( Incidence * incidence, bool deleted)
479{ 503{
480 //mNextAlarmIncidence 504 //mNextAlarmIncidence
481 //mNextAlarmDateTime 505 //mNextAlarmDateTime
482 //return mNextSummary; 506 //return mNextSummary;
483 //return mNextAlarmEventDateTime; 507 //return mNextAlarmEventDateTime;
484 bool newNextAlarm = false; 508 bool newNextAlarm = false;
485 bool computeNextAlarm = false; 509 bool computeNextAlarm = false;
486 bool ok; 510 bool ok;
487 int offset; 511 int offset;
488 QDateTime nextA; 512 QDateTime nextA;
489 // QString nextSum; 513 // QString nextSum;
490 //QDateTime nextEvent; 514 //QDateTime nextEvent;
491 if ( mNextAlarmIncidence == 0 || incidence == 0 ) { 515 if ( mNextAlarmIncidence == 0 || incidence == 0 ) {
492 computeNextAlarm = true; 516 computeNextAlarm = true;
493 } else { 517 } else {
494 if ( ! deleted ) { 518 if ( ! deleted ) {
495 nextA = incidence->getNextAlarmDateTime(& ok, &offset, QDateTime::currentDateTime() ) ; 519 nextA = incidence->getNextAlarmDateTime(& ok, &offset, QDateTime::currentDateTime() ) ;
496 if ( ok ) { 520 if ( ok ) {
497 if ( nextA < mNextAlarmDateTime ) { 521 if ( nextA < mNextAlarmDateTime ) {
498 deRegisterAlarm(); 522 deRegisterAlarm();
499 mNextAlarmDateTime = nextA; 523 mNextAlarmDateTime = nextA;
500 mNextSummary = incidence->summary(); 524 mNextSummary = incidence->summary();
501 mNextAlarmEventDateTime = nextA.addSecs(offset ) ; 525 mNextAlarmEventDateTime = nextA.addSecs(offset ) ;
502 mNextAlarmEventDateTimeString = KGlobal::locale()->formatDateTime(mNextAlarmEventDateTime); 526 mNextAlarmEventDateTimeString = KGlobal::locale()->formatDateTime(mNextAlarmEventDateTime);
503 newNextAlarm = true; 527 newNextAlarm = true;
504 mNextAlarmIncidence = incidence; 528 mNextAlarmIncidence = incidence;
505 } else { 529 } else {
506 if ( incidence == mNextAlarmIncidence ) { 530 if ( incidence == mNextAlarmIncidence ) {
507 computeNextAlarm = true; 531 computeNextAlarm = true;
508 } 532 }
509 } 533 }
510 } else { 534 } else {
511 if ( mNextAlarmIncidence == incidence ) { 535 if ( mNextAlarmIncidence == incidence ) {
512 computeNextAlarm = true; 536 computeNextAlarm = true;
513 } 537 }
514 } 538 }
515 } else { // deleted 539 } else { // deleted
516 if ( incidence == mNextAlarmIncidence ) { 540 if ( incidence == mNextAlarmIncidence ) {
517 computeNextAlarm = true; 541 computeNextAlarm = true;
diff --git a/libkcal/calendarlocal.h b/libkcal/calendarlocal.h
index a7a85c8..ca0bd98 100644
--- a/libkcal/calendarlocal.h
+++ b/libkcal/calendarlocal.h
@@ -140,91 +140,92 @@ class CalendarLocal : public Calendar
140 */ 140 */
141 Journal *journal( const QString &uid ); 141 Journal *journal( const QString &uid );
142 /** 142 /**
143 Return list of all Journals stored in calendar. 143 Return list of all Journals stored in calendar.
144 */ 144 */
145 QPtrList<Journal> journals(); 145 QPtrList<Journal> journals();
146 146
147 /** 147 /**
148 Return all alarms, which ocur in the given time interval. 148 Return all alarms, which ocur in the given time interval.
149 */ 149 */
150 Alarm::List alarms( const QDateTime &from, const QDateTime &to ); 150 Alarm::List alarms( const QDateTime &from, const QDateTime &to );
151 151
152 /** 152 /**
153 Return all alarms, which ocur before given date. 153 Return all alarms, which ocur before given date.
154 */ 154 */
155 Alarm::List alarmsTo( const QDateTime &to ); 155 Alarm::List alarmsTo( const QDateTime &to );
156 156
157 QDateTime nextAlarm( int daysTo ) ; 157 QDateTime nextAlarm( int daysTo ) ;
158 QDateTime nextAlarmEventDateTime() const; 158 QDateTime nextAlarmEventDateTime() const;
159 void checkAlarmForIncidence( Incidence *, bool deleted ) ; 159 void checkAlarmForIncidence( Incidence *, bool deleted ) ;
160 void registerAlarm(); 160 void registerAlarm();
161 void deRegisterAlarm(); 161 void deRegisterAlarm();
162 QString getAlarmNotification(); 162 QString getAlarmNotification();
163 QString nextSummary() const ; 163 QString nextSummary() const ;
164 /** 164 /**
165 This method should be called whenever a Event is modified directly 165 This method should be called whenever a Event is modified directly
166 via it's pointer. It makes sure that the calendar is internally 166 via it's pointer. It makes sure that the calendar is internally
167 consistent. 167 consistent.
168 */ 168 */
169 void update( IncidenceBase *incidence ); 169 void update( IncidenceBase *incidence );
170 170
171 /** 171 /**
172 Builds and then returns a list of all events that match for the 172 Builds and then returns a list of all events that match for the
173 date specified. useful for dayView, etc. etc. 173 date specified. useful for dayView, etc. etc.
174 */ 174 */
175 QPtrList<Event> rawEventsForDate( const QDate &date, bool sorted = false ); 175 QPtrList<Event> rawEventsForDate( const QDate &date, bool sorted = false );
176 /** 176 /**
177 Get unfiltered events for date \a qdt. 177 Get unfiltered events for date \a qdt.
178 */ 178 */
179 QPtrList<Event> rawEventsForDate( const QDateTime &qdt ); 179 QPtrList<Event> rawEventsForDate( const QDateTime &qdt );
180 /** 180 /**
181 Get unfiltered events in a range of dates. If inclusive is set to true, 181 Get unfiltered events in a range of dates. If inclusive is set to true,
182 only events are returned, which are completely included in the range. 182 only events are returned, which are completely included in the range.
183 */ 183 */
184 QPtrList<Event> rawEvents( const QDate &start, const QDate &end, 184 QPtrList<Event> rawEvents( const QDate &start, const QDate &end,
185 bool inclusive = false ); 185 bool inclusive = false );
186 Todo *todo( QString, QString ); 186 Todo *todo( QString, QString );
187 Event *event( QString, QString ); 187 Event *event( QString, QString );
188 void getIncidenceCount( int calId, int& events, int & todos, int & journals);
188 189
189public slots: 190public slots:
190 void setCalendarEnabled( int id, bool enable ); 191 void setCalendarEnabled( int id, bool enable );
191 void setAlarmEnabled( int id, bool enable ); 192 void setAlarmEnabled( int id, bool enable );
192 void setReadOnly( int id, bool enable ); 193 void setReadOnly( int id, bool enable );
193 void setDefaultCalendarEnabledOnly(); 194 void setDefaultCalendarEnabledOnly();
194 void setCalendarRemove( int id ); 195 void setCalendarRemove( int id );
195 196
196 protected: 197 protected:
197 198
198 // Event* mNextAlarmEvent; 199 // Event* mNextAlarmEvent;
199 QString mNextSummary; 200 QString mNextSummary;
200 QString mNextAlarmEventDateTimeString; 201 QString mNextAlarmEventDateTimeString;
201 QString mLastAlarmNotificationString; 202 QString mLastAlarmNotificationString;
202 QDateTime mNextAlarmEventDateTime; 203 QDateTime mNextAlarmEventDateTime;
203 QDateTime mNextAlarmDateTime; 204 QDateTime mNextAlarmDateTime;
204 void reInitAlarmSettings(); 205 void reInitAlarmSettings();
205 206
206 /** Notification function of IncidenceBase::Observer. */ 207 /** Notification function of IncidenceBase::Observer. */
207 void incidenceUpdated( IncidenceBase *i ) { update( i ); } 208 void incidenceUpdated( IncidenceBase *i ) { update( i ); }
208 209
209 /** inserts an event into its "proper place" in the calendar. */ 210 /** inserts an event into its "proper place" in the calendar. */
210 void insertEvent( Event *event ); 211 void insertEvent( Event *event );
211 212
212 /** Append alarms of incidence in interval to list of alarms. */ 213 /** Append alarms of incidence in interval to list of alarms. */
213 void appendAlarms( Alarm::List &alarms, Incidence *incidence, 214 void appendAlarms( Alarm::List &alarms, Incidence *incidence,
214 const QDateTime &from, const QDateTime &to ); 215 const QDateTime &from, const QDateTime &to );
215 216
216 /** Append alarms of recurring events in interval to list of alarms. */ 217 /** Append alarms of recurring events in interval to list of alarms. */
217 void appendRecurringAlarms( Alarm::List &alarms, Incidence *incidence, 218 void appendRecurringAlarms( Alarm::List &alarms, Incidence *incidence,
218 const QDateTime &from, const QDateTime &to ); 219 const QDateTime &from, const QDateTime &to );
219 220
220 private: 221 private:
221 void init(); 222 void init();
222 223
223 QPtrList<Event> mEventList; 224 QPtrList<Event> mEventList;
224 QPtrList<Todo> mTodoList; 225 QPtrList<Todo> mTodoList;
225 QPtrList<Journal> mJournalList; 226 QPtrList<Journal> mJournalList;
226}; 227};
227 228
228} 229}
229 230
230#endif 231#endif