summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-06-27 00:49:23 (UTC)
committer zautrix <zautrix>2005-06-27 00:49:23 (UTC)
commit2e566a307bb50ac595fe729ebed0f5336f2af5a8 (patch) (side-by-side diff)
tree926a9346f1a3c3389e314e170da5cfa64811f9b6 /korganizer
parent72721fd5da5bc08f595cda85bc260112764b2bd8 (diff)
downloadkdepimpi-2e566a307bb50ac595fe729ebed0f5336f2af5a8.zip
kdepimpi-2e566a307bb50ac595fe729ebed0f5336f2af5a8.tar.gz
kdepimpi-2e566a307bb50ac595fe729ebed0f5336f2af5a8.tar.bz2
fixesss
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp15
-rw-r--r--korganizer/kofilterview.cpp24
-rw-r--r--korganizer/kofilterview.h3
-rw-r--r--korganizer/koprefs.cpp4
-rw-r--r--korganizer/main.cpp1
-rw-r--r--korganizer/mainwindow.cpp9
6 files changed, 50 insertions, 6 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()
#ifdef DESKTOP_VERSION
+ int curCal = mCalendar->defaultCalendar();
+ int bd = mCalEditView->getBirtdayID();
+ if ( bd == 0 )
+ return;
+ mCalendar->setDefaultCalendar( bd );
KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true );
@@ -1647,2 +1652,3 @@ bool CalendarView::importBday()
}
+ mCalendar->setDefaultCalendar( curCal );
updateView();
@@ -1668,2 +1674,3 @@ void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthd
{
+
//qDebug("KO::CalendarView::insertBirthdays");
@@ -1671,2 +1678,9 @@ void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthd
{
+ int curCal = mCalendar->defaultCalendar();
+ int bd = mCalEditView->getBirtdayID();
+ if ( bd == 0 )
+ return;
+ mCalendar->setDefaultCalendar( bd );
+
+
int count = birthdayList.count();
@@ -1733,2 +1747,3 @@ void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthd
+ mCalendar->setDefaultCalendar( curCal );
updateView();
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp
index a8a3052..3cde103 100644
--- a/korganizer/kofilterview.cpp
+++ b/korganizer/kofilterview.cpp
@@ -380,6 +380,12 @@ void KOCalEditView::addCal()
}
+ addCalendar ( name, file );
+}
+int KOCalEditView::addCalendar( QString name, QString file, bool ask )
+{
+
QFileInfo fi ( file );
if (!fi.exists() ) {
+ if ( ask )
if ( KMessageBox::questionYesNo(this, i18n("The file\n%1\ndoes not exist!\nShall I create it for you?").arg( file ) )== KMessageBox::No )
- return;
+ return 0;
QFile fileIn( file );
@@ -387,3 +393,3 @@ void KOCalEditView::addCal()
KMessageBox::sorry( this, i18n("Sorry, cannot create the file\n%1!\nNo calendar added!").arg( file ) );
- return;
+ return 0;
}
@@ -398,5 +404,19 @@ void KOCalEditView::addCal()
emit calendarAdded( kkf->mCalNumber );
+ if ( ask )
emit needsUpdate();
QTimer::singleShot( 0, this, SLOT ( readConfig() ) );
+ return kkf->mCalNumber;
+}
+int KOCalEditView::getBirtdayID()
+{
+ KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
+ while ( kkf ) {
+ if ( kkf->mName == i18n("Birthdays") )
+ return kkf->mCalNumber;
+ kkf = KOPrefs::instance()->mCalendars.next();
+ }
+ QString file = locateLocal( "data", "korganizer/birthdays.ics" );
+ return addCalendar( i18n("Birthdays"), file, false );
}
+
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
~KOCalEditView();
-
+ int addCalendar( QString calName, QString fileName, bool ask = true );
+ int getBirtdayID();
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()
}
+ //qDebug("NAME %s %s", kkf->mName.latin1(), i18n("Birthdays").latin1() );
+ if ( kkf->mName == i18n("Birthdays") ) {
+ kkf->mFileName = locateLocal( "data", "korganizer/birthdays.ics" );
+ }
}
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 )
QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont );
+ KPimGlobalPrefs::instance()->setGlobalConfig();
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) :
KOPrefs *p = KOPrefs::instance();
- KPimGlobalPrefs::instance()->setGlobalConfig();
+ //KPimGlobalPrefs::instance()->setGlobalConfig();
p->mCurrentDisplayedView = 0;
@@ -1725,3 +1725,3 @@ void MainWindow::importBday()
{
- int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
+ int result = QMessageBox::warning( this, i18n("KO/Pi import information!"),
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()
{
-
QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir;
@@ -2321,2 +2320,6 @@ void MainWindow::saveCalendar()
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;
+ bool enabled = KPimGlobalPrefs::instance()->mBackupEnabled;
+ KPimGlobalPrefs::instance()->mBackupEnabled = false;
+ save();
+ KPimGlobalPrefs::instance()->mBackupEnabled = enabled;
backupAllFiles();