summaryrefslogtreecommitdiff
authoreilers <eilers>2002-12-16 14:24:22 (UTC)
committer eilers <eilers>2002-12-16 14:24:22 (UTC)
commite555812af7b4183a9b6d276d0b9ac7f01b62eb2f (patch) (unidiff)
tree471979f5d8c35c9eddc89479f223da14140c0f14
parentd1d849bab2d54b1e9144bca1f30786882be9a464 (diff)
downloadopie-e555812af7b4183a9b6d276d0b9ac7f01b62eb2f.zip
opie-e555812af7b4183a9b6d276d0b9ac7f01b62eb2f.tar.gz
opie-e555812af7b4183a9b6d276d0b9ac7f01b62eb2f.tar.bz2
Improvement of previous bugfix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/addressbook.cpp13
-rw-r--r--core/pim/addressbook/addressbook.h4
2 files changed, 12 insertions, 5 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp
index c2cce92..12dc24e 100644
--- a/core/pim/addressbook/addressbook.cpp
+++ b/core/pim/addressbook/addressbook.cpp
@@ -692,77 +692,88 @@ void AddressbookWindow::editEntry( EntryMode entryMode )
692 // fix the foxus... 692 // fix the foxus...
693 abEditor->setNameFocus(); 693 abEditor->setNameFocus();
694 if ( abEditor->exec() ) { 694 if ( abEditor->exec() ) {
695 setFocus(); 695 setFocus();
696 if ( entryMode == NewEntry ) { 696 if ( entryMode == NewEntry ) {
697 OContact insertEntry = abEditor->entry(); 697 OContact insertEntry = abEditor->entry();
698 insertEntry.assignUid(); 698 insertEntry.assignUid();
699 m_abView -> addEntry( insertEntry ); 699 m_abView -> addEntry( insertEntry );
700 } else { 700 } else {
701 OContact replEntry = abEditor->entry(); 701 OContact replEntry = abEditor->entry();
702 702
703 if ( !replEntry.isValidUid() ) 703 if ( !replEntry.isValidUid() )
704 replEntry.assignUid(); 704 replEntry.assignUid();
705 705
706 m_abView -> replaceEntry( replEntry ); 706 m_abView -> replaceEntry( replEntry );
707 } 707 }
708 } 708 }
709 // populateCategories(); 709 // populateCategories();
710 710
711} 711}
712 712
713void AddressbookWindow::editPersonal() 713void AddressbookWindow::editPersonal()
714{ 714{
715 OContact entry; 715 OContact entry;
716
717 // Switch to personal view if not selected
718 // but take care of the menu, too
719 if ( ! actionPersonal->isOn() ){
720 qWarning("*** ++++");
721 actionPersonal->setOn( true );
722 slotPersonalView();
723 }
724
716 if ( !abEditor ) { 725 if ( !abEditor ) {
717 abEditor = new ContactEditor( entry, this, "editor" ); 726 abEditor = new ContactEditor( entry, this, "editor" );
718 } 727 }
719 728
720 m_abView->showPersonal( true );
721 abEditor->setCaption(tr("Edit My Personal Details")); 729 abEditor->setCaption(tr("Edit My Personal Details"));
722 abEditor->setPersonalView( true ); 730 abEditor->setPersonalView( true );
723 editEntry( EditEntry ); 731 editEntry( EditEntry );
724 abEditor->setPersonalView( false ); 732 abEditor->setPersonalView( false );
725 733
726} 734}
727 735
728 736
729void AddressbookWindow::slotPersonalView() 737void AddressbookWindow::slotPersonalView()
730{ 738{
739 qWarning("slotPersonalView()");
731 if (!actionPersonal->isOn()) { 740 if (!actionPersonal->isOn()) {
732 // we just turned it off 741 // we just turned it off
742 qWarning("slotPersonalView()-> OFF");
733 setCaption( tr("Contacts") ); 743 setCaption( tr("Contacts") );
734 actionNew->setEnabled(TRUE); 744 actionNew->setEnabled(TRUE);
735 actionTrash->setEnabled(TRUE); 745 actionTrash->setEnabled(TRUE);
736 actionFind->setEnabled(TRUE); 746 actionFind->setEnabled(TRUE);
737 actionMail->setEnabled(TRUE); 747 actionMail->setEnabled(TRUE);
738 // slotUpdateToolbar(); 748 // slotUpdateToolbar();
739 749
740 m_abView->showPersonal( false ); 750 m_abView->showPersonal( false );
741 751
742 return; 752 return;
743 } 753 }
744 754
755 qWarning("slotPersonalView()-> ON");
745 // XXX need to disable some QActions. 756 // XXX need to disable some QActions.
746 actionNew->setEnabled(FALSE); 757 actionNew->setEnabled(FALSE);
747 actionTrash->setEnabled(FALSE); 758 actionTrash->setEnabled(FALSE);
748 actionFind->setEnabled(FALSE); 759 actionFind->setEnabled(FALSE);
749 actionMail->setEnabled(FALSE); 760 actionMail->setEnabled(FALSE);
750 761
751 setCaption( tr("Contacts - My Personal Details") ); 762 setCaption( tr("Contacts - My Personal Details") );
752 763
753 m_abView->showPersonal( true ); 764 m_abView->showPersonal( true );
754 765
755} 766}
756 767
757 768
758void AddressbookWindow::listIsEmpty( bool empty ) 769void AddressbookWindow::listIsEmpty( bool empty )
759{ 770{
760 if ( !empty ) { 771 if ( !empty ) {
761 deleteButton->setEnabled( TRUE ); 772 deleteButton->setEnabled( TRUE );
762 } 773 }
763} 774}
764 775
765void AddressbookWindow::reload() 776void AddressbookWindow::reload()
766{ 777{
767 syncing = FALSE; 778 syncing = FALSE;
768 m_abView->clear(); 779 m_abView->clear();
diff --git a/core/pim/addressbook/addressbook.h b/core/pim/addressbook/addressbook.h
index 2bedc0b..69fe2f8 100644
--- a/core/pim/addressbook/addressbook.h
+++ b/core/pim/addressbook/addressbook.h
@@ -78,57 +78,53 @@ private slots:
78 void slotPersonalView(); 78 void slotPersonalView();
79 void listIsEmpty( bool ); 79 void listIsEmpty( bool );
80 /* void slotSettings(); */ 80 /* void slotSettings(); */
81 void writeMail(); 81 void writeMail();
82 void slotBeam(); 82 void slotBeam();
83 void beamDone( Ir * ); 83 void beamDone( Ir * );
84 void slotSetCategory( int ); 84 void slotSetCategory( int );
85 void slotSetLetter( char ); 85 void slotSetLetter( char );
86 void slotUpdateToolbar(); 86 void slotUpdateToolbar();
87 void slotSetFont(int); 87 void slotSetFont(int);
88 88
89 void slotFindOpen(); 89 void slotFindOpen();
90 void slotFindClose(); 90 void slotFindClose();
91 void slotFind(); 91 void slotFind();
92 void slotNotFound(); 92 void slotNotFound();
93 void slotWrapAround(); 93 void slotWrapAround();
94 94
95 void slotViewSwitched( int ); 95 void slotViewSwitched( int );
96 void slotListView(); 96 void slotListView();
97 void slotCardView(); 97 void slotCardView();
98 98
99 void slotConfig(); 99 void slotConfig();
100 100
101private: 101private:
102 //void initFields(); // inititialize our fields...
103 // AbLabel *abView();
104 void populateCategories(); 102 void populateCategories();
105 103
106 QPopupMenu *catMenu; 104 QPopupMenu *catMenu;
107 QPEToolBar *listTools; 105 QPEToolBar *listTools;
108 QToolButton *deleteButton; 106 QToolButton *deleteButton;
109 //QValueList<int> allFields, orderedFields;
110 //QStringList slOrderedFields;
111 enum Panes { paneList=0, paneView, paneEdit }; 107 enum Panes { paneList=0, paneView, paneEdit };
112 ContactEditor *abEditor; 108 ContactEditor *abEditor;
113 LetterPicker *pLabel; 109 LetterPicker *pLabel;
114 AbView* m_abView; 110 AbView* m_abView;
115 QWidget *listContainer; 111 QWidget *listContainer;
116 112
117 // Searching stuff 113 // Searching stuff
118 OFloatBar* searchBar; 114 OFloatBar* searchBar;
119 QLineEdit* searchEdit; 115 QLineEdit* searchEdit;
120 116
121 QAction *actionNew, *actionEdit, *actionTrash, *actionFind, *actionBeam, *actionPersonal, *actionMail; 117 QAction *actionNew, *actionEdit, *actionTrash, *actionFind, *actionBeam, *actionPersonal, *actionMail;
122 118
123 int viewMargin; 119 int viewMargin;
124 120
125 bool syncing; 121 bool syncing;
126 QFont *defaultFont; 122 QFont *defaultFont;
127 int m_curFontSize; 123 int m_curFontSize;
128 124
129 bool isLoading; 125 bool isLoading;
130 126
131 AbConfig m_config; 127 AbConfig m_config;
132 128
133 QAction* m_tableViewButton; 129 QAction* m_tableViewButton;
134 QAction* m_cardViewButton; 130 QAction* m_cardViewButton;