summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp32
-rw-r--r--kaddressbook/kabcore.h4
2 files changed, 35 insertions, 1 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index a0fec91..7e3fc7c 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1141,8 +1141,9 @@ void KABCore::initGUI()
1141 //filterMenu = new QPopupMenu( this ); 1141 //filterMenu = new QPopupMenu( this );
1142 ImportMenu = new QPopupMenu( this ); 1142 ImportMenu = new QPopupMenu( this );
1143 ExportMenu = new QPopupMenu( this ); 1143 ExportMenu = new QPopupMenu( this );
1144 1144
1145 changeMenu= new QPopupMenu( this );
1145 1146
1146//US since we have no splitter for the embedded system, setup 1147//US since we have no splitter for the embedded system, setup
1147// a layout with two frames. One left and one right. 1148// a layout with two frames. One left and one right.
1148 1149
@@ -1392,8 +1393,11 @@ void KABCore::initActions()
1392 mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, 1393 mActionCategories = new KAction( i18n( "Set Categories" ), 0, this,
1393 SLOT( setCategories() ), actionCollection(), 1394 SLOT( setCategories() ), actionCollection(),
1394 "edit_set_categories" ); 1395 "edit_set_categories" );
1395 1396
1397 mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this,
1398 SLOT( removeVoice() ), actionCollection(),
1399 "remove_voice" );
1396#ifdef KAB_EMBEDDED 1400#ifdef KAB_EMBEDDED
1397 1401
1398 mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, 1402 mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0,
1399 this, SLOT( createAboutData() ), actionCollection(), 1403 this, SLOT( createAboutData() ), actionCollection(),
@@ -1426,8 +1430,9 @@ void KABCore::addActionsManually()
1426 mb->insertItem( "&File", fileMenu ); 1430 mb->insertItem( "&File", fileMenu );
1427 mb->insertItem( "&Edit", editMenu ); 1431 mb->insertItem( "&Edit", editMenu );
1428 mb->insertItem( "&View", viewMenu ); 1432 mb->insertItem( "&View", viewMenu );
1429 mb->insertItem( "&Settings", settingsMenu ); 1433 mb->insertItem( "&Settings", settingsMenu );
1434 mb->insertItem( "&Change selected", changeMenu );
1430 mb->insertItem( "&Help", helpMenu ); 1435 mb->insertItem( "&Help", helpMenu );
1431 mIncSearchWidget = new IncSearchWidget( tb ); 1436 mIncSearchWidget = new IncSearchWidget( tb );
1432 // tb->insertWidget(-1, 0, mIncSearchWidget); 1437 // tb->insertWidget(-1, 0, mIncSearchWidget);
1433 1438
@@ -1444,8 +1449,9 @@ void KABCore::addActionsManually()
1444 popupBarTB->insertItem( "&Edit", editMenu ); 1449 popupBarTB->insertItem( "&Edit", editMenu );
1445 popupBarTB->insertItem( "&View", viewMenu ); 1450 popupBarTB->insertItem( "&View", viewMenu );
1446 popupBarTB->insertItem( "&Settings", settingsMenu ); 1451 popupBarTB->insertItem( "&Settings", settingsMenu );
1447 mViewManager->getFilterAction()->plug ( popupBarTB); 1452 mViewManager->getFilterAction()->plug ( popupBarTB);
1453 popupBarTB->insertItem( "&Change selected", changeMenu );
1448 popupBarTB->insertItem( "&Help", helpMenu ); 1454 popupBarTB->insertItem( "&Help", helpMenu );
1449 if (QApplication::desktop()->width() > 320 ) { 1455 if (QApplication::desktop()->width() > 320 ) {
1450 // mViewManager->getFilterAction()->plug ( tb); 1456 // mViewManager->getFilterAction()->plug ( tb);
1451 } 1457 }
@@ -1483,9 +1489,9 @@ void KABCore::addActionsManually()
1483 mActionDelete->plug( editMenu ); 1489 mActionDelete->plug( editMenu );
1484 editMenu->insertSeparator(); 1490 editMenu->insertSeparator();
1485 mActionSelectAll->plug( editMenu ); 1491 mActionSelectAll->plug( editMenu );
1486 1492
1487 1493 mActionRemoveVoice->plug( changeMenu );
1488 // settings menu 1494 // settings menu
1489//US special menuentry to configure the addressbook resources. On KDE 1495//US special menuentry to configure the addressbook resources. On KDE
1490// you do that through the control center !!! 1496// you do that through the control center !!!
1491 mActionConfigResources->plug( settingsMenu ); 1497 mActionConfigResources->plug( settingsMenu );
@@ -1543,8 +1549,32 @@ void KABCore::addActionsManually()
1543*/ 1549*/
1544 1550
1545#endif //KAB_EMBEDDED 1551#endif //KAB_EMBEDDED
1546} 1552}
1553void KABCore::removeVoice()
1554{
1555 if ( KMessageBox::questionYesNo( this, i18n("After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as \"other\".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?") ) == KMessageBox::No )
1556 return;
1557 KABC::Addressee::List list = mViewManager->selectedAddressees();
1558 KABC::Addressee::List::Iterator it;
1559 for ( it = list.begin(); it != list.end(); ++it ) {
1560 PhoneNumber::List phoneNumbers = (*it).phoneNumbers();
1561 PhoneNumber::List::Iterator phoneIt;
1562 bool found = false;
1563 for ( phoneIt = phoneNumbers.begin(); phoneIt != phoneNumbers.end(); ++phoneIt ) {
1564 if ( (*phoneIt).type() & PhoneNumber::Voice) { // voice found
1565 if ((*phoneIt).type() - PhoneNumber::Voice ) {
1566 (*phoneIt).setType((*phoneIt).type() - PhoneNumber::Voice );
1567 (*it).insertPhoneNumber( (*phoneIt) );
1568 found = true;
1569 }
1570 }
1571
1572 }
1573 if ( found )
1574 contactModified((*it) );
1575 }
1576}
1547 1577
1548 1578
1549 1579
1550void KABCore::clipboardDataChanged() 1580void KABCore::clipboardDataChanged()
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h
index c823f1f..8d6041e 100644
--- a/kaddressbook/kabcore.h
+++ b/kaddressbook/kabcore.h
@@ -322,8 +322,9 @@ class KABCore : public QWidget
322 void extensionModified( const KABC::Addressee::List &list ); 322 void extensionModified( const KABC::Addressee::List &list );
323 void clipboardDataChanged(); 323 void clipboardDataChanged();
324 void updateActionMenu(); 324 void updateActionMenu();
325 void configureKeyBindings(); 325 void configureKeyBindings();
326 void removeVoice();
326#ifdef KAB_EMBEDDED 327#ifdef KAB_EMBEDDED
327 void configureResources(); 328 void configureResources();
328#endif //KAB_EMBEDDED 329#endif //KAB_EMBEDDED
329 330
@@ -399,12 +400,15 @@ class KABCore : public QWidget
399 400
400 QPopupMenu *viewMenu; 401 QPopupMenu *viewMenu;
401 QPopupMenu *filterMenu; 402 QPopupMenu *filterMenu;
402 QPopupMenu *settingsMenu; 403 QPopupMenu *settingsMenu;
404 QPopupMenu *changeMenu;
403 405
404//US QAction *mActionSave; 406//US QAction *mActionSave;
405 QPopupMenu *ImportMenu; 407 QPopupMenu *ImportMenu;
406 QPopupMenu *ExportMenu; 408 QPopupMenu *ExportMenu;
409 //LR additional methods
410 KAction *mActionRemoveVoice;
407 411
408#ifndef KAB_EMBEDDED 412#ifndef KAB_EMBEDDED
409 KAddressBookService *mAddressBookService; 413 KAddressBookService *mAddressBookService;
410#endif //KAB_EMBEDDED 414#endif //KAB_EMBEDDED