-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 13 | ||||
-rw-r--r-- | core/pim/addressbook/addressbook.h | 4 |
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 @@ -684,93 +684,104 @@ void AddressbookWindow::editEntry( EntryMode entryMode ) else if ( entryMode == NewEntry ) abEditor->setEntry( entry ); // other things may change the caption. abEditor->setCaption( tr("Edit Address") ); #if defined(Q_WS_QWS) || defined(_WS_QWS_) abEditor->showMaximized(); #endif // fix the foxus... abEditor->setNameFocus(); if ( abEditor->exec() ) { setFocus(); if ( entryMode == NewEntry ) { OContact insertEntry = abEditor->entry(); insertEntry.assignUid(); m_abView -> addEntry( insertEntry ); } else { OContact replEntry = abEditor->entry(); if ( !replEntry.isValidUid() ) replEntry.assignUid(); m_abView -> replaceEntry( replEntry ); } } // populateCategories(); } void AddressbookWindow::editPersonal() { OContact entry; + + // Switch to personal view if not selected + // but take care of the menu, too + if ( ! actionPersonal->isOn() ){ + qWarning("*** ++++"); + actionPersonal->setOn( true ); + slotPersonalView(); + } + if ( !abEditor ) { abEditor = new ContactEditor( entry, this, "editor" ); } - m_abView->showPersonal( true ); abEditor->setCaption(tr("Edit My Personal Details")); abEditor->setPersonalView( true ); editEntry( EditEntry ); abEditor->setPersonalView( false ); } void AddressbookWindow::slotPersonalView() { + qWarning("slotPersonalView()"); if (!actionPersonal->isOn()) { // we just turned it off + qWarning("slotPersonalView()-> OFF"); setCaption( tr("Contacts") ); actionNew->setEnabled(TRUE); actionTrash->setEnabled(TRUE); actionFind->setEnabled(TRUE); actionMail->setEnabled(TRUE); // slotUpdateToolbar(); m_abView->showPersonal( false ); return; } + qWarning("slotPersonalView()-> ON"); // XXX need to disable some QActions. actionNew->setEnabled(FALSE); actionTrash->setEnabled(FALSE); actionFind->setEnabled(FALSE); actionMail->setEnabled(FALSE); setCaption( tr("Contacts - My Personal Details") ); m_abView->showPersonal( true ); } void AddressbookWindow::listIsEmpty( bool empty ) { if ( !empty ) { deleteButton->setEnabled( TRUE ); } } void AddressbookWindow::reload() { syncing = FALSE; m_abView->clear(); m_abView->reload(); } void AddressbookWindow::flush() { syncing = TRUE; m_abView->save(); } 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 @@ -70,70 +70,66 @@ public slots: private slots: void importvCard(); void slotListNew(); /* void slotListView(); */ void slotListDelete(); void slotViewBack(); void slotViewEdit(); void slotPersonalView(); void listIsEmpty( bool ); /* void slotSettings(); */ void writeMail(); void slotBeam(); void beamDone( Ir * ); void slotSetCategory( int ); void slotSetLetter( char ); void slotUpdateToolbar(); void slotSetFont(int); void slotFindOpen(); void slotFindClose(); void slotFind(); void slotNotFound(); void slotWrapAround(); void slotViewSwitched( int ); void slotListView(); void slotCardView(); void slotConfig(); private: - // void initFields(); // inititialize our fields... - // AbLabel *abView(); void populateCategories(); QPopupMenu *catMenu; QPEToolBar *listTools; QToolButton *deleteButton; - // QValueList<int> allFields, orderedFields; - // QStringList slOrderedFields; enum Panes { paneList=0, paneView, paneEdit }; ContactEditor *abEditor; LetterPicker *pLabel; AbView* m_abView; QWidget *listContainer; // Searching stuff OFloatBar* searchBar; QLineEdit* searchEdit; QAction *actionNew, *actionEdit, *actionTrash, *actionFind, *actionBeam, *actionPersonal, *actionMail; int viewMargin; bool syncing; QFont *defaultFont; int m_curFontSize; bool isLoading; AbConfig m_config; QAction* m_tableViewButton; QAction* m_cardViewButton; int active_view; }; #endif |