-rw-r--r-- | korganizer/kofilterview.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp index 2b16347..361eec8 100644 --- a/korganizer/kofilterview.cpp +++ b/korganizer/kofilterview.cpp @@ -199,50 +199,53 @@ void KOCalEditView::selectStdCal( int id, bool b ) 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 ) { KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id ); QString name = kkf->mName; QString file = kkf->mFileName; 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; + if ( kkf->isStandard ) + selectStdCal( 1, true ); emit removeCalendar ( id ); KOPrefs::instance()->mCalendars.remove ( kkf ); + emit needsUpdate(); readConfig(); } void KOCalEditView::infoCal( int id ) { QString name = KOPrefs::instance()->getCalendar( id )->mName; QString file = KOPrefs::instance()->getCalendar( id )->mFileName; KMessageBox::information( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>").arg(name).arg(file) ); } void KOCalEditView::readConfig() { mStdandardB.clear(); mEnabledB.clear(); mAlarmB.clear(); mROB.clear(); if ( mw ) delete mw; mw = new QWidget ( this ); ml->addWidget ( mw ); mainLayout = new QGridLayout ( mw , 2, 8 ); //mainLayout->setSpacing( 3 ); QPushButton * addBut = new QPushButton ( mw ); mainLayout->addWidget( addBut,0,0 ); @@ -330,48 +333,49 @@ void KOCalEditView::readConfig() } lab = new QLabel ( "", mw ); mainLayout->addWidget( lab,row,0 ); mw->show(); } void KOCalEditView::addCal() { qDebug("addcal "); KONewCalPrefs prefs ( this ); if ( ! prefs.exec() ) return; QString name = prefs.calName(); QString file = prefs.calFileName(); QFileInfo fi ( file ); if (!fi.exists() ) { KMessageBox::information( this, i18n("File does not exist!\nNo calendar added!")); return; } KopiCalendarFile * kkf = KOPrefs::instance()->getNewCalendar(); kkf->mName = name; kkf->mFileName = file; emit calendarAdded( kkf->mCalNumber ); readConfig(); + emit needsUpdate(); } void KOCalEditView::enableAll() { toggleList( mEnabledB ); } void KOCalEditView::enableAlarm() { toggleList( mAlarmB ); } void KOCalEditView::disableRO() { toggleList( mROB ); } void KOCalEditView::toggleList ( QPtrList<KOCalCheckButton> list ) { bool dis = false; KOCalCheckButton* it = list.first(); while ( it ) { if ( !it->isChecked() ) { dis = true; break; } it = list.next(); } |