author | zautrix <zautrix> | 2005-03-11 19:38:46 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-11 19:38:46 (UTC) |
commit | efa425789895481dd918a55af27895a7917d2a20 (patch) (unidiff) | |
tree | cb6b6d495c17dd649fcc6387a41b2db2eef1d39d | |
parent | 1166a4797a91cedd5002a3513d5028c5e86016f0 (diff) | |
download | kdepimpi-efa425789895481dd918a55af27895a7917d2a20.zip kdepimpi-efa425789895481dd918a55af27895a7917d2a20.tar.gz kdepimpi-efa425789895481dd918a55af27895a7917d2a20.tar.bz2 |
better kopi export
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 4 | ||||
-rw-r--r-- | korganizer/kolistview.cpp | 12 |
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,101 +1,105 @@ | |||
1 | Info about the changes in new versions of KDE-Pim/Pi | 1 | Info about the changes in new versions of KDE-Pim/Pi |
2 | 2 | ||
3 | ********** VERSION 2.0.16 ************ | 3 | ********** VERSION 2.0.16 ************ |
4 | OM/Pi: | 4 | OM/Pi: |
5 | Fixed the SMTP account setting the option. | 5 | Fixed the SMTP account setting the option. |
6 | Fixed something in mail sending. | ||
7 | |||
8 | KO/Pi: | ||
9 | Added possibility to export selected events/todos as vcal file. | ||
6 | 10 | ||
7 | ********** VERSION 2.0.15 ************ | 11 | ********** VERSION 2.0.15 ************ |
8 | 12 | ||
9 | PwM/Pi: | 13 | PwM/Pi: |
10 | Added keyboard shorcuts for | 14 | Added 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) |
14 | Fixed length of info in the title. | 18 | Fixed length of info in the title. |
15 | 19 | ||
16 | KO/Pi-KA/Pi: | 20 | KO/Pi-KA/Pi: |
17 | Changed "ME" menu bar entry to an icon. | 21 | Changed "ME" menu bar entry to an icon. |
18 | 22 | ||
19 | KO/Pi: | 23 | KO/Pi: |
20 | Fixed two minor bugs in displaying todos. | 24 | Fixed two minor bugs in displaying todos. |
21 | If in month view a cell is selected, the key shortcut "d" shows now that date. | 25 | If in month view a cell is selected, the key shortcut "d" shows now that date. |
22 | Added complete info for a todo in month view as an icon left of the text. | 26 | Added complete info for a todo in month view as an icon left of the text. |
23 | Fixed problems of displaying data when "<" or ">" are used in summary/location/description. | 27 | Fixed problems of displaying data when "<" or ">" are used in summary/location/description. |
24 | Fixed problem of search dialog size when switching displays. | 28 | Fixed problem of search dialog size when switching displays. |
25 | Cancel key now closes date picker. | 29 | Cancel key now closes date picker. |
26 | Rearranged KO/Pi file menu structure. | 30 | Rearranged KO/Pi file menu structure. |
27 | 31 | ||
28 | OM/Pi: | 32 | OM/Pi: |
29 | Added to the SMTP account setting the option | 33 | Added to the SMTP account setting the option |
30 | "No secure connection". | 34 | "No secure connection". |
31 | You have to configure your SMTP accounts again, sorry. | 35 | You have to configure your SMTP accounts again, sorry. |
32 | 36 | ||
33 | KA/Pi: | 37 | KA/Pi: |
34 | Added support for importing quoted-printable. | 38 | Added support for importing quoted-printable. |
35 | Support was added by Peter P.. Thanks, Peter! | 39 | Support was added by Peter P.. Thanks, Peter! |
36 | 40 | ||
37 | 41 | ||
38 | ********** VERSION 2.0.14 ************ | 42 | ********** VERSION 2.0.14 ************ |
39 | 43 | ||
40 | Made Passwordmanager PwM/Pi more userfriendly: | 44 | Made Passwordmanager PwM/Pi more userfriendly: |
41 | Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. | 45 | Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. |
42 | Fixed bug in KO/Pi todo printing. | 46 | Fixed bug in KO/Pi todo printing. |
43 | Made Qtopia calendar import possible on desktop . | 47 | Made Qtopia calendar import possible on desktop . |
44 | 48 | ||
45 | ********** VERSION 2.0.13 ************ | 49 | ********** VERSION 2.0.13 ************ |
46 | 50 | ||
47 | Fixed a problem in the addressee select dialog and made it more user friendly by adding a minimize splitter. | 51 | Fixed a problem in the addressee select dialog and made it more user friendly by adding a minimize splitter. |
48 | 52 | ||
49 | In the search dialog you can switch now the focus from search line edit to the list view by pressing key "arrow down". | 53 | In the search dialog you can switch now the focus from search line edit to the list view by pressing key "arrow down". |
50 | 54 | ||
51 | OM/Pi: | 55 | OM/Pi: |
52 | Fixed a refresh problem of outgoing/sent/sendfailed folders after sending mails. | 56 | Fixed a refresh problem of outgoing/sent/sendfailed folders after sending mails. |
53 | Added missing German translation. | 57 | Added missing German translation. |
54 | Added warning if path is specified in local folder settings of account config. | 58 | Added 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 | ||
58 | KO/Pi: | 62 | KO/Pi: |
59 | Fixed a bug in todo start/due date handling for non recurring todos with a start and due date. | 63 | Fixed a bug in todo start/due date handling for non recurring todos with a start and due date. |
60 | Fixed some layout problems in the KO/Pi agenda view when there were many conflicting itmes. | 64 | Fixed some layout problems in the KO/Pi agenda view when there were many conflicting itmes. |
61 | Fixed several problems of the keyboard focus in the desktop versions when opening the search dialog/event viewer. | 65 | Fixed several problems of the keyboard focus in the desktop versions when opening the search dialog/event viewer. |
62 | 66 | ||
63 | Fixed problem in pi-sync mode when wrong password was sent. | 67 | Fixed problem in pi-sync mode when wrong password was sent. |
64 | 68 | ||
65 | OM/Pi: | 69 | OM/Pi: |
66 | Fixed a crash when displaying mails with "Show mail as html" was checked in the config. | 70 | Fixed a crash when displaying mails with "Show mail as html" was checked in the config. |
67 | Added a check before displaying the mail if the mail is in html format, if "Show mail as html" is enabled. | 71 | Added 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 | ||
71 | Fixed some problems in pi-sync mode | 75 | Fixed 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 | ||
76 | KO/Pi: | 80 | KO/Pi: |
77 | In the desktop versions the context menu in the search dialog was broken after introducing the What'sThis info for the list view. | 81 | In the desktop versions the context menu in the search dialog was broken after introducing the What'sThis info for the list view. |
78 | This is fixed. | 82 | This is fixed. |
79 | Changed the search dialog a bit to make it more user friendly. | 83 | Changed 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 | ||
82 | Added config option to hide the week number in KO/Pi toolbar. | 86 | Added 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 | ||
86 | Made month view icons for multiday events a bit nicer. | 90 | Made month view icons for multiday events a bit nicer. |
87 | Some minor fixes in KO/Pi | 91 | Some 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 | ||
93 | Fixed a problem in dependency info in the ipk files for the Zaurus. | 97 | Fixed a problem in dependency info in the ipk files for the Zaurus. |
94 | 98 | ||
95 | Added 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. | 99 | Added 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 | ||
97 | Added a "go today" button to the datepicker. | 101 | Added a "go today" button to the datepicker. |
98 | 102 | ||
99 | Added "created" and "last modified" to event/todo viewer (and What'sThis viewer) | 103 | Added "created" and "last modified" to event/todo viewer (and What'sThis viewer) |
100 | and made it configureable to show these values. | 104 | and made it configureable to show these values. |
101 | 105 | ||
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index f235705..3519985 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -529,241 +529,253 @@ void KOListView::saveDescriptionToFile() | |||
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 | } |
611 | void KOListView::saveToFileVCS() | 611 | void KOListView::saveToFileVCS() |
612 | { | 612 | { |
613 | writeToFile( false ); | 613 | writeToFile( false ); |
614 | } | 614 | } |
615 | void KOListView::saveToFile() | 615 | void KOListView::saveToFile() |
616 | { | 616 | { |
617 | writeToFile( true ); | 617 | writeToFile( true ); |
618 | } | 618 | } |
619 | void KOListView::writeToFile( bool iCal ) | 619 | void 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 | } |
683 | void KOListView::deleteAll() | 695 | void 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 | } |
742 | int KOListView::maxDatesHint() | 754 | int KOListView::maxDatesHint() |
743 | { | 755 | { |
744 | return 0; | 756 | return 0; |
745 | } | 757 | } |
746 | 758 | ||
747 | int KOListView::currentDateCount() | 759 | int KOListView::currentDateCount() |
748 | { | 760 | { |
749 | return 0; | 761 | return 0; |
750 | } | 762 | } |
751 | 763 | ||
752 | QPtrList<Incidence> KOListView::selectedIncidences() | 764 | QPtrList<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 | ||