-rw-r--r-- | core/pim/addressbook/abview.cpp | 7 | ||||
-rw-r--r-- | core/pim/addressbook/abview.h | 1 | ||||
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 52 |
3 files changed, 35 insertions, 25 deletions
diff --git a/core/pim/addressbook/abview.cpp b/core/pim/addressbook/abview.cpp index b89b794..d3ca783 100644 --- a/core/pim/addressbook/abview.cpp +++ b/core/pim/addressbook/abview.cpp @@ -297,4 +297,11 @@ void AbView::showPersonal( bool personal ) } +void AbView::setCurrentUid( int uid ){ + + m_curr_Contact = uid; + updateView( true ); //true: Don't modificate the UID ! +} + + QStringList AbView::categories() { diff --git a/core/pim/addressbook/abview.h b/core/pim/addressbook/abview.h index 8570fe7..55c63cc 100644 --- a/core/pim/addressbook/abview.h +++ b/core/pim/addressbook/abview.h @@ -30,4 +30,5 @@ public: void setView( Views view ); void showPersonal( bool personal ); + void setCurrentUid( int uid ); void setShowByCategory( const QString& cat ); void setShowToView( Views view ); diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index 89a3312..e053e94 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp @@ -687,34 +687,36 @@ void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data) QString description = "mycard.vcf"; ir->send( beamFilename, description, "text/x-vCard" ); - } -#if 0 - else if (msg == "pickAddresses(QCString,QCString,QStringList,...)" ) { + } else if ( msg == "showUid(int)" ) { QDataStream stream(data,IO_ReadOnly); - QCString ch,m; - QStringList types; - stream >> ch >> m >> types; - AddressPicker picker(abList,this,0,TRUE); - picker.showMaximized(); - picker.setChoiceNames(types); - int i=0; - for (QStringList::ConstIterator it = types.begin(); it!=types.end(); ++it) { - QStringList sel; - stream >> sel; - picker.setSelection(i++,sel); + int uid; + stream >> uid; + + // Deactivate Personal View.. + if ( actionPersonal->isOn() ){ + actionPersonal->setOn( false ); + slotPersonalView(); } - picker.showMaximized(); - picker.exec(); - // ###### note: contacts may have been added - save here! + // Reset category and show as card.. + m_abView -> setShowByCategory( QString::null ); + m_abView -> setCurrentUid( uid ); + slotViewSwitched ( AbView::CardView ); + + } else if ( msg == "editUid(int)" ) { + QDataStream stream(data,IO_ReadOnly); + int uid; + stream >> uid; - setCentralWidget(abList); - QCopEnvelope e(ch,m); - i=0; - for (QStringList::ConstIterator it = types.begin(); it!=types.end(); ++it) { - QStringList sel = picker.selection(i++); - e << sel; + // Deactivate Personal View.. + if ( actionPersonal->isOn() ){ + actionPersonal->setOn( false ); + slotPersonalView(); } - } -#endif + + // Reset category and edit.. + m_abView -> setShowByCategory( QString::null ); + m_abView -> setCurrentUid( uid ); + slotViewEdit(); + } } |