author | zautrix <zautrix> | 2004-10-05 08:32:25 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-05 08:32:25 (UTC) |
commit | 701cd3c2b2b713c12797f5bda24c35d3a7889539 (patch) (unidiff) | |
tree | 56d07b2f4a050fbc839ab6435b2266e8a52a08ba /korganizer | |
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 | ||||
-rw-r--r-- | korganizer/calendarview.h | 1 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 2 |
3 files changed, 16 insertions, 4 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index fecc7e2..687943e 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1523,15 +1523,28 @@ bool CalendarView::openCalendar(QString filename, bool merge) | |||
1523 | } else { | 1523 | } else { |
1524 | // while failing to load, the calendar object could | 1524 | // while failing to load, the calendar object could |
1525 | // have become partially populated. Clear it out. | 1525 | // have become partially populated. Clear it out. |
1526 | if ( !merge ) mCalendar->close(); | 1526 | if ( !merge ) { |
1527 | mCalendar->close(); | ||
1528 | mViewManager->setDocumentId( filename ); | ||
1529 | mDialogManager->setDocumentId( filename ); | ||
1530 | mTodoList->setDocumentId( filename ); | ||
1531 | } | ||
1527 | 1532 | ||
1528 | KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename)); | 1533 | //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename)); |
1529 | 1534 | ||
1535 | QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) ); | ||
1530 | globalFlagBlockAgenda = 2; | 1536 | globalFlagBlockAgenda = 2; |
1537 | mCalendar->reInitAlarmSettings(); | ||
1538 | setSyncEventsReadOnly(); | ||
1539 | updateUnmanagedViews(); | ||
1531 | updateView(); | 1540 | updateView(); |
1532 | } | 1541 | } |
1533 | return false; | 1542 | return false; |
1534 | } | 1543 | } |
1544 | void CalendarView::showOpenError() | ||
1545 | { | ||
1546 | KMessageBox::error(this,i18n("Couldn't load calendar\n.")); | ||
1547 | } | ||
1535 | void CalendarView::setLoadedFileVersion(QDateTime dt) | 1548 | void CalendarView::setLoadedFileVersion(QDateTime dt) |
1536 | { | 1549 | { |
1537 | loadedFileVersion = dt; | 1550 | loadedFileVersion = dt; |
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 355bb84..cd54685 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -172,6 +172,7 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
172 | 172 | ||
173 | 173 | ||
174 | public slots: | 174 | public slots: |
175 | void showOpenError(); | ||
175 | void watchSavedFile(); | 176 | void watchSavedFile(); |
176 | void recheckTimerAlarm(); | 177 | void recheckTimerAlarm(); |
177 | void checkNextTimerAlarm(); | 178 | void checkNextTimerAlarm(); |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 43ee2d7..7b666d1 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -144,7 +144,6 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
144 | //mView->resize( splash->size() ); | 144 | //mView->resize( splash->size() ); |
145 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 145 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
146 | mView->readSettings(); | 146 | mView->readSettings(); |
147 | bool oldOpened = false; | ||
148 | bool newFile = false; | 147 | bool newFile = false; |
149 | if( !QFile::exists( defaultFileName() ) ) { | 148 | if( !QFile::exists( defaultFileName() ) ) { |
150 | QFileInfo finfo ( defaultFileName() ); | 149 | QFileInfo finfo ( defaultFileName() ); |
@@ -170,7 +169,6 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
170 | } | 169 | } |
171 | 170 | ||
172 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | 171 | QTime neededSaveTime = QDateTime::currentDateTime().time(); |
173 | if ( ! oldOpened ) | ||
174 | mView->openCalendar( defaultFileName() ); | 172 | mView->openCalendar( defaultFileName() ); |
175 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | 173 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |
176 | qDebug("KO: Calendar loading time: %d ms",msNeeded ); | 174 | qDebug("KO: Calendar loading time: %d ms",msNeeded ); |