summaryrefslogtreecommitdiff
authoreilers <eilers>2003-08-01 13:57:54 (UTC)
committer eilers <eilers>2003-08-01 13:57:54 (UTC)
commit5346424fc26bde232a15aa34fbb720f86218b26f (patch) (unidiff)
treeb6ce224b1fb517e8b31db1b9e0ef30cf539f6f6f
parent307b353d11842b0994827e4130b48386454b3f94 (diff)
downloadopie-5346424fc26bde232a15aa34fbb720f86218b26f.zip
opie-5346424fc26bde232a15aa34fbb720f86218b26f.tar.gz
opie-5346424fc26bde232a15aa34fbb720f86218b26f.tar.bz2
Icon bug.. fixed.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/addressbook.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp
index 6819085..03c96c8 100644
--- a/core/pim/addressbook/addressbook.cpp
+++ b/core/pim/addressbook/addressbook.cpp
@@ -777,281 +777,281 @@ void AddressbookWindow::editPersonal()
777 777
778 // Switch to personal view if not selected 778 // Switch to personal view if not selected
779 // but take care of the menu, too 779 // but take care of the menu, too
780 if ( ! actionPersonal->isOn() ){ 780 if ( ! actionPersonal->isOn() ){
781 qWarning("*** ++++"); 781 qWarning("*** ++++");
782 actionPersonal->setOn( true ); 782 actionPersonal->setOn( true );
783 slotPersonalView(); 783 slotPersonalView();
784 } 784 }
785 785
786 if ( !abEditor ) { 786 if ( !abEditor ) {
787 abEditor = new ContactEditor( entry, this, "editor" ); 787 abEditor = new ContactEditor( entry, this, "editor" );
788 } 788 }
789 789
790 abEditor->setCaption(tr("Edit My Personal Details")); 790 abEditor->setCaption(tr("Edit My Personal Details"));
791 abEditor->setPersonalView( true ); 791 abEditor->setPersonalView( true );
792 editEntry( EditEntry ); 792 editEntry( EditEntry );
793 abEditor->setPersonalView( false ); 793 abEditor->setPersonalView( false );
794 794
795} 795}
796 796
797 797
798void AddressbookWindow::slotPersonalView() 798void AddressbookWindow::slotPersonalView()
799{ 799{
800 qWarning("slotPersonalView()"); 800 qWarning("slotPersonalView()");
801 if (!actionPersonal->isOn()) { 801 if (!actionPersonal->isOn()) {
802 // we just turned it off 802 // we just turned it off
803 qWarning("slotPersonalView()-> OFF"); 803 qWarning("slotPersonalView()-> OFF");
804 setCaption( tr("Contacts") ); 804 setCaption( tr("Contacts") );
805 actionNew->setEnabled(TRUE); 805 actionNew->setEnabled(TRUE);
806 actionTrash->setEnabled(TRUE); 806 actionTrash->setEnabled(TRUE);
807 actionFind->setEnabled(TRUE); 807 actionFind->setEnabled(TRUE);
808 actionMail->setEnabled(TRUE); 808 actionMail->setEnabled(TRUE);
809 // slotUpdateToolbar(); 809 // slotUpdateToolbar();
810 810
811 m_abView->showPersonal( false ); 811 m_abView->showPersonal( false );
812 812
813 return; 813 return;
814 } 814 }
815 815
816 qWarning("slotPersonalView()-> ON"); 816 qWarning("slotPersonalView()-> ON");
817 // XXX need to disable some QActions. 817 // XXX need to disable some QActions.
818 actionNew->setEnabled(FALSE); 818 actionNew->setEnabled(FALSE);
819 actionTrash->setEnabled(FALSE); 819 actionTrash->setEnabled(FALSE);
820 actionFind->setEnabled(FALSE); 820 actionFind->setEnabled(FALSE);
821 actionMail->setEnabled(FALSE); 821 actionMail->setEnabled(FALSE);
822 822
823 setCaption( tr("Contacts - My Personal Details") ); 823 setCaption( tr("Contacts - My Personal Details") );
824 824
825 m_abView->showPersonal( true ); 825 m_abView->showPersonal( true );
826 826
827} 827}
828 828
829 829
830void AddressbookWindow::listIsEmpty( bool empty ) 830void AddressbookWindow::listIsEmpty( bool empty )
831{ 831{
832 if ( !empty ) { 832 if ( !empty ) {
833 deleteButton->setEnabled( TRUE ); 833 deleteButton->setEnabled( TRUE );
834 } 834 }
835} 835}
836 836
837void AddressbookWindow::reload() 837void AddressbookWindow::reload()
838{ 838{
839 syncing = FALSE; 839 syncing = FALSE;
840 m_abView->clear(); 840 m_abView->clear();
841 m_abView->reload(); 841 m_abView->reload();
842} 842}
843 843
844void AddressbookWindow::flush() 844void AddressbookWindow::flush()
845{ 845{
846 syncing = TRUE; 846 syncing = TRUE;
847 m_abView->save(); 847 m_abView->save();
848} 848}
849 849
850 850
851void AddressbookWindow::closeEvent( QCloseEvent *e ) 851void AddressbookWindow::closeEvent( QCloseEvent *e )
852{ 852{
853 if(active_view == AbView::CardView){ 853 if(active_view == AbView::CardView){
854 slotViewSwitched( AbView::TableView ); 854 slotViewSwitched( AbView::TableView );
855 e->ignore(); 855 e->ignore();
856 return; 856 return;
857 } 857 }
858 if(syncing) { 858 if(syncing) {
859 /* shouldn't we save, I hear you say? well its already been set 859 /* shouldn't we save, I hear you say? well its already been set
860 so that an edit can not occur during a sync, and we flushed 860 so that an edit can not occur during a sync, and we flushed
861 at the start of the sync, so there is no need to save 861 at the start of the sync, so there is no need to save
862 Saving however itself would cause problems. */ 862 Saving however itself would cause problems. */
863 e->accept(); 863 e->accept();
864 return; 864 return;
865 } 865 }
866 //################## shouldn't always save 866 //################## shouldn't always save
867 // True, but the database handles this automatically ! (se) 867 // True, but the database handles this automatically ! (se)
868 if ( save() ) 868 if ( save() )
869 e->accept(); 869 e->accept();
870 else 870 else
871 e->ignore(); 871 e->ignore();
872} 872}
873 873
874/* 874/*
875 Returns TRUE if it is OK to exit 875 Returns TRUE if it is OK to exit
876*/ 876*/
877 877
878bool AddressbookWindow::save() 878bool AddressbookWindow::save()
879{ 879{
880 if ( !m_abView->save() ) { 880 if ( !m_abView->save() ) {
881 if ( QMessageBox::critical( 0, tr( "Out of space" ), 881 if ( QMessageBox::critical( 0, tr( "Out of space" ),
882 tr("Unable to save information.\n" 882 tr("Unable to save information.\n"
883 "Free up some space\n" 883 "Free up some space\n"
884 "and try again.\n" 884 "and try again.\n"
885 "\nQuit anyway?"), 885 "\nQuit anyway?"),
886 QMessageBox::Yes|QMessageBox::Escape, 886 QMessageBox::Yes|QMessageBox::Escape,
887 QMessageBox::No|QMessageBox::Default ) 887 QMessageBox::No|QMessageBox::Default )
888 != QMessageBox::No ) 888 != QMessageBox::No )
889 return TRUE; 889 return TRUE;
890 else 890 else
891 return FALSE; 891 return FALSE;
892 } 892 }
893 return TRUE; 893 return TRUE;
894} 894}
895 895
896#ifdef __DEBUG_RELEASE 896#ifdef __DEBUG_RELEASE
897void AddressbookWindow::slotSave() 897void AddressbookWindow::slotSave()
898{ 898{
899 save(); 899 save();
900} 900}
901#endif 901#endif
902 902
903 903
904void AddressbookWindow::slotNotFound() 904void AddressbookWindow::slotNotFound()
905{ 905{
906 qWarning("Got notfound signal!"); 906 qWarning("Got notfound signal!");
907 QMessageBox::information( this, tr( "Not Found" ), 907 QMessageBox::information( this, tr( "Not Found" ),
908 "<qt>" + tr( "Unable to find a contact for this search pattern!" ) + "</qt>" ); 908 "<qt>" + tr( "Unable to find a contact for this search pattern!" ) + "</qt>" );
909 909
910 910
911} 911}
912void AddressbookWindow::slotWrapAround() 912void AddressbookWindow::slotWrapAround()
913{ 913{
914 qWarning("Got wrap signal!"); 914 qWarning("Got wrap signal!");
915 // if ( doNotifyWrapAround ) 915 // if ( doNotifyWrapAround )
916 // QMessageBox::information( this, tr( "End of list" ), 916 // QMessageBox::information( this, tr( "End of list" ),
917 // tr( "End of list. Wrap around now...!" ) + "\n" ); 917 // tr( "End of list. Wrap around now...!" ) + "\n" );
918 918
919} 919}
920 920
921void AddressbookWindow::slotSetCategory( int c ) 921void AddressbookWindow::slotSetCategory( int c )
922{ 922{
923 qWarning( "void AddressbookWindow::slotSetCategory( %d ) from %d", c, catMenu->count() ); 923 qWarning( "void AddressbookWindow::slotSetCategory( %d ) from %d", c, catMenu->count() );
924 924
925 QString cat, book; 925 QString cat, book;
926 AbView::Views view = AbView::TableView; 926 AbView::Views view = AbView::TableView;
927 927
928 if ( c <= 0 ) 928 if ( c <= 0 )
929 return; 929 return;
930 930
931 // Switch view 931 // Switch view
932 if ( c < 3 ) 932 if ( c < 3 )
933 for ( unsigned int i = 1; i < 3; i++ ){ 933 for ( unsigned int i = 1; i < 3; i++ ){
934 if ( catMenu ) 934 if ( catMenu )
935 catMenu->setItemChecked( i, c == (int)i ); 935 catMenu->setItemChecked( i, c == (int)i );
936 } 936 }
937 else 937 else
938 // Checkmark Category Menu Item Selected 938 // Checkmark Category Menu Item Selected
939 for ( unsigned int i = 3; i < catMenu->count(); i++ ) 939 for ( unsigned int i = 3; i < catMenu->count(); i++ )
940 catMenu->setItemChecked( i, c == (int)i ); 940 catMenu->setItemChecked( i, c == (int)i );
941 941
942 // Now switch to the selected category 942 // Now switch to the selected category
943 for ( unsigned int i = 1; i < catMenu->count(); i++ ) { 943 for ( unsigned int i = 1; i < catMenu->count(); i++ ) {
944 if (catMenu->isItemChecked( i )) { 944 if (catMenu->isItemChecked( i )) {
945 if ( i == 1 ){ // default List view 945 if ( i == 1 ){ // default List view
946 book = QString::null; 946 book = QString::null;
947 view = AbView::TableView; 947 view = AbView::TableView;
948 }else if ( i == 2 ){ 948 }else if ( i == 2 ){
949 book = tr( "Cards" ); 949 book = tr( "Cards" );
950 view = AbView::CardView; 950 view = AbView::CardView;
951 // }else if ( i == 3 ){ 951 // }else if ( i == 3 ){
952 // book = tr( "Personal" ); 952 // book = tr( "Personal" );
953 // view = AbView:: PersonalView; 953 // view = AbView:: PersonalView;
954 }else if ( i == 3 ){ // default All Categories 954 }else if ( i == 3 ){ // default All Categories
955 cat = QString::null; 955 cat = QString::null;
956 }else if ( i == (unsigned int)catMenu->count() - 1 ){ // last menu option (seperator is counted, too) will be Unfiled 956 }else if ( i == (unsigned int)catMenu->count() - 1 ){ // last menu option (seperator is counted, too) will be Unfiled
957 cat = "Unfiled"; 957 cat = "Unfiled";
958 qWarning ("Unfiled selected!"); 958 qWarning ("Unfiled selected!");
959 }else{ 959 }else{
960 cat = m_abView->categories()[i - 4]; 960 cat = m_abView->categories()[i - 4];
961 } 961 }
962 } 962 }
963 } 963 }
964 964
965 // Switch to the selected View 965 // Switch to the selected View
966 slotViewSwitched( view ); 966 slotViewSwitched( view );
967 967
968 // Tell the view about the selected category 968 // Tell the view about the selected category
969 m_abView -> setShowByCategory( cat ); 969 m_abView -> setShowByCategory( cat );
970 970
971 if ( book.isEmpty() ) 971 if ( book.isEmpty() )
972 book = "List"; 972 book = "List";
973 if ( cat.isEmpty() ) 973 if ( cat.isEmpty() )
974 cat = "All"; 974 cat = "All";
975 975
976 setCaption( tr( "Contacts" ) + " - " + book + " - " + tr( cat ) ); 976 setCaption( tr( "Contacts" ) + " - " + book + " - " + tr( cat ) );
977} 977}
978 978
979void AddressbookWindow::slotViewSwitched( int view ) 979void AddressbookWindow::slotViewSwitched( int view )
980{ 980{
981 qWarning( "void AddressbookWindow::slotViewSwitched( %d )", view ); 981 qWarning( "void AddressbookWindow::slotViewSwitched( %d )", view );
982 int menu = 0; 982 int menu = 0;
983 983
984 // Switch to selected view 984 // Switch to selected view
985 switch ( view ){ 985 switch ( view ){
986 case AbView::TableView: 986 case AbView::TableView:
987 menu = 1; 987 menu = 1;
988 m_tableViewButton->setOn(true); 988 m_tableViewButton->setOn(true);
989 m_cardViewButton->setOn(false); 989 m_cardViewButton->setOn(false);
990 break; 990 break;
991 case AbView::CardView: 991 case AbView::CardView:
992 menu = 2; 992 menu = 2;
993 m_tableViewButton->setOn(false); 993 m_tableViewButton->setOn(false);
994 m_cardViewButton->setOn(true); 994 m_cardViewButton->setOn(true);
995 break; 995 break;
996 } 996 }
997 for ( unsigned int i = 1; i < 3; i++ ){ 997 for ( unsigned int i = 1; i < 3; i++ ){
998 if ( catMenu ) 998 if ( catMenu )
999 catMenu->setItemChecked( i, menu == (int)i ); 999 catMenu->setItemChecked( i, menu == (int)i );
1000 } 1000 }
1001 1001
1002 // Tell the view about the selected view 1002 // Tell the view about the selected view
1003 m_abView -> setShowToView ( (AbView::Views) view ); 1003 m_abView -> setShowToView ( (AbView::Views) view );
1004 active_view = view; 1004 active_view = view;
1005} 1005}
1006 1006
1007 1007
1008void AddressbookWindow::slotListView() 1008void AddressbookWindow::slotListView()
1009{ 1009{
1010 slotViewSwitched( AbView::TableView ); 1010 slotViewSwitched( AbView::TableView );
1011} 1011}
1012 1012
1013void AddressbookWindow::slotCardView() 1013void AddressbookWindow::slotCardView()
1014{ 1014{
1015 slotViewSwitched( AbView::CardView ); 1015 slotViewSwitched( AbView::CardView );
1016} 1016}
1017 1017
1018void AddressbookWindow::slotSetLetter( char c ) { 1018void AddressbookWindow::slotSetLetter( char c ) {
1019 1019
1020 m_abView->setShowByLetter( c, m_config.letterPickerSearch() ); 1020 m_abView->setShowByLetter( c, m_config.letterPickerSearch() );
1021 1021
1022} 1022}
1023 1023
1024 1024
1025void AddressbookWindow::populateCategories() 1025void AddressbookWindow::populateCategories()
1026{ 1026{
1027 catMenu->clear(); 1027 catMenu->clear();
1028 1028
1029 int id, rememberId; 1029 int id, rememberId;
1030 id = 1; 1030 id = 1;
1031 rememberId = 0; 1031 rememberId = 0;
1032 1032
1033 catMenu->insertItem( Resource::loadPixmap( "datebook/weeklst" ), tr( "List" ), id++ ); 1033 catMenu->insertItem( Resource::loadPixmap( "addressbook/listview" ), tr( "List" ), id++ );
1034 catMenu->insertItem( Resource::loadPixmap( "day" ), tr( "Cards" ), id++ ); 1034 catMenu->insertItem( Resource::loadPixmap( "addressbook/cardview" ), tr( "Cards" ), id++ );
1035 // catMenu->insertItem( tr( "Personal" ), id++ ); 1035 // catMenu->insertItem( tr( "Personal" ), id++ );
1036 catMenu->insertSeparator(); 1036 catMenu->insertSeparator();
1037 1037
1038 catMenu->insertItem( tr( "All" ), id++ ); 1038 catMenu->insertItem( tr( "All" ), id++ );
1039 QStringList categories = m_abView->categories(); 1039 QStringList categories = m_abView->categories();
1040 categories.append( tr( "Unfiled" ) ); 1040 categories.append( tr( "Unfiled" ) );
1041 for ( QStringList::Iterator it = categories.begin(); 1041 for ( QStringList::Iterator it = categories.begin();
1042 it != categories.end(); ++it ) { 1042 it != categories.end(); ++it ) {
1043 catMenu->insertItem( *it, id ); 1043 catMenu->insertItem( *it, id );
1044 if ( *it == m_abView -> showCategory() ) 1044 if ( *it == m_abView -> showCategory() )
1045 rememberId = id; 1045 rememberId = id;
1046 ++id; 1046 ++id;
1047 } 1047 }
1048 1048
1049 1049
1050 if ( m_abView -> showCategory().isEmpty() ) { 1050 if ( m_abView -> showCategory().isEmpty() ) {
1051 slotSetCategory( 3 ); 1051 slotSetCategory( 3 );
1052 } 1052 }
1053 else { 1053 else {
1054 slotSetCategory( rememberId ); 1054 slotSetCategory( rememberId );
1055 } 1055 }
1056} 1056}
1057 1057