-rw-r--r-- | kaddressbook/kabcore.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 7e3fc7c..f4263c4 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -105,16 +105,21 @@ | |||
105 | #include "kabprefs.h" | 105 | #include "kabprefs.h" |
106 | #include "xxportmanager.h" | 106 | #include "xxportmanager.h" |
107 | #include "incsearchwidget.h" | 107 | #include "incsearchwidget.h" |
108 | #include "jumpbuttonbar.h" | 108 | #include "jumpbuttonbar.h" |
109 | #include "extensionmanager.h" | 109 | #include "extensionmanager.h" |
110 | #include "addresseeconfig.h" | 110 | #include "addresseeconfig.h" |
111 | #include <kcmultidialog.h> | 111 | #include <kcmultidialog.h> |
112 | 112 | ||
113 | #ifdef _WIN32_ | ||
114 | |||
115 | #include "kaimportoldialog.h" | ||
116 | #endif | ||
117 | |||
113 | 118 | ||
114 | #ifdef KAB_EMBEDDED | 119 | #ifdef KAB_EMBEDDED |
115 | KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name ) | 120 | KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name ) |
116 | : QWidget( parent, name ), mGUIClient( client ), mViewManager( 0 ), | 121 | : QWidget( parent, name ), mGUIClient( client ), mViewManager( 0 ), |
117 | mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/ | 122 | mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/ |
118 | mReadWrite( readWrite ), mModified( false ), mMainWindow(client) | 123 | mReadWrite( readWrite ), mModified( false ), mMainWindow(client) |
119 | #else //KAB_EMBEDDED | 124 | #else //KAB_EMBEDDED |
120 | KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) | 125 | KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) |
@@ -157,16 +162,18 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const | |||
157 | mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, | 162 | mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, |
158 | "X-Anniversary", "KADDRESSBOOK" ); | 163 | "X-Anniversary", "KADDRESSBOOK" ); |
159 | 164 | ||
160 | //US added this field to become compatible with Opie addressbook | 165 | //US added this field to become compatible with Opie addressbook |
161 | mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal, | 166 | mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal, |
162 | "X-Gender", "KADDRESSBOOK" ); | 167 | "X-Gender", "KADDRESSBOOK" ); |
163 | mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, | 168 | mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, |
164 | "X-Children", "KADDRESSBOOK" ); | 169 | "X-Children", "KADDRESSBOOK" ); |
170 | mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, | ||
171 | "X-FreeBusyUrl", "KADDRESSBOOK" ); | ||
165 | 172 | ||
166 | initGUI(); | 173 | initGUI(); |
167 | 174 | ||
168 | mIncSearchWidget->setFocus(); | 175 | mIncSearchWidget->setFocus(); |
169 | 176 | ||
170 | 177 | ||
171 | connect( mViewManager, SIGNAL( selected( const QString& ) ), | 178 | connect( mViewManager, SIGNAL( selected( const QString& ) ), |
172 | SLOT( setContactSelected( const QString& ) ) ); | 179 | SLOT( setContactSelected( const QString& ) ) ); |
@@ -836,16 +843,27 @@ void KABCore::addEmail( QString aStr ) | |||
836 | qDebug("KABCore::addEmail finsih method"); | 843 | qDebug("KABCore::addEmail finsih method"); |
837 | #endif //KAB_EMBEDDED | 844 | #endif //KAB_EMBEDDED |
838 | } | 845 | } |
839 | 846 | ||
840 | void KABCore::importVCard( const KURL &url, bool showPreview ) | 847 | void KABCore::importVCard( const KURL &url, bool showPreview ) |
841 | { | 848 | { |
842 | mXXPortManager->importVCard( url, showPreview ); | 849 | mXXPortManager->importVCard( url, showPreview ); |
843 | } | 850 | } |
851 | void KABCore::importFromOL() | ||
852 | { | ||
853 | #ifdef _WIN32_ | ||
854 | KAImportOLdialog* idgl = new KAImportOLdialog( i18n("Import Contacts from OL"), mAddressBook, this ); | ||
855 | idgl->exec(); | ||
856 | KABC::Addressee::List list = idgl->getAddressList(); | ||
857 | if ( list.count() > 0 ) | ||
858 | pasteContacts( list ); | ||
859 | delete idgl; | ||
860 | #endif | ||
861 | } | ||
844 | 862 | ||
845 | void KABCore::importVCard( const QString &vCard, bool showPreview ) | 863 | void KABCore::importVCard( const QString &vCard, bool showPreview ) |
846 | { | 864 | { |
847 | mXXPortManager->importVCard( vCard, showPreview ); | 865 | mXXPortManager->importVCard( vCard, showPreview ); |
848 | } | 866 | } |
849 | 867 | ||
850 | //US added a second method without defaultparameter | 868 | //US added a second method without defaultparameter |
851 | void KABCore::editContact2() { | 869 | void KABCore::editContact2() { |
@@ -1392,16 +1410,19 @@ void KABCore::initActions() | |||
1392 | 1410 | ||
1393 | mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, | 1411 | mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, |
1394 | SLOT( setCategories() ), actionCollection(), | 1412 | SLOT( setCategories() ), actionCollection(), |
1395 | "edit_set_categories" ); | 1413 | "edit_set_categories" ); |
1396 | 1414 | ||
1397 | mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, | 1415 | mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, |
1398 | SLOT( removeVoice() ), actionCollection(), | 1416 | SLOT( removeVoice() ), actionCollection(), |
1399 | "remove_voice" ); | 1417 | "remove_voice" ); |
1418 | mActionImportOL = new KAction( i18n( "Import from OL..." ), 0, this, | ||
1419 | SLOT( importFromOL() ), actionCollection(), | ||
1420 | "import_OL" ); | ||
1400 | #ifdef KAB_EMBEDDED | 1421 | #ifdef KAB_EMBEDDED |
1401 | 1422 | ||
1402 | mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, | 1423 | mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, |
1403 | this, SLOT( createAboutData() ), actionCollection(), | 1424 | this, SLOT( createAboutData() ), actionCollection(), |
1404 | "kaddressbook_about_data" ); | 1425 | "kaddressbook_about_data" ); |
1405 | #endif //KAB_EMBEDDED | 1426 | #endif //KAB_EMBEDDED |
1406 | 1427 | ||
1407 | clipboardDataChanged(); | 1428 | clipboardDataChanged(); |
@@ -1472,18 +1493,19 @@ void KABCore::addActionsManually() | |||
1472 | fileMenu->insertSeparator(); | 1493 | fileMenu->insertSeparator(); |
1473 | mActionSave->plug( fileMenu ); | 1494 | mActionSave->plug( fileMenu ); |
1474 | fileMenu->insertItem( "&Import", ImportMenu ); | 1495 | fileMenu->insertItem( "&Import", ImportMenu ); |
1475 | fileMenu->insertItem( "&Emport", ExportMenu ); | 1496 | fileMenu->insertItem( "&Emport", ExportMenu ); |
1476 | fileMenu->insertSeparator(); | 1497 | fileMenu->insertSeparator(); |
1477 | mActionMailVCard->plug( fileMenu ); | 1498 | mActionMailVCard->plug( fileMenu ); |
1478 | fileMenu->insertSeparator(); | 1499 | fileMenu->insertSeparator(); |
1479 | mActionQuit->plug( fileMenu ); | 1500 | mActionQuit->plug( fileMenu ); |
1480 | 1501 | #ifdef _WIN32_ | |
1481 | 1502 | mActionImportOL->plug( ImportMenu ); | |
1503 | #endif | ||
1482 | // edit menu | 1504 | // edit menu |
1483 | mActionUndo->plug( editMenu ); | 1505 | mActionUndo->plug( editMenu ); |
1484 | mActionRedo->plug( editMenu ); | 1506 | mActionRedo->plug( editMenu ); |
1485 | editMenu->insertSeparator(); | 1507 | editMenu->insertSeparator(); |
1486 | mActionCut->plug( editMenu ); | 1508 | mActionCut->plug( editMenu ); |
1487 | mActionCopy->plug( editMenu ); | 1509 | mActionCopy->plug( editMenu ); |
1488 | mActionPaste->plug( editMenu ); | 1510 | mActionPaste->plug( editMenu ); |
1489 | mActionDelete->plug( editMenu ); | 1511 | mActionDelete->plug( editMenu ); |