-rw-r--r-- | korganizer/kofilterview.cpp | 14 | ||||
-rw-r--r-- | korganizer/kofilterview.h | 2 |
2 files changed, 11 insertions, 5 deletions
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp index 9633b2c..3333ac2 100644 --- a/korganizer/kofilterview.cpp +++ b/korganizer/kofilterview.cpp @@ -206,7 +206,13 @@ void KOCalEditView::selectReadOnly(int id ,bool b ) { KOPrefs::instance()->getCalendar( id )->isReadOnly = b; emit calendarReadonly ( id , b ); + if ( KOPrefs::instance()->getCalendar( id )->isStandard && b && id > 1 ) { + KOPrefs::instance()->getCalendar( id )->isStandard = false; + KOPrefs::instance()->getCalendar( 1 )->isStandard = true; + emit setCalendarDefault ( 1 ); + } emit needsUpdate(); + QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); } void KOCalEditView::setColor( const QColor& c, int id ) @@ -225,7 +231,7 @@ void KOCalEditView::deleteCal( int id ) emit removeCalendar ( id ); KOPrefs::instance()->mCalendars.remove ( kkf ); emit needsUpdate(); - readConfig(); + QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); } void KOCalEditView::infoCal( int id ) { @@ -234,8 +240,8 @@ void KOCalEditView::infoCal( int id ) if ( KOPrefs::instance()->getCalendar( id )->mErrorOnLoad ) { if ( KMessageBox::Yes == KMessageBox::questionYesNo( this, i18n("The calendar <b>%1</b> is not loaded! Loading of file <b>%2</b> failed! <b>Try again to load the calendar?</b>").arg(name).arg(file) ) ) { emit calendarAdded( id ); - readConfig(); emit needsUpdate(); + QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); } } else @@ -302,7 +308,7 @@ void KOCalEditView::readConfig() cb->setChecked( kkf->isStandard ); cb->setNum( kkf->mCalNumber ); connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectStdCal(int,bool) ) ); - if ( kkf->mErrorOnLoad ) + if ( kkf->mErrorOnLoad || kkf->isReadOnly ) cb->setEnabled( false ); cb = new KOCalCheckButton( mw ); mainLayout->addWidget( cb,row,1 );mEnabledB.append( cb ); @@ -368,8 +374,8 @@ void KOCalEditView::addCal() kkf->mName = name; kkf->mFileName = file; emit calendarAdded( kkf->mCalNumber ); - readConfig(); emit needsUpdate(); + QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); } void KOCalEditView::enableAll() { diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h index 4a0cd8a..1849e36 100644 --- a/korganizer/kofilterview.h +++ b/korganizer/kofilterview.h @@ -117,7 +117,6 @@ class KOCalEditView : public QWidget KOCalEditView( QWidget* parent=0,const char* name=0); ~KOCalEditView(); - void readConfig(); public slots: void addCal(); void enableAll(); @@ -131,6 +130,7 @@ class KOCalEditView : public QWidget void setColor(const QColor &,int) ; void deleteCal(int) ; void infoCal(int) ; + void readConfig(); signals: void alarmEnabled ( int cal, bool enable ); void calendarEnabled ( int cal, bool enable ); |