-rw-r--r-- | korganizer/calendarview.cpp | 9 | ||||
-rw-r--r-- | korganizer/calendarview.h | 1 | ||||
-rw-r--r-- | korganizer/kofilterview.cpp | 4 |
3 files changed, 11 insertions, 3 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 5c88abd..6746de2 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -459,25 +459,25 @@ void CalendarView::init() | |||
459 | #if 0 | 459 | #if 0 |
460 | // FIXME | 460 | // FIXME |
461 | mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, | 461 | mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, |
462 | "CalendarView::DateNavigator", QDate::currentDate()); | 462 | "CalendarView::DateNavigator", QDate::currentDate()); |
463 | #endif | 463 | #endif |
464 | // mDateNavigator->blockSignals( true ); | 464 | // mDateNavigator->blockSignals( true ); |
465 | //leftFrameLayout->addWidget( mDateNavigator ); | 465 | //leftFrameLayout->addWidget( mDateNavigator ); |
466 | mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); | 466 | mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); |
467 | mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); | 467 | mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); |
468 | mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView"); | 468 | mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView"); |
469 | connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) ); | 469 | connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) ); |
470 | connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) ); | 470 | connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) ); |
471 | connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),mCalendar, SLOT( setReadOnly(int,bool)) ); | 471 | connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),this, SLOT( setCalReadOnly(int,bool)) ); |
472 | connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) ); | 472 | connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) ); |
473 | connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) ); | 473 | connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) ); |
474 | connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) ); | 474 | connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) ); |
475 | connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) ); | 475 | connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) ); |
476 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) ); | 476 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) ); |
477 | connect( mCalEditView, SIGNAL( checkCalendar() ),this, SLOT( checkFiles() )); | 477 | connect( mCalEditView, SIGNAL( checkCalendar() ),this, SLOT( checkFiles() )); |
478 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) ); | 478 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) ); |
479 | 479 | ||
480 | mTodoList->setNavigator( mNavigator ); | 480 | mTodoList->setNavigator( mNavigator ); |
481 | #if 0 | 481 | #if 0 |
482 | if ( QApplication::desktop()->width() < 480 ) { | 482 | if ( QApplication::desktop()->width() < 480 ) { |
483 | leftFrameLayout->addWidget(mFilterView); | 483 | leftFrameLayout->addWidget(mFilterView); |
@@ -645,24 +645,31 @@ void CalendarView::init() | |||
645 | 645 | ||
646 | CalendarView::~CalendarView() | 646 | CalendarView::~CalendarView() |
647 | { | 647 | { |
648 | // kdDebug() << "~CalendarView()" << endl; | 648 | // kdDebug() << "~CalendarView()" << endl; |
649 | //qDebug("CalendarView::~CalendarView() "); | 649 | //qDebug("CalendarView::~CalendarView() "); |
650 | delete mDialogManager; | 650 | delete mDialogManager; |
651 | delete mViewManager; | 651 | delete mViewManager; |
652 | delete mStorage; | 652 | delete mStorage; |
653 | delete mDateFrame ; | 653 | delete mDateFrame ; |
654 | delete mEventViewerDialog; | 654 | delete mEventViewerDialog; |
655 | //kdDebug() << "~CalendarView() done" << endl; | 655 | //kdDebug() << "~CalendarView() done" << endl; |
656 | } | 656 | } |
657 | void CalendarView::setCalReadOnly( int id, bool readO ) | ||
658 | { | ||
659 | if ( readO ) { | ||
660 | emit save(); | ||
661 | } | ||
662 | mCalendar->setReadOnly( id, readO ); | ||
663 | } | ||
657 | void CalendarView::setScrollBarStep(int val ) | 664 | void CalendarView::setScrollBarStep(int val ) |
658 | { | 665 | { |
659 | #ifdef DESKTOP_VERSION | 666 | #ifdef DESKTOP_VERSION |
660 | mDateScrollBar->setLineStep ( val ); | 667 | mDateScrollBar->setLineStep ( val ); |
661 | #endif | 668 | #endif |
662 | } | 669 | } |
663 | void CalendarView::scrollBarValue(int val ) | 670 | void CalendarView::scrollBarValue(int val ) |
664 | { | 671 | { |
665 | #ifdef DESKTOP_VERSION | 672 | #ifdef DESKTOP_VERSION |
666 | if ( QApplication::desktop()->width() < 800 ) return; | 673 | if ( QApplication::desktop()->width() < 800 ) return; |
667 | static bool block = false; | 674 | static bool block = false; |
668 | if ( block ) return; | 675 | if ( block ) return; |
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 651194b..a5f230a 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -191,24 +191,25 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
191 | /** Emitted, when the number of outgoing messages has changed. */ | 191 | /** Emitted, when the number of outgoing messages has changed. */ |
192 | void numOutgoingChanged(int); | 192 | void numOutgoingChanged(int); |
193 | 193 | ||
194 | /** Send status message, which can e.g. be displayed in the status bar. */ | 194 | /** Send status message, which can e.g. be displayed in the status bar. */ |
195 | void statusMessage(const QString &); | 195 | void statusMessage(const QString &); |
196 | 196 | ||
197 | void calendarViewExpanded( bool ); | 197 | void calendarViewExpanded( bool ); |
198 | void updateSearchDialog(); | 198 | void updateSearchDialog(); |
199 | void filtersUpdated(); | 199 | void filtersUpdated(); |
200 | 200 | ||
201 | 201 | ||
202 | public slots: | 202 | public slots: |
203 | void setCalReadOnly( int id, bool readO ); | ||
203 | void checkAlarms(); | 204 | void checkAlarms(); |
204 | void checkFiles(); | 205 | void checkFiles(); |
205 | void slotprintSelInc(); | 206 | void slotprintSelInc(); |
206 | void showNextAlarms(); | 207 | void showNextAlarms(); |
207 | void showOpenError(); | 208 | void showOpenError(); |
208 | void watchSavedFile(); | 209 | void watchSavedFile(); |
209 | void recheckTimerAlarm(); | 210 | void recheckTimerAlarm(); |
210 | void checkNextTimerAlarm(); | 211 | void checkNextTimerAlarm(); |
211 | void addAlarm(const QDateTime &qdt, const QString ¬i ); | 212 | void addAlarm(const QDateTime &qdt, const QString ¬i ); |
212 | void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); | 213 | void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); |
213 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); | 214 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); |
214 | 215 | ||
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp index 1335d7e..3f08ef8 100644 --- a/korganizer/kofilterview.cpp +++ b/korganizer/kofilterview.cpp | |||
@@ -148,41 +148,41 @@ void KOCalEditView::selectStdCal( int id ) | |||
148 | } | 148 | } |
149 | emit setCalendarDefault ( id ); | 149 | emit setCalendarDefault ( id ); |
150 | } | 150 | } |
151 | 151 | ||
152 | void KOCalEditView::selectCalAlarm(int id ,bool b ) | 152 | void KOCalEditView::selectCalAlarm(int id ,bool b ) |
153 | { | 153 | { |
154 | KOPrefs::instance()->getCalendar( id )->isAlarmEnabled = b; | 154 | KOPrefs::instance()->getCalendar( id )->isAlarmEnabled = b; |
155 | emit alarmEnabled ( id , b ); | 155 | emit alarmEnabled ( id , b ); |
156 | emit needsUpdate(); | 156 | emit needsUpdate(); |
157 | } | 157 | } |
158 | void KOCalEditView::selectReadOnly(int id ,bool b ) | 158 | void KOCalEditView::selectReadOnly(int id ,bool b ) |
159 | { | 159 | { |
160 | KOPrefs::instance()->getCalendar( id )->isReadOnly = b; | ||
161 | emit calendarReadonly ( id , b ); | ||
162 | if ( KOPrefs::instance()->getCalendar( id )->isStandard && b ) { | 160 | if ( KOPrefs::instance()->getCalendar( id )->isStandard && b ) { |
163 | findNewStandard(); | 161 | findNewStandard(); |
164 | } else { | 162 | } else { |
165 | if ( !b ){ | 163 | if ( !b ){ |
166 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); | 164 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); |
167 | while ( kkf ) { | 165 | while ( kkf ) { |
168 | if (kkf->isReadOnly && kkf->isStandard ) { | 166 | if (kkf->isReadOnly && kkf->isStandard ) { |
169 | selectStdCal( id ); | 167 | selectStdCal( id ); |
170 | break; | 168 | break; |
171 | } | 169 | } |
172 | kkf = KOPrefs::instance()->mCalendars.next(); | 170 | kkf = KOPrefs::instance()->mCalendars.next(); |
173 | } | 171 | } |
174 | } | 172 | } |
175 | } | 173 | } |
176 | mStdandardB.at(id-1)->setEnabled( !b ); | 174 | mStdandardB.at(id-1)->setEnabled( !b ); |
175 | emit calendarReadonly ( id , b ); | ||
176 | KOPrefs::instance()->getCalendar( id )->isReadOnly = b; | ||
177 | emit needsUpdate(); | 177 | emit needsUpdate(); |
178 | 178 | ||
179 | } | 179 | } |
180 | void KOCalEditView::findNewStandard() | 180 | void KOCalEditView::findNewStandard() |
181 | { | 181 | { |
182 | bool found = false; | 182 | bool found = false; |
183 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); | 183 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); |
184 | while ( kkf ) { | 184 | while ( kkf ) { |
185 | if (!kkf->isReadOnly && !kkf->mErrorOnLoad ) { | 185 | if (!kkf->isReadOnly && !kkf->mErrorOnLoad ) { |
186 | found = true; | 186 | found = true; |
187 | selectStdCal( kkf->mCalNumber ); | 187 | selectStdCal( kkf->mCalNumber ); |
188 | break; | 188 | break; |