author | zautrix <zautrix> | 2004-10-05 08:32:25 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-05 08:32:25 (UTC) |
commit | 701cd3c2b2b713c12797f5bda24c35d3a7889539 (patch) (side-by-side diff) | |
tree | 56d07b2f4a050fbc839ab6435b2266e8a52a08ba /korganizer/calendarview.cpp | |
parent | ad859d26b813101adab963f50e694961702561d9 (diff) | |
download | kdepimpi-701cd3c2b2b713c12797f5bda24c35d3a7889539.zip kdepimpi-701cd3c2b2b713c12797f5bda24c35d3a7889539.tar.gz kdepimpi-701cd3c2b2b713c12797f5bda24c35d3a7889539.tar.bz2 |
warning dialog fixes
-rw-r--r-- | korganizer/calendarview.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index fecc7e2..687943e 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -1514,33 +1514,46 @@ bool CalendarView::openCalendar(QString filename, bool merge) setSyncEventsReadOnly(); updateUnmanagedViews(); updateView(); loadedFileVersion = QDateTime::currentDateTime(); if ( filename != MainWindow::defaultFileName() ) { saveCalendar( MainWindow::defaultFileName() ); watchSavedFile(); } return true; } else { // while failing to load, the calendar object could // have become partially populated. Clear it out. - if ( !merge ) mCalendar->close(); + if ( !merge ) { + mCalendar->close(); + mViewManager->setDocumentId( filename ); + mDialogManager->setDocumentId( filename ); + mTodoList->setDocumentId( filename ); + } - KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename)); + //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename)); + QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) ); globalFlagBlockAgenda = 2; + mCalendar->reInitAlarmSettings(); + setSyncEventsReadOnly(); + updateUnmanagedViews(); updateView(); } return false; } +void CalendarView::showOpenError() +{ + KMessageBox::error(this,i18n("Couldn't load calendar\n.")); +} void CalendarView::setLoadedFileVersion(QDateTime dt) { loadedFileVersion = dt; } bool CalendarView::checkFileChanged(QString fn) { QFileInfo finf ( fn ); if ( !finf.exists() ) return true; QDateTime dt = finf.lastModified (); if ( dt <= loadedFileVersion ) return false; |