author | zautrix <zautrix> | 2005-06-27 00:49:23 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-27 00:49:23 (UTC) |
commit | 2e566a307bb50ac595fe729ebed0f5336f2af5a8 (patch) (unidiff) | |
tree | 926a9346f1a3c3389e314e170da5cfa64811f9b6 /korganizer | |
parent | 72721fd5da5bc08f595cda85bc260112764b2bd8 (diff) | |
download | kdepimpi-2e566a307bb50ac595fe729ebed0f5336f2af5a8.zip kdepimpi-2e566a307bb50ac595fe729ebed0f5336f2af5a8.tar.gz kdepimpi-2e566a307bb50ac595fe729ebed0f5336f2af5a8.tar.bz2 |
fixesss
-rw-r--r-- | korganizer/calendarview.cpp | 17 | ||||
-rw-r--r-- | korganizer/kofilterview.cpp | 32 | ||||
-rw-r--r-- | korganizer/kofilterview.h | 3 | ||||
-rw-r--r-- | korganizer/koprefs.cpp | 4 | ||||
-rw-r--r-- | korganizer/main.cpp | 1 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 9 |
6 files changed, 55 insertions, 11 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 08909ed..f179c58 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1609,2 +1609,7 @@ bool CalendarView::importBday() | |||
1609 | #ifdef DESKTOP_VERSION | 1609 | #ifdef DESKTOP_VERSION |
1610 | int curCal = mCalendar->defaultCalendar(); | ||
1611 | int bd = mCalEditView->getBirtdayID(); | ||
1612 | if ( bd == 0 ) | ||
1613 | return; | ||
1614 | mCalendar->setDefaultCalendar( bd ); | ||
1610 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); | 1615 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); |
@@ -1647,2 +1652,3 @@ bool CalendarView::importBday() | |||
1647 | } | 1652 | } |
1653 | mCalendar->setDefaultCalendar( curCal ); | ||
1648 | updateView(); | 1654 | updateView(); |
@@ -1668,5 +1674,13 @@ void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthd | |||
1668 | { | 1674 | { |
1675 | |||
1669 | //qDebug("KO::CalendarView::insertBirthdays"); | 1676 | //qDebug("KO::CalendarView::insertBirthdays"); |
1670 | if (uid == this->name()) | 1677 | if (uid == this->name()) |
1671 | { | 1678 | { |
1679 | int curCal = mCalendar->defaultCalendar(); | ||
1680 | int bd = mCalEditView->getBirtdayID(); | ||
1681 | if ( bd == 0 ) | ||
1682 | return; | ||
1683 | mCalendar->setDefaultCalendar( bd ); | ||
1684 | |||
1685 | |||
1672 | int count = birthdayList.count(); | 1686 | int count = birthdayList.count(); |
@@ -1733,2 +1747,3 @@ void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthd | |||
1733 | 1747 | ||
1748 | mCalendar->setDefaultCalendar( curCal ); | ||
1734 | updateView(); | 1749 | updateView(); |
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp index a8a3052..3cde103 100644 --- a/korganizer/kofilterview.cpp +++ b/korganizer/kofilterview.cpp | |||
@@ -356,3 +356,3 @@ void KOCalEditView::addCal() | |||
356 | KONewCalPrefs prefs ( this ); | 356 | KONewCalPrefs prefs ( this ); |
357 | prefs.nameE->setText( name ); | 357 | prefs.nameE->setText( name ); |
358 | prefs.url->setURL( file ); | 358 | prefs.url->setURL( file ); |
@@ -380,6 +380,12 @@ void KOCalEditView::addCal() | |||
380 | } | 380 | } |
381 | addCalendar ( name, file ); | ||
382 | } | ||
383 | int KOCalEditView::addCalendar( QString name, QString file, bool ask ) | ||
384 | { | ||
385 | |||
381 | QFileInfo fi ( file ); | 386 | QFileInfo fi ( file ); |
382 | if (!fi.exists() ) { | 387 | if (!fi.exists() ) { |
383 | if ( KMessageBox::questionYesNo(this, i18n("The file\n%1\ndoes not exist!\nShall I create it for you?").arg( file ) )== KMessageBox::No ) | 388 | if ( ask ) |
384 | return; | 389 | 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; | ||
385 | QFile fileIn( file ); | 391 | QFile fileIn( file ); |
@@ -387,3 +393,3 @@ void KOCalEditView::addCal() | |||
387 | KMessageBox::sorry( this, i18n("Sorry, cannot create the file\n%1!\nNo calendar added!").arg( file ) ); | 393 | KMessageBox::sorry( this, i18n("Sorry, cannot create the file\n%1!\nNo calendar added!").arg( file ) ); |
388 | return; | 394 | return 0; |
389 | } | 395 | } |
@@ -398,5 +404,19 @@ void KOCalEditView::addCal() | |||
398 | emit calendarAdded( kkf->mCalNumber ); | 404 | emit calendarAdded( kkf->mCalNumber ); |
399 | emit needsUpdate(); | 405 | if ( ask ) |
400 | QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); | 406 | emit needsUpdate(); |
407 | QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); | ||
408 | return kkf->mCalNumber; | ||
401 | } | 409 | } |
410 | int KOCalEditView::getBirtdayID() | ||
411 | { | ||
412 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); | ||
413 | while ( kkf ) { | ||
414 | if ( kkf->mName == i18n("Birthdays") ) | ||
415 | return kkf->mCalNumber; | ||
416 | kkf = KOPrefs::instance()->mCalendars.next(); | ||
417 | } | ||
418 | QString file = locateLocal( "data", "korganizer/birthdays.ics" ); | ||
419 | return addCalendar( i18n("Birthdays"), file, false ); | ||
420 | } | ||
421 | |||
402 | void KOCalEditView::enableAll() | 422 | void KOCalEditView::enableAll() |
diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h index b57a6e9..54fe2c5 100644 --- a/korganizer/kofilterview.h +++ b/korganizer/kofilterview.h | |||
@@ -210,3 +210,4 @@ class KOCalEditView : public QScrollView | |||
210 | ~KOCalEditView(); | 210 | ~KOCalEditView(); |
211 | 211 | int addCalendar( QString calName, QString fileName, bool ask = true ); | |
212 | int getBirtdayID(); | ||
212 | public slots: | 213 | public slots: |
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index a4ea3d3..7ba7269 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp | |||
@@ -462,2 +462,6 @@ void KOPrefs::usrReadConfig() | |||
462 | } | 462 | } |
463 | //qDebug("NAME %s %s", kkf->mName.latin1(), i18n("Birthdays").latin1() ); | ||
464 | if ( kkf->mName == i18n("Birthdays") ) { | ||
465 | kkf->mFileName = locateLocal( "data", "korganizer/birthdays.ics" ); | ||
466 | } | ||
463 | } | 467 | } |
diff --git a/korganizer/main.cpp b/korganizer/main.cpp index 2bf46b9..c9d1345 100644 --- a/korganizer/main.cpp +++ b/korganizer/main.cpp | |||
@@ -87,2 +87,3 @@ int main( int argc, char **argv ) | |||
87 | QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont ); | 87 | QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont ); |
88 | KPimGlobalPrefs::instance()->setGlobalConfig(); | ||
88 | MainWindow m; | 89 | MainWindow m; |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index b9d8742..68233e8 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -175,3 +175,3 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
175 | KOPrefs *p = KOPrefs::instance(); | 175 | KOPrefs *p = KOPrefs::instance(); |
176 | KPimGlobalPrefs::instance()->setGlobalConfig(); | 176 | //KPimGlobalPrefs::instance()->setGlobalConfig(); |
177 | p->mCurrentDisplayedView = 0; | 177 | p->mCurrentDisplayedView = 0; |
@@ -1725,3 +1725,3 @@ void MainWindow::importBday() | |||
1725 | { | 1725 | { |
1726 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1726 | int result = QMessageBox::warning( this, i18n("KO/Pi import information!"), |
1727 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), | 1727 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), |
@@ -2312,3 +2312,2 @@ void MainWindow::saveCalendar() | |||
2312 | { | 2312 | { |
2313 | |||
2314 | QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; | 2313 | QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; |
@@ -2321,2 +2320,6 @@ void MainWindow::saveCalendar() | |||
2321 | if ( KMessageBox::warningContinueCancel( this, i18n("This will <b>backup all calendar files</b> to the directory %1 %2").arg(bupDir).arg(bupHint),i18n("Information") ) != KMessageBox::Continue ) return; | 2320 | if ( KMessageBox::warningContinueCancel( this, i18n("This will <b>backup all calendar files</b> to the directory %1 %2").arg(bupDir).arg(bupHint),i18n("Information") ) != KMessageBox::Continue ) return; |
2321 | bool enabled = KPimGlobalPrefs::instance()->mBackupEnabled; | ||
2322 | KPimGlobalPrefs::instance()->mBackupEnabled = false; | ||
2323 | save(); | ||
2324 | KPimGlobalPrefs::instance()->mBackupEnabled = enabled; | ||
2322 | backupAllFiles(); | 2325 | backupAllFiles(); |