summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-10-22 16:49:42 (UTC)
committer zautrix <zautrix>2005-10-22 16:49:42 (UTC)
commit3ec18dd19fdf4eb7e763b8022f90de83249facfd (patch) (side-by-side diff)
treeabc6c8568c33b70afd8abc46ae9495e5d862cba1
parentc643664ae97e757afda1012dc998b49e6cc2d575 (diff)
downloadkdepimpi-3ec18dd19fdf4eb7e763b8022f90de83249facfd.zip
kdepimpi-3ec18dd19fdf4eb7e763b8022f90de83249facfd.tar.gz
kdepimpi-3ec18dd19fdf4eb7e763b8022f90de83249facfd.tar.bz2
fixxx
Diffstat (more/less context) (ignore 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
@@ -2,12 +2,13 @@ Info about the changes in new versions of KDE-Pim/Pi
********** VERSION 2.2.5 ************
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 ************
KO/Pi alarm applet: Made font smaller and added a dealy before starting KO/Pi to avoid problems accessing data storage when an alarm did wake up the Z.
Added 3 sec notification about a started timer.
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
@@ -1567,13 +1567,13 @@
{ "Autosave enabled!","Auto-Speichern angeschaltet!" },
{ "Autosave disabled! Save timer stopped!","Auto-Speichern ausgeschaltet! Speicher Timer gestoppt!" },
{ "Autosave disabled!","Auto-Speichern ist ausgeschaltet!" },
{ "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?" },
{ "<p><b>C+ctrl</b>: Dis/enable automatic saving</p>\n","<p><b>C+ctrl</b>: Auto-Speichern ab/anschalten</p>\n" },
-{ "","" },
+{ "<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>" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index e31a6e1..28b17a5 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -474,13 +474,15 @@ void CalendarView::init()
connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) );
connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) );
connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) );
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 ) {
leftFrameLayout->addWidget(mFilterView);
leftFrameLayout->addWidget(mTodoList, 2 );
@@ -5155,6 +5157,20 @@ void CalendarView::showNextAlarms()
message += i18n("Enable it in the settings menu, TAB alarm.");
}
#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 <b>%1</b> is displaying file <b>%2</b>").arg(name).arg(file);
+ mess += i18n("<br>The calendar contains<br><b>%1 events<br>%2 todos<br>%3 journals</b>").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
@@ -198,12 +198,13 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
void calendarViewExpanded( bool );
void updateSearchDialog();
void filtersUpdated();
public slots:
+ void displayCalendarInfo( int id );
void nextConflict( bool all, bool allday );
void conflictAll();
void conflictAllday();
void conflictNotAll();
void setCalReadOnly( int id, bool readO );
void checkAlarms();
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp
index ef25fd0..ee9c9f6 100644
--- a/korganizer/kofilterview.cpp
+++ b/korganizer/kofilterview.cpp
@@ -227,14 +227,16 @@ void KOCalEditView::infoCal( int id )
emit calendarAdded( id );
emit needsUpdate();
QTimer::singleShot( 0, this, SLOT ( readConfig() ) );
QTimer::singleShot( 100, this, SIGNAL ( checkCalendar() ) );
}
}
- else
- KMessageBox::information( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>").arg(name).arg(file) );
+ else {
+ emit requestCalendarInfo( id );
+
+ }
}
void KOCalEditView::readConfig()
{
mStdandardB.clear();
mEnabledB.clear();
diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h
index d534dbf..0dd423a 100644
--- a/korganizer/kofilterview.h
+++ b/korganizer/kofilterview.h
@@ -237,12 +237,13 @@ class KOCalEditView : public QScrollView
void calendarReadonly ( int cal, bool readonly );
void setCalendarDefault ( int cal );
void removeCalendar ( int cal );
void calendarAdded( int );
void needsUpdate();
void checkCalendar();
+ void requestCalendarInfo( int id );
private:
QWidget *mw;
void toggleList ( QPtrList<KOCalCheckButton> , bool b = true );
QPtrList<KOCalRadioButton> mStdandardB;
QPtrList<KOCalCheckButton> mEnabledB;
diff --git a/libkcal/calendar.h b/libkcal/calendar.h
index 3f6895d..4b8b3ff 100644
--- a/libkcal/calendar.h
+++ b/libkcal/calendar.h
@@ -316,12 +316,14 @@ public:
void setDefaultCalendar( int );
virtual void setCalendarEnabled( int id, bool enable ) = 0;
virtual void setAlarmEnabled( int id, bool enable ) = 0;
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();
void calendarLoaded();
void addAlarm(const QDateTime &qdt, const QString &noti );
void removeAlarm(const QDateTime &qdt, const QString &noti );
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index 1a1c6be..0ddfeca 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -449,13 +449,13 @@ Event *CalendarLocal::event( QString syncProf, QString id )
}
return 0;
}
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 ) {
if ( retVal ) {
if ( retVal->calID() > todo->calID() ) {
retVal = todo;
@@ -464,12 +464,36 @@ Todo *CalendarLocal::todo( const QString &uid )
retVal = todo;
}
}
}
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;
}
QDateTime CalendarLocal::nextAlarmEventDateTime() const
{
diff --git a/libkcal/calendarlocal.h b/libkcal/calendarlocal.h
index a7a85c8..ca0bd98 100644
--- a/libkcal/calendarlocal.h
+++ b/libkcal/calendarlocal.h
@@ -182,12 +182,13 @@ class CalendarLocal : public Calendar
only events are returned, which are completely included in the range.
*/
QPtrList<Event> rawEvents( const QDate &start, const QDate &end,
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 );
void setAlarmEnabled( int id, bool enable );
void setReadOnly( int id, bool enable );
void setDefaultCalendarEnabledOnly();