summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-30 01:00:42 (UTC)
committer zautrix <zautrix>2004-10-30 01:00:42 (UTC)
commitc477fa8ba7eacfaba3d154a72153acc7bc46abdc (patch) (unidiff)
tree0ba938ac70b5f878515432a7ba36525f6167be3f
parentaf857a738da80e9eb68cf311832d44ecb9caf1dd (diff)
downloadkdepimpi-c477fa8ba7eacfaba3d154a72153acc7bc46abdc.zip
kdepimpi-c477fa8ba7eacfaba3d154a72153acc7bc46abdc.tar.gz
kdepimpi-c477fa8ba7eacfaba3d154a72153acc7bc46abdc.tar.bz2
AARGG. I just noticed, that set categories was alreday there. removed my second implementation
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp61
-rw-r--r--kaddressbook/kabcore.h7
2 files changed, 14 insertions, 54 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 2c2f1a0..83027ac 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -835,289 +835,292 @@ void KABCore::beamVCard(const QStringList& uids)
835 QFile outFile(fileName); 835 QFile outFile(fileName);
836 if ( outFile.open(IO_WriteOnly) ) { 836 if ( outFile.open(IO_WriteOnly) ) {
837 datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); 837 datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" );
838 QTextStream t( &outFile ); // use a text stream 838 QTextStream t( &outFile ); // use a text stream
839 //t.setEncoding( QTextStream::UnicodeUTF8 ); 839 //t.setEncoding( QTextStream::UnicodeUTF8 );
840 t.setEncoding( QTextStream::Latin1 ); 840 t.setEncoding( QTextStream::Latin1 );
841 t <<datastream.latin1(); 841 t <<datastream.latin1();
842 outFile.close(); 842 outFile.close();
843 Ir *ir = new Ir( this ); 843 Ir *ir = new Ir( this );
844 connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) ); 844 connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) );
845 ir->send( fileName, description, "text/x-vCard" ); 845 ir->send( fileName, description, "text/x-vCard" );
846 } else { 846 } else {
847 qDebug("Error open temp beam file "); 847 qDebug("Error open temp beam file ");
848 return; 848 return;
849 } 849 }
850#endif 850#endif
851 851
852} 852}
853 853
854void KABCore::beamDone( Ir *ir ) 854void KABCore::beamDone( Ir *ir )
855{ 855{
856#ifndef DESKTOP_VERSION 856#ifndef DESKTOP_VERSION
857 delete ir; 857 delete ir;
858#endif 858#endif
859 topLevelWidget()->raise(); 859 topLevelWidget()->raise();
860 message( i18n("Beaming finished!") ); 860 message( i18n("Beaming finished!") );
861} 861}
862 862
863 863
864void KABCore::browse( const QString& url ) 864void KABCore::browse( const QString& url )
865{ 865{
866#ifndef KAB_EMBEDDED 866#ifndef KAB_EMBEDDED
867 kapp->invokeBrowser( url ); 867 kapp->invokeBrowser( url );
868#else //KAB_EMBEDDED 868#else //KAB_EMBEDDED
869 qDebug("KABCore::browse must be fixed"); 869 qDebug("KABCore::browse must be fixed");
870#endif //KAB_EMBEDDED 870#endif //KAB_EMBEDDED
871} 871}
872 872
873void KABCore::selectAllContacts() 873void KABCore::selectAllContacts()
874{ 874{
875 mViewManager->setSelected( QString::null, true ); 875 mViewManager->setSelected( QString::null, true );
876} 876}
877 877
878void KABCore::deleteContacts() 878void KABCore::deleteContacts()
879{ 879{
880 QStringList uidList = mViewManager->selectedUids(); 880 QStringList uidList = mViewManager->selectedUids();
881 deleteContacts( uidList ); 881 deleteContacts( uidList );
882} 882}
883 883
884void KABCore::deleteContacts( const QStringList &uids ) 884void KABCore::deleteContacts( const QStringList &uids )
885{ 885{
886 if ( uids.count() > 0 ) { 886 if ( uids.count() > 0 ) {
887 PwDeleteCommand *command = new PwDeleteCommand( mAddressBook, uids ); 887 PwDeleteCommand *command = new PwDeleteCommand( mAddressBook, uids );
888 UndoStack::instance()->push( command ); 888 UndoStack::instance()->push( command );
889 RedoStack::instance()->clear(); 889 RedoStack::instance()->clear();
890 890
891 // now if we deleted anything, refresh 891 // now if we deleted anything, refresh
892 setContactSelected( QString::null ); 892 setContactSelected( QString::null );
893 setModified( true ); 893 setModified( true );
894 } 894 }
895} 895}
896 896
897void KABCore::copyContacts() 897void KABCore::copyContacts()
898{ 898{
899 KABC::Addressee::List addrList = mViewManager->selectedAddressees(); 899 KABC::Addressee::List addrList = mViewManager->selectedAddressees();
900 900
901 QString clipText = AddresseeUtil::addresseesToClipboard( addrList ); 901 QString clipText = AddresseeUtil::addresseesToClipboard( addrList );
902 902
903 kdDebug(5720) << "KABCore::copyContacts: " << clipText << endl; 903 kdDebug(5720) << "KABCore::copyContacts: " << clipText << endl;
904 904
905 QClipboard *cb = QApplication::clipboard(); 905 QClipboard *cb = QApplication::clipboard();
906 cb->setText( clipText ); 906 cb->setText( clipText );
907} 907}
908 908
909void KABCore::cutContacts() 909void KABCore::cutContacts()
910{ 910{
911 QStringList uidList = mViewManager->selectedUids(); 911 QStringList uidList = mViewManager->selectedUids();
912 912
913//US if ( uidList.size() > 0 ) { 913//US if ( uidList.size() > 0 ) {
914 if ( uidList.count() > 0 ) { 914 if ( uidList.count() > 0 ) {
915 PwCutCommand *command = new PwCutCommand( mAddressBook, uidList ); 915 PwCutCommand *command = new PwCutCommand( mAddressBook, uidList );
916 UndoStack::instance()->push( command ); 916 UndoStack::instance()->push( command );
917 RedoStack::instance()->clear(); 917 RedoStack::instance()->clear();
918 918
919 setModified( true ); 919 setModified( true );
920 } 920 }
921} 921}
922 922
923void KABCore::pasteContacts() 923void KABCore::pasteContacts()
924{ 924{
925 QClipboard *cb = QApplication::clipboard(); 925 QClipboard *cb = QApplication::clipboard();
926 926
927 KABC::Addressee::List list = AddresseeUtil::clipboardToAddressees( cb->text() ); 927 KABC::Addressee::List list = AddresseeUtil::clipboardToAddressees( cb->text() );
928 928
929 pasteContacts( list ); 929 pasteContacts( list );
930} 930}
931 931
932void KABCore::pasteContacts( KABC::Addressee::List &list ) 932void KABCore::pasteContacts( KABC::Addressee::List &list )
933{ 933{
934 KABC::Resource *resource = requestResource( this ); 934 KABC::Resource *resource = requestResource( this );
935 KABC::Addressee::List::Iterator it; 935 KABC::Addressee::List::Iterator it;
936 for ( it = list.begin(); it != list.end(); ++it ) 936 for ( it = list.begin(); it != list.end(); ++it )
937 (*it).setResource( resource ); 937 (*it).setResource( resource );
938 938
939 PwPasteCommand *command = new PwPasteCommand( this, list ); 939 PwPasteCommand *command = new PwPasteCommand( this, list );
940 UndoStack::instance()->push( command ); 940 UndoStack::instance()->push( command );
941 RedoStack::instance()->clear(); 941 RedoStack::instance()->clear();
942 942
943 setModified( true ); 943 setModified( true );
944} 944}
945 945
946void KABCore::setWhoAmI() 946void KABCore::setWhoAmI()
947{ 947{
948 KABC::Addressee::List addrList = mViewManager->selectedAddressees(); 948 KABC::Addressee::List addrList = mViewManager->selectedAddressees();
949 949
950 if ( addrList.count() > 1 ) { 950 if ( addrList.count() > 1 ) {
951 KMessageBox::sorry( this, i18n( "Please select only one contact." ) ); 951 KMessageBox::sorry( this, i18n( "Please select only one contact." ) );
952 return; 952 return;
953 } 953 }
954 954
955 QString text( i18n( "<qt>Do you really want to use <b>%1</b> as your new personal contact?</qt>" ) ); 955 QString text( i18n( "<qt>Do you really want to use <b>%1</b> as your new personal contact?</qt>" ) );
956 if ( KMessageBox::questionYesNo( this, text.arg( addrList[ 0 ].assembledName() ) ) == KMessageBox::Yes ) 956 if ( KMessageBox::questionYesNo( this, text.arg( addrList[ 0 ].assembledName() ) ) == KMessageBox::Yes )
957 static_cast<KABC::StdAddressBook*>( KABC::StdAddressBook::self() )->setWhoAmI( addrList[ 0 ] ); 957 static_cast<KABC::StdAddressBook*>( KABC::StdAddressBook::self() )->setWhoAmI( addrList[ 0 ] );
958} 958}
959 959
960void KABCore::setCategories() 960void KABCore::setCategories()
961{ 961{
962 KPIM::CategorySelectDialog dlg( KABPrefs::instance(), this, "", true ); 962 KPIM::CategorySelectDialog dlg( KABPrefs::instance(), this, "", true );
963 if ( !dlg.exec() ) 963 if ( !dlg.exec() ) {
964 return; 964 message( i18n("Setting categories cancelled") );
965 965 return;
966 }
966 bool merge = false; 967 bool merge = false;
967 QString msg = i18n( "Merge with existing categories?" ); 968 QString msg = i18n( "Merge with existing categories?" );
968 if ( KMessageBox::questionYesNo( this, msg ) == KMessageBox::Yes ) 969 if ( KMessageBox::questionYesNo( this, msg ) == KMessageBox::Yes )
969 merge = true; 970 merge = true;
970 971
972 message( i18n("Setting categories ... please wait!") );
971 QStringList categories = dlg.selectedCategories(); 973 QStringList categories = dlg.selectedCategories();
972 974
973 QStringList uids = mViewManager->selectedUids(); 975 QStringList uids = mViewManager->selectedUids();
974 QStringList::Iterator it; 976 QStringList::Iterator it;
975 for ( it = uids.begin(); it != uids.end(); ++it ) { 977 for ( it = uids.begin(); it != uids.end(); ++it ) {
976 KABC::Addressee addr = mAddressBook->findByUid( *it ); 978 KABC::Addressee addr = mAddressBook->findByUid( *it );
977 if ( !addr.isEmpty() ) { 979 if ( !addr.isEmpty() ) {
978 if ( !merge ) 980 if ( !merge )
979 addr.setCategories( categories ); 981 addr.setCategories( categories );
980 else { 982 else {
981 QStringList addrCategories = addr.categories(); 983 QStringList addrCategories = addr.categories();
982 QStringList::Iterator catIt; 984 QStringList::Iterator catIt;
983 for ( catIt = categories.begin(); catIt != categories.end(); ++catIt ) { 985 for ( catIt = categories.begin(); catIt != categories.end(); ++catIt ) {
984 if ( !addrCategories.contains( *catIt ) ) 986 if ( !addrCategories.contains( *catIt ) )
985 addrCategories.append( *catIt ); 987 addrCategories.append( *catIt );
986 } 988 }
987 addr.setCategories( addrCategories ); 989 addr.setCategories( addrCategories );
988 } 990 }
989 991
990 mAddressBook->insertAddressee( addr ); 992 mAddressBook->insertAddressee( addr );
991 } 993 }
992 } 994 }
993 995
994 if ( uids.count() > 0 ) 996 if ( uids.count() > 0 )
995 setModified( true ); 997 setModified( true );
998 message( i18n("Setting categories completed!") );
996} 999}
997 1000
998void KABCore::setSearchFields( const KABC::Field::List &fields ) 1001void KABCore::setSearchFields( const KABC::Field::List &fields )
999{ 1002{
1000 mIncSearchWidget->setFields( fields ); 1003 mIncSearchWidget->setFields( fields );
1001} 1004}
1002 1005
1003void KABCore::incrementalSearch( const QString& text ) 1006void KABCore::incrementalSearch( const QString& text )
1004{ 1007{
1005 mViewManager->doSearch( text, mIncSearchWidget->currentField() ); 1008 mViewManager->doSearch( text, mIncSearchWidget->currentField() );
1006} 1009}
1007 1010
1008void KABCore::setModified() 1011void KABCore::setModified()
1009{ 1012{
1010 setModified( true ); 1013 setModified( true );
1011} 1014}
1012 1015
1013void KABCore::setModifiedWOrefresh() 1016void KABCore::setModifiedWOrefresh()
1014{ 1017{
1015 // qDebug("KABCore::setModifiedWOrefresh() "); 1018 // qDebug("KABCore::setModifiedWOrefresh() ");
1016 mModified = true; 1019 mModified = true;
1017 mActionSave->setEnabled( mModified ); 1020 mActionSave->setEnabled( mModified );
1018#ifdef DESKTOP_VERSION 1021#ifdef DESKTOP_VERSION
1019 mDetails->refreshView(); 1022 mDetails->refreshView();
1020#endif 1023#endif
1021 1024
1022} 1025}
1023void KABCore::setModified( bool modified ) 1026void KABCore::setModified( bool modified )
1024{ 1027{
1025 mModified = modified; 1028 mModified = modified;
1026 mActionSave->setEnabled( mModified ); 1029 mActionSave->setEnabled( mModified );
1027 1030
1028 if ( modified ) 1031 if ( modified )
1029 mJumpButtonBar->recreateButtons(); 1032 mJumpButtonBar->recreateButtons();
1030 1033
1031 mViewManager->refreshView(); 1034 mViewManager->refreshView();
1032 mDetails->refreshView(); 1035 mDetails->refreshView();
1033 1036
1034} 1037}
1035 1038
1036bool KABCore::modified() const 1039bool KABCore::modified() const
1037{ 1040{
1038 return mModified; 1041 return mModified;
1039} 1042}
1040 1043
1041void KABCore::contactModified( const KABC::Addressee &addr ) 1044void KABCore::contactModified( const KABC::Addressee &addr )
1042{ 1045{
1043 1046
1044 Command *command = 0; 1047 Command *command = 0;
1045 QString uid; 1048 QString uid;
1046 1049
1047 // check if it exists already 1050 // check if it exists already
1048 KABC::Addressee origAddr = mAddressBook->findByUid( addr.uid() ); 1051 KABC::Addressee origAddr = mAddressBook->findByUid( addr.uid() );
1049 if ( origAddr.isEmpty() ) 1052 if ( origAddr.isEmpty() )
1050 command = new PwNewCommand( mAddressBook, addr ); 1053 command = new PwNewCommand( mAddressBook, addr );
1051 else { 1054 else {
1052 command = new PwEditCommand( mAddressBook, origAddr, addr ); 1055 command = new PwEditCommand( mAddressBook, origAddr, addr );
1053 uid = addr.uid(); 1056 uid = addr.uid();
1054 } 1057 }
1055 1058
1056 UndoStack::instance()->push( command ); 1059 UndoStack::instance()->push( command );
1057 RedoStack::instance()->clear(); 1060 RedoStack::instance()->clear();
1058 1061
1059 setModified( true ); 1062 setModified( true );
1060} 1063}
1061 1064
1062void KABCore::newContact() 1065void KABCore::newContact()
1063{ 1066{
1064 1067
1065 1068
1066 QPtrList<KABC::Resource> kabcResources = mAddressBook->resources(); 1069 QPtrList<KABC::Resource> kabcResources = mAddressBook->resources();
1067 1070
1068 QPtrList<KRES::Resource> kresResources; 1071 QPtrList<KRES::Resource> kresResources;
1069 QPtrListIterator<KABC::Resource> it( kabcResources ); 1072 QPtrListIterator<KABC::Resource> it( kabcResources );
1070 KABC::Resource *resource; 1073 KABC::Resource *resource;
1071 while ( ( resource = it.current() ) != 0 ) { 1074 while ( ( resource = it.current() ) != 0 ) {
1072 ++it; 1075 ++it;
1073 if ( !resource->readOnly() ) { 1076 if ( !resource->readOnly() ) {
1074 KRES::Resource *res = static_cast<KRES::Resource*>( resource ); 1077 KRES::Resource *res = static_cast<KRES::Resource*>( resource );
1075 if ( res ) 1078 if ( res )
1076 kresResources.append( res ); 1079 kresResources.append( res );
1077 } 1080 }
1078 } 1081 }
1079 1082
1080 KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, this ); 1083 KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, this );
1081 resource = static_cast<KABC::Resource*>( res ); 1084 resource = static_cast<KABC::Resource*>( res );
1082 1085
1083 if ( resource ) { 1086 if ( resource ) {
1084 KABC::Addressee addr; 1087 KABC::Addressee addr;
1085 addr.setResource( resource ); 1088 addr.setResource( resource );
1086 mEditorDialog->setAddressee( addr ); 1089 mEditorDialog->setAddressee( addr );
1087 KApplication::execDialog ( mEditorDialog ); 1090 KApplication::execDialog ( mEditorDialog );
1088 1091
1089 } else 1092 } else
1090 return; 1093 return;
1091 1094
1092 // mEditorDict.insert( dialog->addressee().uid(), dialog ); 1095 // mEditorDict.insert( dialog->addressee().uid(), dialog );
1093 1096
1094 1097
1095} 1098}
1096 1099
1097void KABCore::addEmail( QString aStr ) 1100void KABCore::addEmail( QString aStr )
1098{ 1101{
1099#ifndef KAB_EMBEDDED 1102#ifndef KAB_EMBEDDED
1100 QString fullName, email; 1103 QString fullName, email;
1101 1104
1102 KABC::Addressee::parseEmailAddress( aStr, fullName, email ); 1105 KABC::Addressee::parseEmailAddress( aStr, fullName, email );
1103 1106
1104 // Try to lookup the addressee matching the email address 1107 // Try to lookup the addressee matching the email address
1105 bool found = false; 1108 bool found = false;
1106 QStringList emailList; 1109 QStringList emailList;
1107 KABC::AddressBook::Iterator it; 1110 KABC::AddressBook::Iterator it;
1108 for ( it = mAddressBook->begin(); !found && (it != mAddressBook->end()); ++it ) { 1111 for ( it = mAddressBook->begin(); !found && (it != mAddressBook->end()); ++it ) {
1109 emailList = (*it).emails(); 1112 emailList = (*it).emails();
1110 if ( emailList.contains( email ) > 0 ) { 1113 if ( emailList.contains( email ) > 0 ) {
1111 found = true; 1114 found = true;
1112 (*it).setNameFromString( fullName ); 1115 (*it).setNameFromString( fullName );
1113 editContact( (*it).uid() ); 1116 editContact( (*it).uid() );
1114 } 1117 }
1115 } 1118 }
1116 1119
1117 if ( !found ) { 1120 if ( !found ) {
1118 KABC::Addressee addr; 1121 KABC::Addressee addr;
1119 addr.setNameFromString( fullName ); 1122 addr.setNameFromString( fullName );
1120 addr.insertEmail( email, true ); 1123 addr.insertEmail( email, true );
1121 1124
1122 mAddressBook->insertAddressee( addr ); 1125 mAddressBook->insertAddressee( addr );
1123 mViewManager->refreshView( addr.uid() ); 1126 mViewManager->refreshView( addr.uid() );
@@ -1759,517 +1762,477 @@ void KABCore::initActions()
1759 if ( Ir::supported() ) { 1762 if ( Ir::supported() ) {
1760 mActionBeamVCard = new KAction( i18n( "Beam selected v&Card(s)" ), "beam", 0, this, 1763 mActionBeamVCard = new KAction( i18n( "Beam selected v&Card(s)" ), "beam", 0, this,
1761 SLOT( beamVCard() ), actionCollection(), 1764 SLOT( beamVCard() ), actionCollection(),
1762 "kaddressbook_beam_vcard" ); 1765 "kaddressbook_beam_vcard" );
1763 1766
1764 mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this, 1767 mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this,
1765 SLOT( beamMySelf() ), actionCollection(), 1768 SLOT( beamMySelf() ), actionCollection(),
1766 "kaddressbook_beam_myself" ); 1769 "kaddressbook_beam_myself" );
1767 } 1770 }
1768#endif 1771#endif
1769 1772
1770 mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0, 1773 mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0,
1771 this, SLOT( editContact2() ), 1774 this, SLOT( editContact2() ),
1772 actionCollection(), "file_properties" ); 1775 actionCollection(), "file_properties" );
1773 1776
1774#ifdef KAB_EMBEDDED 1777#ifdef KAB_EMBEDDED
1775 // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() ); 1778 // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() );
1776 mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0, 1779 mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0,
1777 mMainWindow, SLOT( exit() ), 1780 mMainWindow, SLOT( exit() ),
1778 actionCollection(), "quit" ); 1781 actionCollection(), "quit" );
1779#endif //KAB_EMBEDDED 1782#endif //KAB_EMBEDDED
1780 1783
1781 // edit menu 1784 // edit menu
1782 if ( mIsPart ) { 1785 if ( mIsPart ) {
1783 mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this, 1786 mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this,
1784 SLOT( copyContacts() ), actionCollection(), 1787 SLOT( copyContacts() ), actionCollection(),
1785 "kaddressbook_copy" ); 1788 "kaddressbook_copy" );
1786 mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this, 1789 mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this,
1787 SLOT( cutContacts() ), actionCollection(), 1790 SLOT( cutContacts() ), actionCollection(),
1788 "kaddressbook_cut" ); 1791 "kaddressbook_cut" );
1789 mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this, 1792 mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this,
1790 SLOT( pasteContacts() ), actionCollection(), 1793 SLOT( pasteContacts() ), actionCollection(),
1791 "kaddressbook_paste" ); 1794 "kaddressbook_paste" );
1792 mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this, 1795 mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this,
1793 SLOT( selectAllContacts() ), actionCollection(), 1796 SLOT( selectAllContacts() ), actionCollection(),
1794 "kaddressbook_select_all" ); 1797 "kaddressbook_select_all" );
1795 mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this, 1798 mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this,
1796 SLOT( undo() ), actionCollection(), 1799 SLOT( undo() ), actionCollection(),
1797 "kaddressbook_undo" ); 1800 "kaddressbook_undo" );
1798 mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z, 1801 mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z,
1799 this, SLOT( redo() ), actionCollection(), 1802 this, SLOT( redo() ), actionCollection(),
1800 "kaddressbook_redo" ); 1803 "kaddressbook_redo" );
1801 } else { 1804 } else {
1802 mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() ); 1805 mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() );
1803 mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() ); 1806 mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() );
1804 mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() ); 1807 mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() );
1805 mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() ); 1808 mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() );
1806 mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() ); 1809 mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() );
1807 mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() ); 1810 mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() );
1808 } 1811 }
1809 1812
1810 mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete", 1813 mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete",
1811 Key_Delete, this, SLOT( deleteContacts() ), 1814 Key_Delete, this, SLOT( deleteContacts() ),
1812 actionCollection(), "edit_delete" ); 1815 actionCollection(), "edit_delete" );
1813 1816
1814 mActionUndo->setEnabled( false ); 1817 mActionUndo->setEnabled( false );
1815 mActionRedo->setEnabled( false ); 1818 mActionRedo->setEnabled( false );
1816 1819
1817 // settings menu 1820 // settings menu
1818#ifdef KAB_EMBEDDED 1821#ifdef KAB_EMBEDDED
1819//US special menuentry to configure the addressbook resources. On KDE 1822//US special menuentry to configure the addressbook resources. On KDE
1820// you do that through the control center !!! 1823// you do that through the control center !!!
1821 mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this, 1824 mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this,
1822 SLOT( configureResources() ), actionCollection(), 1825 SLOT( configureResources() ), actionCollection(),
1823 "kaddressbook_configure_resources" ); 1826 "kaddressbook_configure_resources" );
1824#endif //KAB_EMBEDDED 1827#endif //KAB_EMBEDDED
1825 1828
1826 if ( mIsPart ) { 1829 if ( mIsPart ) {
1827 mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this, 1830 mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this,
1828 SLOT( openConfigDialog() ), actionCollection(), 1831 SLOT( openConfigDialog() ), actionCollection(),
1829 "kaddressbook_configure" ); 1832 "kaddressbook_configure" );
1830 1833
1831 //US not implemented yet 1834 //US not implemented yet
1832 //mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0, 1835 //mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0,
1833 // this, SLOT( configureKeyBindings() ), actionCollection(), 1836 // this, SLOT( configureKeyBindings() ), actionCollection(),
1834 // "kaddressbook_configure_shortcuts" ); 1837 // "kaddressbook_configure_shortcuts" );
1835#ifdef KAB_EMBEDDED 1838#ifdef KAB_EMBEDDED
1836 mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() ); 1839 mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() );
1837 mActionConfigureToolbars->setEnabled( false ); 1840 mActionConfigureToolbars->setEnabled( false );
1838#endif //KAB_EMBEDDED 1841#endif //KAB_EMBEDDED
1839 1842
1840 } else { 1843 } else {
1841 mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() ); 1844 mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() );
1842 1845
1843 //US not implemented yet 1846 //US not implemented yet
1844 //mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); 1847 //mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() );
1845 } 1848 }
1846 1849
1847 mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, 1850 mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0,
1848 actionCollection(), "options_show_jump_bar" ); 1851 actionCollection(), "options_show_jump_bar" );
1849 connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) ); 1852 connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) );
1850 1853
1851 mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0, 1854 mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0,
1852 actionCollection(), "options_show_details" ); 1855 actionCollection(), "options_show_details" );
1853 connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); 1856 connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) );
1854 1857
1855 1858
1856 mActionBR = new KToggleAction( i18n( "Beam receive enabled" ), "beam", 0, this, 1859 mActionBR = new KToggleAction( i18n( "Beam receive enabled" ), "beam", 0, this,
1857 SLOT( toggleBeamReceive() ), actionCollection(), 1860 SLOT( toggleBeamReceive() ), actionCollection(),
1858 "kaddressbook_beam_rec" ); 1861 "kaddressbook_beam_rec" );
1859 1862
1860 1863
1861 // misc 1864 // misc
1862 // only enable LDAP lookup if we can handle the protocol 1865 // only enable LDAP lookup if we can handle the protocol
1863#ifndef KAB_EMBEDDED 1866#ifndef KAB_EMBEDDED
1864 if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) { 1867 if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) {
1865 new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0, 1868 new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0,
1866 this, SLOT( openLDAPDialog() ), actionCollection(), 1869 this, SLOT( openLDAPDialog() ), actionCollection(),
1867 "ldap_lookup" ); 1870 "ldap_lookup" );
1868 } 1871 }
1869#else //KAB_EMBEDDED 1872#else //KAB_EMBEDDED
1870 //qDebug("KABCore::initActions() LDAP has to be implemented"); 1873 //qDebug("KABCore::initActions() LDAP has to be implemented");
1871#endif //KAB_EMBEDDED 1874#endif //KAB_EMBEDDED
1872 1875
1873 1876
1874 mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, 1877 mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this,
1875 SLOT( setWhoAmI() ), actionCollection(), 1878 SLOT( setWhoAmI() ), actionCollection(),
1876 "set_personal" ); 1879 "set_personal" );
1877 1880
1878 1881
1879 mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, 1882 mActionCategories = new KAction( i18n( "Set Categories" ), 0, this,
1880 SLOT( setCategories() ), actionCollection(), 1883 SLOT( setCategories() ), actionCollection(),
1881 "edit_set_categories" ); 1884 "edit_set_categories" );
1882 1885
1883 mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, 1886 mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this,
1884 SLOT( removeVoice() ), actionCollection(), 1887 SLOT( removeVoice() ), actionCollection(),
1885 "remove_voice" ); 1888 "remove_voice" );
1886 1889
1887 mActionSetCat= new KAction( i18n( "Set categories..." ), 0, this, 1890 mActionManageCategories= new KAction( i18n( "Manage new categories..." ), 0, this,
1888 SLOT( setCat() ), actionCollection(), 1891 SLOT( manageCategories() ), actionCollection(),
1889 "remove_voice" ); 1892 "remove_voice" );
1890 1893
1891 1894
1892 mActionAddCat= new KAction( i18n( "Add categories..." ), 0, this,
1893 SLOT( addCat() ), actionCollection(),
1894 "remove_voice" );
1895
1896 mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this, 1895 mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this,
1897 SLOT( importFromOL() ), actionCollection(), 1896 SLOT( importFromOL() ), actionCollection(),
1898 "import_OL" ); 1897 "import_OL" );
1899#ifdef KAB_EMBEDDED 1898#ifdef KAB_EMBEDDED
1900 mActionLicence = new KAction( i18n( "Licence" ), 0, 1899 mActionLicence = new KAction( i18n( "Licence" ), 0,
1901 this, SLOT( showLicence() ), actionCollection(), 1900 this, SLOT( showLicence() ), actionCollection(),
1902 "licence_about_data" ); 1901 "licence_about_data" );
1903 mActionFaq = new KAction( i18n( "Faq" ), 0, 1902 mActionFaq = new KAction( i18n( "Faq" ), 0,
1904 this, SLOT( faq() ), actionCollection(), 1903 this, SLOT( faq() ), actionCollection(),
1905 "faq_about_data" ); 1904 "faq_about_data" );
1906 mActionWN = new KAction( i18n( "What's New?" ), 0, 1905 mActionWN = new KAction( i18n( "What's New?" ), 0,
1907 this, SLOT( whatsnew() ), actionCollection(), 1906 this, SLOT( whatsnew() ), actionCollection(),
1908 "wn" ); 1907 "wn" );
1909 mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0, 1908 mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0,
1910 this, SLOT( synchowto() ), actionCollection(), 1909 this, SLOT( synchowto() ), actionCollection(),
1911 "sync" ); 1910 "sync" );
1912 mActionKdeSyncHowto = new KAction( i18n( "Kde Sync HowTo" ), 0, 1911 mActionKdeSyncHowto = new KAction( i18n( "Kde Sync HowTo" ), 0,
1913 this, SLOT( kdesynchowto() ), actionCollection(), 1912 this, SLOT( kdesynchowto() ), actionCollection(),
1914 "kdesync" ); 1913 "kdesync" );
1915 mActionMultiSyncHowto = new KAction( i18n( "Multi Sync HowTo" ), 0, 1914 mActionMultiSyncHowto = new KAction( i18n( "Multi Sync HowTo" ), 0,
1916 this, SLOT( multisynchowto() ), actionCollection(), 1915 this, SLOT( multisynchowto() ), actionCollection(),
1917 "multisync" ); 1916 "multisync" );
1918 1917
1919 mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, 1918 mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0,
1920 this, SLOT( createAboutData() ), actionCollection(), 1919 this, SLOT( createAboutData() ), actionCollection(),
1921 "kaddressbook_about_data" ); 1920 "kaddressbook_about_data" );
1922#endif //KAB_EMBEDDED 1921#endif //KAB_EMBEDDED
1923 1922
1924 clipboardDataChanged(); 1923 clipboardDataChanged();
1925 connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); 1924 connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) );
1926 connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); 1925 connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) );
1927} 1926}
1928 1927
1929//US we need this function, to plug all actions into the correct menues. 1928//US we need this function, to plug all actions into the correct menues.
1930// KDE uses a XML format to plug the actions, but we work her without this overhead. 1929// KDE uses a XML format to plug the actions, but we work her without this overhead.
1931void KABCore::addActionsManually() 1930void KABCore::addActionsManually()
1932{ 1931{
1933//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); 1932//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart);
1934 1933
1935#ifdef KAB_EMBEDDED 1934#ifdef KAB_EMBEDDED
1936 QPopupMenu *fileMenu = new QPopupMenu( this ); 1935 QPopupMenu *fileMenu = new QPopupMenu( this );
1937 QPopupMenu *editMenu = new QPopupMenu( this ); 1936 QPopupMenu *editMenu = new QPopupMenu( this );
1938 QPopupMenu *helpMenu = new QPopupMenu( this ); 1937 QPopupMenu *helpMenu = new QPopupMenu( this );
1939 1938
1940 KToolBar* tb = mMainWindow->toolBar(); 1939 KToolBar* tb = mMainWindow->toolBar();
1941 1940
1942#ifndef DESKTOP_VERSION 1941#ifndef DESKTOP_VERSION
1943 if ( KABPrefs::instance()->mFullMenuBarVisible ) { 1942 if ( KABPrefs::instance()->mFullMenuBarVisible ) {
1944#endif 1943#endif
1945 QMenuBar* mb = mMainWindow->menuBar(); 1944 QMenuBar* mb = mMainWindow->menuBar();
1946 1945
1947 //US setup menubar. 1946 //US setup menubar.
1948 //Disable the following block if you do not want to have a menubar. 1947 //Disable the following block if you do not want to have a menubar.
1949 mb->insertItem( "&File", fileMenu ); 1948 mb->insertItem( "&File", fileMenu );
1950 mb->insertItem( "&Edit", editMenu ); 1949 mb->insertItem( "&Edit", editMenu );
1951 mb->insertItem( "&View", viewMenu ); 1950 mb->insertItem( "&View", viewMenu );
1952 mb->insertItem( "&Settings", settingsMenu ); 1951 mb->insertItem( "&Settings", settingsMenu );
1953 mb->insertItem( i18n("Synchronize"), syncMenu ); 1952 mb->insertItem( i18n("Synchronize"), syncMenu );
1954 mb->insertItem( "&Change selected", changeMenu ); 1953 mb->insertItem( "&Change selected", changeMenu );
1955 mb->insertItem( "&Help", helpMenu ); 1954 mb->insertItem( "&Help", helpMenu );
1956 mIncSearchWidget = new IncSearchWidget( tb ); 1955 mIncSearchWidget = new IncSearchWidget( tb );
1957 // tb->insertWidget(-1, 0, mIncSearchWidget); 1956 // tb->insertWidget(-1, 0, mIncSearchWidget);
1958#ifndef DESKTOP_VERSION 1957#ifndef DESKTOP_VERSION
1959 } else { 1958 } else {
1960 //US setup toolbar 1959 //US setup toolbar
1961 QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); 1960 QPEMenuBar *menuBarTB = new QPEMenuBar( tb );
1962 QPopupMenu *popupBarTB = new QPopupMenu( this ); 1961 QPopupMenu *popupBarTB = new QPopupMenu( this );
1963 menuBarTB->insertItem( "ME", popupBarTB); 1962 menuBarTB->insertItem( "ME", popupBarTB);
1964 tb->insertWidget(-1, 0, menuBarTB); 1963 tb->insertWidget(-1, 0, menuBarTB);
1965 mIncSearchWidget = new IncSearchWidget( tb ); 1964 mIncSearchWidget = new IncSearchWidget( tb );
1966 1965
1967 tb->enableMoving(false); 1966 tb->enableMoving(false);
1968 popupBarTB->insertItem( "&File", fileMenu ); 1967 popupBarTB->insertItem( "&File", fileMenu );
1969 popupBarTB->insertItem( "&Edit", editMenu ); 1968 popupBarTB->insertItem( "&Edit", editMenu );
1970 popupBarTB->insertItem( "&View", viewMenu ); 1969 popupBarTB->insertItem( "&View", viewMenu );
1971 popupBarTB->insertItem( "&Settings", settingsMenu ); 1970 popupBarTB->insertItem( "&Settings", settingsMenu );
1972 popupBarTB->insertItem( i18n("Synchronize"), syncMenu ); 1971 popupBarTB->insertItem( i18n("Synchronize"), syncMenu );
1973 mViewManager->getFilterAction()->plug ( popupBarTB); 1972 mViewManager->getFilterAction()->plug ( popupBarTB);
1974 popupBarTB->insertItem( "&Change selected", changeMenu ); 1973 popupBarTB->insertItem( "&Change selected", changeMenu );
1975 popupBarTB->insertItem( "&Help", helpMenu ); 1974 popupBarTB->insertItem( "&Help", helpMenu );
1976 if (QApplication::desktop()->width() > 320 ) { 1975 if (QApplication::desktop()->width() > 320 ) {
1977 // mViewManager->getFilterAction()->plug ( tb); 1976 // mViewManager->getFilterAction()->plug ( tb);
1978 } 1977 }
1979 } 1978 }
1980#endif 1979#endif
1981 // mActionQuit->plug ( mMainWindow->toolBar()); 1980 // mActionQuit->plug ( mMainWindow->toolBar());
1982 1981
1983 1982
1984 1983
1985 //US Now connect the actions with the menue entries. 1984 //US Now connect the actions with the menue entries.
1986 mActionPrint->plug( fileMenu ); 1985 mActionPrint->plug( fileMenu );
1987 mActionMail->plug( fileMenu ); 1986 mActionMail->plug( fileMenu );
1988 fileMenu->insertSeparator(); 1987 fileMenu->insertSeparator();
1989 1988
1990 mActionNewContact->plug( fileMenu ); 1989 mActionNewContact->plug( fileMenu );
1991 mActionNewContact->plug( tb ); 1990 mActionNewContact->plug( tb );
1992 1991
1993 mActionEditAddressee->plug( fileMenu ); 1992 mActionEditAddressee->plug( fileMenu );
1994 // if ((KGlobal::getDesktopSize() > KGlobal::Small ) || 1993 // if ((KGlobal::getDesktopSize() > KGlobal::Small ) ||
1995 // (!KABPrefs::instance()->mMultipleViewsAtOnce )) 1994 // (!KABPrefs::instance()->mMultipleViewsAtOnce ))
1996 mActionEditAddressee->plug( tb ); 1995 mActionEditAddressee->plug( tb );
1997 1996
1998 fileMenu->insertSeparator(); 1997 fileMenu->insertSeparator();
1999 mActionSave->plug( fileMenu ); 1998 mActionSave->plug( fileMenu );
2000 fileMenu->insertItem( "&Import", ImportMenu ); 1999 fileMenu->insertItem( "&Import", ImportMenu );
2001 fileMenu->insertItem( "&Export", ExportMenu ); 2000 fileMenu->insertItem( "&Export", ExportMenu );
2002 fileMenu->insertSeparator(); 2001 fileMenu->insertSeparator();
2003 mActionMailVCard->plug( fileMenu ); 2002 mActionMailVCard->plug( fileMenu );
2004#ifndef DESKTOP_VERSION 2003#ifndef DESKTOP_VERSION
2005 if ( Ir::supported() ) mActionBeamVCard->plug( fileMenu ); 2004 if ( Ir::supported() ) mActionBeamVCard->plug( fileMenu );
2006 if ( Ir::supported() ) mActionBeam->plug(fileMenu ); 2005 if ( Ir::supported() ) mActionBeam->plug(fileMenu );
2007#endif 2006#endif
2008 fileMenu->insertSeparator(); 2007 fileMenu->insertSeparator();
2009 mActionQuit->plug( fileMenu ); 2008 mActionQuit->plug( fileMenu );
2010#ifdef _WIN32_ 2009#ifdef _WIN32_
2011 mActionImportOL->plug( ImportMenu ); 2010 mActionImportOL->plug( ImportMenu );
2012#endif 2011#endif
2013 // edit menu 2012 // edit menu
2014 mActionUndo->plug( editMenu ); 2013 mActionUndo->plug( editMenu );
2015 mActionRedo->plug( editMenu ); 2014 mActionRedo->plug( editMenu );
2016 editMenu->insertSeparator(); 2015 editMenu->insertSeparator();
2017 mActionCut->plug( editMenu ); 2016 mActionCut->plug( editMenu );
2018 mActionCopy->plug( editMenu ); 2017 mActionCopy->plug( editMenu );
2019 mActionPaste->plug( editMenu ); 2018 mActionPaste->plug( editMenu );
2020 mActionDelete->plug( editMenu ); 2019 mActionDelete->plug( editMenu );
2021 editMenu->insertSeparator(); 2020 editMenu->insertSeparator();
2022 mActionSelectAll->plug( editMenu ); 2021 mActionSelectAll->plug( editMenu );
2023 2022
2024 mActionRemoveVoice->plug( changeMenu ); 2023 mActionRemoveVoice->plug( changeMenu );
2025 mActionSetCat->plug( changeMenu );
2026 mActionAddCat->plug( changeMenu );
2027 // settings menu 2024 // settings menu
2028//US special menuentry to configure the addressbook resources. On KDE 2025//US special menuentry to configure the addressbook resources. On KDE
2029// you do that through the control center !!! 2026// you do that through the control center !!!
2030 mActionConfigResources->plug( settingsMenu ); 2027 mActionConfigResources->plug( settingsMenu );
2031 settingsMenu->insertSeparator(); 2028 settingsMenu->insertSeparator();
2032 2029
2033 mActionConfigKAddressbook->plug( settingsMenu ); 2030 mActionConfigKAddressbook->plug( settingsMenu );
2034 2031
2035 if ( mIsPart ) { 2032 if ( mIsPart ) {
2036 //US not implemented yet 2033 //US not implemented yet
2037 //mActionConfigShortcuts->plug( settingsMenu ); 2034 //mActionConfigShortcuts->plug( settingsMenu );
2038 //mActionConfigureToolbars->plug( settingsMenu ); 2035 //mActionConfigureToolbars->plug( settingsMenu );
2039 2036
2040 } else { 2037 } else {
2041 //US not implemented yet 2038 //US not implemented yet
2042 //mActionKeyBindings->plug( settingsMenu ); 2039 //mActionKeyBindings->plug( settingsMenu );
2043 } 2040 }
2044 2041
2045 settingsMenu->insertSeparator(); 2042 settingsMenu->insertSeparator();
2046 2043
2047 mActionJumpBar->plug( settingsMenu ); 2044 mActionJumpBar->plug( settingsMenu );
2048 mActionDetails->plug( settingsMenu ); 2045 mActionDetails->plug( settingsMenu );
2049 //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) 2046 //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop )
2050 mActionDetails->plug( tb ); 2047 mActionDetails->plug( tb );
2051 settingsMenu->insertSeparator(); 2048 settingsMenu->insertSeparator();
2052 mActionBR->plug(settingsMenu ); 2049 mActionBR->plug(settingsMenu );
2053 settingsMenu->insertSeparator(); 2050 settingsMenu->insertSeparator();
2054 2051
2055 mActionWhoAmI->plug( settingsMenu ); 2052 mActionWhoAmI->plug( settingsMenu );
2056 mActionCategories->plug( settingsMenu ); 2053 mActionCategories->plug( settingsMenu );
2054 mActionManageCategories->plug( settingsMenu );
2057 2055
2058 2056
2059 mActionWN->plug( helpMenu ); 2057 mActionWN->plug( helpMenu );
2060 mActionSyncHowto->plug( helpMenu ); 2058 mActionSyncHowto->plug( helpMenu );
2061 mActionKdeSyncHowto->plug( helpMenu ); 2059 mActionKdeSyncHowto->plug( helpMenu );
2062 mActionMultiSyncHowto->plug( helpMenu ); 2060 mActionMultiSyncHowto->plug( helpMenu );
2063 mActionFaq->plug( helpMenu ); 2061 mActionFaq->plug( helpMenu );
2064 mActionLicence->plug( helpMenu ); 2062 mActionLicence->plug( helpMenu );
2065 mActionAboutKAddressbook->plug( helpMenu ); 2063 mActionAboutKAddressbook->plug( helpMenu );
2066 2064
2067 if (KGlobal::getDesktopSize() > KGlobal::Small ) { 2065 if (KGlobal::getDesktopSize() > KGlobal::Small ) {
2068 2066
2069 mActionSave->plug( tb ); 2067 mActionSave->plug( tb );
2070 mViewManager->getFilterAction()->plug ( tb); 2068 mViewManager->getFilterAction()->plug ( tb);
2071 if (KGlobal::getDesktopSize() == KGlobal::Desktop ) { 2069 if (KGlobal::getDesktopSize() == KGlobal::Desktop ) {
2072 mActionUndo->plug( tb ); 2070 mActionUndo->plug( tb );
2073 mActionDelete->plug( tb ); 2071 mActionDelete->plug( tb );
2074 mActionRedo->plug( tb ); 2072 mActionRedo->plug( tb );
2075 } 2073 }
2076 } else { 2074 } else {
2077 mActionSave->plug( tb ); 2075 mActionSave->plug( tb );
2078 tb->enableMoving(false); 2076 tb->enableMoving(false);
2079 } 2077 }
2080 //mActionQuit->plug ( tb ); 2078 //mActionQuit->plug ( tb );
2081 // tb->insertWidget(-1, 0, mIncSearchWidget, 6); 2079 // tb->insertWidget(-1, 0, mIncSearchWidget, 6);
2082 2080
2083 //US link the searchwidget first to this. 2081 //US link the searchwidget first to this.
2084 // The real linkage to the toolbar happens later. 2082 // The real linkage to the toolbar happens later.
2085//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); 2083//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE);
2086//US tb->insertItem( mIncSearchWidget ); 2084//US tb->insertItem( mIncSearchWidget );
2087/*US 2085/*US
2088 mIncSearchWidget = new IncSearchWidget( tb ); 2086 mIncSearchWidget = new IncSearchWidget( tb );
2089 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 2087 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
2090 SLOT( incrementalSearch( const QString& ) ) ); 2088 SLOT( incrementalSearch( const QString& ) ) );
2091 2089
2092 mJumpButtonBar = new JumpButtonBar( this, this ); 2090 mJumpButtonBar = new JumpButtonBar( this, this );
2093 2091
2094//US topLayout->addWidget( mJumpButtonBar ); 2092//US topLayout->addWidget( mJumpButtonBar );
2095 this->layout()->add( mJumpButtonBar ); 2093 this->layout()->add( mJumpButtonBar );
2096*/ 2094*/
2097 2095
2098#endif //KAB_EMBEDDED 2096#endif //KAB_EMBEDDED
2099 2097
2100 mActionExport2phone->plug( ExportMenu ); 2098 mActionExport2phone->plug( ExportMenu );
2101 connect ( syncMenu, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) ); 2099 connect ( syncMenu, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) );
2102 syncManager->fillSyncMenu(); 2100 syncManager->fillSyncMenu();
2103 2101
2104} 2102}
2105void KABCore::showLicence() 2103void KABCore::showLicence()
2106{ 2104{
2107 KApplication::showLicence(); 2105 KApplication::showLicence();
2108} 2106}
2109void KABCore::setCat() 2107
2110{ 2108void KABCore::manageCategories( )
2111 setCategories( true );
2112}
2113void KABCore::addCat()
2114{
2115 setCategories( false );
2116}
2117void KABCore::setCategories( bool removeOld )
2118{ 2109{
2119 KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KABPrefs::instance(), 0 ); 2110
2120 if (! csd->exec()) {
2121 message( i18n("Setting categories cancelled") );
2122 delete csd;
2123 return;
2124 }
2125 message( i18n("Setting categories ... please wait!") );
2126 QStringList catList = csd->selectedCategories();
2127 delete csd;
2128 catList.sort();
2129 QStringList newList;
2130 KABC::Addressee::List list = mViewManager->selectedAddressees();
2131 KABC::Addressee::List::Iterator it;
2132 for ( it = list.begin(); it != list.end(); ++it ) {
2133 if ( removeOld ) {
2134 (*it).setCategories( catList );
2135 } else {
2136 newList = (*it).categories();
2137 int i;
2138 for( i = 0; i< catList.count(); ++i ) {
2139 if ( !newList.contains (catList[i]))
2140 newList.append( catList[i] );
2141 }
2142 newList.sort();
2143 (*it).setCategories( newList );
2144 }
2145 contactModified((*it) );
2146 }
2147 message( i18n("Setting categories completed!") );
2148} 2111}
2149void KABCore::removeVoice() 2112void KABCore::removeVoice()
2150{ 2113{
2151 if ( KMessageBox::questionYesNo( this, i18n("After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as \"other\".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?") ) == KMessageBox::No ) 2114 if ( KMessageBox::questionYesNo( this, i18n("After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as \"other\".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?") ) == KMessageBox::No )
2152 return; 2115 return;
2153 KABC::Addressee::List list = mViewManager->selectedAddressees(); 2116 KABC::Addressee::List list = mViewManager->selectedAddressees();
2154 KABC::Addressee::List::Iterator it; 2117 KABC::Addressee::List::Iterator it;
2155 for ( it = list.begin(); it != list.end(); ++it ) { 2118 for ( it = list.begin(); it != list.end(); ++it ) {
2156 2119
2157 if ( (*it).removeVoice() ) 2120 if ( (*it).removeVoice() )
2158 contactModified((*it) ); 2121 contactModified((*it) );
2159 } 2122 }
2160} 2123}
2161 2124
2162 2125
2163 2126
2164void KABCore::clipboardDataChanged() 2127void KABCore::clipboardDataChanged()
2165{ 2128{
2166 2129
2167 if ( mReadWrite ) 2130 if ( mReadWrite )
2168 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); 2131 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() );
2169 2132
2170} 2133}
2171 2134
2172void KABCore::updateActionMenu() 2135void KABCore::updateActionMenu()
2173{ 2136{
2174 UndoStack *undo = UndoStack::instance(); 2137 UndoStack *undo = UndoStack::instance();
2175 RedoStack *redo = RedoStack::instance(); 2138 RedoStack *redo = RedoStack::instance();
2176 2139
2177 if ( undo->isEmpty() ) 2140 if ( undo->isEmpty() )
2178 mActionUndo->setText( i18n( "Undo" ) ); 2141 mActionUndo->setText( i18n( "Undo" ) );
2179 else 2142 else
2180 mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); 2143 mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) );
2181 2144
2182 mActionUndo->setEnabled( !undo->isEmpty() ); 2145 mActionUndo->setEnabled( !undo->isEmpty() );
2183 2146
2184 if ( !redo->top() ) 2147 if ( !redo->top() )
2185 mActionRedo->setText( i18n( "Redo" ) ); 2148 mActionRedo->setText( i18n( "Redo" ) );
2186 else 2149 else
2187 mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); 2150 mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) );
2188 2151
2189 mActionRedo->setEnabled( !redo->isEmpty() ); 2152 mActionRedo->setEnabled( !redo->isEmpty() );
2190} 2153}
2191 2154
2192void KABCore::configureKeyBindings() 2155void KABCore::configureKeyBindings()
2193{ 2156{
2194#ifndef KAB_EMBEDDED 2157#ifndef KAB_EMBEDDED
2195 KKeyDialog::configure( actionCollection(), true ); 2158 KKeyDialog::configure( actionCollection(), true );
2196#else //KAB_EMBEDDED 2159#else //KAB_EMBEDDED
2197 qDebug("KABCore::configureKeyBindings() not implemented"); 2160 qDebug("KABCore::configureKeyBindings() not implemented");
2198#endif //KAB_EMBEDDED 2161#endif //KAB_EMBEDDED
2199} 2162}
2200 2163
2201#ifdef KAB_EMBEDDED 2164#ifdef KAB_EMBEDDED
2202void KABCore::configureResources() 2165void KABCore::configureResources()
2203{ 2166{
2204 KRES::KCMKResources dlg( this, "" , 0 ); 2167 KRES::KCMKResources dlg( this, "" , 0 );
2205 2168
2206 if ( !dlg.exec() ) 2169 if ( !dlg.exec() )
2207 return; 2170 return;
2208 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); 2171 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") );
2209} 2172}
2210#endif //KAB_EMBEDDED 2173#endif //KAB_EMBEDDED
2211 2174
2212 2175
2213/* this method will be called through the QCop interface from Ko/Pi to select addresses 2176/* this method will be called through the QCop interface from Ko/Pi to select addresses
2214 * for the attendees list of an event. 2177 * for the attendees list of an event.
2215 */ 2178 */
2216void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) 2179void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid)
2217{ 2180{
2218 QStringList nameList; 2181 QStringList nameList;
2219 QStringList emailList; 2182 QStringList emailList;
2220 QStringList uidList; 2183 QStringList uidList;
2221 2184
2222 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); 2185 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this);
2223 uint i=0; 2186 uint i=0;
2224 for (i=0; i < list.count(); i++) 2187 for (i=0; i < list.count(); i++)
2225 { 2188 {
2226 nameList.append(list[i].realName()); 2189 nameList.append(list[i].realName());
2227 emailList.append(list[i].preferredEmail()); 2190 emailList.append(list[i].preferredEmail());
2228 uidList.append(list[i].uid()); 2191 uidList.append(list[i].uid());
2229 } 2192 }
2230 2193
2231 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList); 2194 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList);
2232 2195
2233} 2196}
2234 2197
2235/* this method will be called through the QCop interface from Ko/Pi to select birthdays 2198/* this method will be called through the QCop interface from Ko/Pi to select birthdays
2236 * to put them into the calendar. 2199 * to put them into the calendar.
2237 */ 2200 */
2238void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid) 2201void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid)
2239{ 2202{
2240 // qDebug("KABCore::requestForBirthdayList"); 2203 // qDebug("KABCore::requestForBirthdayList");
2241 QStringList birthdayList; 2204 QStringList birthdayList;
2242 QStringList anniversaryList; 2205 QStringList anniversaryList;
2243 QStringList realNameList; 2206 QStringList realNameList;
2244 QStringList preferredEmailList; 2207 QStringList preferredEmailList;
2245 QStringList assembledNameList; 2208 QStringList assembledNameList;
2246 QStringList uidList; 2209 QStringList uidList;
2247 2210
2248 KABC::AddressBook::Iterator it; 2211 KABC::AddressBook::Iterator it;
2249 2212
2250 int count = 0; 2213 int count = 0;
2251 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2214 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2252 ++count; 2215 ++count;
2253 } 2216 }
2254 QProgressBar bar(count,0 ); 2217 QProgressBar bar(count,0 );
2255 int w = 300; 2218 int w = 300;
2256 if ( QApplication::desktop()->width() < 320 ) 2219 if ( QApplication::desktop()->width() < 320 )
2257 w = 220; 2220 w = 220;
2258 int h = bar.sizeHint().height() ; 2221 int h = bar.sizeHint().height() ;
2259 int dw = QApplication::desktop()->width(); 2222 int dw = QApplication::desktop()->width();
2260 int dh = QApplication::desktop()->height(); 2223 int dh = QApplication::desktop()->height();
2261 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2224 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2262 bar.show(); 2225 bar.show();
2263 bar.setCaption (i18n("Collecting birthdays - close to abort!") ); 2226 bar.setCaption (i18n("Collecting birthdays - close to abort!") );
2264 qApp->processEvents(); 2227 qApp->processEvents();
2265 2228
2266 QDate bday; 2229 QDate bday;
2267 QString anni; 2230 QString anni;
2268 QString formattedbday; 2231 QString formattedbday;
2269 2232
2270 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) 2233 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it )
2271 { 2234 {
2272 if ( ! bar.isVisible() ) 2235 if ( ! bar.isVisible() )
2273 return; 2236 return;
2274 bar.setProgress( count++ ); 2237 bar.setProgress( count++ );
2275 qApp->processEvents(); 2238 qApp->processEvents();
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h
index 1bdae5f..bf5398b 100644
--- a/kaddressbook/kabcore.h
+++ b/kaddressbook/kabcore.h
@@ -118,396 +118,393 @@ class KABCore : public QWidget, public KSyncInterface
118 118
119 /** 119 /**
120 Returns the current search field of the Incremental Search Widget. 120 Returns the current search field of the Incremental Search Widget.
121 */ 121 */
122 KABC::Field *currentSearchField() const; 122 KABC::Field *currentSearchField() const;
123 123
124 /** 124 /**
125 Returns the uid list of the currently selected contacts. 125 Returns the uid list of the currently selected contacts.
126 */ 126 */
127 QStringList selectedUIDs() const; 127 QStringList selectedUIDs() const;
128 128
129 /** 129 /**
130 Displays the ResourceSelectDialog and returns the selected 130 Displays the ResourceSelectDialog and returns the selected
131 resource or a null pointer if no resource was selected by 131 resource or a null pointer if no resource was selected by
132 the user. 132 the user.
133 */ 133 */
134 KABC::Resource *requestResource( QWidget *parent ); 134 KABC::Resource *requestResource( QWidget *parent );
135 135
136#ifndef KAB_EMBEDDED 136#ifndef KAB_EMBEDDED
137 static KAboutData *createAboutData(); 137 static KAboutData *createAboutData();
138#endif //KAB_EMBEDDED 138#endif //KAB_EMBEDDED
139 139
140#ifdef KAB_EMBEDDED 140#ifdef KAB_EMBEDDED
141 inline QPopupMenu* getImportMenu() { return ImportMenu;} 141 inline QPopupMenu* getImportMenu() { return ImportMenu;}
142 inline QPopupMenu* getExportMenu() { return ExportMenu;} 142 inline QPopupMenu* getExportMenu() { return ExportMenu;}
143#endif //KAB_EMBEDDED 143#endif //KAB_EMBEDDED
144 144
145 public slots: 145 public slots:
146#ifdef KAB_EMBEDDED 146#ifdef KAB_EMBEDDED
147 void createAboutData(); 147 void createAboutData();
148#endif //KAB_EMBEDDED 148#endif //KAB_EMBEDDED
149 void setDetailsToggle(); 149 void setDetailsToggle();
150 150
151 void showLicence(); 151 void showLicence();
152 void faq(); 152 void faq();
153 void whatsnew() ; 153 void whatsnew() ;
154 void synchowto() ; 154 void synchowto() ;
155 void multisynchowto() ; 155 void multisynchowto() ;
156 void kdesynchowto() ; 156 void kdesynchowto() ;
157 void writeToPhone(); 157 void writeToPhone();
158 158
159 /** 159 /**
160 Is called whenever a contact is selected in the view. 160 Is called whenever a contact is selected in the view.
161 */ 161 */
162 void setContactSelected( const QString &uid ); 162 void setContactSelected( const QString &uid );
163 163
164 /** 164 /**
165 Opens the preferred mail composer with all selected contacts as 165 Opens the preferred mail composer with all selected contacts as
166 arguments. 166 arguments.
167 */ 167 */
168 void sendMail(); 168 void sendMail();
169 169
170 /** 170 /**
171 Opens the preferred mail composer with the given contacts as 171 Opens the preferred mail composer with the given contacts as
172 arguments. 172 arguments.
173 */ 173 */
174 void sendMail( const QString& email ); 174 void sendMail( const QString& email );
175 175
176 176
177 void mailVCard(); 177 void mailVCard();
178 void mailVCard(const QStringList& uids); 178 void mailVCard(const QStringList& uids);
179 179
180 /** 180 /**
181 Beams the "WhoAmI contact. 181 Beams the "WhoAmI contact.
182 */ 182 */
183 void beamMySelf(); 183 void beamMySelf();
184 184
185 void beamVCard(); 185 void beamVCard();
186 void export2phone(); 186 void export2phone();
187 void beamVCard(const QStringList& uids); 187 void beamVCard(const QStringList& uids);
188 void beamDone( Ir *ir ); 188 void beamDone( Ir *ir );
189 189
190 190
191 /** 191 /**
192 Starts the preferred web browser with the given URL as argument. 192 Starts the preferred web browser with the given URL as argument.
193 */ 193 */
194 void browse( const QString& url ); 194 void browse( const QString& url );
195 195
196 /** 196 /**
197 Select all contacts in the view. 197 Select all contacts in the view.
198 */ 198 */
199 void selectAllContacts(); 199 void selectAllContacts();
200 200
201 /** 201 /**
202 Deletes all selected contacts from the address book. 202 Deletes all selected contacts from the address book.
203 */ 203 */
204 void deleteContacts(); 204 void deleteContacts();
205 205
206 /** 206 /**
207 Deletes given contacts from the address book. 207 Deletes given contacts from the address book.
208 208
209 @param uids The uids of the contacts, which shall be deleted. 209 @param uids The uids of the contacts, which shall be deleted.
210 */ 210 */
211 void deleteContacts( const QStringList &uids ); 211 void deleteContacts( const QStringList &uids );
212 212
213 /** 213 /**
214 Copys the selected contacts into clipboard for later pasting. 214 Copys the selected contacts into clipboard for later pasting.
215 */ 215 */
216 void copyContacts(); 216 void copyContacts();
217 217
218 /** 218 /**
219 Cuts the selected contacts and stores them for later pasting. 219 Cuts the selected contacts and stores them for later pasting.
220 */ 220 */
221 void cutContacts(); 221 void cutContacts();
222 222
223 /** 223 /**
224 Paste contacts from clipboard into the address book. 224 Paste contacts from clipboard into the address book.
225 */ 225 */
226 void pasteContacts(); 226 void pasteContacts();
227 227
228 /** 228 /**
229 Paste given contacts into the address book. 229 Paste given contacts into the address book.
230 230
231 @param list The list of addressee, which shall be pasted. 231 @param list The list of addressee, which shall be pasted.
232 */ 232 */
233 void pasteContacts( KABC::Addressee::List &list ); 233 void pasteContacts( KABC::Addressee::List &list );
234 234
235 /** 235 /**
236 Sets the whoAmI contact, that is used by many other programs to 236 Sets the whoAmI contact, that is used by many other programs to
237 get personal information about the current user. 237 get personal information about the current user.
238 */ 238 */
239 void setWhoAmI(); 239 void setWhoAmI();
240 240
241 /** 241 /**
242 Displays the category dialog and applies the result to all 242 Displays the category dialog and applies the result to all
243 selected contacts. 243 selected contacts.
244 */ 244 */
245 void setCategories(); 245 void setCategories();
246 void manageCategories();
246 247
247 /** 248 /**
248 Sets the field list of the Incremental Search Widget. 249 Sets the field list of the Incremental Search Widget.
249 */ 250 */
250 void setSearchFields( const KABC::Field::List &fields ); 251 void setSearchFields( const KABC::Field::List &fields );
251 252
252 /** 253 /**
253 Search with the current search field for a contact, that matches 254 Search with the current search field for a contact, that matches
254 the given text, and selects it in the view. 255 the given text, and selects it in the view.
255 */ 256 */
256 void incrementalSearch( const QString& text ); 257 void incrementalSearch( const QString& text );
257 258
258 /** 259 /**
259 Marks the address book as modified. 260 Marks the address book as modified.
260 */ 261 */
261 void setModified(); 262 void setModified();
262 /** 263 /**
263 Marks the address book as modified without refreshing the view. 264 Marks the address book as modified without refreshing the view.
264 */ 265 */
265 void setModifiedWOrefresh(); 266 void setModifiedWOrefresh();
266 267
267 /** 268 /**
268 Marks the address book as modified concerning the argument. 269 Marks the address book as modified concerning the argument.
269 */ 270 */
270 void setModified( bool modified ); 271 void setModified( bool modified );
271 272
272 /** 273 /**
273 Returns whether the address book is modified. 274 Returns whether the address book is modified.
274 */ 275 */
275 bool modified() const; 276 bool modified() const;
276 277
277 /** 278 /**
278 Called whenever an contact is modified in the contact editor 279 Called whenever an contact is modified in the contact editor
279 dialog or the quick edit. 280 dialog or the quick edit.
280 */ 281 */
281 void contactModified( const KABC::Addressee &addr ); 282 void contactModified( const KABC::Addressee &addr );
282 283
283 /** 284 /**
284 DCOP METHODS. 285 DCOP METHODS.
285 */ 286 */
286 void addEmail( QString addr ); 287 void addEmail( QString addr );
287 void importVCard( const KURL& url, bool showPreview ); 288 void importVCard( const KURL& url, bool showPreview );
288 void importVCard( const QString& vCard, bool showPreview ); 289 void importVCard( const QString& vCard, bool showPreview );
289 void newContact(); 290 void newContact();
290 QString getNameByPhone( const QString& phone ); 291 QString getNameByPhone( const QString& phone );
291 /** 292 /**
292 END DCOP METHODS 293 END DCOP METHODS
293 */ 294 */
294 295
295 /** 296 /**
296 Saves the contents of the AddressBook back to disk. 297 Saves the contents of the AddressBook back to disk.
297 */ 298 */
298 void save(); 299 void save();
299 300
300 /** 301 /**
301 Undos the last command using the undo stack. 302 Undos the last command using the undo stack.
302 */ 303 */
303 void undo(); 304 void undo();
304 305
305 /** 306 /**
306 Redos the last command that was undone, using the redo stack. 307 Redos the last command that was undone, using the redo stack.
307 */ 308 */
308 void redo(); 309 void redo();
309 310
310 /** 311 /**
311 Shows the edit dialog for the given uid. If the uid is QString::null, 312 Shows the edit dialog for the given uid. If the uid is QString::null,
312 the method will try to find a selected addressee in the view. 313 the method will try to find a selected addressee in the view.
313 */ 314 */
314 void editContact( const QString &uid /*US = QString::null*/ ); 315 void editContact( const QString &uid /*US = QString::null*/ );
315//US added a second method without defaultparameter 316//US added a second method without defaultparameter
316 void editContact2(); 317 void editContact2();
317 318
318 /** 319 /**
319 Shows or edits the detail view for the given uid. If the uid is QString::null, 320 Shows or edits the detail view for the given uid. If the uid is QString::null,
320 the method will try to find a selected addressee in the view. 321 the method will try to find a selected addressee in the view.
321 */ 322 */
322 void executeContact( const QString &uid /*US = QString::null*/ ); 323 void executeContact( const QString &uid /*US = QString::null*/ );
323 324
324 /** 325 /**
325 Launches the configuration dialog. 326 Launches the configuration dialog.
326 */ 327 */
327 void openConfigDialog(); 328 void openConfigDialog();
328 329
329 /** 330 /**
330 Launches the ldap search dialog. 331 Launches the ldap search dialog.
331 */ 332 */
332 void openLDAPDialog(); 333 void openLDAPDialog();
333 334
334 /** 335 /**
335 Creates a KAddressBookPrinter, which will display the print 336 Creates a KAddressBookPrinter, which will display the print
336 dialog and do the printing. 337 dialog and do the printing.
337 */ 338 */
338 void print(); 339 void print();
339 340
340 /** 341 /**
341 Registers a new GUI client, so plugins can register its actions. 342 Registers a new GUI client, so plugins can register its actions.
342 */ 343 */
343 void addGUIClient( KXMLGUIClient *client ); 344 void addGUIClient( KXMLGUIClient *client );
344 345
345 void requestForNameEmailUidList(const QString& sourceChannel, const QString& sessionuid); 346 void requestForNameEmailUidList(const QString& sourceChannel, const QString& sessionuid);
346 void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid); 347 void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid);
347 void requestForBirthdayList(const QString& sourceChannel, const QString& sessionuid); 348 void requestForBirthdayList(const QString& sourceChannel, const QString& sessionuid);
348 349
349 350
350 signals: 351 signals:
351 void contactSelected( const QString &name ); 352 void contactSelected( const QString &name );
352 void contactSelected( const QPixmap &pixmap ); 353 void contactSelected( const QPixmap &pixmap );
353 public slots: 354 public slots:
354 void recieve(QString cmsg ); 355 void recieve(QString cmsg );
355 void getFile( bool success ); 356 void getFile( bool success );
356 void syncFileRequest(); 357 void syncFileRequest();
357 void setDetailsVisible( bool visible ); 358 void setDetailsVisible( bool visible );
358 void setDetailsToState(); 359 void setDetailsToState();
359 // void slotSyncMenu( int ); 360 // void slotSyncMenu( int );
360 private slots: 361 private slots:
361 void receive( const QCString& cmsg, const QByteArray& data ); 362 void receive( const QCString& cmsg, const QByteArray& data );
362 void toggleBeamReceive( ); 363 void toggleBeamReceive( );
363 void disableBR(bool); 364 void disableBR(bool);
364 void setJumpButtonBarVisible( bool visible ); 365 void setJumpButtonBarVisible( bool visible );
365 void setCaptionBack(); 366 void setCaptionBack();
366 void importFromOL(); 367 void importFromOL();
367 void extensionModified( const KABC::Addressee::List &list ); 368 void extensionModified( const KABC::Addressee::List &list );
368 void extensionChanged( int id ); 369 void extensionChanged( int id );
369 void clipboardDataChanged(); 370 void clipboardDataChanged();
370 void updateActionMenu(); 371 void updateActionMenu();
371 void configureKeyBindings(); 372 void configureKeyBindings();
372 void removeVoice(); 373 void removeVoice();
373 void setCat();
374 void addCat();
375 void setCategories( bool removeOld );
376#ifdef KAB_EMBEDDED 374#ifdef KAB_EMBEDDED
377 void configureResources(); 375 void configureResources();
378#endif //KAB_EMBEDDED 376#endif //KAB_EMBEDDED
379 377
380 void slotEditorDestroyed( const QString &uid ); 378 void slotEditorDestroyed( const QString &uid );
381 void configurationChanged(); 379 void configurationChanged();
382 void addressBookChanged(); 380 void addressBookChanged();
383 381
384 private: 382 private:
385 bool mBRdisabled; 383 bool mBRdisabled;
386#ifndef DESKTOP_VERSION 384#ifndef DESKTOP_VERSION
387 QCopChannel* infrared; 385 QCopChannel* infrared;
388#endif 386#endif
389 QTimer *mMessageTimer; 387 QTimer *mMessageTimer;
390 void initGUI(); 388 void initGUI();
391 void initActions(); 389 void initActions();
392 QString getPhoneFile(); 390 QString getPhoneFile();
393 391
394 AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent, 392 AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent,
395 const char *name = 0 ); 393 const char *name = 0 );
396 394
397 KXMLGUIClient *mGUIClient; 395 KXMLGUIClient *mGUIClient;
398 396
399 KABC::AddressBook *mAddressBook; 397 KABC::AddressBook *mAddressBook;
400 398
401 ViewManager *mViewManager; 399 ViewManager *mViewManager;
402 // QSplitter *mDetailsSplitter; 400 // QSplitter *mDetailsSplitter;
403 KDGanttMinimizeSplitter *mExtensionBarSplitter; 401 KDGanttMinimizeSplitter *mExtensionBarSplitter;
404 ViewContainer *mDetails; 402 ViewContainer *mDetails;
405 KDGanttMinimizeSplitter* mMiniSplitter; 403 KDGanttMinimizeSplitter* mMiniSplitter;
406 XXPortManager *mXXPortManager; 404 XXPortManager *mXXPortManager;
407 JumpButtonBar *mJumpButtonBar; 405 JumpButtonBar *mJumpButtonBar;
408 IncSearchWidget *mIncSearchWidget; 406 IncSearchWidget *mIncSearchWidget;
409 ExtensionManager *mExtensionManager; 407 ExtensionManager *mExtensionManager;
410 408
411 KCMultiDialog *mConfigureDialog; 409 KCMultiDialog *mConfigureDialog;
412 410
413#ifndef KAB_EMBEDDED 411#ifndef KAB_EMBEDDED
414 LDAPSearchDialog *mLdapSearchDialog; 412 LDAPSearchDialog *mLdapSearchDialog;
415#endif //KAB_EMBEDDED 413#endif //KAB_EMBEDDED
416 // QDict<AddresseeEditorDialog> mEditorDict; 414 // QDict<AddresseeEditorDialog> mEditorDict;
417 AddresseeEditorDialog *mEditorDialog; 415 AddresseeEditorDialog *mEditorDialog;
418 bool mReadWrite; 416 bool mReadWrite;
419 bool mModified; 417 bool mModified;
420 bool mIsPart; 418 bool mIsPart;
421 bool mMultipleViewsAtOnce; 419 bool mMultipleViewsAtOnce;
422 420
423 421
424 //US file menu 422 //US file menu
425 KAction *mActionMail; 423 KAction *mActionMail;
426 KAction *mActionBeam; 424 KAction *mActionBeam;
427 KToggleAction *mActionBR; 425 KToggleAction *mActionBR;
428 KAction *mActionExport2phone; 426 KAction *mActionExport2phone;
429 KAction* mActionPrint; 427 KAction* mActionPrint;
430 KAction* mActionNewContact; 428 KAction* mActionNewContact;
431 KAction *mActionSave; 429 KAction *mActionSave;
432 KAction *mActionEditAddressee; 430 KAction *mActionEditAddressee;
433 KAction *mActionMailVCard; 431 KAction *mActionMailVCard;
434 KAction *mActionBeamVCard; 432 KAction *mActionBeamVCard;
435 433
436 KAction *mActionQuit; 434 KAction *mActionQuit;
437 435
438 //US edit menu 436 //US edit menu
439 KAction *mActionCopy; 437 KAction *mActionCopy;
440 KAction *mActionCut; 438 KAction *mActionCut;
441 KAction *mActionPaste; 439 KAction *mActionPaste;
442 KAction *mActionSelectAll; 440 KAction *mActionSelectAll;
443 KAction *mActionUndo; 441 KAction *mActionUndo;
444 KAction *mActionRedo; 442 KAction *mActionRedo;
445 KAction *mActionDelete; 443 KAction *mActionDelete;
446 444
447 //US settings menu 445 //US settings menu
448 KAction *mActionConfigResources; 446 KAction *mActionConfigResources;
449 KAction *mActionConfigKAddressbook; 447 KAction *mActionConfigKAddressbook;
450 KAction *mActionConfigShortcuts; 448 KAction *mActionConfigShortcuts;
451 KAction *mActionConfigureToolbars; 449 KAction *mActionConfigureToolbars;
452 KAction *mActionKeyBindings; 450 KAction *mActionKeyBindings;
453 KToggleAction *mActionJumpBar; 451 KToggleAction *mActionJumpBar;
454 KToggleAction *mActionDetails; 452 KToggleAction *mActionDetails;
455 KAction *mActionWhoAmI; 453 KAction *mActionWhoAmI;
456 KAction *mActionCategories; 454 KAction *mActionCategories;
455 KAction *mActionManageCategories;
457 KAction *mActionAboutKAddressbook; 456 KAction *mActionAboutKAddressbook;
458 KAction *mActionLicence; 457 KAction *mActionLicence;
459 KAction *mActionFaq; 458 KAction *mActionFaq;
460 KAction *mActionWN; 459 KAction *mActionWN;
461 KAction *mActionSyncHowto; 460 KAction *mActionSyncHowto;
462 KAction *mActionKdeSyncHowto; 461 KAction *mActionKdeSyncHowto;
463 KAction *mActionMultiSyncHowto; 462 KAction *mActionMultiSyncHowto;
464 463
465 KAction *mActionDeleteView; 464 KAction *mActionDeleteView;
466 465
467 QPopupMenu *viewMenu; 466 QPopupMenu *viewMenu;
468 QPopupMenu *filterMenu; 467 QPopupMenu *filterMenu;
469 QPopupMenu *settingsMenu; 468 QPopupMenu *settingsMenu;
470 QPopupMenu *changeMenu; 469 QPopupMenu *changeMenu;
471//US QAction *mActionSave; 470//US QAction *mActionSave;
472 QPopupMenu *ImportMenu; 471 QPopupMenu *ImportMenu;
473 QPopupMenu *ExportMenu; 472 QPopupMenu *ExportMenu;
474 //LR additional methods 473 //LR additional methods
475 KAction *mActionRemoveVoice; 474 KAction *mActionRemoveVoice;
476 KAction *mActionSetCat;
477 KAction *mActionAddCat;
478 KAction * mActionImportOL; 475 KAction * mActionImportOL;
479 476
480#ifndef KAB_EMBEDDED 477#ifndef KAB_EMBEDDED
481 KAddressBookService *mAddressBookService; 478 KAddressBookService *mAddressBookService;
482#endif //KAB_EMBEDDED 479#endif //KAB_EMBEDDED
483 480
484 class KABCorePrivate; 481 class KABCorePrivate;
485 KABCorePrivate *d; 482 KABCorePrivate *d;
486 //US bool mBlockSaveFlag; 483 //US bool mBlockSaveFlag;
487 484
488#ifdef KAB_EMBEDDED 485#ifdef KAB_EMBEDDED
489 KAddressBookMain *mMainWindow; // should be the same like mGUIClient 486 KAddressBookMain *mMainWindow; // should be the same like mGUIClient
490#endif //KAB_EMBEDDED 487#endif //KAB_EMBEDDED
491 488
492 //this are the overwritten callbackmethods from the syncinterface 489 //this are the overwritten callbackmethods from the syncinterface
493 virtual bool sync(KSyncManager* manager, QString filename, int mode); 490 virtual bool sync(KSyncManager* manager, QString filename, int mode);
494 virtual bool syncExternal(KSyncManager* manager, QString resource); 491 virtual bool syncExternal(KSyncManager* manager, QString resource);
495 virtual void removeSyncInfo( QString syncProfile); 492 virtual void removeSyncInfo( QString syncProfile);
496 bool syncPhone(); 493 bool syncPhone();
497 void message( QString m ); 494 void message( QString m );
498 495
499 // LR ******************************* 496 // LR *******************************
500 // sync stuff! 497 // sync stuff!
501 QString sentSyncFile(); 498 QString sentSyncFile();
502 QPopupMenu *syncMenu; 499 QPopupMenu *syncMenu;
503 KSyncManager* syncManager; 500 KSyncManager* syncManager;
504 int mGlobalSyncMode; 501 int mGlobalSyncMode;
505 bool synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode); 502 bool synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode);
506 KABC::Addressee getLastSyncAddressee(); 503 KABC::Addressee getLastSyncAddressee();
507 QDateTime mLastAddressbookSync; 504 QDateTime mLastAddressbookSync;
508 int takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ); 505 int takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full );
509 // ********************* 506 // *********************
510 507
511}; 508};
512 509
513#endif 510#endif