summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-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
9 files changed, 24 insertions, 8 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 07ec459..6e60c56 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -442,48 +442,51 @@ void CalendarView::init()
442 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left); 442 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left);
443 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame); 443 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame);
444 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); 444 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
445 } 445 }
446 mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); 446 mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) );
447 //QBoxLayout * leftFrameLayout; 447 //QBoxLayout * leftFrameLayout;
448 topLayout->addWidget( mMainFrame ); 448 topLayout->addWidget( mMainFrame );
449 //mainBoxLayout->addWidget (mLeftFrame); 449 //mainBoxLayout->addWidget (mLeftFrame);
450 mDateNavigator = new DateNavigatorContainer( mLeftFrame, 450 mDateNavigator = new DateNavigatorContainer( mLeftFrame,
451 "CalendarView::DateNavigator" ); 451 "CalendarView::DateNavigator" );
452#if 0 452#if 0
453 // FIXME 453 // FIXME
454 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, 454 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE,
455 "CalendarView::DateNavigator", QDate::currentDate()); 455 "CalendarView::DateNavigator", QDate::currentDate());
456#endif 456#endif
457 // mDateNavigator->blockSignals( true ); 457 // mDateNavigator->blockSignals( true );
458 //leftFrameLayout->addWidget( mDateNavigator ); 458 //leftFrameLayout->addWidget( mDateNavigator );
459 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); 459 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall");
460 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); 460 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView");
461 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView"); 461 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView");
462 connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) ); 462 connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) );
463 connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) ); 463 connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) );
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
468 if ( QApplication::desktop()->width() < 480 ) { 471 if ( QApplication::desktop()->width() < 480 ) {
469 leftFrameLayout->addWidget(mFilterView); 472 leftFrameLayout->addWidget(mFilterView);
470 leftFrameLayout->addWidget(mTodoList, 2 ); 473 leftFrameLayout->addWidget(mTodoList, 2 );
471 474
472 } else { 475 } else {
473 leftFrameLayout->addWidget(mTodoList,2 ); 476 leftFrameLayout->addWidget(mTodoList,2 );
474 leftFrameLayout->addWidget(mFilterView ); 477 leftFrameLayout->addWidget(mFilterView );
475 } 478 }
476#endif 479#endif
477 mFilterView->hide(); 480 mFilterView->hide();
478 mCalEditView->hide(); 481 mCalEditView->hide();
479 QWidget *rightBox = new QWidget( mMainFrame ); 482 QWidget *rightBox = new QWidget( mMainFrame );
480 //mainBoxLayout->addWidget ( rightBox, 10 ); 483 //mainBoxLayout->addWidget ( rightBox, 10 );
481 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 484 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
482 mRightFrame = new QWidgetStack( rightBox ); 485 mRightFrame = new QWidgetStack( rightBox );
483 rightLayout->addWidget( mRightFrame, 10 ); 486 rightLayout->addWidget( mRightFrame, 10 );
484 487
485 //mLeftFrame = (QWidget *)leftFrame; 488 //mLeftFrame = (QWidget *)leftFrame;
486 if ( KOPrefs::instance()->mVerticalScreen ) { 489 if ( KOPrefs::instance()->mVerticalScreen ) {
487 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); 490 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() );
488 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); 491 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() );
489 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); 492 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() );
@@ -1848,48 +1851,53 @@ bool CalendarView::loadCalendars()
1848 cal = calendars.next(); 1851 cal = calendars.next();
1849 while ( cal ) { 1852 while ( cal ) {
1850 addCalendar( cal ); 1853 addCalendar( cal );
1851 cal = calendars.next(); 1854 cal = calendars.next();
1852 } 1855 }
1853 restoreCalendarSettings(); 1856 restoreCalendarSettings();
1854 mCalendar->reInitAlarmSettings(); 1857 mCalendar->reInitAlarmSettings();
1855 setSyncEventsReadOnly(); 1858 setSyncEventsReadOnly();
1856 updateUnmanagedViews(); 1859 updateUnmanagedViews();
1857 updateView(); 1860 updateView();
1858} 1861}
1859bool CalendarView::restoreCalendarSettings() 1862bool CalendarView::restoreCalendarSettings()
1860{ 1863{
1861 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 1864 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
1862 KopiCalendarFile * cal = calendars.first(); 1865 KopiCalendarFile * cal = calendars.first();
1863 while ( cal ) { 1866 while ( cal ) {
1864 mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled ); 1867 mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled );
1865 mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled ); 1868 mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled );
1866 mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly ); 1869 mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly );
1867 if ( cal->isStandard ) 1870 if ( cal->isStandard )
1868 mCalendar->setDefaultCalendar( cal->mCalNumber ); 1871 mCalendar->setDefaultCalendar( cal->mCalNumber );
1869 cal = calendars.next(); 1872 cal = calendars.next();
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{
1874 1882
1875 if ( mCalendar->addCalendarFile( cal->mFileName, cal->mCalNumber )) 1883 if ( mCalendar->addCalendarFile( cal->mFileName, cal->mCalNumber ))
1876 return true; 1884 return true;
1877 qDebug("KO: Error adding calendar file %1 ",cal->mFileName.latin1() ); 1885 qDebug("KO: Error adding calendar file %1 ",cal->mFileName.latin1() );
1878 KMessageBox::error(this,i18n("Error loading calendar file\n%1.").arg(cal->mFileName)); 1886 KMessageBox::error(this,i18n("Error loading calendar file\n%1.").arg(cal->mFileName));
1879 return false; 1887 return false;
1880} 1888}
1881bool CalendarView::openCalendar(QString filename, bool merge) 1889bool CalendarView::openCalendar(QString filename, bool merge)
1882{ 1890{
1883 1891
1884 if (filename.isEmpty()) { 1892 if (filename.isEmpty()) {
1885 return false; 1893 return false;
1886 } 1894 }
1887 1895
1888 if (!QFile::exists(filename)) { 1896 if (!QFile::exists(filename)) {
1889 KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename)); 1897 KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename));
1890 return false; 1898 return false;
1891 } 1899 }
1892 1900
1893 globalFlagBlockAgenda = 1; 1901 globalFlagBlockAgenda = 1;
1894 clearAllViews(); 1902 clearAllViews();
1895 if (!merge) { 1903 if (!merge) {
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 0144ba4..ec5b7ab 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -206,48 +206,49 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
206 void checkNextTimerAlarm(); 206 void checkNextTimerAlarm();
207 void addAlarm(const QDateTime &qdt, const QString &noti ); 207 void addAlarm(const QDateTime &qdt, const QString &noti );
208 void addSuspendAlarm(const QDateTime &qdt, const QString &noti ); 208 void addSuspendAlarm(const QDateTime &qdt, const QString &noti );
209 void removeAlarm(const QDateTime &qdt, const QString &noti ); 209 void removeAlarm(const QDateTime &qdt, const QString &noti );
210 210
211 /** options dialog made a changed to the configuration. we catch this 211 /** options dialog made a changed to the configuration. we catch this
212 * and notify all widgets which need to update their configuration. */ 212 * and notify all widgets which need to update their configuration. */
213 void updateConfig(); 213 void updateConfig();
214 214
215 void insertBirthdays(const QString& uid, const QStringList& birthdayList, 215 void insertBirthdays(const QString& uid, const QStringList& birthdayList,
216 const QStringList& anniversaryList, const QStringList& realNameList, 216 const QStringList& anniversaryList, const QStringList& realNameList,
217 const QStringList& emailList, const QStringList& assembledNameList, 217 const QStringList& emailList, const QStringList& assembledNameList,
218 const QStringList& uidList); 218 const QStringList& uidList);
219 219
220 /** 220 /**
221 Load calendar from file \a filename. If \a merge is true, load 221 Load calendar from file \a filename. If \a merge is true, load
222 calendar into existing one, if it is false, clear calendar, before 222 calendar into existing one, if it is false, clear calendar, before
223 loading. Return true, if calendar could be successfully loaded. 223 loading. Return true, if calendar could be successfully loaded.
224 */ 224 */
225 bool openCalendar(QString filename, bool merge=false); 225 bool openCalendar(QString filename, bool merge=false);
226 bool loadCalendars(); 226 bool loadCalendars();
227 bool saveCalendars(); 227 bool saveCalendars();
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
232 /** 233 /**
233 Save calendar data to file. Return true if calendar could be 234 Save calendar data to file. Return true if calendar could be
234 successfully saved. 235 successfully saved.
235 */ 236 */
236 bool saveCalendar(QString filename); 237 bool saveCalendar(QString filename);
237 238
238 /** 239 /**
239 Close calendar. Clear calendar data and reset views to display an empty 240 Close calendar. Clear calendar data and reset views to display an empty
240 calendar. 241 calendar.
241 */ 242 */
242 void closeCalendar(); 243 void closeCalendar();
243 244
244 /** Archive old events of calendar */ 245 /** Archive old events of calendar */
245 void archiveCalendar(); 246 void archiveCalendar();
246 247
247 void showIncidence(); 248 void showIncidence();
248 void editIncidence(); 249 void editIncidence();
249 void editIncidenceDescription(); 250 void editIncidenceDescription();
250 void deleteIncidence(); 251 void deleteIncidence();
251 void cloneIncidence(); 252 void cloneIncidence();
252 void moveIncidence(); 253 void moveIncidence();
253 void beamIncidence(); 254 void beamIncidence();
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 5a3c4d2..c7bc6eb 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -100,49 +100,49 @@ QString KOAgendaItem::getWhatsThisText()
100void KOAgendaItem::init ( Incidence *incidence, QDate qd ) 100void KOAgendaItem::init ( Incidence *incidence, QDate qd )
101{ 101{
102 mIncidence = incidence; 102 mIncidence = incidence;
103 mDate = qd; 103 mDate = qd;
104 mFirstMultiItem = 0; 104 mFirstMultiItem = 0;
105 mNextMultiItem = 0; 105 mNextMultiItem = 0;
106 mLastMultiItem = 0; 106 mLastMultiItem = 0;
107 computeText(); 107 computeText();
108 108
109 if ( (incidence->typeID() == todoID ) && 109 if ( (incidence->typeID() == todoID ) &&
110 ( !((static_cast<Todo*>(incidence))->isCompleted()) && 110 ( !((static_cast<Todo*>(incidence))->isCompleted()) &&
111 ((static_cast<Todo*>(incidence))->dtDue().date() <= QDate::currentDate()) ) ) { 111 ((static_cast<Todo*>(incidence))->dtDue().date() <= QDate::currentDate()) ) ) {
112 if ( (static_cast<Todo*>(incidence))->dtDue() < QDateTime::currentDateTime().date()) 112 if ( (static_cast<Todo*>(incidence))->dtDue() < QDateTime::currentDateTime().date())
113 mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ; 113 mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ;
114 else 114 else
115 mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor; 115 mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor;
116 } 116 }
117 else { 117 else {
118 QStringList categories = mIncidence->categories(); 118 QStringList categories = mIncidence->categories();
119 QString cat = categories.first(); 119 QString cat = categories.first();
120 if (cat.isEmpty()) { 120 if (cat.isEmpty()) {
121 if ( (incidence->typeID() == todoID ) &&((static_cast<Todo*>(incidence))->isCompleted()) ) 121 if ( (incidence->typeID() == todoID ) &&((static_cast<Todo*>(incidence))->isCompleted()) )
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);
127 if ( (incidence->typeID() == todoID ) &&((static_cast<Todo*>(incidence))->isCompleted()) ) { 127 if ( (incidence->typeID() == todoID ) &&((static_cast<Todo*>(incidence))->isCompleted()) ) {
128 if ( mBackgroundColor == KOPrefs::instance()->mEventColor ) 128 if ( mBackgroundColor == KOPrefs::instance()->mEventColor )
129 mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; 129 mBackgroundColor =KOPrefs::instance()->mTodoDoneColor;
130 } 130 }
131 } 131 }
132 132
133 } 133 }
134 mColorGroup = QColorGroup( mBackgroundColor.light(), 134 mColorGroup = QColorGroup( mBackgroundColor.light(),
135 mBackgroundColor.dark(),mBackgroundColor.light(), 135 mBackgroundColor.dark(),mBackgroundColor.light(),
136 mBackgroundColor.dark(),mBackgroundColor, black, mBackgroundColor) ; 136 mBackgroundColor.dark(),mBackgroundColor, black, mBackgroundColor) ;
137 setBackgroundColor( mBackgroundColor ); 137 setBackgroundColor( mBackgroundColor );
138 138
139 mConflictItems.clear(); 139 mConflictItems.clear();
140 setCellXY(0,0,1); 140 setCellXY(0,0,1);
141 setCellXWidth(0); 141 setCellXWidth(0);
142 setSubCell(0); 142 setSubCell(0);
143 setSubCells(1); 143 setSubCells(1);
144 setMultiItem(0,0,0); 144 setMultiItem(0,0,0);
145 startMove(); 145 startMove();
146 mSelected = true; 146 mSelected = true;
147 select(false); 147 select(false);
148 QFontMetrics fontinf(KOPrefs::instance()->mAgendaViewFont); 148 QFontMetrics fontinf(KOPrefs::instance()->mAgendaViewFont);
@@ -180,49 +180,49 @@ void KOAgendaItem::recreateIncidence()
180 mIncidence = mIncidence->recreateCloneException( mDate ); 180 mIncidence = mIncidence->recreateCloneException( mDate );
181} 181}
182bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) 182bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout)
183{ 183{
184 int size = AGENDA_ICON_SIZE; 184 int size = AGENDA_ICON_SIZE;
185 185
186 int yOff = 0; 186 int yOff = 0;
187 int xOff = 0; 187 int xOff = 0;
188 int x = pos().x() +3; 188 int x = pos().x() +3;
189 int y; 189 int y;
190 if ( mAllDay ) 190 if ( mAllDay )
191 y = pos().y()+3; 191 y = pos().y()+3;
192 else 192 else
193 y = mCellYTop * ( height() / cellHeight() ) +3; 193 y = mCellYTop * ( height() / cellHeight() ) +3;
194 if (mIncidence->cancelled()) { 194 if (mIncidence->cancelled()) {
195 int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x; 195 int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x;
196 int ypos = yOff*( 1 +AGENDA_ICON_SIZE)+y; 196 int ypos = yOff*( 1 +AGENDA_ICON_SIZE)+y;
197 p->drawLine( xpos, ypos, xpos+AGENDA_ICON_SIZE-1, ypos+AGENDA_ICON_SIZE-1 ); 197 p->drawLine( xpos, ypos, xpos+AGENDA_ICON_SIZE-1, ypos+AGENDA_ICON_SIZE-1 );
198 p->drawLine( xpos, ypos+AGENDA_ICON_SIZE-1, xpos+AGENDA_ICON_SIZE-1, ypos ); 198 p->drawLine( xpos, ypos+AGENDA_ICON_SIZE-1, xpos+AGENDA_ICON_SIZE-1, ypos );
199 if ( horLayout ) 199 if ( horLayout )
200 ++xOff; 200 ++xOff;
201 else 201 else
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 )
207 ++xOff; 207 ++xOff;
208 else 208 else
209 ++yOff; 209 ++yOff;
210 } 210 }
211 if (mIncidence->recurrence()->doesRecur()) { 211 if (mIncidence->recurrence()->doesRecur()) {
212 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, blue ); 212 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, blue );
213 if ( horLayout ) 213 if ( horLayout )
214 ++xOff; 214 ++xOff;
215 else 215 else
216 ++yOff; 216 ++yOff;
217 } 217 }
218 if (mIncidence->description().length() > 0) { 218 if (mIncidence->description().length() > 0) {
219 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkGreen ); 219 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkGreen );
220 if ( horLayout ) 220 if ( horLayout )
221 ++xOff; 221 ++xOff;
222 else 222 else
223 ++yOff; 223 ++yOff;
224 } 224 }
225 if (mIncidence->isReadOnly()) { 225 if (mIncidence->isReadOnly()) {
226 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, white ); 226 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, white );
227 if ( horLayout ) 227 if ( horLayout )
228 ++xOff; 228 ++xOff;
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp
index 29a4393..2b16347 100644
--- a/korganizer/kofilterview.cpp
+++ b/korganizer/kofilterview.cpp
@@ -137,99 +137,103 @@ void KOFilterView::setSelectedFilter( int fil )
137 if ( fil >= mSelectionCombo->count() ) 137 if ( fil >= mSelectionCombo->count() )
138 return; 138 return;
139 mSelectionCombo->setCurrentItem( fil ); 139 mSelectionCombo->setCurrentItem( fil );
140 emit filterChanged(); 140 emit filterChanged();
141} 141}
142 142
143 143
144 144
145KOCalEditView::KOCalEditView(QWidget* parent, 145KOCalEditView::KOCalEditView(QWidget* parent,
146 const char* name ) 146 const char* name )
147 : QWidget(parent,name) 147 : QWidget(parent,name)
148{ 148{
149 mw = 0; 149 mw = 0;
150 ml = new QVBoxLayout ( this ); 150 ml = new QVBoxLayout ( this );
151} 151}
152 152
153KOCalEditView::~KOCalEditView() 153KOCalEditView::~KOCalEditView()
154{ 154{
155 // no need to delete child widgets, Qt does it all for us 155 // no need to delete child widgets, Qt does it all for us
156} 156}
157void KOCalEditView::selectCal(int id ,bool b) 157void KOCalEditView::selectCal(int id ,bool b)
158{ 158{
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}
163void KOCalEditView::selectStdCal( int id, bool b ) 164void KOCalEditView::selectStdCal( int id, bool b )
164{ 165{
165 166
166 if ( !b ) { 167 if ( !b ) {
167 KOCalCheckButton* it = (KOCalCheckButton*) sender(); 168 KOCalCheckButton* it = (KOCalCheckButton*) sender();
168 if ( it ) { 169 if ( it ) {
169 it->blockSignals( true ); 170 it->blockSignals( true );
170 it->setChecked( true ); 171 it->setChecked( true );
171 it->blockSignals( false ); 172 it->blockSignals( false );
172 return; 173 return;
173 } 174 }
174 return; 175 return;
175 } 176 }
176 KOCalCheckButton* sen = (KOCalCheckButton*) sender(); 177 KOCalCheckButton* sen = (KOCalCheckButton*) sender();
177 KOCalCheckButton* it = mStdandardB.first(); 178 KOCalCheckButton* it = mStdandardB.first();
178 while ( it ) { 179 while ( it ) {
179 if ( it->isChecked() ) { 180 if ( it->isChecked() ) {
180 if ( it != sen ) { 181 if ( it != sen ) {
181 it->blockSignals( true ); 182 it->blockSignals( true );
182 it->setChecked( false ); 183 it->setChecked( false );
183 it->blockSignals( false ); 184 it->blockSignals( false );
184 break; 185 break;
185 } 186 }
186 } 187 }
187 it = mStdandardB.next(); 188 it = mStdandardB.next();
188 } 189 }
189 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 190 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
190 while ( kkf ) { 191 while ( kkf ) {
191 kkf->isStandard = false; 192 kkf->isStandard = false;
192 kkf = KOPrefs::instance()->mCalendars.next(); 193 kkf = KOPrefs::instance()->mCalendars.next();
193 } 194 }
194 KOPrefs::instance()->getCalendar( id )->isStandard = true; 195 KOPrefs::instance()->getCalendar( id )->isStandard = true;
195 emit setCalendarDefault ( id ); 196 emit setCalendarDefault ( id );
196} 197}
197 198
198void KOCalEditView::selectCalAlarm(int id ,bool b ) 199void KOCalEditView::selectCalAlarm(int id ,bool b )
199{ 200{
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 )
204{ 206{
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}
209void KOCalEditView::setColor( const QColor& c, int id ) 212void 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 )
214{ 218{
215 KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id ); 219 KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id );
216 QString name = kkf->mName; 220 QString name = kkf->mName;
217 QString file = kkf->mFileName; 221 QString file = kkf->mFileName;
218 if ( KMessageBox::warningContinueCancel( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b><tr> Do you want to remove this calendar from KO/Pi? (The file is not removed, of course!)").arg(name).arg(file) ) != KMessageBox::Continue ) return; 222 if ( KMessageBox::warningContinueCancel( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b><tr> Do you want to remove this calendar from KO/Pi? (The file is not removed, of course!)").arg(name).arg(file) ) != KMessageBox::Continue ) return;
219 emit removeCalendar ( id ); 223 emit removeCalendar ( id );
220 KOPrefs::instance()->mCalendars.remove ( kkf ); 224 KOPrefs::instance()->mCalendars.remove ( kkf );
221 readConfig(); 225 readConfig();
222} 226}
223void KOCalEditView::infoCal( int id ) 227void KOCalEditView::infoCal( int id )
224{ 228{
225 QString name = KOPrefs::instance()->getCalendar( id )->mName; 229 QString name = KOPrefs::instance()->getCalendar( id )->mName;
226 QString file = KOPrefs::instance()->getCalendar( id )->mFileName; 230 QString file = KOPrefs::instance()->getCalendar( id )->mFileName;
227 KMessageBox::information( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>").arg(name).arg(file) ); 231 KMessageBox::information( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>").arg(name).arg(file) );
228} 232}
229void KOCalEditView::readConfig() 233void KOCalEditView::readConfig()
230{ 234{
231 235
232 mStdandardB.clear(); 236 mStdandardB.clear();
233 mEnabledB.clear(); 237 mEnabledB.clear();
234 mAlarmB.clear(); 238 mAlarmB.clear();
235 mROB.clear(); 239 mROB.clear();
diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h
index aaf0eb6..4a0cd8a 100644
--- a/korganizer/kofilterview.h
+++ b/korganizer/kofilterview.h
@@ -117,39 +117,40 @@ class KOCalEditView : public QWidget
117 KOCalEditView( QWidget* parent=0,const char* name=0); 117 KOCalEditView( QWidget* parent=0,const char* name=0);
118 ~KOCalEditView(); 118 ~KOCalEditView();
119 119
120 void readConfig(); 120 void readConfig();
121 public slots: 121 public slots:
122 void addCal(); 122 void addCal();
123 void enableAll(); 123 void enableAll();
124 void enableAlarm(); 124 void enableAlarm();
125 void disableRO(); 125 void disableRO();
126 void deleteAll(); 126 void deleteAll();
127 void selectStdCal(int,bool ); 127 void selectStdCal(int,bool );
128 void selectCal(int,bool ); 128 void selectCal(int,bool );
129 void selectCalAlarm(int,bool ); 129 void selectCalAlarm(int,bool );
130 void selectReadOnly(int,bool ); 130 void selectReadOnly(int,bool );
131 void setColor(const QColor &,int) ; 131 void setColor(const QColor &,int) ;
132 void deleteCal(int) ; 132 void deleteCal(int) ;
133 void infoCal(int) ; 133 void infoCal(int) ;
134 signals: 134 signals:
135 void alarmEnabled ( int cal, bool enable ); 135 void alarmEnabled ( int cal, bool enable );
136 void calendarEnabled ( int cal, bool enable ); 136 void calendarEnabled ( int cal, bool enable );
137 void calendarReadonly ( int cal, bool readonly ); 137 void calendarReadonly ( int cal, bool readonly );
138 void setCalendarDefault ( int cal ); 138 void setCalendarDefault ( int cal );
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:
143 QVBoxLayout* ml; 144 QVBoxLayout* ml;
144 QWidget *mw; 145 QWidget *mw;
145 void toggleList ( QPtrList<KOCalCheckButton> ); 146 void toggleList ( QPtrList<KOCalCheckButton> );
146 QPtrList<KOCalCheckButton> mStdandardB; 147 QPtrList<KOCalCheckButton> mStdandardB;
147 QPtrList<KOCalCheckButton> mEnabledB; 148 QPtrList<KOCalCheckButton> mEnabledB;
148 QPtrList<KOCalCheckButton> mAlarmB; 149 QPtrList<KOCalCheckButton> mAlarmB;
149 QPtrList<KOCalCheckButton> mROB; 150 QPtrList<KOCalCheckButton> mROB;
150 QGridLayout* mainLayout; 151 QGridLayout* mainLayout;
151}; 152};
152 153
153 154
154 155
155#endif // KOFILTERVIEW_H 156#endif // KOFILTERVIEW_H
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index c868270..96f2502 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -727,49 +727,49 @@ int MonthViewCell::insertEvent(Event *event)
727 if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { 727 if (KOPrefs::instance()->mMonthViewUsesCategoryColor) {
728 QStringList categories = event->categories(); 728 QStringList categories = event->categories();
729 QString cat = categories.first(); 729 QString cat = categories.first();
730 if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { 730 if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) {
731 pal = getPalette(); 731 pal = getPalette();
732 if (cat.isEmpty()) { 732 if (cat.isEmpty()) {
733 pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); 733 pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor);
734 } else { 734 } else {
735 pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); 735 pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat)));
736 } 736 }
737 737
738 } else { 738 } else {
739 if (cat.isEmpty()) { 739 if (cat.isEmpty()) {
740 pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); 740 pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor);
741 } else { 741 } else {
742 pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); 742 pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat)));
743 } 743 }
744 } 744 }
745 745
746 } else { 746 } else {
747 pal = mStandardPalette ; 747 pal = mStandardPalette ;
748 } 748 }
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
754 Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails, 754 Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails,
755 KOPrefs::instance()->email()); 755 KOPrefs::instance()->email());
756 if ( me != 0 ) { 756 if ( me != 0 ) {
757 if ( me->status() == Attendee::NeedsAction && me->RSVP()) 757 if ( me->status() == Attendee::NeedsAction && me->RSVP())
758 item->setReply(true && multiday < 2); 758 item->setReply(true && multiday < 2);
759 else 759 else
760 item->setReply(false); 760 item->setReply(false);
761 } else 761 } else
762 item->setReply(false); 762 item->setReply(false);
763#endif 763#endif
764 item->setMultiDay( multiday ); 764 item->setMultiDay( multiday );
765 if ( multiday ) { 765 if ( multiday ) {
766 insertItem( item ,mdayCount); 766 insertItem( item ,mdayCount);
767 ++mdayCount; 767 ++mdayCount;
768 } else { 768 } else {
769 uint i; 769 uint i;
770 int pos = mdayCount; 770 int pos = mdayCount;
771 for ( i = mdayCount; i < count();++i ) { 771 for ( i = mdayCount; i < count();++i ) {
772 QListBoxItem* it = this->item ( i ); 772 QListBoxItem* it = this->item ( i );
773 if ( it && text < it->text() ) { 773 if ( it && text < it->text() ) {
774 pos = i; 774 pos = i;
775 break; 775 break;
@@ -808,49 +808,49 @@ void MonthViewCell::insertTodo(Todo *todo)
808 if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { 808 if (KOPrefs::instance()->mMonthViewUsesCategoryColor) {
809 QStringList categories = todo->categories(); 809 QStringList categories = todo->categories();
810 QString cat = categories.first(); 810 QString cat = categories.first();
811 if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { 811 if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) {
812 pal = getPalette(); 812 pal = getPalette();
813 if (cat.isEmpty()) { 813 if (cat.isEmpty()) {
814 pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); 814 pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor);
815 } else { 815 } else {
816 pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); 816 pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat)));
817 } 817 }
818 818
819 } else { 819 } else {
820 if (cat.isEmpty()) { 820 if (cat.isEmpty()) {
821 pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); 821 pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor);
822 } else { 822 } else {
823 pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); 823 pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat)));
824 } 824 }
825 } 825 }
826 826
827 } else { 827 } else {
828 pal = mStandardPalette ; 828 pal = mStandardPalette ;
829 } 829 }
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());
835#ifdef DESKTOP_VERSION 835#ifdef DESKTOP_VERSION
836 mToolTip.append( text ); 836 mToolTip.append( text );
837#endif 837#endif
838} 838}
839void MonthViewCell::repaintfinishUpdateCell() 839void MonthViewCell::repaintfinishUpdateCell()
840{ 840{
841 MonthViewItem *mitem = (MonthViewItem*) firstItem (); 841 MonthViewItem *mitem = (MonthViewItem*) firstItem ();
842 while ( mitem ) { 842 while ( mitem ) {
843 mitem->setBlockRepaint( false ); 843 mitem->setBlockRepaint( false );
844 updateItem ( mitem ); 844 updateItem ( mitem );
845 mitem = (MonthViewItem *)mitem->next(); 845 mitem = (MonthViewItem *)mitem->next();
846 } 846 }
847} 847}
848void MonthViewCell::finishUpdateCell() 848void MonthViewCell::finishUpdateCell()
849{ 849{
850 850
851 851
852 852
853#ifdef DESKTOP_VERSION 853#ifdef DESKTOP_VERSION
854 if (mToolTip.count() > 0 ) { 854 if (mToolTip.count() > 0 ) {
855 mToolTip.sort(); 855 mToolTip.sort();
856 QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),""); 856 QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),"");
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 2602487..35c2a9f 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -683,49 +683,49 @@ void KOTodoView::updateView()
683 kdDebug() << " (related to " << t->getRelatedTo()->getSummary() << ")" << endl; 683 kdDebug() << " (related to " << t->getRelatedTo()->getSummary() << ")" << endl;
684 } 684 }
685 685
686 QPtrList<Event> l = t->getRelations(); 686 QPtrList<Event> l = t->getRelations();
687 Event *c; 687 Event *c;
688 for(c=l.first();c;c=l.next()) { 688 for(c=l.first();c;c=l.next()) {
689 kdDebug() << " - relation: " << c->getSummary() << endl; 689 kdDebug() << " - relation: " << c->getSummary() << endl;
690 } 690 }
691 } 691 }
692*/ 692*/
693 693
694 // Put for each Event a KOTodoViewItem in the list view. Don't rely on a 694 // Put for each Event a KOTodoViewItem in the list view. Don't rely on a
695 // specific order of events. That means that we have to generate parent items 695 // specific order of events. That means that we have to generate parent items
696 // recursively for proper hierarchical display of Todos. 696 // recursively for proper hierarchical display of Todos.
697 mTodoMap.clear(); 697 mTodoMap.clear();
698 Todo *todo; 698 Todo *todo;
699 todo = todoList.first();// todo; todo = todoList.next()) { 699 todo = todoList.first();// todo; todo = todoList.next()) {
700 while ( todo ) { 700 while ( todo ) {
701 bool next = true; 701 bool next = true;
702 // qDebug("todo %s ", todo->summary().latin1()); 702 // qDebug("todo %s ", todo->summary().latin1());
703 Incidence *incidence = todo->relatedTo(); 703 Incidence *incidence = todo->relatedTo();
704 while ( incidence ) { 704 while ( incidence ) {
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( );
710 todo = todoList.current(); 710 todo = todoList.current();
711 next = false; 711 next = false;
712 incidence = 0; 712 incidence = 0;
713 713
714 } else { 714 } else {
715 //qDebug("related found "); 715 //qDebug("related found ");
716 incidence = incidence->relatedTo(); 716 incidence = incidence->relatedTo();
717 } 717 }
718 } else 718 } else
719 incidence = 0; 719 incidence = 0;
720 } 720 }
721 if ( next ) 721 if ( next )
722 todo = todoList.next(); 722 todo = todoList.next();
723 } 723 }
724 724
725 for(todo = todoList.first(); todo; todo = todoList.next()) { 725 for(todo = todoList.first(); todo; todo = todoList.next()) {
726 if (!mTodoMap.contains(todo) && checkTodo( todo ) ) 726 if (!mTodoMap.contains(todo) && checkTodo( todo ) )
727 { 727 {
728 insertTodoItem(todo); 728 insertTodoItem(todo);
729 } 729 }
730 } 730 }
731 // Restore opened/closed state 731 // Restore opened/closed state
@@ -823,48 +823,50 @@ bool KOTodoView::checkTodo( Todo * todo )
823 return true; 823 return true;
824} 824}
825 825
826void KOTodoView::restoreItemState( QListViewItem *item ) 826void KOTodoView::restoreItemState( QListViewItem *item )
827{ 827{
828 pendingSubtodo = 0; 828 pendingSubtodo = 0;
829 while( item ) { 829 while( item ) {
830 KOTodoViewItem *todoItem = (KOTodoViewItem *)item; 830 KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
831 todoItem->setOpen( mDocPrefs->readBoolEntry( todoItem->todo()->uid() ) ); 831 todoItem->setOpen( mDocPrefs->readBoolEntry( todoItem->todo()->uid() ) );
832 if( item->childCount() > 0 ) restoreItemState( item->firstChild() ); 832 if( item->childCount() > 0 ) restoreItemState( item->firstChild() );
833 item = item->nextSibling(); 833 item = item->nextSibling();
834 } 834 }
835} 835}
836 836
837 837
838QMap<Todo *,KOTodoViewItem *>::ConstIterator 838QMap<Todo *,KOTodoViewItem *>::ConstIterator
839 KOTodoView::insertTodoItem(Todo *todo) 839 KOTodoView::insertTodoItem(Todo *todo)
840{ 840{
841 841
842// kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl; 842// kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl;
843 // TODO: Check, if dynmaic cast is necessary 843 // TODO: Check, if dynmaic cast is necessary
844 844
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);
849 851
850// kdDebug() << " has Related" << endl; 852// kdDebug() << " has Related" << endl;
851 QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; 853 QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator;
852 itemIterator = mTodoMap.find(relatedTodo); 854 itemIterator = mTodoMap.find(relatedTodo);
853 if (itemIterator == mTodoMap.end()) { 855 if (itemIterator == mTodoMap.end()) {
854// kdDebug() << " related not yet in list" << endl; 856// kdDebug() << " related not yet in list" << endl;
855 itemIterator = insertTodoItem (relatedTodo); 857 itemIterator = insertTodoItem (relatedTodo);
856 } 858 }
857 // isn't this pretty stupid? We give one Todo to the KOTodoViewItem 859 // isn't this pretty stupid? We give one Todo to the KOTodoViewItem
858 // and one into the map. Sure finding is more easy but why? -zecke 860 // and one into the map. Sure finding is more easy but why? -zecke
859 KOTodoViewItem *todoItem = new KOTodoViewItem(*itemIterator,todo,this); 861 KOTodoViewItem *todoItem = new KOTodoViewItem(*itemIterator,todo,this);
860 return mTodoMap.insert(todo,todoItem); 862 return mTodoMap.insert(todo,todoItem);
861 } else { 863 } else {
862// kdDebug() << " no Related" << endl; 864// kdDebug() << " no Related" << endl;
863 // see above -zecke 865 // see above -zecke
864 KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); 866 KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this);
865 return mTodoMap.insert(todo,todoItem); 867 return mTodoMap.insert(todo,todoItem);
866 } 868 }
867} 869}
868 870
869 871
870void KOTodoView::updateConfig() 872void KOTodoView::updateConfig()
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp
index 8cb6b83..f987b63 100644
--- a/korganizer/kotodoviewitem.cpp
+++ b/korganizer/kotodoviewitem.cpp
@@ -174,49 +174,49 @@ void KOTodoViewItem::construct()
174 m_init = false; 174 m_init = false;
175 175
176 setMyPixmap(); 176 setMyPixmap();
177 177
178} 178}
179void KOTodoViewItem::setMyPixmap() 179void KOTodoViewItem::setMyPixmap()
180{ 180{
181 int size = 5; 181 int size = 5;
182 QPixmap pixi = QPixmap( 1, 1 ); 182 QPixmap pixi = QPixmap( 1, 1 );
183 // if ( !mTodo->isCompleted() && mTodo->hasDueDate() && mTodo->dtDue() < QDateTime::currentDateTime() ) { 183 // if ( !mTodo->isCompleted() && mTodo->hasDueDate() && mTodo->dtDue() < QDateTime::currentDateTime() ) {
184// pixi = SmallIcon("redcross16"); 184// pixi = SmallIcon("redcross16");
185// } else { 185// } else {
186 QPainter p; 186 QPainter p;
187 187
188 int pixSize = 0; 188 int pixSize = 0;
189 QPixmap pPix = QPixmap( size, size ); 189 QPixmap pPix = QPixmap( size, size );
190 if ( mTodo->description().length() > 0 ) { 190 if ( mTodo->description().length() > 0 ) {
191 pixi.resize(size, pixSize+size); 191 pixi.resize(size, pixSize+size);
192 pPix.fill( Qt::darkGreen ); 192 pPix.fill( Qt::darkGreen );
193 p.begin( &pixi ); 193 p.begin( &pixi );
194 p. drawPixmap ( 0, pixSize, pPix); 194 p. drawPixmap ( 0, pixSize, pPix);
195 p.end(); 195 p.end();
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 );
201 p.begin( &pixi ); 201 p.begin( &pixi );
202 p. drawPixmap ( 0, pixSize, pPix); 202 p. drawPixmap ( 0, pixSize, pPix);
203 p.end(); 203 p.end();
204 pixSize += size; 204 pixSize += size;
205 } 205 }
206 if ( mTodo->doesRecur() ) { 206 if ( mTodo->doesRecur() ) {
207 pixi.resize(size, pixSize+size); 207 pixi.resize(size, pixSize+size);
208 pPix.fill( Qt::blue ); 208 pPix.fill( Qt::blue );
209 p.begin( &pixi ); 209 p.begin( &pixi );
210 p. drawPixmap ( 0, pixSize, pPix); 210 p. drawPixmap ( 0, pixSize, pPix);
211 p.end(); 211 p.end();
212 pixSize += size; 212 pixSize += size;
213 } 213 }
214 // } 214 // }
215 if ( pixi.width() > 1 ) { 215 if ( pixi.width() > 1 ) {
216 setPixmap ( 0,pixi ) ; 216 setPixmap ( 0,pixi ) ;
217 } else { 217 } else {
218 setPixmap ( 0,QPixmap() ) ; 218 setPixmap ( 0,QPixmap() ) ;
219 } 219 }
220} 220}
221void KOTodoViewItem::stateChange(bool state) 221void KOTodoViewItem::stateChange(bool state)
222{ 222{
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index e8574a0..221debc 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -574,49 +574,49 @@ bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool a
574 // tempText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; 574 // tempText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>";
575 QString dfs = KGlobal::locale()->dateFormatShort(); 575 QString dfs = KGlobal::locale()->dateFormatShort();
576 KGlobal::locale()->setDateFormatShort("%d.%b"); 576 KGlobal::locale()->setDateFormatShort("%d.%b");
577 tempText +="<font color=\"#F00000\">" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "</font>"; 577 tempText +="<font color=\"#F00000\">" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "</font>";
578 KGlobal::locale()->setDateFormatShort(dfs); 578 KGlobal::locale()->setDateFormatShort(dfs);
579 } else { 579 } else {
580 if (!ev->doesFloat() ) 580 if (!ev->doesFloat() )
581 if( ( (Todo*)ev)->dtDue() < cdt ) { 581 if( ( (Todo*)ev)->dtDue() < cdt ) {
582 tempText +="<font color=\"#F00000\">" + ((Todo*)ev)->dtDueTimeStr() + "</font>"; 582 tempText +="<font color=\"#F00000\">" + ((Todo*)ev)->dtDueTimeStr() + "</font>";
583 583
584 584
585 } else 585 } else
586 tempText +=((Todo*)ev)->dtDueTimeStr(); 586 tempText +=((Todo*)ev)->dtDueTimeStr();
587 mTodos.append( ev ); 587 mTodos.append( ev );
588 } 588 }
589 } 589 }
590 } 590 }
591 tempText += "</b></td><td>"; 591 tempText += "</b></td><td>";
592 bool needClose = false; 592 bool needClose = false;
593 if ( ev->cancelled() ) { 593 if ( ev->cancelled() ) {
594 tempText += "<font color=\"#F00000\">[c"; 594 tempText += "<font color=\"#F00000\">[c";
595 needClose =true; 595 needClose =true;
596 596
597 } 597 }
598 if ( ev->isAlarmEnabled() ) { 598 if ( ev->isAlarmEnabled() && ev->alarmEnabled()) {
599 if ( !needClose) 599 if ( !needClose)
600 tempText +="["; 600 tempText +="[";
601 tempText += "a"; 601 tempText += "a";
602 needClose =true; 602 needClose =true;
603 603
604 } 604 }
605 if ( ev->description().length() > 0 ) { 605 if ( ev->description().length() > 0 ) {
606 if ( !needClose) 606 if ( !needClose)
607 tempText +="["; 607 tempText +="[";
608 tempText += "i"; 608 tempText += "i";
609 needClose =true; 609 needClose =true;
610 } 610 }
611 if ( ev->recurrence()->doesRecur() ) { 611 if ( ev->recurrence()->doesRecur() ) {
612 if ( !needClose) 612 if ( !needClose)
613 tempText +="["; 613 tempText +="[";
614 tempText += "r"; 614 tempText += "r";
615 needClose =true; 615 needClose =true;
616 } 616 }
617 if ( needClose ) { 617 if ( needClose ) {
618 tempText += "] "; 618 tempText += "] ";
619 } 619 }
620 if ( ev->cancelled() ) 620 if ( ev->cancelled() )
621 tempText += "</font>"; 621 tempText += "</font>";
622 tempText += "<a "; 622 tempText += "<a ";
@@ -648,49 +648,49 @@ bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool a
648 tempText += "</td></tr>\n"; 648 tempText += "</td></tr>\n";
649 mText += tempText; 649 mText += tempText;
650 return true; 650 return true;
651} 651}
652 652
653bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) 653bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub )
654{ 654{
655 if ( mTodos.find( ev ) != mTodos.end() ) return false; 655 if ( mTodos.find( ev ) != mTodos.end() ) return false;
656 656
657 mTodos.append( ev ); 657 mTodos.append( ev );
658 if ( !isSub ) 658 if ( !isSub )
659 mText += "<p>"; 659 mText += "<p>";
660 else 660 else
661 mText += "<li>"; 661 mText += "<li>";
662 mText += "[" +QString::number(ev->priority()) + "/" + QString::number(((Todo*)ev)->percentComplete())+"%] "; 662 mText += "[" +QString::number(ev->priority()) + "/" + QString::number(((Todo*)ev)->percentComplete())+"%] ";
663 663
664 664
665 mText += ind; 665 mText += ind;
666 bool needClose = false; 666 bool needClose = false;
667 if ( ev->cancelled() ) { 667 if ( ev->cancelled() ) {
668 mText += "<font color=\"#F00000\">[c"; 668 mText += "<font color=\"#F00000\">[c";
669 needClose =true; 669 needClose =true;
670 670
671 } 671 }
672 if ( ev->isAlarmEnabled() ) { 672 if ( ev->isAlarmEnabled() && ev->alarmEnabled() ) {
673 if ( !needClose) 673 if ( !needClose)
674 mText +="["; 674 mText +="[";
675 mText += "a"; 675 mText += "a";
676 needClose =true; 676 needClose =true;
677 677
678 } 678 }
679 679
680 if ( ev->description().length() > 0 ) { 680 if ( ev->description().length() > 0 ) {
681 if ( !needClose) 681 if ( !needClose)
682 mText +="["; 682 mText +="[";
683 mText += "i"; 683 mText += "i";
684 needClose =true; 684 needClose =true;
685 } 685 }
686 if ( ev->doesRecur() ) { 686 if ( ev->doesRecur() ) {
687 if ( !needClose) 687 if ( !needClose)
688 mText +="["; 688 mText +="[";
689 mText += "r"; 689 mText += "r";
690 needClose =true; 690 needClose =true;
691 } 691 }
692 // if ( ev->recurrence()->doesRecur() ) { 692 // if ( ev->recurrence()->doesRecur() ) {
693 // if ( !needClose) 693 // if ( !needClose)
694 // mText +="("; 694 // mText +="(";
695 // mText += "r"; 695 // mText += "r";
696 // needClose =true; 696 // needClose =true;