-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 @@ -109,8 +109,13 @@ #include "extensionmanager.h" #include "addresseeconfig.h" #include <kcmultidialog.h> +#ifdef _WIN32_ + +#include "kaimportoldialog.h" +#endif + #ifdef KAB_EMBEDDED KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name ) : QWidget( parent, name ), mGUIClient( client ), mViewManager( 0 ), @@ -161,8 +166,10 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal, "X-Gender", "KADDRESSBOOK" ); mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, "X-Children", "KADDRESSBOOK" ); + mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, + "X-FreeBusyUrl", "KADDRESSBOOK" ); initGUI(); mIncSearchWidget->setFocus(); @@ -840,8 +847,19 @@ void KABCore::addEmail( QString aStr ) void KABCore::importVCard( const KURL &url, bool showPreview ) { mXXPortManager->importVCard( url, showPreview ); } +void KABCore::importFromOL() +{ +#ifdef _WIN32_ + KAImportOLdialog* idgl = new KAImportOLdialog( i18n("Import Contacts from OL"), mAddressBook, this ); + idgl->exec(); + KABC::Addressee::List list = idgl->getAddressList(); + if ( list.count() > 0 ) + pasteContacts( list ); + delete idgl; +#endif +} void KABCore::importVCard( const QString &vCard, bool showPreview ) { mXXPortManager->importVCard( vCard, showPreview ); @@ -1396,8 +1414,11 @@ void KABCore::initActions() mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, SLOT( removeVoice() ), actionCollection(), "remove_voice" ); + mActionImportOL = new KAction( i18n( "Import from OL..." ), 0, this, + SLOT( importFromOL() ), actionCollection(), + "import_OL" ); #ifdef KAB_EMBEDDED mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, this, SLOT( createAboutData() ), actionCollection(), @@ -1476,10 +1497,11 @@ void KABCore::addActionsManually() fileMenu->insertSeparator(); mActionMailVCard->plug( fileMenu ); fileMenu->insertSeparator(); mActionQuit->plug( fileMenu ); - - +#ifdef _WIN32_ + mActionImportOL->plug( ImportMenu ); +#endif // edit menu mActionUndo->plug( editMenu ); mActionRedo->plug( editMenu ); editMenu->insertSeparator(); |