-rw-r--r-- | korganizer/kofilterview.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp index 9633b2c..3333ac2 100644 --- a/korganizer/kofilterview.cpp +++ b/korganizer/kofilterview.cpp @@ -205,9 +205,15 @@ void KOCalEditView::selectCalAlarm(int id ,bool b ) 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 ) { @@ -224,19 +230,19 @@ void KOCalEditView::deleteCal( int id ) selectStdCal( 1, true ); emit removeCalendar ( id ); KOPrefs::instance()->mCalendars.remove ( kkf ); emit needsUpdate(); - readConfig(); + QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); } void KOCalEditView::infoCal( int id ) { QString name = KOPrefs::instance()->getCalendar( id )->mName; QString file = KOPrefs::instance()->getCalendar( id )->mFileName; 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 KMessageBox::information( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>").arg(name).arg(file) ); @@ -301,9 +307,9 @@ void KOCalEditView::readConfig() mainLayout->addWidget( cb,row,0 );mStdandardB.append( cb ); 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 ); cb->setChecked( kkf->isEnabled ); @@ -367,10 +373,10 @@ void KOCalEditView::addCal() KopiCalendarFile * kkf = KOPrefs::instance()->getNewCalendar(); kkf->mName = name; kkf->mFileName = file; emit calendarAdded( kkf->mCalNumber ); - readConfig(); emit needsUpdate(); + QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); } void KOCalEditView::enableAll() { toggleList( mEnabledB ); |