summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt2
-rw-r--r--korganizer/calendarview.cpp8
-rw-r--r--korganizer/calendarview.h1
-rw-r--r--korganizer/koagendaitem.cpp4
-rw-r--r--korganizer/kofilterview.cpp4
-rw-r--r--korganizer/kofilterview.h1
-rw-r--r--korganizer/komonthview.cpp4
-rw-r--r--korganizer/kotodoview.cpp4
-rw-r--r--korganizer/kotodoviewitem.cpp2
-rw-r--r--korganizer/kowhatsnextview.cpp4
-rw-r--r--libkcal/alarm.cpp2
-rw-r--r--libkcal/calendar.cpp0
-rw-r--r--libkcal/calendar.h1
-rw-r--r--libkcal/calendarlocal.cpp56
-rw-r--r--libkcal/calendarlocal.h1
15 files changed, 85 insertions, 9 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index acf17b2..8651a49 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1381,5 +1381,5 @@
1381{ "Global Settings...","Globale Einstellungen..." }, 1381{ "Global Settings...","Globale Einstellungen..." },
1382{ "<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n","<p><b>R</b>: Zeige Resource Ansicht | <b>F</b>: Editiere Filter </p>\n" }, 1382{ "<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n","<p><b>R</b>: Zeige Resource Ansicht | <b>F</b>: Editiere Filter </p>\n" },
1383{ "","" }, 1383{ "(disabled)","(abgeschaltet)" },
1384{ "","" }, 1384{ "","" },
1385{ "","" }, 1385{ "","" },
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 07ec459..6e60c56 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -464,4 +464,7 @@ void CalendarView::init()
464 connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),mCalendar, SLOT( setReadOnly(int,bool)) ); 464 connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),mCalendar, SLOT( setReadOnly(int,bool)) );
465 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) ); 465 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) );
466 connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) );
467 connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) );
468 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) );
466 mTodoList->setNavigator( mNavigator ); 469 mTodoList->setNavigator( mNavigator );
467#if 0 470#if 0
@@ -1870,4 +1873,9 @@ bool CalendarView::restoreCalendarSettings()
1870 } 1873 }
1871} 1874}
1875void CalendarView::addCalendarId( int id )
1876{
1877 KopiCalendarFile * cal = KOPrefs::instance()->getCalendar( id );
1878 addCalendar( cal );
1879}
1872bool CalendarView::addCalendar( KopiCalendarFile * cal ) 1880bool CalendarView::addCalendar( KopiCalendarFile * cal )
1873{ 1881{
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 0144ba4..ec5b7ab 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -228,4 +228,5 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
228 bool restoreCalendarSettings(); 228 bool restoreCalendarSettings();
229 bool addCalendar( KopiCalendarFile * ); 229 bool addCalendar( KopiCalendarFile * );
230 void addCalendarId( int id );
230 bool syncCalendar(QString filename,int mode = 0 ); 231 bool syncCalendar(QString filename,int mode = 0 );
231 232
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 5a3c4d2..c7bc6eb 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -122,5 +122,5 @@ void KOAgendaItem::init ( Incidence *incidence, QDate qd )
122 mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; 122 mBackgroundColor =KOPrefs::instance()->mTodoDoneColor;
123 else 123 else
124 mBackgroundColor =KOPrefs::instance()->mEventColor; 124 mBackgroundColor =KOPrefs::instance()->defaultColor( incidence->calID() );
125 } else { 125 } else {
126 mBackgroundColor = *KOPrefs::instance()->categoryColor(cat); 126 mBackgroundColor = *KOPrefs::instance()->categoryColor(cat);
@@ -202,5 +202,5 @@ bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout)
202 ++yOff; 202 ++yOff;
203 } 203 }
204 if (mIncidence->isAlarmEnabled()) { 204 if (mIncidence->isAlarmEnabled() && mIncidence->alarmEnabled()) {
205 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red ); 205 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red );
206 if ( horLayout ) 206 if ( horLayout )
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp
index 29a4393..2b16347 100644
--- a/korganizer/kofilterview.cpp
+++ b/korganizer/kofilterview.cpp
@@ -159,4 +159,5 @@ void KOCalEditView::selectCal(int id ,bool b)
159 KOPrefs::instance()->getCalendar( id )->isEnabled = b; 159 KOPrefs::instance()->getCalendar( id )->isEnabled = b;
160 emit calendarEnabled ( id, b ); 160 emit calendarEnabled ( id, b );
161 emit needsUpdate();
161 162
162} 163}
@@ -200,4 +201,5 @@ void KOCalEditView::selectCalAlarm(int id ,bool b )
200 KOPrefs::instance()->getCalendar( id )->isAlarmEnabled = b; 201 KOPrefs::instance()->getCalendar( id )->isAlarmEnabled = b;
201 emit alarmEnabled ( id , b ); 202 emit alarmEnabled ( id , b );
203 emit needsUpdate();
202} 204}
203void KOCalEditView::selectReadOnly(int id ,bool b ) 205void KOCalEditView::selectReadOnly(int id ,bool b )
@@ -205,4 +207,5 @@ void KOCalEditView::selectReadOnly(int id ,bool b )
205 KOPrefs::instance()->getCalendar( id )->isReadOnly = b; 207 KOPrefs::instance()->getCalendar( id )->isReadOnly = b;
206 emit calendarReadonly ( id , b ); 208 emit calendarReadonly ( id , b );
209 emit needsUpdate();
207 210
208} 211}
@@ -210,4 +213,5 @@ void KOCalEditView::setColor( const QColor& c, int id )
210{ 213{
211 KOPrefs::instance()->getCalendar( id )->mDefaultColor = c; 214 KOPrefs::instance()->getCalendar( id )->mDefaultColor = c;
215 emit needsUpdate();
212} 216}
213void KOCalEditView::deleteCal( int id ) 217void KOCalEditView::deleteCal( int id )
diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h
index aaf0eb6..4a0cd8a 100644
--- a/korganizer/kofilterview.h
+++ b/korganizer/kofilterview.h
@@ -139,4 +139,5 @@ class KOCalEditView : public QWidget
139 void removeCalendar ( int cal ); 139 void removeCalendar ( int cal );
140 void calendarAdded( int ); 140 void calendarAdded( int );
141 void needsUpdate();
141 142
142 private: 143 private:
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index c868270..96f2502 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -749,5 +749,5 @@ int MonthViewCell::insertEvent(Event *event)
749 item->setPalette( pal ); 749 item->setPalette( pal );
750 item->setRecur( event->recurrence()->doesRecur() ); 750 item->setRecur( event->recurrence()->doesRecur() );
751 item->setAlarm( event->isAlarmEnabled() && multiday < 2 ); 751 item->setAlarm( event->isAlarmEnabled() && multiday < 2 && event->alarmEnabled() );
752 item->setMoreInfo( event->description().length() > 0 ); 752 item->setMoreInfo( event->description().length() > 0 );
753#ifdef DESKTOP_VERSION 753#ifdef DESKTOP_VERSION
@@ -830,5 +830,5 @@ void MonthViewCell::insertTodo(Todo *todo)
830 item->setPalette( pal ); 830 item->setPalette( pal );
831 item->setRecur( todo->recurrence()->doesRecur() ); 831 item->setRecur( todo->recurrence()->doesRecur() );
832 item->setAlarm( todo->isAlarmEnabled() ); 832 item->setAlarm( todo->isAlarmEnabled() && todo->alarmEnabled() );
833 item->setMoreInfo( todo->description().length() > 0 ); 833 item->setMoreInfo( todo->description().length() > 0 );
834 insertItem( item , count()); 834 insertItem( item , count());
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 2602487..35c2a9f 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -705,5 +705,5 @@ void KOTodoView::updateView()
705 if ( incidence->typeID() == todoID ) { 705 if ( incidence->typeID() == todoID ) {
706 //qDebug("related %s ",incidence->summary().latin1() ); 706 //qDebug("related %s ",incidence->summary().latin1() );
707 if ( !(todoList.contains ( ((Todo* )incidence ) ) )) { 707 if ( !(todoList.contains ( ((Todo* )incidence ) ) ) && incidence->calEnabled() ) {
708 //qDebug("related not found "); 708 //qDebug("related not found ");
709 todoList.remove( ); 709 todoList.remove( );
@@ -845,4 +845,6 @@ QMap<Todo *,KOTodoViewItem *>::ConstIterator
845 pendingSubtodo = 0; 845 pendingSubtodo = 0;
846 Incidence *incidence = todo->relatedTo(); 846 Incidence *incidence = todo->relatedTo();
847 while ( incidence && !incidence->calEnabled() )
848 incidence = incidence->relatedTo();
847 if (incidence && incidence->typeID() == todoID ) { 849 if (incidence && incidence->typeID() == todoID ) {
848 Todo *relatedTodo = static_cast<Todo *>(incidence); 850 Todo *relatedTodo = static_cast<Todo *>(incidence);
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp
index 8cb6b83..f987b63 100644
--- a/korganizer/kotodoviewitem.cpp
+++ b/korganizer/kotodoviewitem.cpp
@@ -196,5 +196,5 @@ void KOTodoViewItem::setMyPixmap()
196 pixSize += size; 196 pixSize += size;
197 } 197 }
198 if ( mTodo->isAlarmEnabled() ) { 198 if ( mTodo->isAlarmEnabled() && mTodo->alarmEnabled()) {
199 pixi.resize(size, pixSize+size); 199 pixi.resize(size, pixSize+size);
200 pPix.fill( Qt::red ); 200 pPix.fill( Qt::red );
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index e8574a0..221debc 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -596,5 +596,5 @@ bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool a
596 596
597 } 597 }
598 if ( ev->isAlarmEnabled() ) { 598 if ( ev->isAlarmEnabled() && ev->alarmEnabled()) {
599 if ( !needClose) 599 if ( !needClose)
600 tempText +="["; 600 tempText +="[";
@@ -670,5 +670,5 @@ bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub )
670 670
671 } 671 }
672 if ( ev->isAlarmEnabled() ) { 672 if ( ev->isAlarmEnabled() && ev->alarmEnabled() ) {
673 if ( !needClose) 673 if ( !needClose)
674 mText +="["; 674 mText +="[";
diff --git a/libkcal/alarm.cpp b/libkcal/alarm.cpp
index 0afa0a7..79e0464 100644
--- a/libkcal/alarm.cpp
+++ b/libkcal/alarm.cpp
@@ -372,4 +372,6 @@ QString Alarm::offsetText()
372 if ( message.isEmpty() ) 372 if ( message.isEmpty() )
373 message = i18n("%1min").arg( 0 ); 373 message = i18n("%1min").arg( 0 );
374 if ( !mParent->alarmEnabled() )
375 return "!"+message + i18n("(disabled)");
374 return message; 376 return message;
375} 377}
diff --git a/libkcal/calendar.cpp b/libkcal/calendar.cpp
index 5092d1a..a662eeb 100644
--- a/libkcal/calendar.cpp
+++ b/libkcal/calendar.cpp
diff --git a/libkcal/calendar.h b/libkcal/calendar.h
index 73f82bb..2243e28 100644
--- a/libkcal/calendar.h
+++ b/libkcal/calendar.h
@@ -313,4 +313,5 @@ public:
313 virtual void setReadOnly( int id, bool enable ) = 0; 313 virtual void setReadOnly( int id, bool enable ) = 0;
314 virtual void setDefaultCalendarEnabledOnly() = 0; 314 virtual void setDefaultCalendarEnabledOnly() = 0;
315 virtual void setCalendarRemove( int id ) = 0;
315 signals: 316 signals:
316 void calendarChanged(); 317 void calendarChanged();
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index e48122a..749d9f6 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -86,4 +86,6 @@ void CalendarLocal::addCalendar( Calendar* cal )
86 Event * ev = EventList.first(); 86 Event * ev = EventList.first();
87 while ( ev ) { 87 while ( ev ) {
88 ev->unRegisterObserver( cal );
89 ev->registerObserver( this );
88 mEventList.append( ev ); 90 mEventList.append( ev );
89 ev = EventList.next(); 91 ev = EventList.next();
@@ -91,8 +93,22 @@ void CalendarLocal::addCalendar( Calendar* cal )
91 } 93 }
92 { 94 {
95
93 QPtrList<Todo> TodoList = cal->rawTodos(); 96 QPtrList<Todo> TodoList = cal->rawTodos();
94 Todo * ev = TodoList.first(); 97 Todo * ev = TodoList.first();
95 while ( ev ) { 98 while ( ev ) {
99 QString rel = ev->relatedToUid();
100 if ( !rel.isEmpty() ){
101 ev->setRelatedTo ( 0 );
102 ev->setRelatedToUid( rel );
103 }
104 ev = TodoList.next();
105 }
106 //TodoList = cal->rawTodos();
107 ev = TodoList.first();
108 while ( ev ) {
109 ev->unRegisterObserver( cal );
110 ev->registerObserver( this );
96 mTodoList.append( ev ); 111 mTodoList.append( ev );
112 setupRelations( ev );
97 ev = TodoList.next(); 113 ev = TodoList.next();
98 } 114 }
@@ -102,8 +118,11 @@ void CalendarLocal::addCalendar( Calendar* cal )
102 Journal * ev = JournalList.first(); 118 Journal * ev = JournalList.first();
103 while ( ev ) { 119 while ( ev ) {
120 ev->unRegisterObserver( cal );
121 ev->registerObserver( this );
104 mJournalList.append( ev ); 122 mJournalList.append( ev );
105 ev = JournalList.next(); 123 ev = JournalList.next();
106 } 124 }
107 } 125 }
126 setModified( true );
108} 127}
109bool CalendarLocal::load( const QString &fileName ) 128bool CalendarLocal::load( const QString &fileName )
@@ -782,4 +801,40 @@ QPtrList<Journal> CalendarLocal::journals()
782 return el; 801 return el;
783} 802}
803void CalendarLocal::setCalendarRemove( int id )
804{
805
806 {
807 QPtrList<Event> EventList = mEventList;
808 Event * ev = EventList.first();
809 while ( ev ) {
810 if ( ev->calID() == id )
811 deleteEvent( ev );
812 ev = EventList.next();
813 }
814 }
815 {
816
817 QPtrList<Todo> TodoList = mTodoList;
818 Todo * ev = TodoList.first();
819 while ( ev ) {
820 if ( ev->calID() == id )
821 deleteTodo( ev );
822 ev = TodoList.next();
823 }
824 }
825 {
826 QPtrList<Journal> JournalList = mJournalList;
827 Journal * ev = JournalList.first();
828 while ( ev ) {
829 if ( ev->calID() == id )
830 deleteJournal( ev );
831 ev = JournalList.next();
832 }
833 }
834
835 if ( mUndoIncidence ) delete mUndoIncidence;
836 mUndoIncidence = 0;
837
838}
784 839
785void CalendarLocal::setCalendarEnabled( int id, bool enable ) 840void CalendarLocal::setCalendarEnabled( int id, bool enable )
@@ -819,4 +874,5 @@ void CalendarLocal::setAlarmEnabled( int id, bool enable )
819 for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() ) 874 for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() )
820 if ( it->calID() == id ) it->setAlarmEnabled( enable ); 875 if ( it->calID() == id ) it->setAlarmEnabled( enable );
876 reInitAlarmSettings();
821 877
822} 878}
diff --git a/libkcal/calendarlocal.h b/libkcal/calendarlocal.h
index 65f6aa7..5bbe55f 100644
--- a/libkcal/calendarlocal.h
+++ b/libkcal/calendarlocal.h
@@ -186,4 +186,5 @@ public slots:
186 void setReadOnly( int id, bool enable ); 186 void setReadOnly( int id, bool enable );
187 void setDefaultCalendarEnabledOnly(); 187 void setDefaultCalendarEnabledOnly();
188 void setCalendarRemove( int id );
188 189
189 protected: 190 protected: