-rw-r--r-- | kaddressbook/kabcore.cpp | 61 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 7 |
2 files changed, 14 insertions, 54 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 2c2f1a0..83027ac 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -961,7 +961,8 @@ void KABCore::setCategories() { KPIM::CategorySelectDialog dlg( KABPrefs::instance(), this, "", true ); - if ( !dlg.exec() ) - return; - + if ( !dlg.exec() ) { + message( i18n("Setting categories cancelled") ); + return; + } bool merge = false; QString msg = i18n( "Merge with existing categories?" ); @@ -969,4 +970,5 @@ void KABCore::setCategories() merge = true; + message( i18n("Setting categories ... please wait!") ); QStringList categories = dlg.selectedCategories(); @@ -994,4 +996,5 @@ void KABCore::setCategories() if ( uids.count() > 0 ) setModified( true ); + message( i18n("Setting categories completed!") ); } @@ -1885,13 +1888,9 @@ void KABCore::initActions() "remove_voice" ); - mActionSetCat= new KAction( i18n( "Set categories..." ), 0, this, - SLOT( setCat() ), actionCollection(), + mActionManageCategories= new KAction( i18n( "Manage new categories..." ), 0, this, + SLOT( manageCategories() ), actionCollection(), "remove_voice" ); - mActionAddCat= new KAction( i18n( "Add categories..." ), 0, this, - SLOT( addCat() ), actionCollection(), - "remove_voice" ); - mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this, SLOT( importFromOL() ), actionCollection(), @@ -2023,6 +2022,4 @@ void KABCore::addActionsManually() mActionRemoveVoice->plug( changeMenu ); - mActionSetCat->plug( changeMenu ); - mActionAddCat->plug( changeMenu ); // settings menu //US special menuentry to configure the addressbook resources. On KDE @@ -2055,4 +2052,5 @@ void KABCore::addActionsManually() mActionWhoAmI->plug( settingsMenu ); mActionCategories->plug( settingsMenu ); + mActionManageCategories->plug( settingsMenu ); @@ -2107,43 +2105,8 @@ void KABCore::showLicence() KApplication::showLicence(); } -void KABCore::setCat() -{ - setCategories( true ); -} -void KABCore::addCat() -{ - setCategories( false ); -} -void KABCore::setCategories( bool removeOld ) + +void KABCore::manageCategories( ) { - KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KABPrefs::instance(), 0 ); - if (! csd->exec()) { - message( i18n("Setting categories cancelled") ); - delete csd; - return; - } - message( i18n("Setting categories ... please wait!") ); - QStringList catList = csd->selectedCategories(); - delete csd; - catList.sort(); - QStringList newList; - KABC::Addressee::List list = mViewManager->selectedAddressees(); - KABC::Addressee::List::Iterator it; - for ( it = list.begin(); it != list.end(); ++it ) { - if ( removeOld ) { - (*it).setCategories( catList ); - } else { - newList = (*it).categories(); - int i; - for( i = 0; i< catList.count(); ++i ) { - if ( !newList.contains (catList[i])) - newList.append( catList[i] ); - } - newList.sort(); - (*it).setCategories( newList ); - } - contactModified((*it) ); - } - message( i18n("Setting categories completed!") ); + } void KABCore::removeVoice() diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index 1bdae5f..bf5398b 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h @@ -244,4 +244,5 @@ class KABCore : public QWidget, public KSyncInterface */ void setCategories(); + void manageCategories(); /** @@ -371,7 +372,4 @@ class KABCore : public QWidget, public KSyncInterface void configureKeyBindings(); void removeVoice(); - void setCat(); - void addCat(); - void setCategories( bool removeOld ); #ifdef KAB_EMBEDDED void configureResources(); @@ -455,4 +453,5 @@ class KABCore : public QWidget, public KSyncInterface KAction *mActionWhoAmI; KAction *mActionCategories; + KAction *mActionManageCategories; KAction *mActionAboutKAddressbook; KAction *mActionLicence; @@ -474,6 +473,4 @@ class KABCore : public QWidget, public KSyncInterface //LR additional methods KAction *mActionRemoveVoice; - KAction *mActionSetCat; - KAction *mActionAddCat; KAction * mActionImportOL; |