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 | |
parent | 72721fd5da5bc08f595cda85bc260112764b2bd8 (diff) | |
download | kdepimpi-2e566a307bb50ac595fe729ebed0f5336f2af5a8.zip kdepimpi-2e566a307bb50ac595fe729ebed0f5336f2af5a8.tar.gz kdepimpi-2e566a307bb50ac595fe729ebed0f5336f2af5a8.tar.bz2 |
fixesss
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 3 | ||||
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 4 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 15 | ||||
-rw-r--r-- | korganizer/kofilterview.cpp | 24 | ||||
-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 |
8 files changed, 55 insertions, 8 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index dfc9553..2e120df 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -2,6 +2,9 @@ Info about the changes in new versions of KDE-Pim/Pi | |||
2 | 2 | ||
3 | ********** VERSION 2.1.10 ************ | 3 | ********** VERSION 2.1.10 ************ |
4 | 4 | ||
5 | KO/Pi: | ||
6 | Importing Birthdays will now create another file resource "Birthdays" and import the birthday data from KA/Pi into that file. | ||
7 | |||
5 | ********** VERSION 2.1.9 ************ | 8 | ********** VERSION 2.1.9 ************ |
6 | 9 | ||
7 | KO/Pi: | 10 | KO/Pi: |
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 2ade5bd..01c707e 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1455,8 +1455,8 @@ | |||
1455 | { "Backup succesfully finished","Backup erfolgreich beendet" }, | 1455 | { "Backup succesfully finished","Backup erfolgreich beendet" }, |
1456 | { "(Hint: You can enable automatic backup in the global settings!)","(Hinweis: Sie können ein automatisches Backup in den globalen Einstellungen konfigurieren!)" }, | 1456 | { "(Hint: You can enable automatic backup in the global settings!)","(Hinweis: Sie können ein automatisches Backup in den globalen Einstellungen konfigurieren!)" }, |
1457 | { "This will <b>backup all calendar files</b> to the directory %1 %2","Das schreibt ein <b>Backup aller Kalenderdateien</b> in das Verzeichnis %1 %2" }, | 1457 | { "This will <b>backup all calendar files</b> to the directory %1 %2","Das schreibt ein <b>Backup aller Kalenderdateien</b> in das Verzeichnis %1 %2" }, |
1458 | { "","" }, | 1458 | { "Birthdays","Geburtstage" }, |
1459 | { "","" }, | 1459 | { "KO/Pi import information!","KO/Pi Import Information!" }, |
1460 | { "","" }, | 1460 | { "","" }, |
1461 | { "","" }, | 1461 | { "","" }, |
1462 | { "","" }, | 1462 | { "","" }, |
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 08909ed..f179c58 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1607,6 +1607,11 @@ bool CalendarView::importBday() | |||
1607 | #ifndef KORG_NOKABC | 1607 | #ifndef KORG_NOKABC |
1608 | 1608 | ||
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 ); |
1611 | KABC::AddressBook::Iterator it; | 1616 | KABC::AddressBook::Iterator it; |
1612 | int count = 0; | 1617 | int count = 0; |
@@ -1645,6 +1650,7 @@ bool CalendarView::importBday() | |||
1645 | ++addCount; | 1650 | ++addCount; |
1646 | } | 1651 | } |
1647 | } | 1652 | } |
1653 | mCalendar->setDefaultCalendar( curCal ); | ||
1648 | updateView(); | 1654 | updateView(); |
1649 | topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); | 1655 | topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); |
1650 | #else //DESKTOP_VERSION | 1656 | #else //DESKTOP_VERSION |
@@ -1666,9 +1672,17 @@ void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthd | |||
1666 | const QStringList& emailList, const QStringList& assembledNameList, | 1672 | const QStringList& emailList, const QStringList& assembledNameList, |
1667 | const QStringList& uidList) | 1673 | const QStringList& uidList) |
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(); |
1673 | int addCount = 0; | 1687 | int addCount = 0; |
1674 | KCal::Attendee* a = 0; | 1688 | KCal::Attendee* a = 0; |
@@ -1731,6 +1745,7 @@ void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthd | |||
1731 | } | 1745 | } |
1732 | } | 1746 | } |
1733 | 1747 | ||
1748 | mCalendar->setDefaultCalendar( curCal ); | ||
1734 | updateView(); | 1749 | updateView(); |
1735 | topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); | 1750 | topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); |
1736 | 1751 | ||
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp index a8a3052..3cde103 100644 --- a/korganizer/kofilterview.cpp +++ b/korganizer/kofilterview.cpp | |||
@@ -378,14 +378,20 @@ void KOCalEditView::addCal() | |||
378 | kkf = KOPrefs::instance()->mCalendars.next(); | 378 | kkf = KOPrefs::instance()->mCalendars.next(); |
379 | } | 379 | } |
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() ) { |
388 | if ( ask ) | ||
383 | if ( KMessageBox::questionYesNo(this, i18n("The file\n%1\ndoes not exist!\nShall I create it for you?").arg( file ) )== KMessageBox::No ) | 389 | if ( KMessageBox::questionYesNo(this, i18n("The file\n%1\ndoes not exist!\nShall I create it for you?").arg( file ) )== KMessageBox::No ) |
384 | return; | 390 | return 0; |
385 | QFile fileIn( file ); | 391 | QFile fileIn( file ); |
386 | if (!fileIn.open( IO_WriteOnly ) ) { | 392 | if (!fileIn.open( IO_WriteOnly ) ) { |
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 | } |
390 | QTextStream tsIn( &fileIn ); | 396 | QTextStream tsIn( &fileIn ); |
391 | tsIn.setCodec( QTextCodec::codecForName("utf8") ); | 397 | tsIn.setCodec( QTextCodec::codecForName("utf8") ); |
@@ -396,9 +402,23 @@ void KOCalEditView::addCal() | |||
396 | kkf->mName = name; | 402 | kkf->mName = name; |
397 | kkf->mFileName = file; | 403 | kkf->mFileName = file; |
398 | emit calendarAdded( kkf->mCalNumber ); | 404 | emit calendarAdded( kkf->mCalNumber ); |
405 | if ( ask ) | ||
399 | emit needsUpdate(); | 406 | emit needsUpdate(); |
400 | QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); | 407 | QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); |
408 | return kkf->mCalNumber; | ||
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 ); | ||
401 | } | 420 | } |
421 | |||
402 | void KOCalEditView::enableAll() | 422 | void KOCalEditView::enableAll() |
403 | { | 423 | { |
404 | toggleList( mEnabledB ); | 424 | toggleList( mEnabledB ); |
diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h index b57a6e9..54fe2c5 100644 --- a/korganizer/kofilterview.h +++ b/korganizer/kofilterview.h | |||
@@ -208,7 +208,8 @@ class KOCalEditView : public QScrollView | |||
208 | public: | 208 | public: |
209 | KOCalEditView( QWidget* parent=0,const char* name=0); | 209 | KOCalEditView( QWidget* parent=0,const char* name=0); |
210 | ~KOCalEditView(); | 210 | ~KOCalEditView(); |
211 | 211 | int addCalendar( QString calName, QString fileName, bool ask = true ); | |
212 | int getBirtdayID(); | ||
212 | public slots: | 213 | public slots: |
213 | void addCal(); | 214 | void addCal(); |
214 | void enableAll(); | 215 | void enableAll(); |
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index a4ea3d3..7ba7269 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp | |||
@@ -460,6 +460,10 @@ void KOPrefs::usrReadConfig() | |||
460 | if ( kkf->mCalNumber == 1 ) { | 460 | if ( kkf->mCalNumber == 1 ) { |
461 | kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); | 461 | kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); |
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 | } |
464 | 468 | ||
465 | KPimPrefs::usrReadConfig(); | 469 | KPimPrefs::usrReadConfig(); |
diff --git a/korganizer/main.cpp b/korganizer/main.cpp index 2bf46b9..c9d1345 100644 --- a/korganizer/main.cpp +++ b/korganizer/main.cpp | |||
@@ -85,6 +85,7 @@ int main( int argc, char **argv ) | |||
85 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer"))); | 85 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer"))); |
86 | 86 | ||
87 | QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont ); | 87 | QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont ); |
88 | KPimGlobalPrefs::instance()->setGlobalConfig(); | ||
88 | MainWindow m; | 89 | MainWindow m; |
89 | #ifndef DESKTOP_VERSION | 90 | #ifndef DESKTOP_VERSION |
90 | 91 | ||
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index b9d8742..68233e8 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -173,7 +173,7 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
173 | mFlagKeyPressed = false; | 173 | mFlagKeyPressed = false; |
174 | setCaption("KO/Pi"); | 174 | setCaption("KO/Pi"); |
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; |
178 | if ( p->mHourSize > 22 ) | 178 | if ( p->mHourSize > 22 ) |
179 | p->mHourSize = 22; | 179 | p->mHourSize = 22; |
@@ -1723,7 +1723,7 @@ void MainWindow::importOL() | |||
1723 | } | 1723 | } |
1724 | void MainWindow::importBday() | 1724 | 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"), |
1728 | i18n("Import!"), i18n("Cancel"), 0, | 1728 | i18n("Import!"), i18n("Cancel"), 0, |
1729 | 0, 1 ); | 1729 | 0, 1 ); |
@@ -2310,7 +2310,6 @@ void MainWindow::configureAgenda( int item ) | |||
2310 | 2310 | ||
2311 | void MainWindow::saveCalendar() | 2311 | void MainWindow::saveCalendar() |
2312 | { | 2312 | { |
2313 | |||
2314 | QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; | 2313 | QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; |
2315 | if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) | 2314 | if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) |
2316 | bupDir = KGlobalSettings::backupDataDir(); | 2315 | bupDir = KGlobalSettings::backupDataDir(); |
@@ -2319,6 +2318,10 @@ void MainWindow::saveCalendar() | |||
2319 | if ( !KPimGlobalPrefs::instance()->mBackupEnabled ) | 2318 | if ( !KPimGlobalPrefs::instance()->mBackupEnabled ) |
2320 | bupHint = i18n("(Hint: You can enable automatic backup in the global settings!)"); | 2319 | bupHint = i18n("(Hint: You can enable automatic backup in the global settings!)"); |
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(); |
2323 | } | 2326 | } |
2324 | void MainWindow::loadCalendar() | 2327 | void MainWindow::loadCalendar() |