summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-11 19:38:46 (UTC)
committer zautrix <zautrix>2005-03-11 19:38:46 (UTC)
commitefa425789895481dd918a55af27895a7917d2a20 (patch) (unidiff)
treecb6b6d495c17dd649fcc6387a41b2db2eef1d39d
parent1166a4797a91cedd5002a3513d5028c5e86016f0 (diff)
downloadkdepimpi-efa425789895481dd918a55af27895a7917d2a20.zip
kdepimpi-efa425789895481dd918a55af27895a7917d2a20.tar.gz
kdepimpi-efa425789895481dd918a55af27895a7917d2a20.tar.bz2
better kopi export
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt4
-rw-r--r--korganizer/kolistview.cpp12
2 files changed, 16 insertions, 0 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index e769bd8..ef53ad9 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,197 +1,201 @@
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.0.16 ************ 3********** VERSION 2.0.16 ************
4OM/Pi: 4OM/Pi:
5Fixed the SMTP account setting the option. 5Fixed the SMTP account setting the option.
6Fixed something in mail sending.
7
8KO/Pi:
9Added possibility to export selected events/todos as vcal file.
6 10
7********** VERSION 2.0.15 ************ 11********** VERSION 2.0.15 ************
8 12
9PwM/Pi: 13PwM/Pi:
10Added keyboard shorcuts for 14Added keyboard shorcuts for
11- toggling summary view (space bar) 15- toggling summary view (space bar)
12- delete item (delete + backspace key) 16- delete item (delete + backspace key)
13- add new item ( i + n key) 17- add new item ( i + n key)
14Fixed length of info in the title. 18Fixed length of info in the title.
15 19
16KO/Pi-KA/Pi: 20KO/Pi-KA/Pi:
17Changed "ME" menu bar entry to an icon. 21Changed "ME" menu bar entry to an icon.
18 22
19KO/Pi: 23KO/Pi:
20Fixed two minor bugs in displaying todos. 24Fixed two minor bugs in displaying todos.
21If in month view a cell is selected, the key shortcut "d" shows now that date. 25If in month view a cell is selected, the key shortcut "d" shows now that date.
22Added complete info for a todo in month view as an icon left of the text. 26Added complete info for a todo in month view as an icon left of the text.
23Fixed problems of displaying data when "<" or ">" are used in summary/location/description. 27Fixed problems of displaying data when "<" or ">" are used in summary/location/description.
24Fixed problem of search dialog size when switching displays. 28Fixed problem of search dialog size when switching displays.
25Cancel key now closes date picker. 29Cancel key now closes date picker.
26Rearranged KO/Pi file menu structure. 30Rearranged KO/Pi file menu structure.
27 31
28OM/Pi: 32OM/Pi:
29Added to the SMTP account setting the option 33Added to the SMTP account setting the option
30"No secure connection". 34"No secure connection".
31You have to configure your SMTP accounts again, sorry. 35You have to configure your SMTP accounts again, sorry.
32 36
33KA/Pi: 37KA/Pi:
34Added support for importing quoted-printable. 38Added support for importing quoted-printable.
35Support was added by Peter P.. Thanks, Peter! 39Support was added by Peter P.. Thanks, Peter!
36 40
37 41
38********** VERSION 2.0.14 ************ 42********** VERSION 2.0.14 ************
39 43
40Made Passwordmanager PwM/Pi more userfriendly: 44Made Passwordmanager PwM/Pi more userfriendly:
41Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. 45Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more.
42Fixed bug in KO/Pi todo printing. 46Fixed bug in KO/Pi todo printing.
43Made Qtopia calendar import possible on desktop . 47Made Qtopia calendar import possible on desktop .
44 48
45********** VERSION 2.0.13 ************ 49********** VERSION 2.0.13 ************
46 50
47Fixed a problem in the addressee select dialog and made it more user friendly by adding a minimize splitter. 51Fixed a problem in the addressee select dialog and made it more user friendly by adding a minimize splitter.
48 52
49In the search dialog you can switch now the focus from search line edit to the list view by pressing key "arrow down". 53In the search dialog you can switch now the focus from search line edit to the list view by pressing key "arrow down".
50 54
51OM/Pi: 55OM/Pi:
52Fixed a refresh problem of outgoing/sent/sendfailed folders after sending mails. 56Fixed a refresh problem of outgoing/sent/sendfailed folders after sending mails.
53Added missing German translation. 57Added missing German translation.
54Added warning if path is specified in local folder settings of account config. 58Added warning if path is specified in local folder settings of account config.
55 59
56********** VERSION 2.0.12 ************ 60********** VERSION 2.0.12 ************
57 61
58KO/Pi: 62KO/Pi:
59Fixed a bug in todo start/due date handling for non recurring todos with a start and due date. 63Fixed a bug in todo start/due date handling for non recurring todos with a start and due date.
60Fixed some layout problems in the KO/Pi agenda view when there were many conflicting itmes. 64Fixed some layout problems in the KO/Pi agenda view when there were many conflicting itmes.
61Fixed several problems of the keyboard focus in the desktop versions when opening the search dialog/event viewer. 65Fixed several problems of the keyboard focus in the desktop versions when opening the search dialog/event viewer.
62 66
63Fixed problem in pi-sync mode when wrong password was sent. 67Fixed problem in pi-sync mode when wrong password was sent.
64 68
65OM/Pi: 69OM/Pi:
66Fixed a crash when displaying mails with "Show mail as html" was checked in the config. 70Fixed a crash when displaying mails with "Show mail as html" was checked in the config.
67Added a check before displaying the mail if the mail is in html format, if "Show mail as html" is enabled. 71Added a check before displaying the mail if the mail is in html format, if "Show mail as html" is enabled.
68 72
69********** VERSION 2.0.11 ************ 73********** VERSION 2.0.11 ************
70 74
71Fixed some problems in pi-sync mode 75Fixed some problems in pi-sync mode
72(e.g. details of events were not synced properly) 76(e.g. details of events were not synced properly)
73 77
74********** VERSION 2.0.10 ************ 78********** VERSION 2.0.10 ************
75 79
76KO/Pi: 80KO/Pi:
77In the desktop versions the context menu in the search dialog was broken after introducing the What'sThis info for the list view. 81In the desktop versions the context menu in the search dialog was broken after introducing the What'sThis info for the list view.
78This is fixed. 82This is fixed.
79Changed the search dialog a bit to make it more user friendly. 83Changed the search dialog a bit to make it more user friendly.
80(E.g.: Removed message box about "no items found" and set key focus to search line edit after search). 84(E.g.: Removed message box about "no items found" and set key focus to search line edit after search).
81 85
82Added config option to hide the week number in KO/Pi toolbar. 86Added config option to hide the week number in KO/Pi toolbar.
83 87
84********** VERSION 2.0.9 ************ 88********** VERSION 2.0.9 ************
85 89
86Made month view icons for multiday events a bit nicer. 90Made month view icons for multiday events a bit nicer.
87Some minor fixes in KO/Pi 91Some minor fixes in KO/Pi
88(e.g. go to today did not work for new week view properly). 92(e.g. go to today did not work for new week view properly).
89 93
90 94
91********** VERSION 2.0.8 ************ 95********** VERSION 2.0.8 ************
92 96
93Fixed a problem in dependency info in the ipk files for the Zaurus. 97Fixed a problem in dependency info in the ipk files for the Zaurus.
94 98
95Added icon for the stealth new week view and made navigation more user friendly in monthview by adding a prev/next week button to the navigator bar. 99Added icon for the stealth new week view and made navigation more user friendly in monthview by adding a prev/next week button to the navigator bar.
96 100
97Added a "go today" button to the datepicker. 101Added a "go today" button to the datepicker.
98 102
99Added "created" and "last modified" to event/todo viewer (and What'sThis viewer) 103Added "created" and "last modified" to event/todo viewer (and What'sThis viewer)
100and made it configureable to show these values. 104and made it configureable to show these values.
101 105
102Fixed a problem for events (from external iCal files) that do have a duration but no end date. 106Fixed a problem for events (from external iCal files) that do have a duration but no end date.
103 107
104 108
105********** VERSION 2.0.7 ************ 109********** VERSION 2.0.7 ************
106 110
107Added global application font settings 111Added global application font settings
108(for all KDE-Pim/Pi apps) to the general settings. 112(for all KDE-Pim/Pi apps) to the general settings.
109 113
110Fixed a problem in OM/Pi when trying to login to some IMAP servers 114Fixed a problem in OM/Pi when trying to login to some IMAP servers
111(like the IMAP server of Apple: mail.mac.com ) 115(like the IMAP server of Apple: mail.mac.com )
112 116
113Added recurring todos to KO/Pi. 117Added recurring todos to KO/Pi.
114 118
115 119
116********** VERSION 2.0.6 ************ 120********** VERSION 2.0.6 ************
117 121
118Some bugfixes in the pi-sync mode. 122Some bugfixes in the pi-sync mode.
119Added German translation for pi-sync mode. 123Added German translation for pi-sync mode.
120 124
121KO/Pi: 125KO/Pi:
122Made the todolist using alternate background. 126Made the todolist using alternate background.
123 127
124Other minor fixes in KO/Pi. 128Other minor fixes in KO/Pi.
125 129
126 130
127********** VERSION 2.0.5 ************ 131********** VERSION 2.0.5 ************
128 132
129Bugfixes in KO/Pi. 133Bugfixes in KO/Pi.
130 134
131********** VERSION 2.0.4 ************ 135********** VERSION 2.0.4 ************
132 136
133KO/Pi: 137KO/Pi:
134Fixed problem loading translations for summary/location edit boxes in event/todo editor. 138Fixed problem loading translations for summary/location edit boxes in event/todo editor.
135 139
136Added a general "select week number" to the toolbar. 140Added a general "select week number" to the toolbar.
137 141
138Fixed some small problem of the new features introduced in version 2.0.3. 142Fixed some small problem of the new features introduced in version 2.0.3.
139 143
140Made it possible to specify one specific category as category color, 144Made it possible to specify one specific category as category color,
141if more than one categories are selected. 145if more than one categories are selected.
142 146
143Fixed a bug in saving colors for categories with non-ascii characters. 147Fixed a bug in saving colors for categories with non-ascii characters.
144(Like, e.g. German Umlauts). 148(Like, e.g. German Umlauts).
145Propably you have to set your colors again for those categories. 149Propably you have to set your colors again for those categories.
146 150
147 151
148********** VERSION 2.0.3 ************ 152********** VERSION 2.0.3 ************
149 153
150KO/Pi: 154KO/Pi:
151Added feature for changing alarm settings for many items at once: 155Added feature for changing alarm settings for many items at once:
152Open list view (or search dialog), select the desired items and choose in 156Open list view (or search dialog), select the desired items and choose in
153the popup menu: Set alarm for selected... 157the popup menu: Set alarm for selected...
154 158
155Added to the event/todo viewer the option to send an email to 159Added to the event/todo viewer the option to send an email to
156all attendees or all selected (with RSVP) attendees. 160all attendees or all selected (with RSVP) attendees.
157 161
158Made the week-month mode changing in month view faster. 162Made the week-month mode changing in month view faster.
159 163
160Made month view better useable with keyboard. 164Made month view better useable with keyboard.
161Now TAB key jumps to next cell with an event/todo. 165Now TAB key jumps to next cell with an event/todo.
162Scroll in cell with coursor keys, scroll in time (next week) with 166Scroll in cell with coursor keys, scroll in time (next week) with
163Shift/Control + coursorkeys. 167Shift/Control + coursorkeys.
164 168
165Fixed bug that the todo view flat mode was reset after first view update. 169Fixed bug that the todo view flat mode was reset after first view update.
166 170
167If a todo is displayed closed in the todo view, 171If a todo is displayed closed in the todo view,
168it is now displayed in overdue/due today color depending on the subtodos overdue/due today properties. 172it is now displayed in overdue/due today color depending on the subtodos overdue/due today properties.
169 173
170Added info about the numbers of years to the caption (title) information about a birthday event. 174Added info about the numbers of years to the caption (title) information about a birthday event.
171 175
172Made completion date in todo editor editable. 176Made completion date in todo editor editable.
173 177
174Added possibility to save/load templates for journals. 178Added possibility to save/load templates for journals.
175(Which is just a simple "save text to file" or "insert text from file". 179(Which is just a simple "save text to file" or "insert text from file".
176 180
177********** VERSION 2.0.2 ************ 181********** VERSION 2.0.2 ************
178 182
179KO/Pi: 183KO/Pi:
180Fixed the layout problem of the day label buttons 184Fixed the layout problem of the day label buttons
181of the agenda view introduced in version 2.0.1. 185of the agenda view introduced in version 2.0.1.
182 186
183Added WhatsThis support for the todo view and the list view. 187Added WhatsThis support for the todo view and the list view.
184 188
185Added a quite useful feature to the montview. 189Added a quite useful feature to the montview.
186Just click on the week numbers on the left. 190Just click on the week numbers on the left.
187And in the top right corner of month view/agenda view 191And in the top right corner of month view/agenda view
188there is now a "week number quick selector". 192there is now a "week number quick selector".
189(Click on the black triangle). 193(Click on the black triangle).
190 194
191Made the quite difficult timezone change in KO/Pi easy. 195Made the quite difficult timezone change in KO/Pi easy.
192 196
193OM/Pi: 197OM/Pi:
194Fixed too small icons on desktop. 198Fixed too small icons on desktop.
195Fixed non visible icons in mainwindow on Z with fastload enabled. 199Fixed non visible icons in mainwindow on Z with fastload enabled.
196Added signature file setting to smtp account config. 200Added signature file setting to smtp account config.
197And the signature can be edited and saved in the edit mail dialog. 201And the signature can be edited and saved in the edit mail dialog.
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index f235705..3519985 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -433,433 +433,445 @@ void KOListView::setCategories( bool removeOld )
433 delete csd; 433 delete csd;
434 // if ( catList.count() == 0 ) 434 // if ( catList.count() == 0 )
435 // return; 435 // return;
436 catList.sort(); 436 catList.sort();
437 QString categoriesStr = catList.join(","); 437 QString categoriesStr = catList.join(",");
438 int i; 438 int i;
439 QStringList itemList; 439 QStringList itemList;
440 QPtrList<KOListViewItem> sel ; 440 QPtrList<KOListViewItem> sel ;
441 QListViewItem *qitem = mListView->firstChild (); 441 QListViewItem *qitem = mListView->firstChild ();
442 while ( qitem ) { 442 while ( qitem ) {
443 if ( qitem->isSelected() ) { 443 if ( qitem->isSelected() ) {
444 sel.append(((KOListViewItem *)qitem)); 444 sel.append(((KOListViewItem *)qitem));
445 } 445 }
446 qitem = qitem->nextSibling(); 446 qitem = qitem->nextSibling();
447 } 447 }
448 KOListViewItem * item, *temp; 448 KOListViewItem * item, *temp;
449 item = sel.first(); 449 item = sel.first();
450 Incidence* inc; 450 Incidence* inc;
451 while ( item ) { 451 while ( item ) {
452 inc = item->data(); 452 inc = item->data();
453 if ( removeOld ) { 453 if ( removeOld ) {
454 inc->setCategories( categoriesStr ); 454 inc->setCategories( categoriesStr );
455 } else { 455 } else {
456 itemList = QStringList::split (",", inc->categoriesStr() ); 456 itemList = QStringList::split (",", inc->categoriesStr() );
457 for( i = 0; i< catList.count(); ++i ) { 457 for( i = 0; i< catList.count(); ++i ) {
458 if ( !itemList.contains (catList[i])) 458 if ( !itemList.contains (catList[i]))
459 itemList.append( catList[i] ); 459 itemList.append( catList[i] );
460 } 460 }
461 itemList.sort(); 461 itemList.sort();
462 inc->setCategories( itemList.join(",") ); 462 inc->setCategories( itemList.join(",") );
463 } 463 }
464 temp = item; 464 temp = item;
465 item = sel.next(); 465 item = sel.next();
466 mUidDict.remove( inc->uid() ); 466 mUidDict.remove( inc->uid() );
467 delete temp;; 467 delete temp;;
468 addIncidence( inc ); 468 addIncidence( inc );
469 } 469 }
470} 470}
471 471
472void KOListView::beamSelected() 472void KOListView::beamSelected()
473{ 473{
474 int icount = 0; 474 int icount = 0;
475 QPtrList<Incidence> delSel ; 475 QPtrList<Incidence> delSel ;
476 QListViewItem *item = mListView->firstChild (); 476 QListViewItem *item = mListView->firstChild ();
477 while ( item ) { 477 while ( item ) {
478 if ( item->isSelected() ) { 478 if ( item->isSelected() ) {
479 delSel.append(((KOListViewItem *)item)->data()); 479 delSel.append(((KOListViewItem *)item)->data());
480 ++icount; 480 ++icount;
481 } 481 }
482 482
483 item = item->nextSibling(); 483 item = item->nextSibling();
484 } 484 }
485 if ( icount ) { 485 if ( icount ) {
486 emit beamIncidenceList( delSel ); 486 emit beamIncidenceList( delSel );
487 return; 487 return;
488 QString fn ; 488 QString fn ;
489 fn = QDir::homeDirPath()+"/kopitempbeamfile.vcs"; 489 fn = QDir::homeDirPath()+"/kopitempbeamfile.vcs";
490 QString mes; 490 QString mes;
491 bool createbup = true; 491 bool createbup = true;
492 if ( createbup ) { 492 if ( createbup ) {
493 QString description = "\n"; 493 QString description = "\n";
494 CalendarLocal* cal = new CalendarLocal(); 494 CalendarLocal* cal = new CalendarLocal();
495 cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 495 cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
496 Incidence *incidence = delSel.first(); 496 Incidence *incidence = delSel.first();
497 while ( incidence ) { 497 while ( incidence ) {
498 Incidence *in = incidence->clone(); 498 Incidence *in = incidence->clone();
499 description += in->summary() + "\n"; 499 description += in->summary() + "\n";
500 cal->addIncidence( in ); 500 cal->addIncidence( in );
501 incidence = delSel.next(); 501 incidence = delSel.next();
502 } 502 }
503 FileStorage storage( cal, fn, new VCalFormat ); 503 FileStorage storage( cal, fn, new VCalFormat );
504 storage.save(); 504 storage.save();
505 delete cal; 505 delete cal;
506 mes = i18n("KO/Pi: Ready for beaming"); 506 mes = i18n("KO/Pi: Ready for beaming");
507 topLevelWidget()->setCaption(mes); 507 topLevelWidget()->setCaption(mes);
508 508
509#ifndef DESKTOP_VERSION 509#ifndef DESKTOP_VERSION
510 Ir *ir = new Ir( this ); 510 Ir *ir = new Ir( this );
511 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); 511 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) );
512 ir->send( fn, description, "text/x-vCalendar" ); 512 ir->send( fn, description, "text/x-vCalendar" );
513#endif 513#endif
514 } 514 }
515 } 515 }
516} 516}
517void KOListView::beamDone( Ir *ir ) 517void KOListView::beamDone( Ir *ir )
518{ 518{
519#ifndef DESKTOP_VERSION 519#ifndef DESKTOP_VERSION
520 delete ir; 520 delete ir;
521#endif 521#endif
522 topLevelWidget()->setCaption(i18n("KO/Pi:Beaming done")); 522 topLevelWidget()->setCaption(i18n("KO/Pi:Beaming done"));
523} 523}
524 524
525void KOListView::saveDescriptionToFile() 525void KOListView::saveDescriptionToFile()
526{ 526{
527 527
528 int result = QMessageBox::warning( this, i18n("KO/Pi: Information!"), 528 int result = QMessageBox::warning( this, i18n("KO/Pi: Information!"),
529 i18n("This saves the text/details of selected\nJournals and Events/Todos\nto a text file."), 529 i18n("This saves the text/details of selected\nJournals and Events/Todos\nto a text file."),
530 i18n("Continue"), i18n("Cancel"), 0, 530 i18n("Continue"), i18n("Cancel"), 0,
531 0, 1 ); 531 0, 1 );
532 if ( result != 0 ) { 532 if ( result != 0 ) {
533 return; 533 return;
534 } 534 }
535 int icount = 0; 535 int icount = 0;
536 QPtrList<Incidence> delSel ; 536 QPtrList<Incidence> delSel ;
537 QListViewItem *item = mListView->firstChild (); 537 QListViewItem *item = mListView->firstChild ();
538 while ( item ) { 538 while ( item ) {
539 if ( item->isSelected() ) { 539 if ( item->isSelected() ) {
540 delSel.append(((KOListViewItem *)item)->data()); 540 delSel.append(((KOListViewItem *)item)->data());
541 ++icount; 541 ++icount;
542 } 542 }
543 543
544 item = item->nextSibling(); 544 item = item->nextSibling();
545 } 545 }
546 if ( icount ) { 546 if ( icount ) {
547 QString fn = KOPrefs::instance()->mLastSaveFile; 547 QString fn = KOPrefs::instance()->mLastSaveFile;
548 fn = KFileDialog::getSaveFileName( fn, i18n("Save filename"), this ); 548 fn = KFileDialog::getSaveFileName( fn, i18n("Save filename"), this );
549 549
550 if ( fn == "" ) 550 if ( fn == "" )
551 return; 551 return;
552 QFileInfo info; 552 QFileInfo info;
553 info.setFile( fn ); 553 info.setFile( fn );
554 QString mes; 554 QString mes;
555 bool createbup = true; 555 bool createbup = true;
556 if ( info. exists() ) { 556 if ( info. exists() ) {
557 mes = i18n("File already exists!\nOld file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); 557 mes = i18n("File already exists!\nOld file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) );
558 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, 558 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes,
559 i18n("Overwrite!"), i18n("Cancel"), 0, 559 i18n("Overwrite!"), i18n("Cancel"), 0,
560 0, 1 ); 560 0, 1 );
561 if ( result != 0 ) { 561 if ( result != 0 ) {
562 createbup = false; 562 createbup = false;
563 } 563 }
564 } 564 }
565 if ( createbup ) { 565 if ( createbup ) {
566 QString text = i18n("KO/Pi Description/Journal save file.\nSave date: ") + 566 QString text = i18n("KO/Pi Description/Journal save file.\nSave date: ") +
567 KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), false); 567 KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), false);
568 Incidence *incidence = delSel.first(); 568 Incidence *incidence = delSel.first();
569 icount = 0; 569 icount = 0;
570 while ( incidence ) { 570 while ( incidence ) {
571 if ( incidence->type() == "Journal" ) { 571 if ( incidence->type() == "Journal" ) {
572 text += "\n************************************\n"; 572 text += "\n************************************\n";
573 text += i18n("Journal from: ") +incidence->dtStartDateStr( false ); 573 text += i18n("Journal from: ") +incidence->dtStartDateStr( false );
574 text +="\n" + i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false); 574 text +="\n" + i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false);
575 text +="\n" + i18n("Description: ") + "\n"+ incidence->description(); 575 text +="\n" + i18n("Description: ") + "\n"+ incidence->description();
576 ++icount; 576 ++icount;
577 577
578 } else { 578 } else {
579 if ( !incidence->description().isEmpty() ) { 579 if ( !incidence->description().isEmpty() ) {
580 text += "\n************************************\n"; 580 text += "\n************************************\n";
581 if ( incidence->type() == "Todo" ) 581 if ( incidence->type() == "Todo" )
582 text += i18n("To-Do: "); 582 text += i18n("To-Do: ");
583 text += incidence->summary(); 583 text += incidence->summary();
584 if ( incidence->hasStartDate() ) 584 if ( incidence->hasStartDate() )
585 text +="\n"+ i18n("Start Date: ") + incidence->dtStartStr( false ); 585 text +="\n"+ i18n("Start Date: ") + incidence->dtStartStr( false );
586 text +="\n"+ i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false); 586 text +="\n"+ i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false);
587 if ( !incidence->location().isEmpty() ) 587 if ( !incidence->location().isEmpty() )
588 text += "\n" +i18n("Location: ") + incidence->location(); 588 text += "\n" +i18n("Location: ") + incidence->location();
589 text += "\n" + i18n("Description: ") + "\n" + incidence->description(); 589 text += "\n" + i18n("Description: ") + "\n" + incidence->description();
590 ++icount; 590 ++icount;
591 591
592 } 592 }
593 } 593 }
594 incidence = delSel.next(); 594 incidence = delSel.next();
595 } 595 }
596 QFile file( fn ); 596 QFile file( fn );
597 if (!file.open( IO_WriteOnly ) ) { 597 if (!file.open( IO_WriteOnly ) ) {
598 topLevelWidget()->setCaption(i18n("File open error - nothing saved!") ); 598 topLevelWidget()->setCaption(i18n("File open error - nothing saved!") );
599 return; 599 return;
600 } 600 }
601 QTextStream ts( &file ); 601 QTextStream ts( &file );
602 ts << text; 602 ts << text;
603 file.close(); 603 file.close();
604 //qDebug("%s ", text.latin1()); 604 //qDebug("%s ", text.latin1());
605 mes = i18n("KO/Pi:Saved %1 descriptions/journals").arg(icount ); 605 mes = i18n("KO/Pi:Saved %1 descriptions/journals").arg(icount );
606 KOPrefs::instance()->mLastSaveFile = fn; 606 KOPrefs::instance()->mLastSaveFile = fn;
607 topLevelWidget()->setCaption(mes); 607 topLevelWidget()->setCaption(mes);
608 } 608 }
609 } 609 }
610} 610}
611void KOListView::saveToFileVCS() 611void KOListView::saveToFileVCS()
612{ 612{
613 writeToFile( false ); 613 writeToFile( false );
614} 614}
615void KOListView::saveToFile() 615void KOListView::saveToFile()
616{ 616{
617 writeToFile( true ); 617 writeToFile( true );
618} 618}
619void KOListView::writeToFile( bool iCal ) 619void KOListView::writeToFile( bool iCal )
620{ 620{
621 621
622 int icount = 0; 622 int icount = 0;
623 QPtrList<Incidence> delSel ; 623 QPtrList<Incidence> delSel ;
624 QListViewItem *item = mListView->firstChild (); 624 QListViewItem *item = mListView->firstChild ();
625 bool journal = iCal; // warn only for vCal
625 while ( item ) { 626 while ( item ) {
626 if ( item->isSelected() ) { 627 if ( item->isSelected() ) {
628 if ( !journal )
629 if ( ((KOListViewItem *)item)->data()->type() == "Journal")
630 journal = true;
627 delSel.append(((KOListViewItem *)item)->data()); 631 delSel.append(((KOListViewItem *)item)->data());
628 ++icount; 632 ++icount;
629 } 633 }
630 634
631 item = item->nextSibling(); 635 item = item->nextSibling();
632 } 636 }
637 if ( !iCal && journal ) {
638 int result = KMessageBox::warningContinueCancel(this,
639 i18n("The journal entries can not be\nexported to a vCalendar file."),
640 i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"),
641 true);
642 if (result != KMessageBox::Continue) return;
643 }
633 if ( icount ) { 644 if ( icount ) {
634 QString fn = KOPrefs::instance()->mLastSaveFile; 645 QString fn = KOPrefs::instance()->mLastSaveFile;
635 QString extension; 646 QString extension;
636 if ( iCal ) { 647 if ( iCal ) {
637 if ( fn.right( 4 ).lower() == ".vcs" ) { 648 if ( fn.right( 4 ).lower() == ".vcs" ) {
638 fn = fn.left( fn.length() -3) + "ics"; 649 fn = fn.left( fn.length() -3) + "ics";
639 } 650 }
640 } else { 651 } else {
641 if ( fn.right( 4 ).lower() == ".ics" ) { 652 if ( fn.right( 4 ).lower() == ".ics" ) {
642 fn = fn.left( fn.length() -3) + "vcs"; 653 fn = fn.left( fn.length() -3) + "vcs";
643 } 654 }
644 } 655 }
645 fn = KFileDialog::getSaveFileName( fn, i18n("Save filename"), this ); 656 fn = KFileDialog::getSaveFileName( fn, i18n("Save filename"), this );
646 657
647 if ( fn == "" ) 658 if ( fn == "" )
648 return; 659 return;
649 QFileInfo info; 660 QFileInfo info;
650 info.setFile( fn ); 661 info.setFile( fn );
651 QString mes; 662 QString mes;
652 bool createbup = true; 663 bool createbup = true;
653 if ( info. exists() ) { 664 if ( info. exists() ) {
654 mes = i18n("File already exists!\nOld file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); 665 mes = i18n("File already exists!\nOld file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) );
655 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, 666 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes,
656 i18n("Overwrite!"), i18n("Cancel"), 0, 667 i18n("Overwrite!"), i18n("Cancel"), 0,
657 0, 1 ); 668 0, 1 );
658 if ( result != 0 ) { 669 if ( result != 0 ) {
659 createbup = false; 670 createbup = false;
660 } 671 }
661 } 672 }
662 if ( createbup ) { 673 if ( createbup ) {
663 CalendarLocal cal; 674 CalendarLocal cal;
664 cal.setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 675 cal.setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
665 Incidence *incidence = delSel.first(); 676 Incidence *incidence = delSel.first();
666 while ( incidence ) { 677 while ( incidence ) {
667 cal.addIncidence( incidence->clone() ); 678 cal.addIncidence( incidence->clone() );
668 incidence = delSel.next(); 679 incidence = delSel.next();
669 } 680 }
670 if ( iCal ) { 681 if ( iCal ) {
671 ICalFormat format; 682 ICalFormat format;
672 format.save( &cal, fn ); 683 format.save( &cal, fn );
673 } else { 684 } else {
685
674 VCalFormat format; 686 VCalFormat format;
675 format.save( &cal, fn ); 687 format.save( &cal, fn );
676 } 688 }
677 mes = i18n("KO/Pi:Saved %1").arg(fn ); 689 mes = i18n("KO/Pi:Saved %1").arg(fn );
678 KOPrefs::instance()->mLastSaveFile = fn; 690 KOPrefs::instance()->mLastSaveFile = fn;
679 topLevelWidget()->setCaption(mes); 691 topLevelWidget()->setCaption(mes);
680 } 692 }
681 } 693 }
682} 694}
683void KOListView::deleteAll() 695void KOListView::deleteAll()
684{ 696{
685 int icount = 0; 697 int icount = 0;
686 QPtrList<Incidence> delSel ; 698 QPtrList<Incidence> delSel ;
687 QListViewItem *item = mListView->firstChild (); 699 QListViewItem *item = mListView->firstChild ();
688 while ( item ) { 700 while ( item ) {
689 if ( item->isSelected() ) { 701 if ( item->isSelected() ) {
690 delSel.append(((KOListViewItem *)item)->data()); 702 delSel.append(((KOListViewItem *)item)->data());
691 ++icount; 703 ++icount;
692 } 704 }
693 705
694 item = item->nextSibling(); 706 item = item->nextSibling();
695 } 707 }
696 if ( icount ) { 708 if ( icount ) {
697 Incidence *incidence = delSel.first(); 709 Incidence *incidence = delSel.first();
698 Incidence *toDelete; 710 Incidence *toDelete;
699 KOPrefs *p = KOPrefs::instance(); 711 KOPrefs *p = KOPrefs::instance();
700 bool confirm = p->mConfirm; 712 bool confirm = p->mConfirm;
701 QString mess; 713 QString mess;
702 mess = mess.sprintf( i18n("You have %d item(s) selected.\n"), icount ); 714 mess = mess.sprintf( i18n("You have %d item(s) selected.\n"), icount );
703 if ( KMessageBox::Continue == KMessageBox::warningContinueCancel(this, mess + i18n("All selected items will be\npermanently deleted.\n(Deleting items will take\nsome time on a PDA)\n"), i18n("KO/Pi Confirmation"),i18n("Delete")) ) { 715 if ( KMessageBox::Continue == KMessageBox::warningContinueCancel(this, mess + i18n("All selected items will be\npermanently deleted.\n(Deleting items will take\nsome time on a PDA)\n"), i18n("KO/Pi Confirmation"),i18n("Delete")) ) {
704 p->mConfirm = false; 716 p->mConfirm = false;
705 int delCounter = 0; 717 int delCounter = 0;
706 QDialog dia ( this, "p-dialog", true ); 718 QDialog dia ( this, "p-dialog", true );
707 QLabel lab (i18n("Close dialog to abort deletion!"), &dia ); 719 QLabel lab (i18n("Close dialog to abort deletion!"), &dia );
708 QVBoxLayout lay( &dia ); 720 QVBoxLayout lay( &dia );
709 lay.setMargin(7); 721 lay.setMargin(7);
710 lay.setSpacing(7); 722 lay.setSpacing(7);
711 lay.addWidget( &lab); 723 lay.addWidget( &lab);
712 QProgressBar bar( icount, &dia ); 724 QProgressBar bar( icount, &dia );
713 lay.addWidget( &bar); 725 lay.addWidget( &bar);
714 int w = 220; 726 int w = 220;
715 int h = 50; 727 int h = 50;
716 int dw = QApplication::desktop()->width(); 728 int dw = QApplication::desktop()->width();
717 int dh = QApplication::desktop()->height(); 729 int dh = QApplication::desktop()->height();
718 dia.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 730 dia.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
719 //dia.resize( 240,50 ); 731 //dia.resize( 240,50 );
720 dia.show(); 732 dia.show();
721 733
722 while ( incidence ) { 734 while ( incidence ) {
723 bar.setProgress( delCounter ); 735 bar.setProgress( delCounter );
724 mess = mess.sprintf( i18n("Deleting item %d ..."), ++delCounter ); 736 mess = mess.sprintf( i18n("Deleting item %d ..."), ++delCounter );
725 dia.setCaption( mess ); 737 dia.setCaption( mess );
726 qApp->processEvents(); 738 qApp->processEvents();
727 toDelete = (incidence); 739 toDelete = (incidence);
728 incidence = delSel.next(); 740 incidence = delSel.next();
729 emit deleteIncidenceSignal(toDelete ); 741 emit deleteIncidenceSignal(toDelete );
730 if ( dia.result() != 0 ) 742 if ( dia.result() != 0 )
731 break; 743 break;
732 744
733 } 745 }
734 mess = mess.sprintf( i18n("%d items remaining in list."), count() ); 746 mess = mess.sprintf( i18n("%d items remaining in list."), count() );
735 topLevelWidget ()->setCaption( mess ); 747 topLevelWidget ()->setCaption( mess );
736 p->mConfirm = confirm; 748 p->mConfirm = confirm;
737 } 749 }
738 } 750 }
739 751
740 752
741} 753}
742int KOListView::maxDatesHint() 754int KOListView::maxDatesHint()
743{ 755{
744 return 0; 756 return 0;
745} 757}
746 758
747int KOListView::currentDateCount() 759int KOListView::currentDateCount()
748{ 760{
749 return 0; 761 return 0;
750} 762}
751 763
752QPtrList<Incidence> KOListView::selectedIncidences() 764QPtrList<Incidence> KOListView::selectedIncidences()
753{ 765{
754 QPtrList<Incidence> eventList; 766 QPtrList<Incidence> eventList;
755 QListViewItem *item = mListView->firstChild (); 767 QListViewItem *item = mListView->firstChild ();
756 while ( item ) { 768 while ( item ) {
757 if ( item->isSelected() ) { 769 if ( item->isSelected() ) {
758 eventList.append(((KOListViewItem *)item)->data()); 770 eventList.append(((KOListViewItem *)item)->data());
759 } 771 }
760 772
761 item = item->nextSibling(); 773 item = item->nextSibling();
762 } 774 }
763 775
764 // // QListViewItem *item = mListView->selectedItem(); 776 // // QListViewItem *item = mListView->selectedItem();
765 //if (item) eventList.append(((KOListViewItem *)item)->data()); 777 //if (item) eventList.append(((KOListViewItem *)item)->data());
766 778
767 return eventList; 779 return eventList;
768} 780}
769 781
770DateList KOListView::selectedDates() 782DateList KOListView::selectedDates()
771{ 783{
772 DateList eventList; 784 DateList eventList;
773 return eventList; 785 return eventList;
774} 786}
775 787
776void KOListView::showDates(bool show) 788void KOListView::showDates(bool show)
777{ 789{
778 // Shouldn't we set it to a value greater 0? When showDates is called with 790 // Shouldn't we set it to a value greater 0? When showDates is called with
779 // show == true at first, then the columnwidths are set to zero. 791 // show == true at first, then the columnwidths are set to zero.
780 static int oldColWidth1 = 0; 792 static int oldColWidth1 = 0;
781 static int oldColWidth3 = 0; 793 static int oldColWidth3 = 0;
782 794
783 if (!show) { 795 if (!show) {
784 oldColWidth1 = mListView->columnWidth(1); 796 oldColWidth1 = mListView->columnWidth(1);
785 oldColWidth3 = mListView->columnWidth(3); 797 oldColWidth3 = mListView->columnWidth(3);
786 mListView->setColumnWidth(1, 0); 798 mListView->setColumnWidth(1, 0);
787 mListView->setColumnWidth(3, 0); 799 mListView->setColumnWidth(3, 0);
788 } else { 800 } else {
789 mListView->setColumnWidth(1, oldColWidth1); 801 mListView->setColumnWidth(1, oldColWidth1);
790 mListView->setColumnWidth(3, oldColWidth3); 802 mListView->setColumnWidth(3, oldColWidth3);
791 } 803 }
792 mListView->repaint(); 804 mListView->repaint();
793} 805}
794 806
795void KOListView::printPreview(CalPrinter *calPrinter, const QDate &fd, 807void KOListView::printPreview(CalPrinter *calPrinter, const QDate &fd,
796 const QDate &td) 808 const QDate &td)
797{ 809{
798#ifndef KORG_NOPRINTER 810#ifndef KORG_NOPRINTER
799 calPrinter->preview(CalPrinter::Day, fd, td); 811 calPrinter->preview(CalPrinter::Day, fd, td);
800#endif 812#endif
801} 813}
802 814
803void KOListView::showDates() 815void KOListView::showDates()
804{ 816{
805 showDates(true); 817 showDates(true);
806} 818}
807 819
808void KOListView::hideDates() 820void KOListView::hideDates()
809{ 821{
810 showDates(false); 822 showDates(false);
811} 823}
812void KOListView::resetFocus() 824void KOListView::resetFocus()
813{ 825{
814 mListView->setFocus(); 826 mListView->setFocus();
815} 827}
816void KOListView::updateView() 828void KOListView::updateView()
817{ 829{
818 mListView->setFocus(); 830 mListView->setFocus();
819 if ( mListView->firstChild () ) 831 if ( mListView->firstChild () )
820 mListView->setCurrentItem( mListView->firstChild () ); 832 mListView->setCurrentItem( mListView->firstChild () );
821} 833}
822void KOListView::updateConfig() 834void KOListView::updateConfig()
823{ 835{
824 836
825 mListView->setFont ( KOPrefs::instance()->mListViewFont ); 837 mListView->setFont ( KOPrefs::instance()->mListViewFont );
826 updateView(); 838 updateView();
827 839
828} 840}
829void KOListView::setStartDate(const QDate &start) 841void KOListView::setStartDate(const QDate &start)
830{ 842{
831 mStartDate = start; 843 mStartDate = start;
832} 844}
833 845
834void KOListView::showDates(const QDate &start, const QDate &end) 846void KOListView::showDates(const QDate &start, const QDate &end)
835{ 847{
836 clear(); 848 clear();
837 mStartDate = start; 849 mStartDate = start;
838 QDate date = start; 850 QDate date = start;
839 QPtrList<Journal> j_list; 851 QPtrList<Journal> j_list;
840 while( date <= end ) { 852 while( date <= end ) {
841 addEvents(calendar()->events(date)); 853 addEvents(calendar()->events(date));
842 addTodos(calendar()->todos(date)); 854 addTodos(calendar()->todos(date));
843 Journal* jo = calendar()->journal(date); 855 Journal* jo = calendar()->journal(date);
844 if ( jo ) 856 if ( jo )
845 j_list.append( jo ); 857 j_list.append( jo );
846 date = date.addDays( 1 ); 858 date = date.addDays( 1 );
847 } 859 }
848 addJournals(j_list); 860 addJournals(j_list);
849 emit incidenceSelected( 0 ); 861 emit incidenceSelected( 0 );
850 updateView(); 862 updateView();
851 863
852} 864}
853 865
854void KOListView::addEvents(QPtrList<Event> eventList) 866void KOListView::addEvents(QPtrList<Event> eventList)
855{ 867{
856 Event *ev; 868 Event *ev;
857 for(ev = eventList.first(); ev; ev = eventList.next()) { 869 for(ev = eventList.first(); ev; ev = eventList.next()) {
858 addIncidence(ev); 870 addIncidence(ev);
859 } 871 }
860 if ( !mListView->currentItem() ){ 872 if ( !mListView->currentItem() ){
861 updateView(); 873 updateView();
862 } 874 }
863} 875}
864 876
865void KOListView::addTodos(QPtrList<Todo> eventList) 877void KOListView::addTodos(QPtrList<Todo> eventList)