summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Unidiff
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index c4382d6..4c1d5da 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1462,769 +1462,769 @@ void KABCore::print()
1462 KPrinter printer; 1462 KPrinter printer;
1463 if ( !printer.setup( this ) ) 1463 if ( !printer.setup( this ) )
1464 return; 1464 return;
1465 1465
1466 KABPrinting::PrintingWizard wizard( &printer, mAddressBook, 1466 KABPrinting::PrintingWizard wizard( &printer, mAddressBook,
1467 mViewManager->selectedUids(), this ); 1467 mViewManager->selectedUids(), this );
1468 1468
1469 wizard.exec(); 1469 wizard.exec();
1470#else //KAB_EMBEDDED 1470#else //KAB_EMBEDDED
1471 qDebug("KABCore::print() finsih method"); 1471 qDebug("KABCore::print() finsih method");
1472#endif //KAB_EMBEDDED 1472#endif //KAB_EMBEDDED
1473 1473
1474} 1474}
1475 1475
1476 1476
1477void KABCore::addGUIClient( KXMLGUIClient *client ) 1477void KABCore::addGUIClient( KXMLGUIClient *client )
1478{ 1478{
1479 if ( mGUIClient ) 1479 if ( mGUIClient )
1480 mGUIClient->insertChildClient( client ); 1480 mGUIClient->insertChildClient( client );
1481 else 1481 else
1482 KMessageBox::error( this, "no KXMLGUICLient"); 1482 KMessageBox::error( this, "no KXMLGUICLient");
1483} 1483}
1484 1484
1485 1485
1486void KABCore::configurationChanged() 1486void KABCore::configurationChanged()
1487{ 1487{
1488 mExtensionManager->reconfigure(); 1488 mExtensionManager->reconfigure();
1489} 1489}
1490 1490
1491void KABCore::addressBookChanged() 1491void KABCore::addressBookChanged()
1492{ 1492{
1493/*US 1493/*US
1494 QDictIterator<AddresseeEditorDialog> it( mEditorDict ); 1494 QDictIterator<AddresseeEditorDialog> it( mEditorDict );
1495 while ( it.current() ) { 1495 while ( it.current() ) {
1496 if ( it.current()->dirty() ) { 1496 if ( it.current()->dirty() ) {
1497 QString text = i18n( "Data has been changed externally. Unsaved " 1497 QString text = i18n( "Data has been changed externally. Unsaved "
1498 "changes will be lost." ); 1498 "changes will be lost." );
1499 KMessageBox::information( this, text ); 1499 KMessageBox::information( this, text );
1500 } 1500 }
1501 it.current()->setAddressee( mAddressBook->findByUid( it.currentKey() ) ); 1501 it.current()->setAddressee( mAddressBook->findByUid( it.currentKey() ) );
1502 ++it; 1502 ++it;
1503 } 1503 }
1504*/ 1504*/
1505 if (mEditorDialog) 1505 if (mEditorDialog)
1506 { 1506 {
1507 if (mEditorDialog->dirty()) 1507 if (mEditorDialog->dirty())
1508 { 1508 {
1509 QString text = i18n( "Data has been changed externally. Unsaved " 1509 QString text = i18n( "Data has been changed externally. Unsaved "
1510 "changes will be lost." ); 1510 "changes will be lost." );
1511 KMessageBox::information( this, text ); 1511 KMessageBox::information( this, text );
1512 } 1512 }
1513 QString currentuid = mEditorDialog->addressee().uid(); 1513 QString currentuid = mEditorDialog->addressee().uid();
1514 mEditorDialog->setAddressee( mAddressBook->findByUid( currentuid ) ); 1514 mEditorDialog->setAddressee( mAddressBook->findByUid( currentuid ) );
1515 } 1515 }
1516 mViewManager->refreshView(); 1516 mViewManager->refreshView();
1517// mDetails->refreshView(); 1517// mDetails->refreshView();
1518 1518
1519 1519
1520} 1520}
1521 1521
1522AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent, 1522AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent,
1523 const char *name ) 1523 const char *name )
1524{ 1524{
1525 1525
1526 if ( mEditorDialog == 0 ) { 1526 if ( mEditorDialog == 0 ) {
1527 mEditorDialog = new AddresseeEditorDialog( this, parent, 1527 mEditorDialog = new AddresseeEditorDialog( this, parent,
1528 name ? name : "editorDialog" ); 1528 name ? name : "editorDialog" );
1529 1529
1530 1530
1531 connect( mEditorDialog, SIGNAL( contactModified( const KABC::Addressee& ) ), 1531 connect( mEditorDialog, SIGNAL( contactModified( const KABC::Addressee& ) ),
1532 SLOT( contactModified( const KABC::Addressee& ) ) ); 1532 SLOT( contactModified( const KABC::Addressee& ) ) );
1533 //connect( mEditorDialog, SIGNAL( editorDestroyed( const QString& ) ), 1533 //connect( mEditorDialog, SIGNAL( editorDestroyed( const QString& ) ),
1534 // SLOT( slotEditorDestroyed( const QString& ) ) ; 1534 // SLOT( slotEditorDestroyed( const QString& ) ) ;
1535 } 1535 }
1536 1536
1537 return mEditorDialog; 1537 return mEditorDialog;
1538} 1538}
1539 1539
1540void KABCore::slotEditorDestroyed( const QString &uid ) 1540void KABCore::slotEditorDestroyed( const QString &uid )
1541{ 1541{
1542 //mEditorDict.remove( uid ); 1542 //mEditorDict.remove( uid );
1543} 1543}
1544 1544
1545void KABCore::initGUI() 1545void KABCore::initGUI()
1546{ 1546{
1547#ifndef KAB_EMBEDDED 1547#ifndef KAB_EMBEDDED
1548 QHBoxLayout *topLayout = new QHBoxLayout( this ); 1548 QHBoxLayout *topLayout = new QHBoxLayout( this );
1549 topLayout->setSpacing( KDialogBase::spacingHint() ); 1549 topLayout->setSpacing( KDialogBase::spacingHint() );
1550 1550
1551 mExtensionBarSplitter = new QSplitter( this ); 1551 mExtensionBarSplitter = new QSplitter( this );
1552 mExtensionBarSplitter->setOrientation( Qt::Vertical ); 1552 mExtensionBarSplitter->setOrientation( Qt::Vertical );
1553 1553
1554 mDetailsSplitter = new QSplitter( mExtensionBarSplitter ); 1554 mDetailsSplitter = new QSplitter( mExtensionBarSplitter );
1555 1555
1556 QVBox *viewSpace = new QVBox( mDetailsSplitter ); 1556 QVBox *viewSpace = new QVBox( mDetailsSplitter );
1557 mIncSearchWidget = new IncSearchWidget( viewSpace ); 1557 mIncSearchWidget = new IncSearchWidget( viewSpace );
1558 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 1558 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
1559 SLOT( incrementalSearch( const QString& ) ) ); 1559 SLOT( incrementalSearch( const QString& ) ) );
1560 1560
1561 mViewManager = new ViewManager( this, viewSpace ); 1561 mViewManager = new ViewManager( this, viewSpace );
1562 viewSpace->setStretchFactor( mViewManager, 1 ); 1562 viewSpace->setStretchFactor( mViewManager, 1 );
1563 1563
1564 mDetails = new ViewContainer( mDetailsSplitter ); 1564 mDetails = new ViewContainer( mDetailsSplitter );
1565 1565
1566 mJumpButtonBar = new JumpButtonBar( this, this ); 1566 mJumpButtonBar = new JumpButtonBar( this, this );
1567 1567
1568 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); 1568 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter );
1569 1569
1570 topLayout->addWidget( mExtensionBarSplitter ); 1570 topLayout->addWidget( mExtensionBarSplitter );
1571 topLayout->setStretchFactor( mExtensionBarSplitter, 100 ); 1571 topLayout->setStretchFactor( mExtensionBarSplitter, 100 );
1572 topLayout->addWidget( mJumpButtonBar ); 1572 topLayout->addWidget( mJumpButtonBar );
1573 topLayout->setStretchFactor( mJumpButtonBar, 1 ); 1573 topLayout->setStretchFactor( mJumpButtonBar, 1 );
1574 1574
1575 mXXPortManager = new XXPortManager( this, this ); 1575 mXXPortManager = new XXPortManager( this, this );
1576 1576
1577#else //KAB_EMBEDDED 1577#else //KAB_EMBEDDED
1578 //US initialize viewMenu before settingup viewmanager. 1578 //US initialize viewMenu before settingup viewmanager.
1579 // Viewmanager needs this menu to plugin submenues. 1579 // Viewmanager needs this menu to plugin submenues.
1580 viewMenu = new QPopupMenu( this ); 1580 viewMenu = new QPopupMenu( this );
1581 settingsMenu = new QPopupMenu( this ); 1581 settingsMenu = new QPopupMenu( this );
1582 //filterMenu = new QPopupMenu( this ); 1582 //filterMenu = new QPopupMenu( this );
1583 ImportMenu = new QPopupMenu( this ); 1583 ImportMenu = new QPopupMenu( this );
1584 ExportMenu = new QPopupMenu( this ); 1584 ExportMenu = new QPopupMenu( this );
1585 syncMenu = new QPopupMenu( this ); 1585 syncMenu = new QPopupMenu( this );
1586 changeMenu= new QPopupMenu( this ); 1586 changeMenu= new QPopupMenu( this );
1587 1587
1588//US since we have no splitter for the embedded system, setup 1588//US since we have no splitter for the embedded system, setup
1589// a layout with two frames. One left and one right. 1589// a layout with two frames. One left and one right.
1590 1590
1591 QBoxLayout *topLayout; 1591 QBoxLayout *topLayout;
1592 1592
1593 // = new QHBoxLayout( this ); 1593 // = new QHBoxLayout( this );
1594// QBoxLayout *topLayout = (QBoxLayout*)layout(); 1594// QBoxLayout *topLayout = (QBoxLayout*)layout();
1595 1595
1596// QWidget *mainBox = new QWidget( this ); 1596// QWidget *mainBox = new QWidget( this );
1597// QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox); 1597// QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox);
1598 1598
1599#ifdef DESKTOP_VERSION 1599#ifdef DESKTOP_VERSION
1600 topLayout = new QHBoxLayout( this ); 1600 topLayout = new QHBoxLayout( this );
1601 1601
1602 1602
1603 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 1603 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
1604 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 1604 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
1605 1605
1606 topLayout->addWidget(mMiniSplitter ); 1606 topLayout->addWidget(mMiniSplitter );
1607 1607
1608 mExtensionBarSplitter = new KDGanttMinimizeSplitter( Qt::Vertical,mMiniSplitter ); 1608 mExtensionBarSplitter = new KDGanttMinimizeSplitter( Qt::Vertical,mMiniSplitter );
1609 mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); 1609 mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
1610 mViewManager = new ViewManager( this, mExtensionBarSplitter ); 1610 mViewManager = new ViewManager( this, mExtensionBarSplitter );
1611 mDetails = new ViewContainer( mMiniSplitter ); 1611 mDetails = new ViewContainer( mMiniSplitter );
1612 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); 1612 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter );
1613#else 1613#else
1614 if ( QApplication::desktop()->width() > 480 ) { 1614 if ( QApplication::desktop()->width() > 480 ) {
1615 topLayout = new QHBoxLayout( this ); 1615 topLayout = new QHBoxLayout( this );
1616 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 1616 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
1617 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 1617 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
1618 } else { 1618 } else {
1619 1619
1620 topLayout = new QHBoxLayout( this ); 1620 topLayout = new QHBoxLayout( this );
1621 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this); 1621 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this);
1622 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); 1622 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
1623 } 1623 }
1624 1624
1625 topLayout->addWidget(mMiniSplitter ); 1625 topLayout->addWidget(mMiniSplitter );
1626 mViewManager = new ViewManager( this, mMiniSplitter ); 1626 mViewManager = new ViewManager( this, mMiniSplitter );
1627 mDetails = new ViewContainer( mMiniSplitter ); 1627 mDetails = new ViewContainer( mMiniSplitter );
1628 1628
1629 1629
1630 mExtensionManager = new ExtensionManager( this, mMiniSplitter ); 1630 mExtensionManager = new ExtensionManager( this, mMiniSplitter );
1631#endif 1631#endif
1632 //eh->hide(); 1632 //eh->hide();
1633 // topLayout->addWidget(mExtensionManager ); 1633 // topLayout->addWidget(mExtensionManager );
1634 1634
1635 1635
1636/*US 1636/*US
1637#ifndef KAB_NOSPLITTER 1637#ifndef KAB_NOSPLITTER
1638 QHBoxLayout *topLayout = new QHBoxLayout( this ); 1638 QHBoxLayout *topLayout = new QHBoxLayout( this );
1639//US topLayout->setSpacing( KDialogBase::spacingHint() ); 1639//US topLayout->setSpacing( KDialogBase::spacingHint() );
1640 topLayout->setSpacing( 10 ); 1640 topLayout->setSpacing( 10 );
1641 1641
1642 mDetailsSplitter = new QSplitter( this ); 1642 mDetailsSplitter = new QSplitter( this );
1643 1643
1644 QVBox *viewSpace = new QVBox( mDetailsSplitter ); 1644 QVBox *viewSpace = new QVBox( mDetailsSplitter );
1645 1645
1646 mViewManager = new ViewManager( this, viewSpace ); 1646 mViewManager = new ViewManager( this, viewSpace );
1647 viewSpace->setStretchFactor( mViewManager, 1 ); 1647 viewSpace->setStretchFactor( mViewManager, 1 );
1648 1648
1649 mDetails = new ViewContainer( mDetailsSplitter ); 1649 mDetails = new ViewContainer( mDetailsSplitter );
1650 1650
1651 topLayout->addWidget( mDetailsSplitter ); 1651 topLayout->addWidget( mDetailsSplitter );
1652 topLayout->setStretchFactor( mDetailsSplitter, 100 ); 1652 topLayout->setStretchFactor( mDetailsSplitter, 100 );
1653#else //KAB_NOSPLITTER 1653#else //KAB_NOSPLITTER
1654 QHBoxLayout *topLayout = new QHBoxLayout( this ); 1654 QHBoxLayout *topLayout = new QHBoxLayout( this );
1655//US topLayout->setSpacing( KDialogBase::spacingHint() ); 1655//US topLayout->setSpacing( KDialogBase::spacingHint() );
1656 topLayout->setSpacing( 10 ); 1656 topLayout->setSpacing( 10 );
1657 1657
1658// mDetailsSplitter = new QSplitter( this ); 1658// mDetailsSplitter = new QSplitter( this );
1659 1659
1660 QVBox *viewSpace = new QVBox( this ); 1660 QVBox *viewSpace = new QVBox( this );
1661 1661
1662 mViewManager = new ViewManager( this, viewSpace ); 1662 mViewManager = new ViewManager( this, viewSpace );
1663 viewSpace->setStretchFactor( mViewManager, 1 ); 1663 viewSpace->setStretchFactor( mViewManager, 1 );
1664 1664
1665 mDetails = new ViewContainer( this ); 1665 mDetails = new ViewContainer( this );
1666 1666
1667 topLayout->addWidget( viewSpace ); 1667 topLayout->addWidget( viewSpace );
1668// topLayout->setStretchFactor( mDetailsSplitter, 100 ); 1668// topLayout->setStretchFactor( mDetailsSplitter, 100 );
1669 topLayout->addWidget( mDetails ); 1669 topLayout->addWidget( mDetails );
1670#endif //KAB_NOSPLITTER 1670#endif //KAB_NOSPLITTER
1671*/ 1671*/
1672 1672
1673 syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); 1673 syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu);
1674 syncManager->setBlockSave(false); 1674 syncManager->setBlockSave(false);
1675 1675
1676 connect(syncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); 1676 connect(syncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) );
1677 connect(syncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); 1677 connect(syncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) );
1678 syncManager->setDefaultFileName( sentSyncFile()); 1678 syncManager->setDefaultFileName( sentSyncFile());
1679 //connect(syncManager , SIGNAL( ), this, SLOT( ) ); 1679 //connect(syncManager , SIGNAL( ), this, SLOT( ) );
1680 1680
1681#endif //KAB_EMBEDDED 1681#endif //KAB_EMBEDDED
1682 initActions(); 1682 initActions();
1683 1683
1684#ifdef KAB_EMBEDDED 1684#ifdef KAB_EMBEDDED
1685 addActionsManually(); 1685 addActionsManually();
1686 //US make sure the export and import menues are initialized before creating the xxPortManager. 1686 //US make sure the export and import menues are initialized before creating the xxPortManager.
1687 mXXPortManager = new XXPortManager( this, this ); 1687 mXXPortManager = new XXPortManager( this, this );
1688 1688
1689 // LR mIncSearchWidget = new IncSearchWidget( mMainWindow->getIconToolBar() ); 1689 // LR mIncSearchWidget = new IncSearchWidget( mMainWindow->getIconToolBar() );
1690 //mMainWindow->toolBar()->insertWidget(-1, 4, mIncSearchWidget); 1690 //mMainWindow->toolBar()->insertWidget(-1, 4, mIncSearchWidget);
1691 // mActionQuit->plug ( mMainWindow->toolBar()); 1691 // mActionQuit->plug ( mMainWindow->toolBar());
1692 //mIncSearchWidget = new IncSearchWidget( mMainWindow->toolBar() ); 1692 //mIncSearchWidget = new IncSearchWidget( mMainWindow->toolBar() );
1693 //mMainWindow->toolBar()->insertWidget(-1, 0, mIncSearchWidget); 1693 //mMainWindow->toolBar()->insertWidget(-1, 0, mIncSearchWidget);
1694 // mIncSearchWidget->hide(); 1694 // mIncSearchWidget->hide();
1695 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 1695 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
1696 SLOT( incrementalSearch( const QString& ) ) ); 1696 SLOT( incrementalSearch( const QString& ) ) );
1697 connect( mIncSearchWidget, SIGNAL( scrollUP() ),mViewManager, SLOT( scrollUP() ) ); 1697 connect( mIncSearchWidget, SIGNAL( scrollUP() ),mViewManager, SLOT( scrollUP() ) );
1698 connect( mIncSearchWidget, SIGNAL( scrollDOWN() ),mViewManager, SLOT( scrollDOWN() ) ); 1698 connect( mIncSearchWidget, SIGNAL( scrollDOWN() ),mViewManager, SLOT( scrollDOWN() ) );
1699 1699
1700 mJumpButtonBar = new JumpButtonBar( this, this ); 1700 mJumpButtonBar = new JumpButtonBar( this, this );
1701 1701
1702 topLayout->addWidget( mJumpButtonBar ); 1702 topLayout->addWidget( mJumpButtonBar );
1703//US topLayout->setStretchFactor( mJumpButtonBar, 10 ); 1703//US topLayout->setStretchFactor( mJumpButtonBar, 10 );
1704 1704
1705// mMainWindow->getIconToolBar()->raise(); 1705// mMainWindow->getIconToolBar()->raise();
1706 1706
1707#endif //KAB_EMBEDDED 1707#endif //KAB_EMBEDDED
1708 1708
1709} 1709}
1710void KABCore::initActions() 1710void KABCore::initActions()
1711{ 1711{
1712//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); 1712//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart);
1713 1713
1714#ifndef KAB_EMBEDDED 1714#ifndef KAB_EMBEDDED
1715 connect( QApplication::clipboard(), SIGNAL( dataChanged() ), 1715 connect( QApplication::clipboard(), SIGNAL( dataChanged() ),
1716 SLOT( clipboardDataChanged() ) ); 1716 SLOT( clipboardDataChanged() ) );
1717#endif //KAB_EMBEDDED 1717#endif //KAB_EMBEDDED
1718 1718
1719 // file menu 1719 // file menu
1720 if ( mIsPart ) { 1720 if ( mIsPart ) {
1721 mActionMail = new KAction( i18n( "&Mail" ), "mail_generic", 0, this, 1721 mActionMail = new KAction( i18n( "&Mail" ), "mail_generic", 0, this,
1722 SLOT( sendMail() ), actionCollection(), 1722 SLOT( sendMail() ), actionCollection(),
1723 "kaddressbook_mail" ); 1723 "kaddressbook_mail" );
1724 mActionPrint = new KAction( i18n( "&Print" ), "fileprint", CTRL + Key_P, this, 1724 mActionPrint = new KAction( i18n( "&Print" ), "fileprint", CTRL + Key_P, this,
1725 SLOT( print() ), actionCollection(), "kaddressbook_print" ); 1725 SLOT( print() ), actionCollection(), "kaddressbook_print" );
1726 1726
1727 } else { 1727 } else {
1728 mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() ); 1728 mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() );
1729 mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() ); 1729 mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() );
1730 } 1730 }
1731 1731
1732 1732
1733 mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this, 1733 mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this,
1734 SLOT( save() ), actionCollection(), "file_sync" ); 1734 SLOT( save() ), actionCollection(), "file_sync" );
1735 1735
1736 mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this, 1736 mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this,
1737 SLOT( newContact() ), actionCollection(), "file_new_contact" ); 1737 SLOT( newContact() ), actionCollection(), "file_new_contact" );
1738 1738
1739 mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0, 1739 mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0,
1740 this, SLOT( mailVCard() ), 1740 this, SLOT( mailVCard() ),
1741 actionCollection(), "file_mail_vcard"); 1741 actionCollection(), "file_mail_vcard");
1742 1742
1743 mActionExport2phone = new KAction( i18n( "Selected to phone" ), "ex2phone", 0, this, 1743 mActionExport2phone = new KAction( i18n( "Selected to phone" ), "ex2phone", 0, this,
1744 SLOT( export2phone() ), actionCollection(), 1744 SLOT( export2phone() ), actionCollection(),
1745 "kaddressbook_ex2phone" ); 1745 "kaddressbook_ex2phone" );
1746 1746
1747 mActionBeamVCard = 0; 1747 mActionBeamVCard = 0;
1748 mActionBeam = 0; 1748 mActionBeam = 0;
1749 1749
1750#ifndef DESKTOP_VERSION 1750#ifndef DESKTOP_VERSION
1751 if ( Ir::supported() ) { 1751 if ( Ir::supported() ) {
1752 mActionBeamVCard = new KAction( i18n( "Beam selected v&Card(s)" ), "beam", 0, this, 1752 mActionBeamVCard = new KAction( i18n( "Beam selected v&Card(s)" ), "beam", 0, this,
1753 SLOT( beamVCard() ), actionCollection(), 1753 SLOT( beamVCard() ), actionCollection(),
1754 "kaddressbook_beam_vcard" ); 1754 "kaddressbook_beam_vcard" );
1755 1755
1756 mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this, 1756 mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this,
1757 SLOT( beamMySelf() ), actionCollection(), 1757 SLOT( beamMySelf() ), actionCollection(),
1758 "kaddressbook_beam_myself" ); 1758 "kaddressbook_beam_myself" );
1759 } 1759 }
1760#endif 1760#endif
1761 1761
1762 mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0, 1762 mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0,
1763 this, SLOT( editContact2() ), 1763 this, SLOT( editContact2() ),
1764 actionCollection(), "file_properties" ); 1764 actionCollection(), "file_properties" );
1765 1765
1766#ifdef KAB_EMBEDDED 1766#ifdef KAB_EMBEDDED
1767 // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() ); 1767 // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() );
1768 mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0, 1768 mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0,
1769 mMainWindow, SLOT( exit() ), 1769 mMainWindow, SLOT( exit() ),
1770 actionCollection(), "quit" ); 1770 actionCollection(), "quit" );
1771#endif //KAB_EMBEDDED 1771#endif //KAB_EMBEDDED
1772 1772
1773 // edit menu 1773 // edit menu
1774 if ( mIsPart ) { 1774 if ( mIsPart ) {
1775 mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this, 1775 mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this,
1776 SLOT( copyContacts() ), actionCollection(), 1776 SLOT( copyContacts() ), actionCollection(),
1777 "kaddressbook_copy" ); 1777 "kaddressbook_copy" );
1778 mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this, 1778 mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this,
1779 SLOT( cutContacts() ), actionCollection(), 1779 SLOT( cutContacts() ), actionCollection(),
1780 "kaddressbook_cut" ); 1780 "kaddressbook_cut" );
1781 mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this, 1781 mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this,
1782 SLOT( pasteContacts() ), actionCollection(), 1782 SLOT( pasteContacts() ), actionCollection(),
1783 "kaddressbook_paste" ); 1783 "kaddressbook_paste" );
1784 mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this, 1784 mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this,
1785 SLOT( selectAllContacts() ), actionCollection(), 1785 SLOT( selectAllContacts() ), actionCollection(),
1786 "kaddressbook_select_all" ); 1786 "kaddressbook_select_all" );
1787 mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this, 1787 mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this,
1788 SLOT( undo() ), actionCollection(), 1788 SLOT( undo() ), actionCollection(),
1789 "kaddressbook_undo" ); 1789 "kaddressbook_undo" );
1790 mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z, 1790 mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z,
1791 this, SLOT( redo() ), actionCollection(), 1791 this, SLOT( redo() ), actionCollection(),
1792 "kaddressbook_redo" ); 1792 "kaddressbook_redo" );
1793 } else { 1793 } else {
1794 mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() ); 1794 mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() );
1795 mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() ); 1795 mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() );
1796 mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() ); 1796 mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() );
1797 mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() ); 1797 mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() );
1798 mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() ); 1798 mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() );
1799 mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() ); 1799 mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() );
1800 } 1800 }
1801 1801
1802 mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete", 1802 mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete",
1803 Key_Delete, this, SLOT( deleteContacts() ), 1803 Key_Delete, this, SLOT( deleteContacts() ),
1804 actionCollection(), "edit_delete" ); 1804 actionCollection(), "edit_delete" );
1805 1805
1806 mActionUndo->setEnabled( false ); 1806 mActionUndo->setEnabled( false );
1807 mActionRedo->setEnabled( false ); 1807 mActionRedo->setEnabled( false );
1808 1808
1809 // settings menu 1809 // settings menu
1810#ifdef KAB_EMBEDDED 1810#ifdef KAB_EMBEDDED
1811//US special menuentry to configure the addressbook resources. On KDE 1811//US special menuentry to configure the addressbook resources. On KDE
1812// you do that through the control center !!! 1812// you do that through the control center !!!
1813 mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this, 1813 mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this,
1814 SLOT( configureResources() ), actionCollection(), 1814 SLOT( configureResources() ), actionCollection(),
1815 "kaddressbook_configure_resources" ); 1815 "kaddressbook_configure_resources" );
1816#endif //KAB_EMBEDDED 1816#endif //KAB_EMBEDDED
1817 1817
1818 if ( mIsPart ) { 1818 if ( mIsPart ) {
1819 mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this, 1819 mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this,
1820 SLOT( openConfigDialog() ), actionCollection(), 1820 SLOT( openConfigDialog() ), actionCollection(),
1821 "kaddressbook_configure" ); 1821 "kaddressbook_configure" );
1822 1822
1823 mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0, 1823 mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0,
1824 this, SLOT( configureKeyBindings() ), actionCollection(), 1824 this, SLOT( configureKeyBindings() ), actionCollection(),
1825 "kaddressbook_configure_shortcuts" ); 1825 "kaddressbook_configure_shortcuts" );
1826#ifdef KAB_EMBEDDED 1826#ifdef KAB_EMBEDDED
1827 mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() ); 1827 mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() );
1828 mActionConfigureToolbars->setEnabled( false ); 1828 mActionConfigureToolbars->setEnabled( false );
1829#endif //KAB_EMBEDDED 1829#endif //KAB_EMBEDDED
1830 1830
1831 } else { 1831 } else {
1832 mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() ); 1832 mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() );
1833 1833
1834 mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); 1834 mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() );
1835 } 1835 }
1836 1836
1837 mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, 1837 mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0,
1838 actionCollection(), "options_show_jump_bar" ); 1838 actionCollection(), "options_show_jump_bar" );
1839 connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) ); 1839 connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) );
1840 1840
1841 mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0, 1841 mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0,
1842 actionCollection(), "options_show_details" ); 1842 actionCollection(), "options_show_details" );
1843 connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); 1843 connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) );
1844 1844
1845 1845
1846 mActionBR = new KToggleAction( i18n( "Beam receice enabled" ), "beam", 0, this, 1846 mActionBR = new KToggleAction( i18n( "Beam receive enabled" ), "beam", 0, this,
1847 SLOT( toggleBeamReceive() ), actionCollection(), 1847 SLOT( toggleBeamReceive() ), actionCollection(),
1848 "kaddressbook_beam_rec" ); 1848 "kaddressbook_beam_rec" );
1849 1849
1850 1850
1851 // misc 1851 // misc
1852 // only enable LDAP lookup if we can handle the protocol 1852 // only enable LDAP lookup if we can handle the protocol
1853#ifndef KAB_EMBEDDED 1853#ifndef KAB_EMBEDDED
1854 if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) { 1854 if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) {
1855 new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0, 1855 new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0,
1856 this, SLOT( openLDAPDialog() ), actionCollection(), 1856 this, SLOT( openLDAPDialog() ), actionCollection(),
1857 "ldap_lookup" ); 1857 "ldap_lookup" );
1858 } 1858 }
1859#else //KAB_EMBEDDED 1859#else //KAB_EMBEDDED
1860 //qDebug("KABCore::initActions() LDAP has to be implemented"); 1860 //qDebug("KABCore::initActions() LDAP has to be implemented");
1861#endif //KAB_EMBEDDED 1861#endif //KAB_EMBEDDED
1862 1862
1863 1863
1864 mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, 1864 mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this,
1865 SLOT( setWhoAmI() ), actionCollection(), 1865 SLOT( setWhoAmI() ), actionCollection(),
1866 "set_personal" ); 1866 "set_personal" );
1867 1867
1868 1868
1869 1869
1870 1870
1871 mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, 1871 mActionCategories = new KAction( i18n( "Set Categories" ), 0, this,
1872 SLOT( setCategories() ), actionCollection(), 1872 SLOT( setCategories() ), actionCollection(),
1873 "edit_set_categories" ); 1873 "edit_set_categories" );
1874 1874
1875 mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, 1875 mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this,
1876 SLOT( removeVoice() ), actionCollection(), 1876 SLOT( removeVoice() ), actionCollection(),
1877 "remove_voice" ); 1877 "remove_voice" );
1878 mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this, 1878 mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this,
1879 SLOT( importFromOL() ), actionCollection(), 1879 SLOT( importFromOL() ), actionCollection(),
1880 "import_OL" ); 1880 "import_OL" );
1881#ifdef KAB_EMBEDDED 1881#ifdef KAB_EMBEDDED
1882 mActionLicence = new KAction( i18n( "Licence" ), 0, 1882 mActionLicence = new KAction( i18n( "Licence" ), 0,
1883 this, SLOT( showLicence() ), actionCollection(), 1883 this, SLOT( showLicence() ), actionCollection(),
1884 "licence_about_data" ); 1884 "licence_about_data" );
1885 mActionFaq = new KAction( i18n( "Faq" ), 0, 1885 mActionFaq = new KAction( i18n( "Faq" ), 0,
1886 this, SLOT( faq() ), actionCollection(), 1886 this, SLOT( faq() ), actionCollection(),
1887 "faq_about_data" ); 1887 "faq_about_data" );
1888 mActionWN = new KAction( i18n( "What's New?" ), 0, 1888 mActionWN = new KAction( i18n( "What's New?" ), 0,
1889 this, SLOT( whatsnew() ), actionCollection(), 1889 this, SLOT( whatsnew() ), actionCollection(),
1890 "wn" ); 1890 "wn" );
1891 mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0, 1891 mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0,
1892 this, SLOT( synchowto() ), actionCollection(), 1892 this, SLOT( synchowto() ), actionCollection(),
1893 "sync" ); 1893 "sync" );
1894 1894
1895 mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, 1895 mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0,
1896 this, SLOT( createAboutData() ), actionCollection(), 1896 this, SLOT( createAboutData() ), actionCollection(),
1897 "kaddressbook_about_data" ); 1897 "kaddressbook_about_data" );
1898#endif //KAB_EMBEDDED 1898#endif //KAB_EMBEDDED
1899 1899
1900 clipboardDataChanged(); 1900 clipboardDataChanged();
1901 connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); 1901 connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) );
1902 connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); 1902 connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) );
1903} 1903}
1904 1904
1905//US we need this function, to plug all actions into the correct menues. 1905//US we need this function, to plug all actions into the correct menues.
1906// KDE uses a XML format to plug the actions, but we work her without this overhead. 1906// KDE uses a XML format to plug the actions, but we work her without this overhead.
1907void KABCore::addActionsManually() 1907void KABCore::addActionsManually()
1908{ 1908{
1909//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); 1909//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart);
1910 1910
1911#ifdef KAB_EMBEDDED 1911#ifdef KAB_EMBEDDED
1912 QPopupMenu *fileMenu = new QPopupMenu( this ); 1912 QPopupMenu *fileMenu = new QPopupMenu( this );
1913 QPopupMenu *editMenu = new QPopupMenu( this ); 1913 QPopupMenu *editMenu = new QPopupMenu( this );
1914 QPopupMenu *helpMenu = new QPopupMenu( this ); 1914 QPopupMenu *helpMenu = new QPopupMenu( this );
1915 1915
1916 KToolBar* tb = mMainWindow->toolBar(); 1916 KToolBar* tb = mMainWindow->toolBar();
1917 1917
1918#ifdef DESKTOP_VERSION 1918#ifdef DESKTOP_VERSION
1919 QMenuBar* mb = mMainWindow->menuBar(); 1919 QMenuBar* mb = mMainWindow->menuBar();
1920 1920
1921 //US setup menubar. 1921 //US setup menubar.
1922 //Disable the following block if you do not want to have a menubar. 1922 //Disable the following block if you do not want to have a menubar.
1923 mb->insertItem( "&File", fileMenu ); 1923 mb->insertItem( "&File", fileMenu );
1924 mb->insertItem( "&Edit", editMenu ); 1924 mb->insertItem( "&Edit", editMenu );
1925 mb->insertItem( "&View", viewMenu ); 1925 mb->insertItem( "&View", viewMenu );
1926 mb->insertItem( "&Settings", settingsMenu ); 1926 mb->insertItem( "&Settings", settingsMenu );
1927 mb->insertItem( i18n("Synchronize"), syncMenu ); 1927 mb->insertItem( i18n("Synchronize"), syncMenu );
1928 mb->insertItem( "&Change selected", changeMenu ); 1928 mb->insertItem( "&Change selected", changeMenu );
1929 mb->insertItem( "&Help", helpMenu ); 1929 mb->insertItem( "&Help", helpMenu );
1930 mIncSearchWidget = new IncSearchWidget( tb ); 1930 mIncSearchWidget = new IncSearchWidget( tb );
1931 // tb->insertWidget(-1, 0, mIncSearchWidget); 1931 // tb->insertWidget(-1, 0, mIncSearchWidget);
1932 1932
1933#else 1933#else
1934 //US setup toolbar 1934 //US setup toolbar
1935 QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); 1935 QPEMenuBar *menuBarTB = new QPEMenuBar( tb );
1936 QPopupMenu *popupBarTB = new QPopupMenu( this ); 1936 QPopupMenu *popupBarTB = new QPopupMenu( this );
1937 menuBarTB->insertItem( "ME", popupBarTB); 1937 menuBarTB->insertItem( "ME", popupBarTB);
1938 tb->insertWidget(-1, 0, menuBarTB); 1938 tb->insertWidget(-1, 0, menuBarTB);
1939 mIncSearchWidget = new IncSearchWidget( tb ); 1939 mIncSearchWidget = new IncSearchWidget( tb );
1940 1940
1941 tb->enableMoving(false); 1941 tb->enableMoving(false);
1942 popupBarTB->insertItem( "&File", fileMenu ); 1942 popupBarTB->insertItem( "&File", fileMenu );
1943 popupBarTB->insertItem( "&Edit", editMenu ); 1943 popupBarTB->insertItem( "&Edit", editMenu );
1944 popupBarTB->insertItem( "&View", viewMenu ); 1944 popupBarTB->insertItem( "&View", viewMenu );
1945 popupBarTB->insertItem( "&Settings", settingsMenu ); 1945 popupBarTB->insertItem( "&Settings", settingsMenu );
1946 popupBarTB->insertItem( i18n("Synchronize"), syncMenu ); 1946 popupBarTB->insertItem( i18n("Synchronize"), syncMenu );
1947 mViewManager->getFilterAction()->plug ( popupBarTB); 1947 mViewManager->getFilterAction()->plug ( popupBarTB);
1948 popupBarTB->insertItem( "&Change selected", changeMenu ); 1948 popupBarTB->insertItem( "&Change selected", changeMenu );
1949 popupBarTB->insertItem( "&Help", helpMenu ); 1949 popupBarTB->insertItem( "&Help", helpMenu );
1950 if (QApplication::desktop()->width() > 320 ) { 1950 if (QApplication::desktop()->width() > 320 ) {
1951 // mViewManager->getFilterAction()->plug ( tb); 1951 // mViewManager->getFilterAction()->plug ( tb);
1952 } 1952 }
1953#endif 1953#endif
1954 // mActionQuit->plug ( mMainWindow->toolBar()); 1954 // mActionQuit->plug ( mMainWindow->toolBar());
1955 1955
1956 1956
1957 1957
1958 //US Now connect the actions with the menue entries. 1958 //US Now connect the actions with the menue entries.
1959 mActionPrint->plug( fileMenu ); 1959 mActionPrint->plug( fileMenu );
1960 mActionMail->plug( fileMenu ); 1960 mActionMail->plug( fileMenu );
1961 fileMenu->insertSeparator(); 1961 fileMenu->insertSeparator();
1962 1962
1963 mActionNewContact->plug( fileMenu ); 1963 mActionNewContact->plug( fileMenu );
1964 mActionNewContact->plug( tb ); 1964 mActionNewContact->plug( tb );
1965 1965
1966 mActionEditAddressee->plug( fileMenu ); 1966 mActionEditAddressee->plug( fileMenu );
1967 if ((KGlobal::getDesktopSize() > KGlobal::Small ) || 1967 if ((KGlobal::getDesktopSize() > KGlobal::Small ) ||
1968 (!KABPrefs::instance()->mMultipleViewsAtOnce )) 1968 (!KABPrefs::instance()->mMultipleViewsAtOnce ))
1969 mActionEditAddressee->plug( tb ); 1969 mActionEditAddressee->plug( tb );
1970 1970
1971 fileMenu->insertSeparator(); 1971 fileMenu->insertSeparator();
1972 mActionSave->plug( fileMenu ); 1972 mActionSave->plug( fileMenu );
1973 fileMenu->insertItem( "&Import", ImportMenu ); 1973 fileMenu->insertItem( "&Import", ImportMenu );
1974 fileMenu->insertItem( "&Export", ExportMenu ); 1974 fileMenu->insertItem( "&Export", ExportMenu );
1975 fileMenu->insertSeparator(); 1975 fileMenu->insertSeparator();
1976 mActionMailVCard->plug( fileMenu ); 1976 mActionMailVCard->plug( fileMenu );
1977#ifndef DESKTOP_VERSION 1977#ifndef DESKTOP_VERSION
1978 if ( Ir::supported() ) mActionBeamVCard->plug( fileMenu ); 1978 if ( Ir::supported() ) mActionBeamVCard->plug( fileMenu );
1979 if ( Ir::supported() ) mActionBeam->plug(fileMenu ); 1979 if ( Ir::supported() ) mActionBeam->plug(fileMenu );
1980#endif 1980#endif
1981 fileMenu->insertSeparator(); 1981 fileMenu->insertSeparator();
1982 mActionQuit->plug( fileMenu ); 1982 mActionQuit->plug( fileMenu );
1983#ifdef _WIN32_ 1983#ifdef _WIN32_
1984 mActionImportOL->plug( ImportMenu ); 1984 mActionImportOL->plug( ImportMenu );
1985#endif 1985#endif
1986 // edit menu 1986 // edit menu
1987 mActionUndo->plug( editMenu ); 1987 mActionUndo->plug( editMenu );
1988 mActionRedo->plug( editMenu ); 1988 mActionRedo->plug( editMenu );
1989 editMenu->insertSeparator(); 1989 editMenu->insertSeparator();
1990 mActionCut->plug( editMenu ); 1990 mActionCut->plug( editMenu );
1991 mActionCopy->plug( editMenu ); 1991 mActionCopy->plug( editMenu );
1992 mActionPaste->plug( editMenu ); 1992 mActionPaste->plug( editMenu );
1993 mActionDelete->plug( editMenu ); 1993 mActionDelete->plug( editMenu );
1994 editMenu->insertSeparator(); 1994 editMenu->insertSeparator();
1995 mActionSelectAll->plug( editMenu ); 1995 mActionSelectAll->plug( editMenu );
1996 1996
1997 mActionRemoveVoice->plug( changeMenu ); 1997 mActionRemoveVoice->plug( changeMenu );
1998 // settings menu 1998 // settings menu
1999//US special menuentry to configure the addressbook resources. On KDE 1999//US special menuentry to configure the addressbook resources. On KDE
2000// you do that through the control center !!! 2000// you do that through the control center !!!
2001 mActionConfigResources->plug( settingsMenu ); 2001 mActionConfigResources->plug( settingsMenu );
2002 settingsMenu->insertSeparator(); 2002 settingsMenu->insertSeparator();
2003 2003
2004 mActionConfigKAddressbook->plug( settingsMenu ); 2004 mActionConfigKAddressbook->plug( settingsMenu );
2005 2005
2006 if ( mIsPart ) { 2006 if ( mIsPart ) {
2007 mActionConfigShortcuts->plug( settingsMenu ); 2007 mActionConfigShortcuts->plug( settingsMenu );
2008 mActionConfigureToolbars->plug( settingsMenu ); 2008 mActionConfigureToolbars->plug( settingsMenu );
2009 2009
2010 } else { 2010 } else {
2011 mActionKeyBindings->plug( settingsMenu ); 2011 mActionKeyBindings->plug( settingsMenu );
2012 } 2012 }
2013 2013
2014 settingsMenu->insertSeparator(); 2014 settingsMenu->insertSeparator();
2015 2015
2016 mActionJumpBar->plug( settingsMenu ); 2016 mActionJumpBar->plug( settingsMenu );
2017 mActionDetails->plug( settingsMenu ); 2017 mActionDetails->plug( settingsMenu );
2018 if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) 2018 if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop )
2019 mActionDetails->plug( tb ); 2019 mActionDetails->plug( tb );
2020 settingsMenu->insertSeparator(); 2020 settingsMenu->insertSeparator();
2021 mActionBR->plug(settingsMenu ); 2021 mActionBR->plug(settingsMenu );
2022 settingsMenu->insertSeparator(); 2022 settingsMenu->insertSeparator();
2023 2023
2024 mActionWhoAmI->plug( settingsMenu ); 2024 mActionWhoAmI->plug( settingsMenu );
2025 mActionCategories->plug( settingsMenu ); 2025 mActionCategories->plug( settingsMenu );
2026 2026
2027 2027
2028 mActionWN->plug( helpMenu ); 2028 mActionWN->plug( helpMenu );
2029 mActionSyncHowto->plug( helpMenu ); 2029 mActionSyncHowto->plug( helpMenu );
2030 mActionLicence->plug( helpMenu ); 2030 mActionLicence->plug( helpMenu );
2031 mActionFaq->plug( helpMenu ); 2031 mActionFaq->plug( helpMenu );
2032 mActionAboutKAddressbook->plug( helpMenu ); 2032 mActionAboutKAddressbook->plug( helpMenu );
2033 2033
2034 if (KGlobal::getDesktopSize() > KGlobal::Small ) { 2034 if (KGlobal::getDesktopSize() > KGlobal::Small ) {
2035 2035
2036 mActionSave->plug( tb ); 2036 mActionSave->plug( tb );
2037 mViewManager->getFilterAction()->plug ( tb); 2037 mViewManager->getFilterAction()->plug ( tb);
2038 if (KGlobal::getDesktopSize() == KGlobal::Desktop ) { 2038 if (KGlobal::getDesktopSize() == KGlobal::Desktop ) {
2039 mActionUndo->plug( tb ); 2039 mActionUndo->plug( tb );
2040 mActionDelete->plug( tb ); 2040 mActionDelete->plug( tb );
2041 mActionRedo->plug( tb ); 2041 mActionRedo->plug( tb );
2042 } 2042 }
2043 } 2043 }
2044 //mActionQuit->plug ( tb ); 2044 //mActionQuit->plug ( tb );
2045 // tb->insertWidget(-1, 0, mIncSearchWidget, 6); 2045 // tb->insertWidget(-1, 0, mIncSearchWidget, 6);
2046 2046
2047 //US link the searchwidget first to this. 2047 //US link the searchwidget first to this.
2048 // The real linkage to the toolbar happens later. 2048 // The real linkage to the toolbar happens later.
2049//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); 2049//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE);
2050//US tb->insertItem( mIncSearchWidget ); 2050//US tb->insertItem( mIncSearchWidget );
2051/*US 2051/*US
2052 mIncSearchWidget = new IncSearchWidget( tb ); 2052 mIncSearchWidget = new IncSearchWidget( tb );
2053 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 2053 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
2054 SLOT( incrementalSearch( const QString& ) ) ); 2054 SLOT( incrementalSearch( const QString& ) ) );
2055 2055
2056 mJumpButtonBar = new JumpButtonBar( this, this ); 2056 mJumpButtonBar = new JumpButtonBar( this, this );
2057 2057
2058//US topLayout->addWidget( mJumpButtonBar ); 2058//US topLayout->addWidget( mJumpButtonBar );
2059 this->layout()->add( mJumpButtonBar ); 2059 this->layout()->add( mJumpButtonBar );
2060*/ 2060*/
2061 2061
2062#endif //KAB_EMBEDDED 2062#endif //KAB_EMBEDDED
2063 2063
2064 mActionExport2phone->plug( ExportMenu ); 2064 mActionExport2phone->plug( ExportMenu );
2065 connect ( syncMenu, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) ); 2065 connect ( syncMenu, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) );
2066 syncManager->fillSyncMenu(); 2066 syncManager->fillSyncMenu();
2067 2067
2068} 2068}
2069void KABCore::showLicence() 2069void KABCore::showLicence()
2070{ 2070{
2071 KApplication::showLicence(); 2071 KApplication::showLicence();
2072} 2072}
2073void KABCore::removeVoice() 2073void KABCore::removeVoice()
2074{ 2074{
2075 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 ) 2075 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 )
2076 return; 2076 return;
2077 KABC::Addressee::List list = mViewManager->selectedAddressees(); 2077 KABC::Addressee::List list = mViewManager->selectedAddressees();
2078 KABC::Addressee::List::Iterator it; 2078 KABC::Addressee::List::Iterator it;
2079 for ( it = list.begin(); it != list.end(); ++it ) { 2079 for ( it = list.begin(); it != list.end(); ++it ) {
2080 2080
2081 if ( (*it).removeVoice() ) 2081 if ( (*it).removeVoice() )
2082 contactModified((*it) ); 2082 contactModified((*it) );
2083 } 2083 }
2084} 2084}
2085 2085
2086 2086
2087 2087
2088void KABCore::clipboardDataChanged() 2088void KABCore::clipboardDataChanged()
2089{ 2089{
2090 2090
2091 if ( mReadWrite ) 2091 if ( mReadWrite )
2092 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); 2092 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() );
2093 2093
2094} 2094}
2095 2095
2096void KABCore::updateActionMenu() 2096void KABCore::updateActionMenu()
2097{ 2097{
2098 UndoStack *undo = UndoStack::instance(); 2098 UndoStack *undo = UndoStack::instance();
2099 RedoStack *redo = RedoStack::instance(); 2099 RedoStack *redo = RedoStack::instance();
2100 2100
2101 if ( undo->isEmpty() ) 2101 if ( undo->isEmpty() )
2102 mActionUndo->setText( i18n( "Undo" ) ); 2102 mActionUndo->setText( i18n( "Undo" ) );
2103 else 2103 else
2104 mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); 2104 mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) );
2105 2105
2106 mActionUndo->setEnabled( !undo->isEmpty() ); 2106 mActionUndo->setEnabled( !undo->isEmpty() );
2107 2107
2108 if ( !redo->top() ) 2108 if ( !redo->top() )
2109 mActionRedo->setText( i18n( "Redo" ) ); 2109 mActionRedo->setText( i18n( "Redo" ) );
2110 else 2110 else
2111 mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); 2111 mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) );
2112 2112
2113 mActionRedo->setEnabled( !redo->isEmpty() ); 2113 mActionRedo->setEnabled( !redo->isEmpty() );
2114} 2114}
2115 2115
2116void KABCore::configureKeyBindings() 2116void KABCore::configureKeyBindings()
2117{ 2117{
2118#ifndef KAB_EMBEDDED 2118#ifndef KAB_EMBEDDED
2119 KKeyDialog::configure( actionCollection(), true ); 2119 KKeyDialog::configure( actionCollection(), true );
2120#else //KAB_EMBEDDED 2120#else //KAB_EMBEDDED
2121 qDebug("KABCore::configureKeyBindings() not implemented"); 2121 qDebug("KABCore::configureKeyBindings() not implemented");
2122#endif //KAB_EMBEDDED 2122#endif //KAB_EMBEDDED
2123} 2123}
2124 2124
2125#ifdef KAB_EMBEDDED 2125#ifdef KAB_EMBEDDED
2126void KABCore::configureResources() 2126void KABCore::configureResources()
2127{ 2127{
2128 KRES::KCMKResources dlg( this, "" , 0 ); 2128 KRES::KCMKResources dlg( this, "" , 0 );
2129 2129
2130 if ( !dlg.exec() ) 2130 if ( !dlg.exec() )
2131 return; 2131 return;
2132 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); 2132 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") );
2133} 2133}
2134#endif //KAB_EMBEDDED 2134#endif //KAB_EMBEDDED
2135 2135
2136 2136
2137/* this method will be called through the QCop interface from Ko/Pi to select addresses 2137/* this method will be called through the QCop interface from Ko/Pi to select addresses
2138 * for the attendees list of an event. 2138 * for the attendees list of an event.
2139 */ 2139 */
2140void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) 2140void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid)
2141{ 2141{
2142 QStringList nameList; 2142 QStringList nameList;
2143 QStringList emailList; 2143 QStringList emailList;
2144 QStringList uidList; 2144 QStringList uidList;
2145 2145
2146 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); 2146 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this);
2147 uint i=0; 2147 uint i=0;
2148 for (i=0; i < list.count(); i++) 2148 for (i=0; i < list.count(); i++)
2149 { 2149 {
2150 nameList.append(list[i].realName()); 2150 nameList.append(list[i].realName());
2151 emailList.append(list[i].preferredEmail()); 2151 emailList.append(list[i].preferredEmail());
2152 uidList.append(list[i].uid()); 2152 uidList.append(list[i].uid());
2153 } 2153 }
2154 2154
2155 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList); 2155 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList);
2156 2156
2157} 2157}
2158 2158
2159/* this method will be called through the QCop interface from Ko/Pi to select birthdays 2159/* this method will be called through the QCop interface from Ko/Pi to select birthdays
2160 * to put them into the calendar. 2160 * to put them into the calendar.
2161 */ 2161 */
2162void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid) 2162void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid)
2163{ 2163{
2164 // qDebug("KABCore::requestForBirthdayList"); 2164 // qDebug("KABCore::requestForBirthdayList");
2165 QStringList birthdayList; 2165 QStringList birthdayList;
2166 QStringList anniversaryList; 2166 QStringList anniversaryList;
2167 QStringList realNameList; 2167 QStringList realNameList;
2168 QStringList preferredEmailList; 2168 QStringList preferredEmailList;
2169 QStringList assembledNameList; 2169 QStringList assembledNameList;
2170 QStringList uidList; 2170 QStringList uidList;
2171 2171
2172 KABC::AddressBook::Iterator it; 2172 KABC::AddressBook::Iterator it;
2173 2173
2174 int count = 0; 2174 int count = 0;
2175 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2175 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2176 ++count; 2176 ++count;
2177 } 2177 }
2178 QProgressBar bar(count,0 ); 2178 QProgressBar bar(count,0 );
2179 int w = 300; 2179 int w = 300;
2180 if ( QApplication::desktop()->width() < 320 ) 2180 if ( QApplication::desktop()->width() < 320 )
2181 w = 220; 2181 w = 220;
2182 int h = bar.sizeHint().height() ; 2182 int h = bar.sizeHint().height() ;
2183 int dw = QApplication::desktop()->width(); 2183 int dw = QApplication::desktop()->width();
2184 int dh = QApplication::desktop()->height(); 2184 int dh = QApplication::desktop()->height();
2185 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2185 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2186 bar.show(); 2186 bar.show();
2187 bar.setCaption (i18n("Collecting birthdays - close to abort!") ); 2187 bar.setCaption (i18n("Collecting birthdays - close to abort!") );
2188 qApp->processEvents(); 2188 qApp->processEvents();
2189 2189
2190 QDate bday; 2190 QDate bday;
2191 QString anni; 2191 QString anni;
2192 QString formattedbday; 2192 QString formattedbday;
2193 2193
2194 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) 2194 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it )
2195 { 2195 {
2196 if ( ! bar.isVisible() ) 2196 if ( ! bar.isVisible() )
2197 return; 2197 return;
2198 bar.setProgress( count++ ); 2198 bar.setProgress( count++ );
2199 qApp->processEvents(); 2199 qApp->processEvents();
2200 bday = (*it).birthday().date(); 2200 bday = (*it).birthday().date();
2201 anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" ); 2201 anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" );
2202 2202
2203 if ( bday.isValid() || !anni.isEmpty()) 2203 if ( bday.isValid() || !anni.isEmpty())
2204 { 2204 {
2205 if (bday.isValid()) 2205 if (bday.isValid())
2206 formattedbday = KGlobal::locale()->formatDate(bday, true, KLocale::ISODate); 2206 formattedbday = KGlobal::locale()->formatDate(bday, true, KLocale::ISODate);
2207 else 2207 else
2208 formattedbday = "NOTVALID"; 2208 formattedbday = "NOTVALID";
2209 if (anni.isEmpty()) 2209 if (anni.isEmpty())
2210 anni = "INVALID"; 2210 anni = "INVALID";
2211 2211
2212 birthdayList.append(formattedbday); 2212 birthdayList.append(formattedbday);
2213 anniversaryList.append(anni); //should be ISODate 2213 anniversaryList.append(anni); //should be ISODate
2214 realNameList.append((*it).realName()); 2214 realNameList.append((*it).realName());
2215 preferredEmailList.append((*it).preferredEmail()); 2215 preferredEmailList.append((*it).preferredEmail());
2216 assembledNameList.append((*it).assembledName()); 2216 assembledNameList.append((*it).assembledName());
2217 uidList.append((*it).uid()); 2217 uidList.append((*it).uid());
2218 2218
2219 qDebug("found birthday in KA/Pi: %s,%s,%s,%s: %s, %s", (*it).realName().latin1(), (*it).preferredEmail().latin1(), (*it).assembledName().latin1(), (*it).uid().latin1(), formattedbday.latin1(), anni.latin1() ); 2219 qDebug("found birthday in KA/Pi: %s,%s,%s,%s: %s, %s", (*it).realName().latin1(), (*it).preferredEmail().latin1(), (*it).assembledName().latin1(), (*it).uid().latin1(), formattedbday.latin1(), anni.latin1() );
2220 } 2220 }
2221 } 2221 }
2222 2222
2223 bool res = ExternalAppHandler::instance()->returnBirthdayListFromKAPI(sourceChannel, uid, birthdayList, anniversaryList, realNameList, preferredEmailList, assembledNameList, uidList); 2223 bool res = ExternalAppHandler::instance()->returnBirthdayListFromKAPI(sourceChannel, uid, birthdayList, anniversaryList, realNameList, preferredEmailList, assembledNameList, uidList);
2224 2224
2225} 2225}
2226 2226
2227/* this method will be called through the QCop interface from other apps to show details of a contact. 2227/* this method will be called through the QCop interface from other apps to show details of a contact.
2228 */ 2228 */
2229void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) 2229void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid)
2230{ 2230{