summaryrefslogtreecommitdiffabout
path: root/korganizer/kofilterview.cpp
Unidiff
Diffstat (limited to 'korganizer/kofilterview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kofilterview.cpp2
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
@@ -206,24 +206,25 @@ void KOCalEditView::deleteCal( int id )
206 emit needsUpdate(); 206 emit needsUpdate();
207 QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); 207 QTimer::singleShot( 0, this, SLOT ( readConfig() ) );
208} 208}
209void KOCalEditView::infoCal( int id ) 209void 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}
223void KOCalEditView::readConfig() 224void 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();
@@ -370,24 +371,25 @@ void KOCalEditView::addCal()
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}
383int KOCalEditView::addCalendar( QString name, QString file, bool ask ) 385int 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 ) );