author | zautrix <zautrix> | 2004-10-30 01:00:42 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-30 01:00:42 (UTC) |
commit | c477fa8ba7eacfaba3d154a72153acc7bc46abdc (patch) (side-by-side diff) | |
tree | 0ba938ac70b5f878515432a7ba36525f6167be3f | |
parent | af857a738da80e9eb68cf311832d44ecb9caf1dd (diff) | |
download | kdepimpi-c477fa8ba7eacfaba3d154a72153acc7bc46abdc.zip kdepimpi-c477fa8ba7eacfaba3d154a72153acc7bc46abdc.tar.gz kdepimpi-c477fa8ba7eacfaba3d154a72153acc7bc46abdc.tar.bz2 |
AARGG. I just noticed, that set categories was alreday there. removed my second implementation
-rw-r--r-- | kaddressbook/kabcore.cpp | 59 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 7 |
2 files changed, 13 insertions, 53 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 2c2f1a0..83027ac 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -962,5 +962,6 @@ void KABCore::setCategories() KPIM::CategorySelectDialog dlg( KABPrefs::instance(), this, "", true ); - if ( !dlg.exec() ) + if ( !dlg.exec() ) { + message( i18n("Setting categories cancelled") ); return; - + } bool merge = false; @@ -970,2 +971,3 @@ void KABCore::setCategories() + message( i18n("Setting categories ... please wait!") ); QStringList categories = dlg.selectedCategories(); @@ -995,2 +997,3 @@ void KABCore::setCategories() setModified( true ); + message( i18n("Setting categories completed!") ); } @@ -1886,4 +1889,4 @@ void KABCore::initActions() - 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" ); @@ -1891,6 +1894,2 @@ void KABCore::initActions() - mActionAddCat= new KAction( i18n( "Add categories..." ), 0, this, - SLOT( addCat() ), actionCollection(), - "remove_voice" ); - mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this, @@ -2024,4 +2023,2 @@ void KABCore::addActionsManually() mActionRemoveVoice->plug( changeMenu ); - mActionSetCat->plug( changeMenu ); - mActionAddCat->plug( changeMenu ); // settings menu @@ -2056,2 +2053,3 @@ void KABCore::addActionsManually() mActionCategories->plug( settingsMenu ); + mActionManageCategories->plug( settingsMenu ); @@ -2108,41 +2106,6 @@ void KABCore::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!") ); + } diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index 1bdae5f..bf5398b 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h @@ -245,2 +245,3 @@ class KABCore : public QWidget, public KSyncInterface void setCategories(); + void manageCategories(); @@ -372,5 +373,2 @@ class KABCore : public QWidget, public KSyncInterface void removeVoice(); - void setCat(); - void addCat(); - void setCategories( bool removeOld ); #ifdef KAB_EMBEDDED @@ -456,2 +454,3 @@ class KABCore : public QWidget, public KSyncInterface KAction *mActionCategories; + KAction *mActionManageCategories; KAction *mActionAboutKAddressbook; @@ -475,4 +474,2 @@ class KABCore : public QWidget, public KSyncInterface KAction *mActionRemoveVoice; - KAction *mActionSetCat; - KAction *mActionAddCat; KAction * mActionImportOL; |