summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-05 08:32:25 (UTC)
committer zautrix <zautrix>2004-10-05 08:32:25 (UTC)
commit701cd3c2b2b713c12797f5bda24c35d3a7889539 (patch) (side-by-side diff)
tree56d07b2f4a050fbc839ab6435b2266e8a52a08ba
parentad859d26b813101adab963f50e694961702561d9 (diff)
downloadkdepimpi-701cd3c2b2b713c12797f5bda24c35d3a7889539.zip
kdepimpi-701cd3c2b2b713c12797f5bda24c35d3a7889539.tar.gz
kdepimpi-701cd3c2b2b713c12797f5bda24c35d3a7889539.tar.bz2
warning dialog fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp17
-rw-r--r--korganizer/calendarview.h1
-rw-r--r--korganizer/mainwindow.cpp4
3 files changed, 17 insertions, 5 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index fecc7e2..687943e 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1524,13 +1524,26 @@ bool CalendarView::openCalendar(QString filename, bool merge)
// 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)
{
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 355bb84..cd54685 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -173,4 +173,5 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
public slots:
+ void showOpenError();
void watchSavedFile();
void recheckTimerAlarm();
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 43ee2d7..7b666d1 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -145,5 +145,4 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
//qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
mView->readSettings();
- bool oldOpened = false;
bool newFile = false;
if( !QFile::exists( defaultFileName() ) ) {
@@ -171,6 +170,5 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
QTime neededSaveTime = QDateTime::currentDateTime().time();
- if ( ! oldOpened )
- mView->openCalendar( defaultFileName() );
+ mView->openCalendar( defaultFileName() );
int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
qDebug("KO: Calendar loading time: %d ms",msNeeded );