author | zautrix <zautrix> | 2005-07-06 14:24:16 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-06 14:24:16 (UTC) |
commit | 2e8199c8aa82c018d24d67c299a09b2aa6a786f1 (patch) (unidiff) | |
tree | 3883f4d664b632d4107333ca27ff47ef1abdb70a /korganizer/kolistview.cpp | |
parent | feb7b5c7dbc5f9de44993330dee654ad0a38b8d9 (diff) | |
download | kdepimpi-2e8199c8aa82c018d24d67c299a09b2aa6a786f1.zip kdepimpi-2e8199c8aa82c018d24d67c299a09b2aa6a786f1.tar.gz kdepimpi-2e8199c8aa82c018d24d67c299a09b2aa6a786f1.tar.bz2 |
fixxx
-rw-r--r-- | korganizer/kolistview.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index 25e599d..5690bdb 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -836,77 +836,79 @@ void KOListView::printList() | |||
836 | { | 836 | { |
837 | mListView->printList(); | 837 | mListView->printList(); |
838 | } | 838 | } |
839 | void KOListView::deleteAll() | 839 | void KOListView::deleteAll() |
840 | { | 840 | { |
841 | QPtrList<Incidence> delSel = getSelectedIncidences(); // all inc allowed;; | 841 | QPtrList<Incidence> delSel = getSelectedIncidences(); // all inc allowed;; |
842 | if ( delSel.count() ) { | 842 | if ( delSel.count() ) { |
843 | int icount = delSel.count(); | 843 | int icount = delSel.count(); |
844 | Incidence *incidence = delSel.first(); | 844 | Incidence *incidence = delSel.first(); |
845 | Incidence *toDelete; | 845 | Incidence *toDelete; |
846 | KOPrefs *p = KOPrefs::instance(); | 846 | KOPrefs *p = KOPrefs::instance(); |
847 | bool confirm = p->mConfirm; | 847 | bool confirm = p->mConfirm; |
848 | QString mess; | 848 | QString mess; |
849 | mess = mess.sprintf( i18n("You have %d item(s) selected.\n"), icount ); | 849 | mess = mess.sprintf( i18n("You have %d item(s) selected.\n"), icount ); |
850 | 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")) ) { | 850 | 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")) ) { |
851 | p->mConfirm = false; | 851 | p->mConfirm = false; |
852 | int delCounter = 0; | 852 | int delCounter = 0; |
853 | QDialog dia ( this, "p-dialog", true ); | 853 | QDialog dia ( this, "p-dialog", true ); |
854 | QLabel lab (i18n("Close dialog to abort deletion!"), &dia ); | 854 | QLabel lab (i18n("Close dialog to abort deletion!"), &dia ); |
855 | QVBoxLayout lay( &dia ); | 855 | QVBoxLayout lay( &dia ); |
856 | lay.setMargin(7); | 856 | lay.setMargin(7); |
857 | lay.setSpacing(7); | 857 | lay.setSpacing(7); |
858 | lay.addWidget( &lab); | 858 | lay.addWidget( &lab); |
859 | QProgressBar bar( icount, &dia ); | 859 | QProgressBar bar( icount, &dia ); |
860 | lay.addWidget( &bar); | 860 | lay.addWidget( &bar); |
861 | int w = 220; | 861 | int w = 220; |
862 | int h = 50; | 862 | int h = 50; |
863 | int dw = QApplication::desktop()->width(); | 863 | int dw = QApplication::desktop()->width(); |
864 | int dh = QApplication::desktop()->height(); | 864 | int dh = QApplication::desktop()->height(); |
865 | dia.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 865 | dia.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
866 | //dia.resize( 240,50 ); | 866 | //dia.resize( 240,50 ); |
867 | dia.show(); | 867 | dia.show(); |
868 | 868 | KOPrefs::instance()->mGlobalUpdateDisabled = true; | |
869 | while ( incidence ) { | 869 | while ( incidence ) { |
870 | bar.setProgress( delCounter ); | 870 | bar.setProgress( delCounter ); |
871 | mess = mess.sprintf( i18n("Deleting item %d ..."), ++delCounter ); | 871 | mess = mess.sprintf( i18n("Deleting item %d ..."), ++delCounter ); |
872 | dia.setCaption( mess ); | 872 | dia.setCaption( mess ); |
873 | qApp->processEvents(); | 873 | qApp->processEvents(); |
874 | toDelete = (incidence); | 874 | toDelete = (incidence); |
875 | incidence = delSel.next(); | 875 | incidence = delSel.next(); |
876 | emit deleteIncidenceSignal(toDelete ); | 876 | emit deleteIncidenceSignal(toDelete ); |
877 | if ( dia.result() != 0 ) | 877 | if ( dia.result() != 0 ) |
878 | break; | 878 | break; |
879 | 879 | ||
880 | } | 880 | } |
881 | KOPrefs::instance()->mGlobalUpdateDisabled = false; | ||
882 | emit deleteIncidenceSignal( 0 ); | ||
881 | mess = mess.sprintf( i18n("%d items remaining in list."), count() ); | 883 | mess = mess.sprintf( i18n("%d items remaining in list."), count() ); |
882 | topLevelWidget ()->setCaption( mess ); | 884 | topLevelWidget ()->setCaption( mess ); |
883 | p->mConfirm = confirm; | 885 | p->mConfirm = confirm; |
884 | } | 886 | } |
885 | } | 887 | } |
886 | 888 | ||
887 | 889 | ||
888 | } | 890 | } |
889 | int KOListView::maxDatesHint() | 891 | int KOListView::maxDatesHint() |
890 | { | 892 | { |
891 | return 0; | 893 | return 0; |
892 | } | 894 | } |
893 | 895 | ||
894 | int KOListView::currentDateCount() | 896 | int KOListView::currentDateCount() |
895 | { | 897 | { |
896 | return 0; | 898 | return 0; |
897 | } | 899 | } |
898 | 900 | ||
899 | QPtrList<Incidence> KOListView::selectedIncidences() | 901 | QPtrList<Incidence> KOListView::selectedIncidences() |
900 | { | 902 | { |
901 | QPtrList<Incidence> eventList; | 903 | QPtrList<Incidence> eventList; |
902 | QListViewItem *item = mListView->firstChild (); | 904 | QListViewItem *item = mListView->firstChild (); |
903 | while ( item ) { | 905 | while ( item ) { |
904 | if ( item->isSelected() ) { | 906 | if ( item->isSelected() ) { |
905 | eventList.append(((KOListViewItem *)item)->data()); | 907 | eventList.append(((KOListViewItem *)item)->data()); |
906 | } | 908 | } |
907 | 909 | ||
908 | item = item->nextSibling(); | 910 | item = item->nextSibling(); |
909 | } | 911 | } |
910 | 912 | ||
911 | // // QListViewItem *item = mListView->selectedItem(); | 913 | // // QListViewItem *item = mListView->selectedItem(); |
912 | //if (item) eventList.append(((KOListViewItem *)item)->data()); | 914 | //if (item) eventList.append(((KOListViewItem *)item)->data()); |