Diffstat (limited to 'core/pim/addressbook/addressbook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 52 |
1 files changed, 27 insertions, 25 deletions
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 @@ -665,78 +665,80 @@ void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data) OContact cnt; QString fn, mn, ln; parseName( name, &fn, &mn, &ln ); // qDebug( " %s - %s - %s", fn.latin1(), mn.latin1(), ln.latin1() ); cnt.setFirstName( fn ); cnt.setMiddleName( mn ); cnt.setLastName( ln ); cnt.insertEmails( email ); cnt.setDefaultEmail( email ); cnt.setFileAs(); m_abView -> addEntry( cnt ); // :SXm_abView()->init( cnt ); editEntry( EditEntry ); } else if ( msg == "beamBusinessCard()" ) { QString beamFilename = addressbookPersonalVCardName(); if ( !QFile::exists( beamFilename ) ) return; // can't beam a non-existent file Ir *ir = new Ir( this ); connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); 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(); + } } void AddressbookWindow::editEntry( EntryMode entryMode ) { OContact entry; if ( !abEditor ) { abEditor = new ContactEditor( entry, this, "editor" ); } if ( entryMode == EditEntry ) abEditor->setEntry( m_abView -> currentEntry() ); 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 ) { |