-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 @@ | |||
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) |
@@ -159,12 +164,14 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const | |||
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 | ||
@@ -838,12 +845,23 @@ void KABCore::addEmail( QString aStr ) | |||
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 | ||
@@ -1394,12 +1412,15 @@ void KABCore::initActions() | |||
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 |
@@ -1474,14 +1495,15 @@ void KABCore::addActionsManually() | |||
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 ); |