-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 44 |
1 files changed, 36 insertions, 8 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index a4c2c6e..7c52ef2 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp | |||
@@ -708,18 +708,34 @@ void AddressbookWindow::slotPersonalView() | |||
708 | 708 | ||
709 | bool personal = m_actionPersonal->isOn(); | 709 | bool personal = m_actionPersonal->isOn(); |
710 | 710 | ||
711 | // Disable certain menu items when showing personal details | 711 | // Disable actions when showing personal details |
712 | setItemNewEnabled( !personal ); | 712 | setItemNewEnabled( !personal ); |
713 | setItemDuplicateEnabled( !personal ); | 713 | setItemDuplicateEnabled( !personal ); |
714 | setItemDeleteEnabled( !personal ); | 714 | setItemDeleteEnabled( !personal ); |
715 | m_actionMail->setEnabled( !personal ); | 715 | m_actionMail->setEnabled( !personal ); |
716 | setShowCategories( !personal ); | ||
716 | 717 | ||
717 | // Display appropriate view | 718 | // Display appropriate view |
718 | m_abView->showPersonal( personal ); | 719 | m_abView->showPersonal( personal ); |
719 | 720 | ||
720 | // Set application caption | 721 | if ( personal ) |
721 | personal ? setCaption( tr( "Contacts - My Personal Details") ) | 722 | { |
722 | : setCaption( tr( "Contacts") ); | 723 | setCaption( tr( "Contacts - My Personal Details") ); |
724 | |||
725 | // Set category to 'All' to make sure personal details is visible | ||
726 | setViewCategory( "All" ); | ||
727 | m_abView->setShowByCategory( "All" ); | ||
728 | |||
729 | // Temporarily disable letter picker | ||
730 | pLabel->hide(); | ||
731 | } | ||
732 | else | ||
733 | { | ||
734 | setCaption( tr( "Contacts") ); | ||
735 | |||
736 | // Re-enable letter picker | ||
737 | pLabel->show(); | ||
738 | } | ||
723 | } | 739 | } |
724 | 740 | ||
725 | void AddressbookWindow::reload() | 741 | void AddressbookWindow::reload() |
@@ -738,10 +754,22 @@ void AddressbookWindow::flush() | |||
738 | 754 | ||
739 | void AddressbookWindow::closeEvent( QCloseEvent *e ) | 755 | void AddressbookWindow::closeEvent( QCloseEvent *e ) |
740 | { | 756 | { |
741 | if(active_view == AbView::CardView){ | 757 | if ( active_view == AbView::CardView ) |
742 | slotViewSwitched( AbView::TableView ); | 758 | { |
743 | e->ignore(); | 759 | if ( !m_actionPersonal->isOn() ) |
744 | return; | 760 | { |
761 | // Switch to table view only if not editing personal details | ||
762 | slotViewSwitched( AbView::TableView ); | ||
763 | } | ||
764 | else | ||
765 | { | ||
766 | // If currently editing personal details, switch off personal view | ||
767 | m_actionPersonal->setOn( false ); | ||
768 | slotPersonalView(); | ||
769 | } | ||
770 | |||
771 | e->ignore(); | ||
772 | return; | ||
745 | } | 773 | } |
746 | if(syncing) { | 774 | if(syncing) { |
747 | /* shouldn't we save, I hear you say? well its already been set | 775 | /* shouldn't we save, I hear you say? well its already been set |