-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 @@ -107,12 +107,17 @@ #include "incsearchwidget.h" #include "jumpbuttonbar.h" #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 ), mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/ mReadWrite( readWrite ), mModified( false ), mMainWindow(client) @@ -159,12 +164,14 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const //US added this field to become compatible with Opie addressbook 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(); @@ -838,12 +845,23 @@ 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 ); } @@ -1394,12 +1412,15 @@ void KABCore::initActions() SLOT( setCategories() ), actionCollection(), "edit_set_categories" ); 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(), "kaddressbook_about_data" ); #endif //KAB_EMBEDDED @@ -1474,14 +1495,15 @@ void KABCore::addActionsManually() fileMenu->insertItem( "&Import", ImportMenu ); fileMenu->insertItem( "&Emport", ExportMenu ); 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(); mActionCut->plug( editMenu ); mActionCopy->plug( editMenu ); |