summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt1
-rw-r--r--korganizer/kofilterview.cpp7
-rw-r--r--korganizer/koprefs.cpp8
-rw-r--r--korganizer/mainwindow.cpp6
4 files changed, 12 insertions, 10 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 944ee1e..0160dbe 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,32 +1,33 @@
1Info about the changes in new versions of KDE-Pim/Pi 1Info about the changes in new versions of KDE-Pim/Pi
2 2
3********** VERSION 2.2.1 ************ 3********** VERSION 2.2.1 ************
4 4
5KO/Pi: 5KO/Pi:
6Fixed a problem displaying very long allday events in agenda view in single day mode. 6Fixed a problem displaying very long allday events in agenda view in single day mode.
7Fixed a problem with the default settings for new todos. 7Fixed a problem with the default settings for new todos.
8Added an error message dialog if saving of calendar files is not possible. 8Added an error message dialog if saving of calendar files is not possible.
9Made it impossible to close KO/Pi if saving fails. 9Made it impossible to close KO/Pi if saving fails.
10Fixed a problem adding calendars on windows such that these calendars can be used on the memory stick.
10 11
11KA/Pi: 12KA/Pi:
12Added a config option to turn on asking before a contact is deleted. 13Added a config option to turn on asking before a contact is deleted.
13Fixed a problem with the default view and view selection at startup. 14Fixed a problem with the default view and view selection at startup.
14Formatted name is now set on import, if formatted name is empty. 15Formatted name is now set on import, if formatted name is empty.
15 16
16********** VERSION 2.2.0 ************ 17********** VERSION 2.2.0 ************
17 18
18New stable release! 19New stable release!
19Fixed some minor usability problems. 20Fixed some minor usability problems.
20Added writing of next alarm to a file for usage on pdaXrom. 21Added writing of next alarm to a file for usage on pdaXrom.
21 22
22 23
23************************************* 24*************************************
24 25
25You can find the complete changelog 26You can find the complete changelog
26from version 1.7.7 to 2.2.0 27from version 1.7.7 to 2.2.0
27in the source package or on 28in the source package or on
28 29
29http://www.pi-sync.net/html/changelog.html 30http://www.pi-sync.net/html/changelog.html
30 31
31 32
32 33
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp
index e86ec95..ef25fd0 100644
--- a/korganizer/kofilterview.cpp
+++ b/korganizer/kofilterview.cpp
@@ -1,80 +1,81 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qcheckbox.h> 24#include <qcheckbox.h>
25#include <qcombobox.h> 25#include <qcombobox.h>
26#include <qpushbutton.h> 26#include <qpushbutton.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qlabel.h> 28#include <qlabel.h>
29#include <qdialog.h> 29#include <qdialog.h>
30#include <qtextstream.h> 30#include <qtextstream.h>
31#include <qtextcodec.h> 31#include <qtextcodec.h>
32#include <qwhatsthis.h> 32#include <qwhatsthis.h>
33#include <qdir.h>
33 34
34 35
35#include <libkcal/calfilter.h> 36#include <libkcal/calfilter.h>
36 37
37#include "kofilterview.h" 38#include "kofilterview.h"
38#include "koprefs.h" 39#include "koprefs.h"
39#include <kiconloader.h> 40#include <kiconloader.h>
40#include <kglobal.h> 41#include <kglobal.h>
41#include <kglobalsettings.h> 42#include <kglobalsettings.h>
42#include <kcolorbutton.h> 43#include <kcolorbutton.h>
43#include <kmessagebox.h> 44#include <kmessagebox.h>
44 45
45 46
46 47
47 48
48 49
49KOFilterView::KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent, 50KOFilterView::KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent,
50 const char* name,WFlags fl ) 51 const char* name,WFlags fl )
51 : KOFilterView_base(parent,name,fl) 52 : KOFilterView_base(parent,name,fl)
52{ 53{
53 mFilters = filterList; 54 mFilters = filterList;
54 55
55 connect(mSelectionCombo,SIGNAL(activated(int)),SIGNAL(filterChanged())); 56 connect(mSelectionCombo,SIGNAL(activated(int)),SIGNAL(filterChanged()));
56 connect(mEnabledCheck,SIGNAL(clicked()),SIGNAL(filterChanged())); 57 connect(mEnabledCheck,SIGNAL(clicked()),SIGNAL(filterChanged()));
57 connect(mEditButton,SIGNAL(clicked()),SIGNAL(editFilters())); 58 connect(mEditButton,SIGNAL(clicked()),SIGNAL(editFilters()));
58} 59}
59 60
60KOFilterView::~KOFilterView() 61KOFilterView::~KOFilterView()
61{ 62{
62 // no need to delete child widgets, Qt does it all for us 63 // no need to delete child widgets, Qt does it all for us
63} 64}
64 65
65bool KOFilterView::filtersEnabled() 66bool KOFilterView::filtersEnabled()
66{ 67{
67 return mEnabledCheck->isChecked(); 68 return mEnabledCheck->isChecked();
68} 69}
69 70
70void KOFilterView::setFiltersEnabled(bool set) 71void KOFilterView::setFiltersEnabled(bool set)
71{ 72{
72 mEnabledCheck->setChecked(set); 73 mEnabledCheck->setChecked(set);
73 emit filterChanged(); 74 emit filterChanged();
74} 75}
75 76
76 77
77void KOFilterView::updateFilters() 78void KOFilterView::updateFilters()
78{ 79{
79 mSelectionCombo->clear(); 80 mSelectionCombo->clear();
80 81
@@ -362,106 +363,106 @@ void KOCalEditView::readConfig()
362 mainLayout->addWidget( lab,row,0 ); 363 mainLayout->addWidget( lab,row,0 );
363 mw->show(); 364 mw->show();
364 365
365} 366}
366 367
367void KOCalEditView::defaultInfo() 368void KOCalEditView::defaultInfo()
368{ 369{
369 KMessageBox::information( this, i18n("Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.") ); 370 KMessageBox::information( this, i18n("Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.") );
370} 371}
371void KOCalEditView::addCal() 372void KOCalEditView::addCal()
372{ 373{
373 bool tryagain = true; 374 bool tryagain = true;
374 QString name, file = KGlobalSettings::calendarDir()+"newCal.ics"; 375 QString name, file = KGlobalSettings::calendarDir()+"newCal.ics";
375 while ( tryagain ) { 376 while ( tryagain ) {
376 KONewCalPrefs prefs ( this ); 377 KONewCalPrefs prefs ( this );
377 prefs.nameE->setText( name ); 378 prefs.nameE->setText( name );
378 prefs.url->setURL( file ); 379 prefs.url->setURL( file );
379 if ( ! prefs.exec() ) 380 if ( ! prefs.exec() )
380 return; 381 return;
381 name = prefs.calName(); 382 name = prefs.calName();
382 file = prefs.calFileName(); 383 file = prefs.calFileName();
383 tryagain = false; 384 tryagain = false;
384 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 385 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
385 while ( kkf ) { 386 while ( kkf ) {
386 if ( kkf->mName == name ) { 387 if ( kkf->mName == name ) {
387 KMessageBox::information( this, i18n("Sorry, the calendar name \n%1\nalready exists!\nPlease choose another name!").arg( name ) ); 388 KMessageBox::information( this, i18n("Sorry, the calendar name \n%1\nalready exists!\nPlease choose another name!").arg( name ) );
388 name = ""; 389 name = "";
389 tryagain = true; 390 tryagain = true;
390 break; 391 break;
391 } 392 }
392 if ( kkf->mFileName == file ) { 393 if ( kkf->mFileName == file ) {
393 KMessageBox::information( this, i18n("Sorry, the file \n%1\nis already loaded!\nPlease choose another file!").arg( KGlobal::formatMessage (file, 0 )) ); 394 KMessageBox::information( this, i18n("Sorry, the file \n%1\nis already loaded!\nPlease choose another file!").arg( KGlobal::formatMessage (file, 0 )) );
394 tryagain = true; 395 tryagain = true;
395 file = KGlobalSettings::calendarDir()+"newCal.ics"; 396 file = KGlobalSettings::calendarDir()+"newCal.ics";
396 break; 397 break;
397 } 398 }
398 kkf = KOPrefs::instance()->mCalendars.next(); 399 kkf = KOPrefs::instance()->mCalendars.next();
399 } 400 }
400 QFileInfo fi ( file ); 401 QFileInfo fi ( file );
401 if ( fi.isDir() ) { 402 if ( fi.isDir() ) {
402 tryagain = true; 403 tryagain = true;
403 } 404 }
404 } 405 }
405 addCalendar ( name, file ); 406 addCalendar ( name, file );
406 QTimer::singleShot( 100, this, SIGNAL ( checkCalendar() ) ); 407 QTimer::singleShot( 100, this, SIGNAL ( checkCalendar() ) );
407} 408}
408int KOCalEditView::addCalendar( QString name, QString file, bool ask ) 409int KOCalEditView::addCalendar( QString name, QString file, bool ask )
409{ 410{
410 411 file = QDir::convertSeparators( file );
411 QFileInfo fi ( file ); 412 QFileInfo fi ( file );
412 QString absFile = file; 413 QString absFile = file;
413 bool isRelative = false; 414 bool isRelative = false;
414 if ( fi.isRelative() ) { 415 if ( fi.isRelative() ) {
415 isRelative = true; 416 isRelative = true;
416 absFile = KGlobalSettings::calendarDir()+file; 417 absFile = QDir::convertSeparators( KGlobalSettings::calendarDir()+file );
417 fi.setFile( absFile ); 418 fi.setFile( absFile );
418 } else { 419 } else {
419 QString cd = KGlobalSettings::calendarDir(); 420 QString cd = QDir::convertSeparators( KGlobalSettings::calendarDir() );
420 if ( file.left( cd.length() ) == cd ) { 421 if ( file.left( cd.length() ) == cd ) {
421 isRelative = true; 422 isRelative = true;
422 file = fi.fileName (); 423 file = fi.fileName ();
423 fi.setFile( absFile ); 424 fi.setFile( absFile );
424 } 425 }
425 } 426 }
426 if (!fi.exists() ) { 427 if (!fi.exists() ) {
427 if ( ask ) 428 if ( ask )
428 if ( KMessageBox::questionYesNo(this, i18n("The file\n%1\ndoes not exist!\nShall I create it for you?").arg( KGlobal::formatMessage (absFile,0) ) )== KMessageBox::No ) 429 if ( KMessageBox::questionYesNo(this, i18n("The file\n%1\ndoes not exist!\nShall I create it for you?").arg( KGlobal::formatMessage (absFile,0) ) )== KMessageBox::No )
429 return 0; 430 return 0;
430 QFile fileIn( absFile ); 431 QFile fileIn( absFile );
431 if (!fileIn.open( IO_WriteOnly ) ) { 432 if (!fileIn.open( IO_WriteOnly ) ) {
432 KMessageBox::sorry( this, i18n("Sorry, cannot create the file\n%1!\nNo calendar added!").arg( file ) ); 433 KMessageBox::sorry( this, i18n("Sorry, cannot create the file\n%1!\nNo calendar added!").arg( file ) );
433 return 0; 434 return 0;
434 } 435 }
435 QTextStream tsIn( &fileIn ); 436 QTextStream tsIn( &fileIn );
436 tsIn.setCodec( QTextCodec::codecForName("utf8") ); 437 tsIn.setCodec( QTextCodec::codecForName("utf8") );
437 tsIn << "BEGIN:VCALENDAR\nPRODID:-//KDE-Pim//Platform-independent 2.1.0\nVERSION:2.0\nEND:VCALENDAR\n"; 438 tsIn << "BEGIN:VCALENDAR\nPRODID:-//KDE-Pim//Platform-independent 2.1.0\nVERSION:2.0\nEND:VCALENDAR\n";
438 fileIn.close(); 439 fileIn.close();
439 } 440 }
440 KopiCalendarFile * kkf = KOPrefs::instance()->getNewCalendar(); 441 KopiCalendarFile * kkf = KOPrefs::instance()->getNewCalendar();
441 kkf->mName = name; 442 kkf->mName = name;
442 kkf->mFileName = absFile; 443 kkf->mFileName = absFile;
443 kkf->mSavedFileName = file; 444 kkf->mSavedFileName = file;
444 kkf->isRelative = isRelative; 445 kkf->isRelative = isRelative;
445 emit calendarAdded( kkf->mCalNumber ); 446 emit calendarAdded( kkf->mCalNumber );
446 if ( ask ) 447 if ( ask )
447 emit needsUpdate(); 448 emit needsUpdate();
448 QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); 449 QTimer::singleShot( 0, this, SLOT ( readConfig() ) );
449 return kkf->mCalNumber; 450 return kkf->mCalNumber;
450} 451}
451int KOCalEditView::getBirtdayID() 452int KOCalEditView::getBirtdayID()
452{ 453{
453 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 454 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
454 while ( kkf ) { 455 while ( kkf ) {
455 if ( kkf->mName == i18n("Birthdays") ) 456 if ( kkf->mName == i18n("Birthdays") )
456 return kkf->mCalNumber; 457 return kkf->mCalNumber;
457 kkf = KOPrefs::instance()->mCalendars.next(); 458 kkf = KOPrefs::instance()->mCalendars.next();
458 } 459 }
459 QString file = locateLocal( "data", "korganizer/birthdays.ics" ); 460 QString file = locateLocal( "data", "korganizer/birthdays.ics" );
460 return addCalendar( i18n("Birthdays"), file, false ); 461 return addCalendar( i18n("Birthdays"), file, false );
461} 462}
462 463
463void KOCalEditView::enableAll() 464void KOCalEditView::enableAll()
464{ 465{
465 toggleList( mEnabledB ); 466 toggleList( mEnabledB );
466} 467}
467void KOCalEditView::enableAlarm() 468void KOCalEditView::enableAlarm()
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index eb997f5..77f572c 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -404,120 +404,120 @@ QStringList KOPrefs::getDefaultList()
404 << i18n("PHB") << i18n("Phone Calls") << i18n("Shopping") 404 << i18n("PHB") << i18n("Phone Calls") << i18n("Shopping")
405 << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV") 405 << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")
406 << i18n("Vacation") ; 406 << i18n("Vacation") ;
407 retval.sort(); 407 retval.sort();
408 //qDebug("cat %s ", retval.join("-").latin1()); 408 //qDebug("cat %s ", retval.join("-").latin1());
409 return retval; 409 return retval;
410} 410}
411// << i18n("Business Travel") << i18n("Education") << i18n("Hiking") << i18n("Hunting") << i18n("Recurring") << i18n("Personal Travel") << i18n("Speach") << i18n("Festival") << i18n("Competition")<< i18n("Party")<< i18n("Projects")<< i18n("Kids") << i18n("Special Occasion")<< i18n("Breakfast")<< i18n("Dinner") << i18n("Lunch")<< i18n("University")<< i18n("School")<< i18n("Flight")<< i18n("Key Customer") << i18n("VIP") << i18n("SyncEvent") << i18n("Cinema") 411// << i18n("Business Travel") << i18n("Education") << i18n("Hiking") << i18n("Hunting") << i18n("Recurring") << i18n("Personal Travel") << i18n("Speach") << i18n("Festival") << i18n("Competition")<< i18n("Party")<< i18n("Projects")<< i18n("Kids") << i18n("Special Occasion")<< i18n("Breakfast")<< i18n("Dinner") << i18n("Lunch")<< i18n("University")<< i18n("School")<< i18n("Flight")<< i18n("Key Customer") << i18n("VIP") << i18n("SyncEvent") << i18n("Cinema")
412void KOPrefs::usrReadConfig() 412void KOPrefs::usrReadConfig()
413{ 413{
414 config()->setGroup("General"); 414 config()->setGroup("General");
415 415
416 //qDebug("KOPrefs::usrReadConfig() "); 416 //qDebug("KOPrefs::usrReadConfig() ");
417 mCustomCategories = config()->readListEntry("Custom Categories"); 417 mCustomCategories = config()->readListEntry("Custom Categories");
418 mOldLoadedLanguage = mOldLanguage ; 418 mOldLoadedLanguage = mOldLanguage ;
419 mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; 419 mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage;
420 if (mLocationDefaults.isEmpty()) { 420 if (mLocationDefaults.isEmpty()) {
421 mLocationDefaults = getLocationDefaultList(); 421 mLocationDefaults = getLocationDefaultList();
422 } 422 }
423 423
424 if (mEventSummaryUser.isEmpty()) { 424 if (mEventSummaryUser.isEmpty()) {
425 mEventSummaryUser = getDefaultList() ; 425 mEventSummaryUser = getDefaultList() ;
426 } 426 }
427 if (mTodoSummaryUser.isEmpty()) { 427 if (mTodoSummaryUser.isEmpty()) {
428 mTodoSummaryUser = getDefaultList() ; 428 mTodoSummaryUser = getDefaultList() ;
429 } 429 }
430 430
431 if (mCustomCategories.isEmpty()) setCategoryDefaults(); 431 if (mCustomCategories.isEmpty()) setCategoryDefaults();
432 432
433 config()->setGroup("Personal Settings"); 433 config()->setGroup("Personal Settings");
434 mName = config()->readEntry("user_name",""); 434 mName = config()->readEntry("user_name","");
435 mEmail = config()->readEntry("user_email",""); 435 mEmail = config()->readEntry("user_email","");
436 fillMailDefaults(); 436 fillMailDefaults();
437 437
438 config()->setGroup("Category Colors"); 438 config()->setGroup("Category Colors");
439 QStringList::Iterator it; 439 QStringList::Iterator it;
440 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 440 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
441 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); 441 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor));
442 442
443 } 443 }
444 KConfig fc (locateLocal("config","kopicalendarrc")); 444 KConfig fc (locateLocal("config","kopicalendarrc"));
445 fc.setGroup("CC"); 445 fc.setGroup("CC");
446 int numCals = fc.readNumEntry("NumberCalendars",0 ); 446 int numCals = fc.readNumEntry("NumberCalendars",0 );
447 mNextAvailableCalendar = 1; 447 mNextAvailableCalendar = 1;
448 if ( numCals == 0 ) { 448 if ( numCals == 0 ) {
449 KopiCalendarFile *kkf = getNewCalendar(); 449 KopiCalendarFile *kkf = getNewCalendar();
450 kkf->isStandard = true; 450 kkf->isStandard = true;
451 kkf->mName = i18n("Standard"); 451 kkf->mName = i18n("Standard");
452 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); 452 kkf->mFileName = QDir::convertSeparators( locateLocal( "data", "korganizer/mycalendar.ics" ) );
453 } 453 }
454 while ( mNextAvailableCalendar <= numCals ) { 454 while ( mNextAvailableCalendar <= numCals ) {
455 //qDebug("Read cal #%d ", mNextAvailableCalendar ); 455 //qDebug("Read cal #%d ", mNextAvailableCalendar );
456 QString prefix = "Cal_" +QString::number( mNextAvailableCalendar ); 456 QString prefix = "Cal_" +QString::number( mNextAvailableCalendar );
457 KopiCalendarFile *kkf = getNewCalendar(); 457 KopiCalendarFile *kkf = getNewCalendar();
458 kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false ); 458 kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false );
459 kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true); 459 kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true);
460 kkf->isRelative = fc.readBoolEntry( prefix+"_isRelative", false ); 460 kkf->isRelative = fc.readBoolEntry( prefix+"_isRelative", false );
461 kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true); 461 kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true);
462 kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false); 462 kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false);
463 kkf->mName = fc.readEntry( prefix+"_Name", "Calendar"); 463 kkf->mName = fc.readEntry( prefix+"_Name", "Calendar");
464 kkf->mFileName = fc.readEntry( prefix+"_FileName", kkf->mFileName); 464 kkf->mFileName = QDir::convertSeparators( fc.readEntry( prefix+"_FileName", kkf->mFileName) );
465 kkf->mSavedFileName = fc.readEntry( prefix+"_SavedFileName", kkf->mFileName); 465 kkf->mSavedFileName = QDir::convertSeparators( fc.readEntry( prefix+"_SavedFileName", kkf->mFileName) );
466 kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor); 466 kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor);
467 if ( kkf->mCalNumber == 1 ) { 467 if ( kkf->mCalNumber == 1 ) {
468 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); 468 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" );
469 } 469 }
470 //qDebug("NAME %s %s", kkf->mName.latin1(), i18n("Birthdays").latin1() ); 470 //qDebug("NAME %s %s", kkf->mName.latin1(), i18n("Birthdays").latin1() );
471 if ( kkf->mName == i18n("Birthdays") ) { 471 if ( kkf->mName == i18n("Birthdays") ) {
472 kkf->mFileName = locateLocal( "data", "korganizer/birthdays.ics" ); 472 kkf->mFileName = locateLocal( "data", "korganizer/birthdays.ics" );
473 } 473 }
474 if ( kkf->isRelative ) 474 if ( kkf->isRelative )
475 kkf->mFileName = KGlobalSettings::calendarDir() + kkf->mSavedFileName; 475 kkf->mFileName = QDir::convertSeparators( KGlobalSettings::calendarDir() + kkf->mSavedFileName );
476 } 476 }
477 477
478 KPimPrefs::usrReadConfig(); 478 KPimPrefs::usrReadConfig();
479} 479}
480 480
481KopiCalendarFile * KOPrefs::getCalendar( int num ) 481KopiCalendarFile * KOPrefs::getCalendar( int num )
482{ 482{
483 return mDefCalColors[num-1]; 483 return mDefCalColors[num-1];
484} 484}
485 485
486KopiCalendarFile * KOPrefs::getNewCalendar() 486KopiCalendarFile * KOPrefs::getNewCalendar()
487{ 487{
488 KopiCalendarFile * kkf = new KopiCalendarFile(); 488 KopiCalendarFile * kkf = new KopiCalendarFile();
489 kkf->mCalNumber = mNextAvailableCalendar; 489 kkf->mCalNumber = mNextAvailableCalendar;
490 mDefCalColors.resize( mNextAvailableCalendar ); 490 mDefCalColors.resize( mNextAvailableCalendar );
491 mDefCalColors[mNextAvailableCalendar-1] = kkf; 491 mDefCalColors[mNextAvailableCalendar-1] = kkf;
492 ++mNextAvailableCalendar; 492 ++mNextAvailableCalendar;
493 kkf->mDefaultColor = mEventColor; 493 kkf->mDefaultColor = mEventColor;
494 kkf->mName = i18n("New Calendar"); 494 kkf->mName = i18n("New Calendar");
495 mCalendars.append( kkf ); 495 mCalendars.append( kkf );
496 return kkf; 496 return kkf;
497} 497}
498void KOPrefs::deleteCalendar( int num ) 498void KOPrefs::deleteCalendar( int num )
499{ 499{
500 KopiCalendarFile * kkf = mCalendars.first(); 500 KopiCalendarFile * kkf = mCalendars.first();
501 while ( kkf ) { 501 while ( kkf ) {
502 if ( kkf->mCalNumber == num ) { 502 if ( kkf->mCalNumber == num ) {
503 qDebug("KOPrefs::deleteCalendar %d ", num ); 503 qDebug("KOPrefs::deleteCalendar %d ", num );
504 mCalendars.remove( kkf ); 504 mCalendars.remove( kkf );
505 delete kkf; 505 delete kkf;
506 return; 506 return;
507 } 507 }
508 kkf = mCalendars.next(); 508 kkf = mCalendars.next();
509 } 509 }
510} 510}
511int KOPrefs::getCalendarID( const QString & name ) 511int KOPrefs::getCalendarID( const QString & name )
512{ 512{
513 KopiCalendarFile * kkf = mCalendars.first(); 513 KopiCalendarFile * kkf = mCalendars.first();
514 while ( kkf ) { 514 while ( kkf ) {
515 if ( name == kkf->mName) 515 if ( name == kkf->mName)
516 return kkf->mCalNumber; 516 return kkf->mCalNumber;
517 kkf = mCalendars.next(); 517 kkf = mCalendars.next();
518 } 518 }
519 return 1; 519 return 1;
520} 520}
521QString KOPrefs::calName( int calNum) const 521QString KOPrefs::calName( int calNum) const
522{ 522{
523 return (mDefCalColors[calNum-1])->mName; 523 return (mDefCalColors[calNum-1])->mName;
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 9c55e9f..9ae393d 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1647,102 +1647,102 @@ void MainWindow::keyBindings()
1647 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1647 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1648 i18n("<p><b>return</b>: Select item+one step down</p>\n")+ 1648 i18n("<p><b>return</b>: Select item+one step down</p>\n")+
1649 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ 1649 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+
1650 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ 1650 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+
1651 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ 1651 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+
1652 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ 1652 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+
1653 i18n("<p><h3>In event/todo viewer:</h3></p>\n") + 1653 i18n("<p><h3>In event/todo viewer:</h3></p>\n") +
1654 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ 1654 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+
1655 i18n("<p><b>A</b>: Show agenda view.</p>\n")+ 1655 i18n("<p><b>A</b>: Show agenda view.</p>\n")+
1656 i18n("<p><b>E</b>: Edit item</p>\n") + 1656 i18n("<p><b>E</b>: Edit item</p>\n") +
1657 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + 1657 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") +
1658 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + 1658 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") +
1659 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ 1659 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+
1660 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ 1660 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+
1661 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ 1661 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+
1662 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ 1662 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+
1663 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ 1663 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+
1664 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + 1664 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") +
1665 i18n("<p><b>White</b>: Item readonly</p>\n"); 1665 i18n("<p><b>White</b>: Item readonly</p>\n");
1666 displayText( text, cap); 1666 displayText( text, cap);
1667} 1667}
1668void MainWindow::aboutAutoSaving() 1668void MainWindow::aboutAutoSaving()
1669{ 1669{
1670 QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"); 1670 QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n");
1671 1671
1672 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); 1672 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text);
1673 1673
1674} 1674}
1675void MainWindow::aboutKnownBugs() 1675void MainWindow::aboutKnownBugs()
1676{ 1676{
1677 QMessageBox* msg; 1677 QMessageBox* msg;
1678 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), 1678 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"),
1679 i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+ 1679 i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+
1680 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ 1680 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+
1681 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + 1681 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") +
1682 i18n("\nor report them in the bugtracker on\n") + 1682 i18n("\nor report them in the bugtracker on\n") +
1683 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), 1683 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"),
1684 QMessageBox::NoIcon, 1684 QMessageBox::NoIcon,
1685 QMessageBox::Ok, 1685 QMessageBox::Ok,
1686 QMessageBox::NoButton, 1686 QMessageBox::NoButton,
1687 QMessageBox::NoButton); 1687 QMessageBox::NoButton);
1688 msg->exec(); 1688 msg->exec();
1689 delete msg; 1689 delete msg;
1690 1690
1691} 1691}
1692 1692
1693QString MainWindow::defaultFileName() 1693QString MainWindow::defaultFileName()
1694{ 1694{
1695 return locateLocal( "data", "korganizer/mycalendar.ics" ); 1695 return QDir::convertSeparators( locateLocal( "data", "korganizer/mycalendar.ics" ) );
1696} 1696}
1697QString MainWindow::syncFileName() 1697QString MainWindow::syncFileName()
1698{ 1698{
1699#ifdef DESKTOP_VERSION 1699#ifdef DESKTOP_VERSION
1700 return locateLocal( "tmp", "synccalendar.ics" ); 1700 return QDir::convertSeparators( locateLocal( "tmp", "synccalendar.ics" ) );
1701#else 1701#else
1702 return QString( "/tmp/synccalendar.ics" ); 1702 return QString( "/tmp/synccalendar.ics" );
1703#endif 1703#endif
1704} 1704}
1705#include "koglobals.h" 1705#include "koglobals.h"
1706#include <kcalendarsystem.h> 1706#include <kcalendarsystem.h>
1707void MainWindow::updateWeek(QDate seda) 1707void MainWindow::updateWeek(QDate seda)
1708{ 1708{
1709 int weekNum = KGlobal::locale()->weekNum ( seda ); 1709 int weekNum = KGlobal::locale()->weekNum ( seda );
1710 mWeekPixmap.fill( mWeekBgColor ); 1710 mWeekPixmap.fill( mWeekBgColor );
1711 QPainter p ( &mWeekPixmap ); 1711 QPainter p ( &mWeekPixmap );
1712 p.setFont( mWeekFont ); 1712 p.setFont( mWeekFont );
1713 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); 1713 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) );
1714 p.end(); 1714 p.end();
1715 QIconSet icon3 ( mWeekPixmap ); 1715 QIconSet icon3 ( mWeekPixmap );
1716 mWeekAction->setIconSet ( icon3 ); 1716 mWeekAction->setIconSet ( icon3 );
1717 1717
1718} 1718}
1719void MainWindow::updateWeekNum(const DateList &selectedDates) 1719void MainWindow::updateWeekNum(const DateList &selectedDates)
1720{ 1720{
1721 updateWeek( selectedDates.first() ); 1721 updateWeek( selectedDates.first() );
1722} 1722}
1723void MainWindow::processIncidenceSelection( Incidence *incidence ) 1723void MainWindow::processIncidenceSelection( Incidence *incidence )
1724{ 1724{
1725 if ( !incidence ) { 1725 if ( !incidence ) {
1726 mShowAction->setMenuText( i18n("Show") ); 1726 mShowAction->setMenuText( i18n("Show") );
1727 enableIncidenceActions( false ); 1727 enableIncidenceActions( false );
1728 mNewSubTodoAction->setEnabled( false ); 1728 mNewSubTodoAction->setEnabled( false );
1729 setCaptionToDates(); 1729 setCaptionToDates();
1730 return; 1730 return;
1731 } 1731 }
1732 QString startString = ""; 1732 QString startString = "";
1733 if ( incidence->typeID() != todoID ) { 1733 if ( incidence->typeID() != todoID ) {
1734 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { 1734 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) {
1735 if ( incidence->doesFloat() ) { 1735 if ( incidence->doesFloat() ) {
1736 startString += ": "+incidence->dtStartDateStr( true ); 1736 startString += ": "+incidence->dtStartDateStr( true );
1737 startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); 1737 startString += " --- "+((Event*)incidence)->dtEndDateStr( true );
1738 } else { 1738 } else {
1739 startString = ": "+incidence->dtStartStr(true); 1739 startString = ": "+incidence->dtStartStr(true);
1740 startString += " --- "+((Event*)incidence)->dtEndStr(true); 1740 startString += " --- "+((Event*)incidence)->dtEndStr(true);
1741 } 1741 }
1742 } else { 1742 } else {
1743 if ( incidence->dtStart().time() != incidence->dtEnd().time() ) 1743 if ( incidence->dtStart().time() != incidence->dtEnd().time() )
1744 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ 1744 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+
1745 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); 1745 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time());
1746 if ( incidence->isBirthday() || incidence->isAnniversary() ) { 1746 if ( incidence->isBirthday() || incidence->isAnniversary() ) {
1747 bool ok; 1747 bool ok;
1748 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); 1748 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok );
@@ -2520,97 +2520,97 @@ void MainWindow::importFile( QString fn, bool quick )
2520} 2520}
2521 2521
2522void MainWindow::importIcal() 2522void MainWindow::importIcal()
2523{ 2523{
2524 2524
2525 QString fn =KOPrefs::instance()->mLastImportFile; 2525 QString fn =KOPrefs::instance()->mLastImportFile;
2526 2526
2527 fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); 2527 fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this );
2528 if ( fn == "" ) 2528 if ( fn == "" )
2529 return; 2529 return;
2530 importFile( fn, true ); 2530 importFile( fn, true );
2531 2531
2532} 2532}
2533 2533
2534void MainWindow::exportVCalendar() 2534void MainWindow::exportVCalendar()
2535{ 2535{
2536 QString fn = KOPrefs::instance()->mLastVcalFile; 2536 QString fn = KOPrefs::instance()->mLastVcalFile;
2537 fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); 2537 fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this );
2538 if ( fn == "" ) 2538 if ( fn == "" )
2539 return; 2539 return;
2540 QFileInfo info; 2540 QFileInfo info;
2541 info.setFile( fn ); 2541 info.setFile( fn );
2542 QString mes; 2542 QString mes;
2543 bool createbup = true; 2543 bool createbup = true;
2544 if ( info. exists() ) { 2544 if ( info. exists() ) {
2545 mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); 2545 mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) );
2546 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, 2546 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes,
2547 i18n("Overwrite!"), i18n("Cancel"), 0, 2547 i18n("Overwrite!"), i18n("Cancel"), 0,
2548 0, 1 ); 2548 0, 1 );
2549 if ( result != 0 ) { 2549 if ( result != 0 ) {
2550 createbup = false; 2550 createbup = false;
2551 } 2551 }
2552 } 2552 }
2553 if ( createbup ) { 2553 if ( createbup ) {
2554 if ( mView->exportVCalendar( fn ) ) { 2554 if ( mView->exportVCalendar( fn ) ) {
2555 KOPrefs::instance()->mLastVcalFile = fn; 2555 KOPrefs::instance()->mLastVcalFile = fn;
2556 if ( fn.length() > 20 ) 2556 if ( fn.length() > 20 )
2557 mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; 2557 mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ;
2558 else 2558 else
2559 mes = i18n("KO/Pi:Exported to %1").arg(fn ); 2559 mes = i18n("KO/Pi:Exported to %1").arg(fn );
2560 setCaption(mes); 2560 setCaption(mes);
2561 } 2561 }
2562 } 2562 }
2563 2563
2564} 2564}
2565QString MainWindow::sentSyncFile() 2565QString MainWindow::sentSyncFile()
2566{ 2566{
2567#ifdef DESKTOP_VERSION 2567#ifdef DESKTOP_VERSION
2568 return locateLocal( "tmp", "copysynccal.ics" ); 2568 return QDir::convertSeparators( locateLocal( "tmp", "copysynccal.ics" ) );
2569#else 2569#else
2570 return QString( "/tmp/copysynccal.ics" ); 2570 return QString( "/tmp/copysynccal.ics" );
2571#endif 2571#endif
2572} 2572}
2573 2573
2574void MainWindow::syncFileRequest() 2574void MainWindow::syncFileRequest()
2575{ 2575{
2576 while ( mSyncManager->blockSave() ) { 2576 while ( mSyncManager->blockSave() ) {
2577 qApp->processEvents(); 2577 qApp->processEvents();
2578 } 2578 }
2579 mSyncManager->setBlockSave(true); 2579 mSyncManager->setBlockSave(true);
2580 2580
2581 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { 2581 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) {
2582 mSyncManager->slotSyncMenu( 999 ); 2582 mSyncManager->slotSyncMenu( 999 );
2583 } 2583 }
2584 2584
2585 setCaption(i18n("Saving Data to temp file ..." )); 2585 setCaption(i18n("Saving Data to temp file ..." ));
2586 mView->saveCalendar( sentSyncFile() ); 2586 mView->saveCalendar( sentSyncFile() );
2587 setCaption(i18n("Data saved to temp file!" )); 2587 setCaption(i18n("Data saved to temp file!" ));
2588 mSyncManager->setBlockSave( false ); 2588 mSyncManager->setBlockSave( false );
2589 2589
2590} 2590}
2591void MainWindow::getFile( bool success ) 2591void MainWindow::getFile( bool success )
2592{ 2592{
2593 if ( ! success ) { 2593 if ( ! success ) {
2594 setCaption( i18n("Error receiving file. Nothing changed!") ); 2594 setCaption( i18n("Error receiving file. Nothing changed!") );
2595 return; 2595 return;
2596 } 2596 }
2597 mView->mergeFile( sentSyncFile() ); 2597 mView->mergeFile( sentSyncFile() );
2598 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { 2598 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) {
2599 mSyncManager->slotSyncMenu( 999 ); 2599 mSyncManager->slotSyncMenu( 999 );
2600 } 2600 }
2601 setCaption( i18n("Pi-Sync successful!") ); 2601 setCaption( i18n("Pi-Sync successful!") );
2602} 2602}
2603void MainWindow::printListView() 2603void MainWindow::printListView()
2604{ 2604{
2605 2605
2606 QString message = i18n("You can make a printout of the <b>List View</b> and the list view in the <b>Search Dialog</b>! To do this, please go to the <b>List View/Search Dialog</b>. Right click on the list. Select in the popup menu the entry <b>Print complete list</b>. That prints the list as you see it. You can remove items from the list before printing without deleting the corresponding event/todo! Simply select all items you do not want to print out. Then right click on one of the items and choose <b>Hide selected items</b>. After that you can print the list without these items."); 2606 QString message = i18n("You can make a printout of the <b>List View</b> and the list view in the <b>Search Dialog</b>! To do this, please go to the <b>List View/Search Dialog</b>. Right click on the list. Select in the popup menu the entry <b>Print complete list</b>. That prints the list as you see it. You can remove items from the list before printing without deleting the corresponding event/todo! Simply select all items you do not want to print out. Then right click on one of the items and choose <b>Hide selected items</b>. After that you can print the list without these items.");
2607 2607
2608 KMessageBox::information( this, message); 2608 KMessageBox::information( this, message);
2609} 2609}
2610void MainWindow::printSel( ) 2610void MainWindow::printSel( )
2611{ 2611{
2612 mView->viewManager()->agendaView()->agenda()->printSelection(); 2612 mView->viewManager()->agendaView()->agenda()->printSelection();
2613} 2613}
2614 2614
2615void MainWindow::printCal() 2615void MainWindow::printCal()
2616{ 2616{