author | tille <tille> | 2002-12-08 16:47:12 (UTC) |
---|---|---|
committer | tille <tille> | 2002-12-08 16:47:12 (UTC) |
commit | aea4a628b4500f8551255d715c9f8696c6ad3280 (patch) (unidiff) | |
tree | 96fbc930732b4574490fe7e59fa19a35fb5b8596 | |
parent | a2840f80792c7e40ee3b44be0ec48302d8816cc0 (diff) | |
download | opie-aea4a628b4500f8551255d715c9f8696c6ad3280.zip opie-aea4a628b4500f8551255d715c9f8696c6ad3280.tar.gz opie-aea4a628b4500f8551255d715c9f8696c6ad3280.tar.bz2 |
do not close ab while in cardview, rather switch back to listview
as the old version did
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 8 | ||||
-rw-r--r-- | core/pim/addressbook/addressbook.h | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index 055124c..60db2b4 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp | |||
@@ -734,33 +734,37 @@ void AddressbookWindow::listIsEmpty( bool empty ) | |||
734 | void AddressbookWindow::reload() | 734 | void AddressbookWindow::reload() |
735 | { | 735 | { |
736 | syncing = FALSE; | 736 | syncing = FALSE; |
737 | m_abView->clear(); | 737 | m_abView->clear(); |
738 | m_abView->reload(); | 738 | m_abView->reload(); |
739 | } | 739 | } |
740 | 740 | ||
741 | void AddressbookWindow::flush() | 741 | void AddressbookWindow::flush() |
742 | { | 742 | { |
743 | syncing = TRUE; | 743 | syncing = TRUE; |
744 | m_abView->save(); | 744 | m_abView->save(); |
745 | } | 745 | } |
746 | 746 | ||
747 | 747 | ||
748 | void AddressbookWindow::closeEvent( QCloseEvent *e ) | 748 | void AddressbookWindow::closeEvent( QCloseEvent *e ) |
749 | { | 749 | { |
750 | 750 | if(active_view == AbView::CardView){ | |
751 | slotViewSwitched( AbView::TableView ); | ||
752 | e->ignore(); | ||
753 | return; | ||
754 | } | ||
751 | if(syncing) { | 755 | if(syncing) { |
752 | /* shouldn't we save, I hear you say? well its already been set | 756 | /* shouldn't we save, I hear you say? well its already been set |
753 | so that an edit can not occur during a sync, and we flushed | 757 | so that an edit can not occur during a sync, and we flushed |
754 | at the start of the sync, so there is no need to save | 758 | at the start of the sync, so there is no need to save |
755 | Saving however itself would cause problems. */ | 759 | Saving however itself would cause problems. */ |
756 | e->accept(); | 760 | e->accept(); |
757 | return; | 761 | return; |
758 | } | 762 | } |
759 | //################## shouldn't always save | 763 | //################## shouldn't always save |
760 | // True, but the database handles this automatically ! (se) | 764 | // True, but the database handles this automatically ! (se) |
761 | if ( save() ) | 765 | if ( save() ) |
762 | e->accept(); | 766 | e->accept(); |
763 | else | 767 | else |
764 | e->ignore(); | 768 | e->ignore(); |
765 | } | 769 | } |
766 | 770 | ||
@@ -881,33 +885,33 @@ void AddressbookWindow::slotViewSwitched( int view ) | |||
881 | m_tableViewButton->setOn(true); | 885 | m_tableViewButton->setOn(true); |
882 | m_cardViewButton->setOn(false); | 886 | m_cardViewButton->setOn(false); |
883 | break; | 887 | break; |
884 | case AbView::CardView: | 888 | case AbView::CardView: |
885 | menu = 2; | 889 | menu = 2; |
886 | m_tableViewButton->setOn(false); | 890 | m_tableViewButton->setOn(false); |
887 | m_cardViewButton->setOn(true); | 891 | m_cardViewButton->setOn(true); |
888 | break; | 892 | break; |
889 | } | 893 | } |
890 | for ( unsigned int i = 1; i < 3; i++ ){ | 894 | for ( unsigned int i = 1; i < 3; i++ ){ |
891 | if ( catMenu ) | 895 | if ( catMenu ) |
892 | catMenu->setItemChecked( i, menu == (int)i ); | 896 | catMenu->setItemChecked( i, menu == (int)i ); |
893 | } | 897 | } |
894 | 898 | ||
895 | // Tell the view about the selected view | 899 | // Tell the view about the selected view |
896 | m_abView -> setShowToView ( (AbView::Views) view ); | 900 | m_abView -> setShowToView ( (AbView::Views) view ); |
897 | 901 | active_view = view; | |
898 | } | 902 | } |
899 | 903 | ||
900 | 904 | ||
901 | void AddressbookWindow::slotListView() | 905 | void AddressbookWindow::slotListView() |
902 | { | 906 | { |
903 | slotViewSwitched( AbView::TableView ); | 907 | slotViewSwitched( AbView::TableView ); |
904 | } | 908 | } |
905 | 909 | ||
906 | void AddressbookWindow::slotCardView() | 910 | void AddressbookWindow::slotCardView() |
907 | { | 911 | { |
908 | slotViewSwitched( AbView::CardView ); | 912 | slotViewSwitched( AbView::CardView ); |
909 | } | 913 | } |
910 | 914 | ||
911 | void AddressbookWindow::slotSetLetter( char c ) { | 915 | void AddressbookWindow::slotSetLetter( char c ) { |
912 | 916 | ||
913 | m_abView->setShowByLetter( c ); | 917 | m_abView->setShowByLetter( c ); |
diff --git a/core/pim/addressbook/addressbook.h b/core/pim/addressbook/addressbook.h index 4c1e2f2..2bedc0b 100644 --- a/core/pim/addressbook/addressbook.h +++ b/core/pim/addressbook/addressbook.h | |||
@@ -119,19 +119,21 @@ private: | |||
119 | QLineEdit* searchEdit; | 119 | QLineEdit* searchEdit; |
120 | 120 | ||
121 | QAction *actionNew, *actionEdit, *actionTrash, *actionFind, *actionBeam, *actionPersonal, *actionMail; | 121 | QAction *actionNew, *actionEdit, *actionTrash, *actionFind, *actionBeam, *actionPersonal, *actionMail; |
122 | 122 | ||
123 | int viewMargin; | 123 | int viewMargin; |
124 | 124 | ||
125 | bool syncing; | 125 | bool syncing; |
126 | QFont *defaultFont; | 126 | QFont *defaultFont; |
127 | int m_curFontSize; | 127 | int m_curFontSize; |
128 | 128 | ||
129 | bool isLoading; | 129 | bool isLoading; |
130 | 130 | ||
131 | AbConfig m_config; | 131 | AbConfig m_config; |
132 | 132 | ||
133 | QAction* m_tableViewButton; | 133 | QAction* m_tableViewButton; |
134 | QAction* m_cardViewButton; | 134 | QAction* m_cardViewButton; |
135 | |||
136 | int active_view; | ||
135 | }; | 137 | }; |
136 | 138 | ||
137 | #endif | 139 | #endif |