-rw-r--r-- | kaddressbook/kabcore.cpp | 19 | ||||
-rw-r--r-- | kaddressbook/xxportselectdialog.cpp | 9 | ||||
-rw-r--r-- | kaddressbook/xxportselectdialog.h | 1 | ||||
-rw-r--r-- | version | 2 |
4 files changed, 23 insertions, 8 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index c339244..755da11 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -115,6 +115,7 @@ $Id$ #include "kcmconfigs/kcmkdepimconfig.h" #include "kpimglobalprefs.h" #include "externalapphandler.h" +#include "xxportselectdialog.h" #include <kresources/selectdialog.h> @@ -678,7 +679,6 @@ void KABCore::setContactSelected( const QString &uid ) if (mActionBeamVCard) mActionBeamVCard->setEnabled( selected ); - mActionExport2phone->setEnabled( selected ); mActionWhoAmI->setEnabled( selected ); mActionCategories->setEnabled( selected ); } @@ -780,7 +780,16 @@ void KABCore::beamMySelf() void KABCore::export2phone() { - + QStringList uids; + XXPortSelectDialog dlg( this, false, this ); + if ( dlg.exec() ) + uids = dlg.uids(); + else + return; + if ( uids.isEmpty() ) + return; + // qDebug("count %d ", uids.count()); + KAex2phonePrefs ex2phone; ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); @@ -798,10 +807,6 @@ void KABCore::export2phone() KPimGlobalPrefs::instance()->mEx2PhoneConnection, KPimGlobalPrefs::instance()->mEx2PhoneModel ); - QStringList uids = mViewManager->selectedUids(); - if ( uids.isEmpty() ) - return; - QString fileName = getPhoneFile(); if ( ! mAddressBook->export2PhoneFormat( uids ,fileName ) ) return; @@ -1799,7 +1804,7 @@ void KABCore::initActions() this, SLOT( mailVCard() ), actionCollection(), "file_mail_vcard"); - mActionExport2phone = new KAction( i18n( "Selected to phone" ), "ex2phone", 0, this, + mActionExport2phone = new KAction( i18n( "Export to phone" ), "ex2phone", 0, this, SLOT( export2phone() ), actionCollection(), "kaddressbook_ex2phone" ); diff --git a/kaddressbook/xxportselectdialog.cpp b/kaddressbook/xxportselectdialog.cpp index 41c999b..be254c0 100644 --- a/kaddressbook/xxportselectdialog.cpp +++ b/kaddressbook/xxportselectdialog.cpp @@ -99,6 +99,15 @@ XXPortSelectDialog::XXPortSelectDialog( KABCore *core, bool sort, mFieldCombo->insertItem( (*fieldIt)->label() ); } +QStringList XXPortSelectDialog::uids() +{ + QStringList uidlist; + KABC::AddresseeList list = contacts(); + KABC::Addressee::List::Iterator it; + for ( it = list.begin(); it != list.end(); ++it ) + uidlist.append((*it).uid()); + return uidlist; +} KABC::AddresseeList XXPortSelectDialog::contacts() { QStringList selection = mCore->selectedUIDs(); diff --git a/kaddressbook/xxportselectdialog.h b/kaddressbook/xxportselectdialog.h index 8d56f66..3bb696f 100644 --- a/kaddressbook/xxportselectdialog.h +++ b/kaddressbook/xxportselectdialog.h @@ -48,6 +48,7 @@ class XXPortSelectDialog : public KDialogBase const char* name = 0 ); KABC::AddresseeList contacts(); + QStringList uids(); private slots: void filterChanged( int ); @@ -1 +1 @@ -version = "1.9.12"; +version = "1.9.13"; |