From 56de219c5ce910a470a01a0e5003d1a113837ef4 Mon Sep 17 00:00:00 2001 From: zautrix Date: Mon, 13 Jun 2005 13:57:22 +0000 Subject: fixxx --- (limited to 'korganizer') diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 07ec459..6e60c56 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -463,6 +463,9 @@ void CalendarView::init() connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) ); connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),mCalendar, SLOT( setReadOnly(int,bool)) ); connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, 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()) ); mTodoList->setNavigator( mNavigator ); #if 0 if ( QApplication::desktop()->width() < 480 ) { @@ -1869,6 +1872,11 @@ bool CalendarView::restoreCalendarSettings() cal = calendars.next(); } } +void CalendarView::addCalendarId( int id ) +{ + KopiCalendarFile * cal = KOPrefs::instance()->getCalendar( id ); + addCalendar( cal ); +} bool CalendarView::addCalendar( KopiCalendarFile * cal ) { diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 0144ba4..ec5b7ab 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h @@ -227,6 +227,7 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser bool saveCalendars(); bool restoreCalendarSettings(); bool addCalendar( KopiCalendarFile * ); + void addCalendarId( int id ); bool syncCalendar(QString filename,int mode = 0 ); /** diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index 5a3c4d2..c7bc6eb 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp @@ -121,12 +121,12 @@ void KOAgendaItem::init ( Incidence *incidence, QDate qd ) if ( (incidence->typeID() == todoID ) &&((static_cast(incidence))->isCompleted()) ) mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; else - mBackgroundColor =KOPrefs::instance()->mEventColor; + mBackgroundColor =KOPrefs::instance()->defaultColor( incidence->calID() ); } else { mBackgroundColor = *KOPrefs::instance()->categoryColor(cat); if ( (incidence->typeID() == todoID ) &&((static_cast(incidence))->isCompleted()) ) { if ( mBackgroundColor == KOPrefs::instance()->mEventColor ) - mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; + mBackgroundColor = KOPrefs::instance()->mTodoDoneColor; } } @@ -201,7 +201,7 @@ bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) else ++yOff; } - if (mIncidence->isAlarmEnabled()) { + if (mIncidence->isAlarmEnabled() && mIncidence->alarmEnabled()) { p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red ); if ( horLayout ) ++xOff; diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp index 29a4393..2b16347 100644 --- a/korganizer/kofilterview.cpp +++ b/korganizer/kofilterview.cpp @@ -158,6 +158,7 @@ void KOCalEditView::selectCal(int id ,bool b) { KOPrefs::instance()->getCalendar( id )->isEnabled = b; emit calendarEnabled ( id, b ); + emit needsUpdate(); } void KOCalEditView::selectStdCal( int id, bool b ) @@ -199,16 +200,19 @@ void KOCalEditView::selectCalAlarm(int id ,bool b ) { KOPrefs::instance()->getCalendar( id )->isAlarmEnabled = b; emit alarmEnabled ( id , b ); + emit needsUpdate(); } void KOCalEditView::selectReadOnly(int id ,bool b ) { KOPrefs::instance()->getCalendar( id )->isReadOnly = b; emit calendarReadonly ( id , b ); + emit needsUpdate(); } void KOCalEditView::setColor( const QColor& c, int id ) { KOPrefs::instance()->getCalendar( id )->mDefaultColor = c; + emit needsUpdate(); } void 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 @@ -138,6 +138,7 @@ class KOCalEditView : public QWidget void setCalendarDefault ( int cal ); void removeCalendar ( int cal ); void calendarAdded( int ); + void needsUpdate(); private: QVBoxLayout* ml; diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index c868270..96f2502 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -748,7 +748,7 @@ int MonthViewCell::insertEvent(Event *event) } item->setPalette( pal ); item->setRecur( event->recurrence()->doesRecur() ); - item->setAlarm( event->isAlarmEnabled() && multiday < 2 ); + item->setAlarm( event->isAlarmEnabled() && multiday < 2 && event->alarmEnabled() ); item->setMoreInfo( event->description().length() > 0 ); #ifdef DESKTOP_VERSION Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails, @@ -829,7 +829,7 @@ void MonthViewCell::insertTodo(Todo *todo) } item->setPalette( pal ); item->setRecur( todo->recurrence()->doesRecur() ); - item->setAlarm( todo->isAlarmEnabled() ); + item->setAlarm( todo->isAlarmEnabled() && todo->alarmEnabled() ); item->setMoreInfo( todo->description().length() > 0 ); insertItem( item , count()); #ifdef DESKTOP_VERSION diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 2602487..35c2a9f 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -701,10 +701,10 @@ void KOTodoView::updateView() bool next = true; // qDebug("todo %s ", todo->summary().latin1()); Incidence *incidence = todo->relatedTo(); - while ( incidence ) { + while ( incidence ) { if ( incidence->typeID() == todoID ) { //qDebug("related %s ",incidence->summary().latin1() ); - if ( !(todoList.contains ( ((Todo* )incidence ) ) )) { + if ( !(todoList.contains ( ((Todo* )incidence ) ) ) && incidence->calEnabled() ) { //qDebug("related not found "); todoList.remove( ); todo = todoList.current(); @@ -836,34 +836,36 @@ void KOTodoView::restoreItemState( QListViewItem *item ) QMap::ConstIterator - KOTodoView::insertTodoItem(Todo *todo) +KOTodoView::insertTodoItem(Todo *todo) { -// kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl; - // TODO: Check, if dynmaic cast is necessary + // kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl; + // TODO: Check, if dynmaic cast is necessary pendingSubtodo = 0; - Incidence *incidence = todo->relatedTo(); - if (incidence && incidence->typeID() == todoID ) { - Todo *relatedTodo = static_cast(incidence); - -// kdDebug() << " has Related" << endl; - QMap::ConstIterator itemIterator; - itemIterator = mTodoMap.find(relatedTodo); - if (itemIterator == mTodoMap.end()) { -// kdDebug() << " related not yet in list" << endl; - itemIterator = insertTodoItem (relatedTodo); + Incidence *incidence = todo->relatedTo(); + while ( incidence && !incidence->calEnabled() ) + incidence = incidence->relatedTo(); + if (incidence && incidence->typeID() == todoID ) { + Todo *relatedTodo = static_cast(incidence); + + // kdDebug() << " has Related" << endl; + QMap::ConstIterator itemIterator; + itemIterator = mTodoMap.find(relatedTodo); + if (itemIterator == mTodoMap.end()) { + // kdDebug() << " related not yet in list" << endl; + itemIterator = insertTodoItem (relatedTodo); + } + // isn't this pretty stupid? We give one Todo to the KOTodoViewItem + // and one into the map. Sure finding is more easy but why? -zecke + KOTodoViewItem *todoItem = new KOTodoViewItem(*itemIterator,todo,this); + return mTodoMap.insert(todo,todoItem); + } else { + // kdDebug() << " no Related" << endl; + // see above -zecke + KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); + return mTodoMap.insert(todo,todoItem); } - // isn't this pretty stupid? We give one Todo to the KOTodoViewItem - // and one into the map. Sure finding is more easy but why? -zecke - KOTodoViewItem *todoItem = new KOTodoViewItem(*itemIterator,todo,this); - return mTodoMap.insert(todo,todoItem); - } else { -// kdDebug() << " no Related" << endl; - // see above -zecke - KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); - return mTodoMap.insert(todo,todoItem); - } } diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp index 8cb6b83..f987b63 100644 --- a/korganizer/kotodoviewitem.cpp +++ b/korganizer/kotodoviewitem.cpp @@ -195,7 +195,7 @@ void KOTodoViewItem::setMyPixmap() p.end(); pixSize += size; } - if ( mTodo->isAlarmEnabled() ) { + if ( mTodo->isAlarmEnabled() && mTodo->alarmEnabled()) { pixi.resize(size, pixSize+size); pPix.fill( Qt::red ); p.begin( &pixi ); diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp index e8574a0..221debc 100644 --- a/korganizer/kowhatsnextview.cpp +++ b/korganizer/kowhatsnextview.cpp @@ -595,7 +595,7 @@ bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool a needClose =true; } - if ( ev->isAlarmEnabled() ) { + if ( ev->isAlarmEnabled() && ev->alarmEnabled()) { if ( !needClose) tempText +="["; tempText += "a"; @@ -669,7 +669,7 @@ bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) needClose =true; } - if ( ev->isAlarmEnabled() ) { + if ( ev->isAlarmEnabled() && ev->alarmEnabled() ) { if ( !needClose) mText +="["; mText += "a"; -- cgit v0.9.0.2