-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 | |||
@@ -820,109 +820,111 @@ void KOListView::hideAll() | |||
820 | QPtrList<QListViewItem> delSel ; | 820 | QPtrList<QListViewItem> delSel ; |
821 | QListViewItem *item = mListView->firstChild (); | 821 | QListViewItem *item = mListView->firstChild (); |
822 | while ( item ) { | 822 | while ( item ) { |
823 | if ( item->isSelected() ) { | 823 | if ( item->isSelected() ) { |
824 | delSel.append(item); | 824 | delSel.append(item); |
825 | } | 825 | } |
826 | item = item->nextSibling(); | 826 | item = item->nextSibling(); |
827 | } | 827 | } |
828 | item = delSel.first() ; | 828 | item = delSel.first() ; |
829 | while ( item ) { | 829 | while ( item ) { |
830 | QListViewItem * del = item; | 830 | QListViewItem * del = item; |
831 | item = delSel.next(); | 831 | item = delSel.next(); |
832 | delete del; | 832 | delete del; |
833 | } | 833 | } |
834 | } | 834 | } |
835 | void KOListView::printList() | 835 | 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()); |
913 | 915 | ||
914 | return eventList; | 916 | return eventList; |
915 | } | 917 | } |
916 | 918 | ||
917 | DateList KOListView::selectedDates() | 919 | DateList KOListView::selectedDates() |
918 | { | 920 | { |
919 | DateList eventList; | 921 | DateList eventList; |
920 | return eventList; | 922 | return eventList; |
921 | } | 923 | } |
922 | 924 | ||
923 | void KOListView::showDates(bool show) | 925 | void KOListView::showDates(bool show) |
924 | { | 926 | { |
925 | // Shouldn't we set it to a value greater 0? When showDates is called with | 927 | // Shouldn't we set it to a value greater 0? When showDates is called with |
926 | // show == true at first, then the columnwidths are set to zero. | 928 | // show == true at first, then the columnwidths are set to zero. |
927 | static int oldColWidth1 = 0; | 929 | static int oldColWidth1 = 0; |
928 | static int oldColWidth3 = 0; | 930 | static int oldColWidth3 = 0; |