-rw-r--r-- | korganizer/kofilterview.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp index 3cde103..20118aa 100644 --- a/korganizer/kofilterview.cpp +++ b/korganizer/kofilterview.cpp | |||
@@ -202,32 +202,33 @@ void KOCalEditView::deleteCal( int id ) | |||
202 | if ( kkf->isStandard ) | 202 | if ( kkf->isStandard ) |
203 | selectStdCal( 1, true ); | 203 | selectStdCal( 1, true ); |
204 | emit removeCalendar ( id ); | 204 | emit removeCalendar ( id ); |
205 | KOPrefs::instance()->mCalendars.remove ( kkf ); | 205 | KOPrefs::instance()->mCalendars.remove ( kkf ); |
206 | emit needsUpdate(); | 206 | emit needsUpdate(); |
207 | QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); | 207 | QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); |
208 | } | 208 | } |
209 | void KOCalEditView::infoCal( int id ) | 209 | void KOCalEditView::infoCal( int id ) |
210 | { | 210 | { |
211 | QString name = KOPrefs::instance()->getCalendar( id )->mName; | 211 | QString name = KOPrefs::instance()->getCalendar( id )->mName; |
212 | QString file = KGlobal::formatMessage ( KOPrefs::instance()->getCalendar( id )->mFileName, 0 ); | 212 | QString file = KGlobal::formatMessage ( KOPrefs::instance()->getCalendar( id )->mFileName, 0 ); |
213 | if ( KOPrefs::instance()->getCalendar( id )->mErrorOnLoad ) { | 213 | if ( KOPrefs::instance()->getCalendar( id )->mErrorOnLoad ) { |
214 | 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) ) ) { | 214 | 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) ) ) { |
215 | emit calendarAdded( id ); | 215 | emit calendarAdded( id ); |
216 | emit needsUpdate(); | 216 | emit needsUpdate(); |
217 | QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); | 217 | QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); |
218 | QTimer::singleShot( 100, this, SIGNAL ( checkCalendar() ) ); | ||
218 | } | 219 | } |
219 | } | 220 | } |
220 | else | 221 | else |
221 | KMessageBox::information( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>").arg(name).arg(file) ); | 222 | KMessageBox::information( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>").arg(name).arg(file) ); |
222 | } | 223 | } |
223 | void KOCalEditView::readConfig() | 224 | void KOCalEditView::readConfig() |
224 | { | 225 | { |
225 | 226 | ||
226 | mStdandardB.clear(); | 227 | mStdandardB.clear(); |
227 | mEnabledB.clear(); | 228 | mEnabledB.clear(); |
228 | mAlarmB.clear(); | 229 | mAlarmB.clear(); |
229 | mROB.clear(); | 230 | mROB.clear(); |
230 | 231 | ||
231 | if ( mw ) delete mw; | 232 | if ( mw ) delete mw; |
232 | mw = new QWidget ( viewport() ); | 233 | mw = new QWidget ( viewport() ); |
233 | addChild(mw); | 234 | addChild(mw); |
@@ -366,32 +367,33 @@ void KOCalEditView::addCal() | |||
366 | if ( kkf->mName == name ) { | 367 | if ( kkf->mName == name ) { |
367 | KMessageBox::information( this, i18n("Sorry, the calendar name \n%1\nalready exists!\nPlease choose another name!").arg( name ) ); | 368 | KMessageBox::information( this, i18n("Sorry, the calendar name \n%1\nalready exists!\nPlease choose another name!").arg( name ) ); |
368 | name = ""; | 369 | name = ""; |
369 | tryagain = true; | 370 | tryagain = true; |
370 | break; | 371 | break; |
371 | } | 372 | } |
372 | if ( kkf->mFileName == file ) { | 373 | if ( kkf->mFileName == file ) { |
373 | KMessageBox::information( this, i18n("Sorry, the file \n%1\nis already loaded!\nPlease choose another file!").arg( KGlobal::formatMessage (file, 0 )) ); | 374 | KMessageBox::information( this, i18n("Sorry, the file \n%1\nis already loaded!\nPlease choose another file!").arg( KGlobal::formatMessage (file, 0 )) ); |
374 | tryagain = true; | 375 | tryagain = true; |
375 | file = ""; | 376 | file = ""; |
376 | break; | 377 | break; |
377 | } | 378 | } |
378 | kkf = KOPrefs::instance()->mCalendars.next(); | 379 | kkf = KOPrefs::instance()->mCalendars.next(); |
379 | } | 380 | } |
380 | } | 381 | } |
381 | addCalendar ( name, file ); | 382 | addCalendar ( name, file ); |
383 | QTimer::singleShot( 100, this, SIGNAL ( checkCalendar() ) ); | ||
382 | } | 384 | } |
383 | int KOCalEditView::addCalendar( QString name, QString file, bool ask ) | 385 | int KOCalEditView::addCalendar( QString name, QString file, bool ask ) |
384 | { | 386 | { |
385 | 387 | ||
386 | QFileInfo fi ( file ); | 388 | QFileInfo fi ( file ); |
387 | if (!fi.exists() ) { | 389 | if (!fi.exists() ) { |
388 | if ( ask ) | 390 | if ( ask ) |
389 | if ( KMessageBox::questionYesNo(this, i18n("The file\n%1\ndoes not exist!\nShall I create it for you?").arg( file ) )== KMessageBox::No ) | 391 | if ( KMessageBox::questionYesNo(this, i18n("The file\n%1\ndoes not exist!\nShall I create it for you?").arg( file ) )== KMessageBox::No ) |
390 | return 0; | 392 | return 0; |
391 | QFile fileIn( file ); | 393 | QFile fileIn( file ); |
392 | if (!fileIn.open( IO_WriteOnly ) ) { | 394 | if (!fileIn.open( IO_WriteOnly ) ) { |
393 | KMessageBox::sorry( this, i18n("Sorry, cannot create the file\n%1!\nNo calendar added!").arg( file ) ); | 395 | KMessageBox::sorry( this, i18n("Sorry, cannot create the file\n%1!\nNo calendar added!").arg( file ) ); |
394 | return 0; | 396 | return 0; |
395 | } | 397 | } |
396 | QTextStream tsIn( &fileIn ); | 398 | QTextStream tsIn( &fileIn ); |
397 | tsIn.setCodec( QTextCodec::codecForName("utf8") ); | 399 | tsIn.setCodec( QTextCodec::codecForName("utf8") ); |