From 3ec18dd19fdf4eb7e763b8022f90de83249facfd Mon Sep 17 00:00:00 2001 From: zautrix Date: Sat, 22 Oct 2005 16:49:42 +0000 Subject: fixxx --- 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 @@ -5,6 +5,7 @@ Info about the changes in new versions of KDE-Pim/Pi Bugfixes in KO/Pi, KA/Pi and OM/Pi. Added possibility to disable auto saving in KO/Pi. How to disable it? Good question! Next question, please? +Added info about count of events/todos/journals to calendar info. ********** VERSION 2.2.4 ************ 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 @@ -1570,7 +1570,7 @@ { "Yes, Save!","Ja, Speichern!" }, { "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?" }, { "

C+ctrl: Dis/enable automatic saving

\n","

C+ctrl: Auto-Speichern ab/anschalten

\n" }, -{ "","" }, +{ "
The calendar contains
%1 events
%2 todos
%3 journals
","
Der Kalender enthält
%1 Termine
%2 Todos
%3 Journale
" }, { "","" }, { "","" }, { "","" }, diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index e31a6e1..28b17a5 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -477,7 +477,9 @@ void CalendarView::init() connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) ); connect( mCalEditView, SIGNAL( checkCalendar() ),this, SLOT( checkFiles() )); connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) ); + connect( mCalEditView, SIGNAL( requestCalendarInfo( int ) ),this, SLOT( displayCalendarInfo( int ) ) ); + mTodoList->setNavigator( mNavigator ); #if 0 if ( QApplication::desktop()->width() < 480 ) { @@ -5158,3 +5160,17 @@ void CalendarView::showNextAlarms() #endif KMessageBox::information( this, message); } + +void CalendarView::displayCalendarInfo( int id ) +{ + int e, t,j; + KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id ); + QString name = kkf->mName; + mCalendar->getIncidenceCount( id, e, t, j ); + QString file = KGlobal::formatMessage ( kkf->mFileName ,0 ); + QString mess = i18n("The calendar %1 is displaying file %2").arg(name).arg(file); + mess += i18n("
The calendar contains
%1 events
%2 todos
%3 journals
").arg( e ).arg( t ).arg( j ); + KMessageBox::information( this, mess ); + + +} diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 8670832..0924f07 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h @@ -201,6 +201,7 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser public slots: + void displayCalendarInfo( int id ); void nextConflict( bool all, bool allday ); void conflictAll(); void conflictAllday(); diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp index ef25fd0..ee9c9f6 100644 --- a/korganizer/kofilterview.cpp +++ b/korganizer/kofilterview.cpp @@ -230,8 +230,10 @@ void KOCalEditView::infoCal( int id ) QTimer::singleShot( 100, this, SIGNAL ( checkCalendar() ) ); } } - else - KMessageBox::information( this, i18n("The calendar %1 is displaying file %2").arg(name).arg(file) ); + else { + emit requestCalendarInfo( id ); + + } } void KOCalEditView::readConfig() { diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h index d534dbf..0dd423a 100644 --- a/korganizer/kofilterview.h +++ b/korganizer/kofilterview.h @@ -240,6 +240,7 @@ class KOCalEditView : public QScrollView void calendarAdded( int ); void needsUpdate(); void checkCalendar(); + void requestCalendarInfo( int id ); private: QWidget *mw; diff --git a/libkcal/calendar.h b/libkcal/calendar.h index 3f6895d..4b8b3ff 100644 --- a/libkcal/calendar.h +++ b/libkcal/calendar.h @@ -319,6 +319,8 @@ public: virtual void setReadOnly( int id, bool enable ) = 0; virtual void setDefaultCalendarEnabledOnly() = 0; virtual void setCalendarRemove( int id ) = 0; + virtual void getIncidenceCount( int calId, int& events, int & todos, int & journals) = 0; + signals: void calendarChanged(); void calendarSaved(); diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index 1a1c6be..0ddfeca 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp @@ -452,7 +452,7 @@ Event *CalendarLocal::event( QString syncProf, QString id ) } Todo *CalendarLocal::todo( const QString &uid ) { - Todo *todo;; + Todo *todo; Todo *retVal = 0; for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { if ( todo->calEnabled() && todo->uid() == uid ) { @@ -467,6 +467,30 @@ Todo *CalendarLocal::todo( const QString &uid ) } return retVal; } +void CalendarLocal::getIncidenceCount( int calId, int& events, int & todos, int & journals) +{ + events = 0; + todos = 0; + journals = 0; + { + Todo *todo; + for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { + if ( todo->calID() == calId ) + ++todos; + } + } + { + Event *todo; + for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { + if ( todo->calID() == calId ) + ++events; + + } + } + for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) + if ( it->calID() == calId ) ++journals; + +} QString CalendarLocal::nextSummary() const { return mNextSummary; diff --git a/libkcal/calendarlocal.h b/libkcal/calendarlocal.h index a7a85c8..ca0bd98 100644 --- a/libkcal/calendarlocal.h +++ b/libkcal/calendarlocal.h @@ -185,6 +185,7 @@ class CalendarLocal : public Calendar bool inclusive = false ); Todo *todo( QString, QString ); Event *event( QString, QString ); + void getIncidenceCount( int calId, int& events, int & todos, int & journals); public slots: void setCalendarEnabled( int id, bool enable ); -- cgit v0.9.0.2