author | eilers <eilers> | 2003-05-09 08:40:42 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-05-09 08:40:42 (UTC) |
commit | fd1f8bdfc8bad5a0344468118c66c6afe3044fde (patch) (unidiff) | |
tree | 58f18282117f9b524c13221f6a54c7bbc94a5827 /core/pim | |
parent | a82928a004882e9aba652061fc6ecffb85d403cf (diff) | |
download | opie-fd1f8bdfc8bad5a0344468118c66c6afe3044fde.zip opie-fd1f8bdfc8bad5a0344468118c66c6afe3044fde.tar.gz opie-fd1f8bdfc8bad5a0344468118c66c6afe3044fde.tar.bz2 |
Added two QCop functions for OSearch:
editUid(int), showUid(int)..
-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 | 54 |
3 files changed, 36 insertions, 26 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 | |||
@@ -293,12 +293,19 @@ void AbView::showPersonal( bool personal ) | |||
293 | m_inPersonal = false; | 293 | m_inPersonal = false; |
294 | 294 | ||
295 | } | 295 | } |
296 | load(); | 296 | load(); |
297 | } | 297 | } |
298 | 298 | ||
299 | void AbView::setCurrentUid( int uid ){ | ||
300 | |||
301 | m_curr_Contact = uid; | ||
302 | updateView( true ); //true: Don't modificate the UID ! | ||
303 | } | ||
304 | |||
305 | |||
299 | QStringList AbView::categories() | 306 | QStringList AbView::categories() |
300 | { | 307 | { |
301 | mCat.load( categoryFileName() ); | 308 | mCat.load( categoryFileName() ); |
302 | QStringList categoryList = mCat.labels( "Contacts" ); | 309 | QStringList categoryList = mCat.labels( "Contacts" ); |
303 | return categoryList; | 310 | return categoryList; |
304 | } | 311 | } |
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 | |||
@@ -26,12 +26,13 @@ public: | |||
26 | void load(); | 26 | void load(); |
27 | void reload(); | 27 | void reload(); |
28 | void clear(); | 28 | void clear(); |
29 | 29 | ||
30 | void setView( Views view ); | 30 | void setView( Views view ); |
31 | void showPersonal( bool personal ); | 31 | void showPersonal( bool personal ); |
32 | void setCurrentUid( int uid ); | ||
32 | void setShowByCategory( const QString& cat ); | 33 | void setShowByCategory( const QString& cat ); |
33 | void setShowToView( Views view ); | 34 | void setShowToView( Views view ); |
34 | void setShowByLetter( char c ); | 35 | void setShowByLetter( char c ); |
35 | void setListOrder( const QValueList<int>& ordered ); | 36 | void setListOrder( const QValueList<int>& ordered ); |
36 | 37 | ||
37 | // Add Entry and put to current | 38 | // Add Entry and put to current |
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 | |||
@@ -683,42 +683,44 @@ void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data) | |||
683 | return; // can't beam a non-existent file | 683 | return; // can't beam a non-existent file |
684 | 684 | ||
685 | Ir *ir = new Ir( this ); | 685 | Ir *ir = new Ir( this ); |
686 | connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); | 686 | connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); |
687 | QString description = "mycard.vcf"; | 687 | QString description = "mycard.vcf"; |
688 | ir->send( beamFilename, description, "text/x-vCard" ); | 688 | ir->send( beamFilename, description, "text/x-vCard" ); |
689 | } else if ( msg == "showUid(int)" ) { | ||
690 | QDataStream stream(data,IO_ReadOnly); | ||
691 | int uid; | ||
692 | stream >> uid; | ||
693 | |||
694 | // Deactivate Personal View.. | ||
695 | if ( actionPersonal->isOn() ){ | ||
696 | actionPersonal->setOn( false ); | ||
697 | slotPersonalView(); | ||
689 | } | 698 | } |
690 | #if 0 | 699 | |
691 | else if (msg == "pickAddresses(QCString,QCString,QStringList,...)" ) { | 700 | // Reset category and show as card.. |
701 | m_abView -> setShowByCategory( QString::null ); | ||
702 | m_abView -> setCurrentUid( uid ); | ||
703 | slotViewSwitched ( AbView::CardView ); | ||
704 | |||
705 | } else if ( msg == "editUid(int)" ) { | ||
692 | QDataStream stream(data,IO_ReadOnly); | 706 | QDataStream stream(data,IO_ReadOnly); |
693 | QCString ch,m; | 707 | int uid; |
694 | QStringList types; | 708 | stream >> uid; |
695 | stream >> ch >> m >> types; | 709 | |
696 | AddressPicker picker(abList,this,0,TRUE); | 710 | // Deactivate Personal View.. |
697 | picker.showMaximized(); | 711 | if ( actionPersonal->isOn() ){ |
698 | picker.setChoiceNames(types); | 712 | actionPersonal->setOn( false ); |
699 | int i=0; | 713 | slotPersonalView(); |
700 | for (QStringList::ConstIterator it = types.begin(); it!=types.end(); ++it) { | ||
701 | QStringList sel; | ||
702 | stream >> sel; | ||
703 | picker.setSelection(i++,sel); | ||
704 | } | ||
705 | picker.showMaximized(); | ||
706 | picker.exec(); | ||
707 | |||
708 | // ###### note: contacts may have been added - save here! | ||
709 | |||
710 | setCentralWidget(abList); | ||
711 | QCopEnvelope e(ch,m); | ||
712 | i=0; | ||
713 | for (QStringList::ConstIterator it = types.begin(); it!=types.end(); ++it) { | ||
714 | QStringList sel = picker.selection(i++); | ||
715 | e << sel; | ||
716 | } | 714 | } |
715 | |||
716 | // Reset category and edit.. | ||
717 | m_abView -> setShowByCategory( QString::null ); | ||
718 | m_abView -> setCurrentUid( uid ); | ||
719 | slotViewEdit(); | ||
717 | } | 720 | } |
718 | #endif | ||
719 | 721 | ||
720 | } | 722 | } |
721 | 723 | ||
722 | void AddressbookWindow::editEntry( EntryMode entryMode ) | 724 | void AddressbookWindow::editEntry( EntryMode entryMode ) |
723 | { | 725 | { |
724 | OContact entry; | 726 | OContact entry; |