-rw-r--r-- | kaddressbook/kabcore.cpp | 10 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 25891a0..2494aa2 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -1510,365 +1510,371 @@ void KABCore::initActions() | |||
1510 | mActionBeam = 0; | 1510 | mActionBeam = 0; |
1511 | 1511 | ||
1512 | #ifndef DESKTOP_VERSION | 1512 | #ifndef DESKTOP_VERSION |
1513 | if ( Ir::supported() ) { | 1513 | if ( Ir::supported() ) { |
1514 | mActionBeamVCard = new KAction( i18n( "Beam selected v&Card(s)" ), "beam", 0, this, | 1514 | mActionBeamVCard = new KAction( i18n( "Beam selected v&Card(s)" ), "beam", 0, this, |
1515 | SLOT( beamVCard() ), actionCollection(), | 1515 | SLOT( beamVCard() ), actionCollection(), |
1516 | "kaddressbook_beam_vcard" ); | 1516 | "kaddressbook_beam_vcard" ); |
1517 | 1517 | ||
1518 | mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this, | 1518 | mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this, |
1519 | SLOT( beamMySelf() ), actionCollection(), | 1519 | SLOT( beamMySelf() ), actionCollection(), |
1520 | "kaddressbook_beam_myself" ); | 1520 | "kaddressbook_beam_myself" ); |
1521 | } | 1521 | } |
1522 | #endif | 1522 | #endif |
1523 | 1523 | ||
1524 | mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0, | 1524 | mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0, |
1525 | this, SLOT( editContact2() ), | 1525 | this, SLOT( editContact2() ), |
1526 | actionCollection(), "file_properties" ); | 1526 | actionCollection(), "file_properties" ); |
1527 | 1527 | ||
1528 | #ifdef KAB_EMBEDDED | 1528 | #ifdef KAB_EMBEDDED |
1529 | // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() ); | 1529 | // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() ); |
1530 | mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0, | 1530 | mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0, |
1531 | mMainWindow, SLOT( exit() ), | 1531 | mMainWindow, SLOT( exit() ), |
1532 | actionCollection(), "quit" ); | 1532 | actionCollection(), "quit" ); |
1533 | #endif //KAB_EMBEDDED | 1533 | #endif //KAB_EMBEDDED |
1534 | 1534 | ||
1535 | // edit menu | 1535 | // edit menu |
1536 | if ( mIsPart ) { | 1536 | if ( mIsPart ) { |
1537 | mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this, | 1537 | mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this, |
1538 | SLOT( copyContacts() ), actionCollection(), | 1538 | SLOT( copyContacts() ), actionCollection(), |
1539 | "kaddressbook_copy" ); | 1539 | "kaddressbook_copy" ); |
1540 | mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this, | 1540 | mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this, |
1541 | SLOT( cutContacts() ), actionCollection(), | 1541 | SLOT( cutContacts() ), actionCollection(), |
1542 | "kaddressbook_cut" ); | 1542 | "kaddressbook_cut" ); |
1543 | mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this, | 1543 | mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this, |
1544 | SLOT( pasteContacts() ), actionCollection(), | 1544 | SLOT( pasteContacts() ), actionCollection(), |
1545 | "kaddressbook_paste" ); | 1545 | "kaddressbook_paste" ); |
1546 | mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this, | 1546 | mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this, |
1547 | SLOT( selectAllContacts() ), actionCollection(), | 1547 | SLOT( selectAllContacts() ), actionCollection(), |
1548 | "kaddressbook_select_all" ); | 1548 | "kaddressbook_select_all" ); |
1549 | mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this, | 1549 | mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this, |
1550 | SLOT( undo() ), actionCollection(), | 1550 | SLOT( undo() ), actionCollection(), |
1551 | "kaddressbook_undo" ); | 1551 | "kaddressbook_undo" ); |
1552 | mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z, | 1552 | mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z, |
1553 | this, SLOT( redo() ), actionCollection(), | 1553 | this, SLOT( redo() ), actionCollection(), |
1554 | "kaddressbook_redo" ); | 1554 | "kaddressbook_redo" ); |
1555 | } else { | 1555 | } else { |
1556 | mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() ); | 1556 | mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() ); |
1557 | mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() ); | 1557 | mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() ); |
1558 | mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() ); | 1558 | mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() ); |
1559 | mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() ); | 1559 | mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() ); |
1560 | mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() ); | 1560 | mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() ); |
1561 | mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() ); | 1561 | mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() ); |
1562 | } | 1562 | } |
1563 | 1563 | ||
1564 | mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete", | 1564 | mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete", |
1565 | Key_Delete, this, SLOT( deleteContacts() ), | 1565 | Key_Delete, this, SLOT( deleteContacts() ), |
1566 | actionCollection(), "edit_delete" ); | 1566 | actionCollection(), "edit_delete" ); |
1567 | 1567 | ||
1568 | mActionUndo->setEnabled( false ); | 1568 | mActionUndo->setEnabled( false ); |
1569 | mActionRedo->setEnabled( false ); | 1569 | mActionRedo->setEnabled( false ); |
1570 | 1570 | ||
1571 | // settings menu | 1571 | // settings menu |
1572 | #ifdef KAB_EMBEDDED | 1572 | #ifdef KAB_EMBEDDED |
1573 | //US special menuentry to configure the addressbook resources. On KDE | 1573 | //US special menuentry to configure the addressbook resources. On KDE |
1574 | // you do that through the control center !!! | 1574 | // you do that through the control center !!! |
1575 | mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this, | 1575 | mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this, |
1576 | SLOT( configureResources() ), actionCollection(), | 1576 | SLOT( configureResources() ), actionCollection(), |
1577 | "kaddressbook_configure_resources" ); | 1577 | "kaddressbook_configure_resources" ); |
1578 | #endif //KAB_EMBEDDED | 1578 | #endif //KAB_EMBEDDED |
1579 | 1579 | ||
1580 | if ( mIsPart ) { | 1580 | if ( mIsPart ) { |
1581 | mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this, | 1581 | mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this, |
1582 | SLOT( openConfigDialog() ), actionCollection(), | 1582 | SLOT( openConfigDialog() ), actionCollection(), |
1583 | "kaddressbook_configure" ); | 1583 | "kaddressbook_configure" ); |
1584 | 1584 | ||
1585 | mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0, | 1585 | mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0, |
1586 | this, SLOT( configureKeyBindings() ), actionCollection(), | 1586 | this, SLOT( configureKeyBindings() ), actionCollection(), |
1587 | "kaddressbook_configure_shortcuts" ); | 1587 | "kaddressbook_configure_shortcuts" ); |
1588 | #ifdef KAB_EMBEDDED | 1588 | #ifdef KAB_EMBEDDED |
1589 | mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() ); | 1589 | mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() ); |
1590 | mActionConfigureToolbars->setEnabled( false ); | 1590 | mActionConfigureToolbars->setEnabled( false ); |
1591 | #endif //KAB_EMBEDDED | 1591 | #endif //KAB_EMBEDDED |
1592 | 1592 | ||
1593 | } else { | 1593 | } else { |
1594 | mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() ); | 1594 | mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() ); |
1595 | 1595 | ||
1596 | mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); | 1596 | mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); |
1597 | } | 1597 | } |
1598 | 1598 | ||
1599 | mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, | 1599 | mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, |
1600 | actionCollection(), "options_show_jump_bar" ); | 1600 | actionCollection(), "options_show_jump_bar" ); |
1601 | connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) ); | 1601 | connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) ); |
1602 | 1602 | ||
1603 | mActionDetails = new KToggleAction( i18n( "Show Details" ), 0, 0, | 1603 | mActionDetails = new KToggleAction( i18n( "Show Details" ), 0, 0, |
1604 | actionCollection(), "options_show_details" ); | 1604 | actionCollection(), "options_show_details" ); |
1605 | connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); | 1605 | connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); |
1606 | 1606 | ||
1607 | // misc | 1607 | // misc |
1608 | // only enable LDAP lookup if we can handle the protocol | 1608 | // only enable LDAP lookup if we can handle the protocol |
1609 | #ifndef KAB_EMBEDDED | 1609 | #ifndef KAB_EMBEDDED |
1610 | if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) { | 1610 | if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) { |
1611 | new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0, | 1611 | new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0, |
1612 | this, SLOT( openLDAPDialog() ), actionCollection(), | 1612 | this, SLOT( openLDAPDialog() ), actionCollection(), |
1613 | "ldap_lookup" ); | 1613 | "ldap_lookup" ); |
1614 | } | 1614 | } |
1615 | #else //KAB_EMBEDDED | 1615 | #else //KAB_EMBEDDED |
1616 | //qDebug("KABCore::initActions() LDAP has to be implemented"); | 1616 | //qDebug("KABCore::initActions() LDAP has to be implemented"); |
1617 | #endif //KAB_EMBEDDED | 1617 | #endif //KAB_EMBEDDED |
1618 | 1618 | ||
1619 | 1619 | ||
1620 | mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, | 1620 | mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, |
1621 | SLOT( setWhoAmI() ), actionCollection(), | 1621 | SLOT( setWhoAmI() ), actionCollection(), |
1622 | "set_personal" ); | 1622 | "set_personal" ); |
1623 | 1623 | ||
1624 | 1624 | ||
1625 | 1625 | ||
1626 | 1626 | ||
1627 | mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, | 1627 | mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, |
1628 | SLOT( setCategories() ), actionCollection(), | 1628 | SLOT( setCategories() ), actionCollection(), |
1629 | "edit_set_categories" ); | 1629 | "edit_set_categories" ); |
1630 | 1630 | ||
1631 | mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, | 1631 | mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, |
1632 | SLOT( removeVoice() ), actionCollection(), | 1632 | SLOT( removeVoice() ), actionCollection(), |
1633 | "remove_voice" ); | 1633 | "remove_voice" ); |
1634 | mActionImportOL = new KAction( i18n( "Import from OL..." ), 0, this, | 1634 | mActionImportOL = new KAction( i18n( "Import from OL..." ), 0, this, |
1635 | SLOT( importFromOL() ), actionCollection(), | 1635 | SLOT( importFromOL() ), actionCollection(), |
1636 | "import_OL" ); | 1636 | "import_OL" ); |
1637 | #ifdef KAB_EMBEDDED | 1637 | #ifdef KAB_EMBEDDED |
1638 | 1638 | mActionLicence = new KAction( i18n( "Licence" ), "licence", 0, | |
1639 | this, SLOT( showLicence() ), actionCollection(), | ||
1640 | "licence_about_data" ); | ||
1639 | mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, | 1641 | mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, |
1640 | this, SLOT( createAboutData() ), actionCollection(), | 1642 | this, SLOT( createAboutData() ), actionCollection(), |
1641 | "kaddressbook_about_data" ); | 1643 | "kaddressbook_about_data" ); |
1642 | #endif //KAB_EMBEDDED | 1644 | #endif //KAB_EMBEDDED |
1643 | 1645 | ||
1644 | clipboardDataChanged(); | 1646 | clipboardDataChanged(); |
1645 | connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); | 1647 | connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); |
1646 | connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); | 1648 | connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); |
1647 | } | 1649 | } |
1648 | 1650 | ||
1649 | //US we need this function, to plug all actions into the correct menues. | 1651 | //US we need this function, to plug all actions into the correct menues. |
1650 | // KDE uses a XML format to plug the actions, but we work her without this overhead. | 1652 | // KDE uses a XML format to plug the actions, but we work her without this overhead. |
1651 | void KABCore::addActionsManually() | 1653 | void KABCore::addActionsManually() |
1652 | { | 1654 | { |
1653 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); | 1655 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); |
1654 | 1656 | ||
1655 | #ifdef KAB_EMBEDDED | 1657 | #ifdef KAB_EMBEDDED |
1656 | QPopupMenu *fileMenu = new QPopupMenu( this ); | 1658 | QPopupMenu *fileMenu = new QPopupMenu( this ); |
1657 | QPopupMenu *editMenu = new QPopupMenu( this ); | 1659 | QPopupMenu *editMenu = new QPopupMenu( this ); |
1658 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 1660 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
1659 | 1661 | ||
1660 | KToolBar* tb = mMainWindow->toolBar(); | 1662 | KToolBar* tb = mMainWindow->toolBar(); |
1661 | 1663 | ||
1662 | #ifdef DESKTOP_VERSION | 1664 | #ifdef DESKTOP_VERSION |
1663 | QMenuBar* mb = mMainWindow->menuBar(); | 1665 | QMenuBar* mb = mMainWindow->menuBar(); |
1664 | 1666 | ||
1665 | //US setup menubar. | 1667 | //US setup menubar. |
1666 | //Disable the following block if you do not want to have a menubar. | 1668 | //Disable the following block if you do not want to have a menubar. |
1667 | mb->insertItem( "&File", fileMenu ); | 1669 | mb->insertItem( "&File", fileMenu ); |
1668 | mb->insertItem( "&Edit", editMenu ); | 1670 | mb->insertItem( "&Edit", editMenu ); |
1669 | mb->insertItem( "&View", viewMenu ); | 1671 | mb->insertItem( "&View", viewMenu ); |
1670 | mb->insertItem( "&Settings", settingsMenu ); | 1672 | mb->insertItem( "&Settings", settingsMenu ); |
1671 | mb->insertItem( "&Change selected", changeMenu ); | 1673 | mb->insertItem( "&Change selected", changeMenu ); |
1672 | mb->insertItem( "&Help", helpMenu ); | 1674 | mb->insertItem( "&Help", helpMenu ); |
1673 | mIncSearchWidget = new IncSearchWidget( tb ); | 1675 | mIncSearchWidget = new IncSearchWidget( tb ); |
1674 | // tb->insertWidget(-1, 0, mIncSearchWidget); | 1676 | // tb->insertWidget(-1, 0, mIncSearchWidget); |
1675 | 1677 | ||
1676 | #else | 1678 | #else |
1677 | //US setup toolbar | 1679 | //US setup toolbar |
1678 | QMenuBar *menuBarTB = new QMenuBar( tb ); | 1680 | QMenuBar *menuBarTB = new QMenuBar( tb ); |
1679 | QPopupMenu *popupBarTB = new QPopupMenu( this ); | 1681 | QPopupMenu *popupBarTB = new QPopupMenu( this ); |
1680 | menuBarTB->insertItem( "ME", popupBarTB); | 1682 | menuBarTB->insertItem( "ME", popupBarTB); |
1681 | tb->insertWidget(-1, 0, menuBarTB); | 1683 | tb->insertWidget(-1, 0, menuBarTB); |
1682 | mIncSearchWidget = new IncSearchWidget( tb ); | 1684 | mIncSearchWidget = new IncSearchWidget( tb ); |
1683 | 1685 | ||
1684 | tb->enableMoving(false); | 1686 | tb->enableMoving(false); |
1685 | popupBarTB->insertItem( "&File", fileMenu ); | 1687 | popupBarTB->insertItem( "&File", fileMenu ); |
1686 | popupBarTB->insertItem( "&Edit", editMenu ); | 1688 | popupBarTB->insertItem( "&Edit", editMenu ); |
1687 | popupBarTB->insertItem( "&View", viewMenu ); | 1689 | popupBarTB->insertItem( "&View", viewMenu ); |
1688 | popupBarTB->insertItem( "&Settings", settingsMenu ); | 1690 | popupBarTB->insertItem( "&Settings", settingsMenu ); |
1689 | mViewManager->getFilterAction()->plug ( popupBarTB); | 1691 | mViewManager->getFilterAction()->plug ( popupBarTB); |
1690 | popupBarTB->insertItem( "&Change selected", changeMenu ); | 1692 | popupBarTB->insertItem( "&Change selected", changeMenu ); |
1691 | popupBarTB->insertItem( "&Help", helpMenu ); | 1693 | popupBarTB->insertItem( "&Help", helpMenu ); |
1692 | if (QApplication::desktop()->width() > 320 ) { | 1694 | if (QApplication::desktop()->width() > 320 ) { |
1693 | // mViewManager->getFilterAction()->plug ( tb); | 1695 | // mViewManager->getFilterAction()->plug ( tb); |
1694 | } | 1696 | } |
1695 | #endif | 1697 | #endif |
1696 | // mActionQuit->plug ( mMainWindow->toolBar()); | 1698 | // mActionQuit->plug ( mMainWindow->toolBar()); |
1697 | 1699 | ||
1698 | 1700 | ||
1699 | 1701 | ||
1700 | //US Now connect the actions with the menue entries. | 1702 | //US Now connect the actions with the menue entries. |
1701 | mActionPrint->plug( fileMenu ); | 1703 | mActionPrint->plug( fileMenu ); |
1702 | mActionMail->plug( fileMenu ); | 1704 | mActionMail->plug( fileMenu ); |
1703 | fileMenu->insertSeparator(); | 1705 | fileMenu->insertSeparator(); |
1704 | 1706 | ||
1705 | mActionNewContact->plug( fileMenu ); | 1707 | mActionNewContact->plug( fileMenu ); |
1706 | mActionNewContact->plug( tb ); | 1708 | mActionNewContact->plug( tb ); |
1707 | 1709 | ||
1708 | mActionEditAddressee->plug( fileMenu ); | 1710 | mActionEditAddressee->plug( fileMenu ); |
1709 | fileMenu->insertSeparator(); | 1711 | fileMenu->insertSeparator(); |
1710 | mActionSave->plug( fileMenu ); | 1712 | mActionSave->plug( fileMenu ); |
1711 | fileMenu->insertItem( "&Import", ImportMenu ); | 1713 | fileMenu->insertItem( "&Import", ImportMenu ); |
1712 | fileMenu->insertItem( "&Emport", ExportMenu ); | 1714 | fileMenu->insertItem( "&Emport", ExportMenu ); |
1713 | fileMenu->insertSeparator(); | 1715 | fileMenu->insertSeparator(); |
1714 | mActionMailVCard->plug( fileMenu ); | 1716 | mActionMailVCard->plug( fileMenu ); |
1715 | #ifndef DESKTOP_VERSION | 1717 | #ifndef DESKTOP_VERSION |
1716 | if ( Ir::supported() ) mActionBeamVCard->plug( fileMenu ); | 1718 | if ( Ir::supported() ) mActionBeamVCard->plug( fileMenu ); |
1717 | if ( Ir::supported() ) mActionBeam->plug(fileMenu ); | 1719 | if ( Ir::supported() ) mActionBeam->plug(fileMenu ); |
1718 | #endif | 1720 | #endif |
1719 | fileMenu->insertSeparator(); | 1721 | fileMenu->insertSeparator(); |
1720 | mActionQuit->plug( fileMenu ); | 1722 | mActionQuit->plug( fileMenu ); |
1721 | #ifdef _WIN32_ | 1723 | #ifdef _WIN32_ |
1722 | mActionImportOL->plug( ImportMenu ); | 1724 | mActionImportOL->plug( ImportMenu ); |
1723 | #endif | 1725 | #endif |
1724 | // edit menu | 1726 | // edit menu |
1725 | mActionUndo->plug( editMenu ); | 1727 | mActionUndo->plug( editMenu ); |
1726 | mActionRedo->plug( editMenu ); | 1728 | mActionRedo->plug( editMenu ); |
1727 | editMenu->insertSeparator(); | 1729 | editMenu->insertSeparator(); |
1728 | mActionCut->plug( editMenu ); | 1730 | mActionCut->plug( editMenu ); |
1729 | mActionCopy->plug( editMenu ); | 1731 | mActionCopy->plug( editMenu ); |
1730 | mActionPaste->plug( editMenu ); | 1732 | mActionPaste->plug( editMenu ); |
1731 | mActionDelete->plug( editMenu ); | 1733 | mActionDelete->plug( editMenu ); |
1732 | editMenu->insertSeparator(); | 1734 | editMenu->insertSeparator(); |
1733 | mActionSelectAll->plug( editMenu ); | 1735 | mActionSelectAll->plug( editMenu ); |
1734 | 1736 | ||
1735 | mActionRemoveVoice->plug( changeMenu ); | 1737 | mActionRemoveVoice->plug( changeMenu ); |
1736 | // settings menu | 1738 | // settings menu |
1737 | //US special menuentry to configure the addressbook resources. On KDE | 1739 | //US special menuentry to configure the addressbook resources. On KDE |
1738 | // you do that through the control center !!! | 1740 | // you do that through the control center !!! |
1739 | mActionConfigResources->plug( settingsMenu ); | 1741 | mActionConfigResources->plug( settingsMenu ); |
1740 | settingsMenu->insertSeparator(); | 1742 | settingsMenu->insertSeparator(); |
1741 | 1743 | ||
1742 | mActionConfigKAddressbook->plug( settingsMenu ); | 1744 | mActionConfigKAddressbook->plug( settingsMenu ); |
1743 | 1745 | ||
1744 | if ( mIsPart ) { | 1746 | if ( mIsPart ) { |
1745 | mActionConfigShortcuts->plug( settingsMenu ); | 1747 | mActionConfigShortcuts->plug( settingsMenu ); |
1746 | mActionConfigureToolbars->plug( settingsMenu ); | 1748 | mActionConfigureToolbars->plug( settingsMenu ); |
1747 | 1749 | ||
1748 | } else { | 1750 | } else { |
1749 | mActionKeyBindings->plug( settingsMenu ); | 1751 | mActionKeyBindings->plug( settingsMenu ); |
1750 | } | 1752 | } |
1751 | 1753 | ||
1752 | settingsMenu->insertSeparator(); | 1754 | settingsMenu->insertSeparator(); |
1753 | 1755 | ||
1754 | mActionJumpBar->plug( settingsMenu ); | 1756 | mActionJumpBar->plug( settingsMenu ); |
1755 | mActionDetails->plug( settingsMenu ); | 1757 | mActionDetails->plug( settingsMenu ); |
1756 | settingsMenu->insertSeparator(); | 1758 | settingsMenu->insertSeparator(); |
1757 | 1759 | ||
1758 | mActionWhoAmI->plug( settingsMenu ); | 1760 | mActionWhoAmI->plug( settingsMenu ); |
1759 | mActionCategories->plug( settingsMenu ); | 1761 | mActionCategories->plug( settingsMenu ); |
1760 | 1762 | ||
1761 | mActionAboutKAddressbook->plug( helpMenu ); | 1763 | mActionAboutKAddressbook->plug( helpMenu ); |
1762 | 1764 | mActionLicence->plug( helpMenu ); | |
1763 | 1765 | ||
1764 | if (QApplication::desktop()->width() > 320 ) { | 1766 | if (QApplication::desktop()->width() > 320 ) { |
1765 | 1767 | ||
1766 | mActionEditAddressee->plug( tb ); | 1768 | mActionEditAddressee->plug( tb ); |
1767 | mActionSave->plug( tb ); | 1769 | mActionSave->plug( tb ); |
1768 | mViewManager->getFilterAction()->plug ( tb); | 1770 | mViewManager->getFilterAction()->plug ( tb); |
1769 | if (QApplication::desktop()->width() > 480 ) { | 1771 | if (QApplication::desktop()->width() > 480 ) { |
1770 | mActionUndo->plug( tb ); | 1772 | mActionUndo->plug( tb ); |
1771 | mActionDelete->plug( tb ); | 1773 | mActionDelete->plug( tb ); |
1772 | mActionRedo->plug( tb ); | 1774 | mActionRedo->plug( tb ); |
1773 | } | 1775 | } |
1774 | } | 1776 | } |
1775 | //mActionQuit->plug ( tb ); | 1777 | //mActionQuit->plug ( tb ); |
1776 | // tb->insertWidget(-1, 0, mIncSearchWidget, 6); | 1778 | // tb->insertWidget(-1, 0, mIncSearchWidget, 6); |
1777 | 1779 | ||
1778 | //US link the searchwidget first to this. | 1780 | //US link the searchwidget first to this. |
1779 | // The real linkage to the toolbar happens later. | 1781 | // The real linkage to the toolbar happens later. |
1780 | //US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); | 1782 | //US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); |
1781 | //US tb->insertItem( mIncSearchWidget ); | 1783 | //US tb->insertItem( mIncSearchWidget ); |
1782 | /*US | 1784 | /*US |
1783 | mIncSearchWidget = new IncSearchWidget( tb ); | 1785 | mIncSearchWidget = new IncSearchWidget( tb ); |
1784 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), | 1786 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), |
1785 | SLOT( incrementalSearch( const QString& ) ) ); | 1787 | SLOT( incrementalSearch( const QString& ) ) ); |
1786 | 1788 | ||
1787 | mJumpButtonBar = new JumpButtonBar( this, this ); | 1789 | mJumpButtonBar = new JumpButtonBar( this, this ); |
1788 | 1790 | ||
1789 | //US topLayout->addWidget( mJumpButtonBar ); | 1791 | //US topLayout->addWidget( mJumpButtonBar ); |
1790 | this->layout()->add( mJumpButtonBar ); | 1792 | this->layout()->add( mJumpButtonBar ); |
1791 | */ | 1793 | */ |
1792 | 1794 | ||
1793 | #endif //KAB_EMBEDDED | 1795 | #endif //KAB_EMBEDDED |
1794 | } | 1796 | } |
1797 | void KABCore::showLicence() | ||
1798 | { | ||
1799 | KApplication::showLicence(); | ||
1800 | } | ||
1795 | void KABCore::removeVoice() | 1801 | void KABCore::removeVoice() |
1796 | { | 1802 | { |
1797 | 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 ) | 1803 | 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 ) |
1798 | return; | 1804 | return; |
1799 | KABC::Addressee::List list = mViewManager->selectedAddressees(); | 1805 | KABC::Addressee::List list = mViewManager->selectedAddressees(); |
1800 | KABC::Addressee::List::Iterator it; | 1806 | KABC::Addressee::List::Iterator it; |
1801 | for ( it = list.begin(); it != list.end(); ++it ) { | 1807 | for ( it = list.begin(); it != list.end(); ++it ) { |
1802 | PhoneNumber::List phoneNumbers = (*it).phoneNumbers(); | 1808 | PhoneNumber::List phoneNumbers = (*it).phoneNumbers(); |
1803 | PhoneNumber::List::Iterator phoneIt; | 1809 | PhoneNumber::List::Iterator phoneIt; |
1804 | bool found = false; | 1810 | bool found = false; |
1805 | for ( phoneIt = phoneNumbers.begin(); phoneIt != phoneNumbers.end(); ++phoneIt ) { | 1811 | for ( phoneIt = phoneNumbers.begin(); phoneIt != phoneNumbers.end(); ++phoneIt ) { |
1806 | if ( (*phoneIt).type() & PhoneNumber::Voice) { // voice found | 1812 | if ( (*phoneIt).type() & PhoneNumber::Voice) { // voice found |
1807 | if ((*phoneIt).type() - PhoneNumber::Voice ) { | 1813 | if ((*phoneIt).type() - PhoneNumber::Voice ) { |
1808 | (*phoneIt).setType((*phoneIt).type() - PhoneNumber::Voice ); | 1814 | (*phoneIt).setType((*phoneIt).type() - PhoneNumber::Voice ); |
1809 | (*it).insertPhoneNumber( (*phoneIt) ); | 1815 | (*it).insertPhoneNumber( (*phoneIt) ); |
1810 | found = true; | 1816 | found = true; |
1811 | } | 1817 | } |
1812 | } | 1818 | } |
1813 | 1819 | ||
1814 | } | 1820 | } |
1815 | if ( found ) | 1821 | if ( found ) |
1816 | contactModified((*it) ); | 1822 | contactModified((*it) ); |
1817 | } | 1823 | } |
1818 | } | 1824 | } |
1819 | 1825 | ||
1820 | 1826 | ||
1821 | 1827 | ||
1822 | void KABCore::clipboardDataChanged() | 1828 | void KABCore::clipboardDataChanged() |
1823 | { | 1829 | { |
1824 | 1830 | ||
1825 | if ( mReadWrite ) | 1831 | if ( mReadWrite ) |
1826 | mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); | 1832 | mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); |
1827 | 1833 | ||
1828 | } | 1834 | } |
1829 | 1835 | ||
1830 | void KABCore::updateActionMenu() | 1836 | void KABCore::updateActionMenu() |
1831 | { | 1837 | { |
1832 | UndoStack *undo = UndoStack::instance(); | 1838 | UndoStack *undo = UndoStack::instance(); |
1833 | RedoStack *redo = RedoStack::instance(); | 1839 | RedoStack *redo = RedoStack::instance(); |
1834 | 1840 | ||
1835 | if ( undo->isEmpty() ) | 1841 | if ( undo->isEmpty() ) |
1836 | mActionUndo->setText( i18n( "Undo" ) ); | 1842 | mActionUndo->setText( i18n( "Undo" ) ); |
1837 | else | 1843 | else |
1838 | mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); | 1844 | mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); |
1839 | 1845 | ||
1840 | mActionUndo->setEnabled( !undo->isEmpty() ); | 1846 | mActionUndo->setEnabled( !undo->isEmpty() ); |
1841 | 1847 | ||
1842 | if ( !redo->top() ) | 1848 | if ( !redo->top() ) |
1843 | mActionRedo->setText( i18n( "Redo" ) ); | 1849 | mActionRedo->setText( i18n( "Redo" ) ); |
1844 | else | 1850 | else |
1845 | mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); | 1851 | mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); |
1846 | 1852 | ||
1847 | mActionRedo->setEnabled( !redo->isEmpty() ); | 1853 | mActionRedo->setEnabled( !redo->isEmpty() ); |
1848 | } | 1854 | } |
1849 | 1855 | ||
1850 | void KABCore::configureKeyBindings() | 1856 | void KABCore::configureKeyBindings() |
1851 | { | 1857 | { |
1852 | #ifndef KAB_EMBEDDED | 1858 | #ifndef KAB_EMBEDDED |
1853 | KKeyDialog::configure( actionCollection(), true ); | 1859 | KKeyDialog::configure( actionCollection(), true ); |
1854 | #else //KAB_EMBEDDED | 1860 | #else //KAB_EMBEDDED |
1855 | qDebug("KABCore::configureKeyBindings() not implemented"); | 1861 | qDebug("KABCore::configureKeyBindings() not implemented"); |
1856 | #endif //KAB_EMBEDDED | 1862 | #endif //KAB_EMBEDDED |
1857 | } | 1863 | } |
1858 | 1864 | ||
1859 | #ifdef KAB_EMBEDDED | 1865 | #ifdef KAB_EMBEDDED |
1860 | void KABCore::configureResources() | 1866 | void KABCore::configureResources() |
1861 | { | 1867 | { |
1862 | KRES::KCMKResources dlg( this, "" , 0 ); | 1868 | KRES::KCMKResources dlg( this, "" , 0 ); |
1863 | 1869 | ||
1864 | if ( !dlg.exec() ) | 1870 | if ( !dlg.exec() ) |
1865 | return; | 1871 | return; |
1866 | KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); | 1872 | KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); |
1867 | } | 1873 | } |
1868 | #endif //KAB_EMBEDDED | 1874 | #endif //KAB_EMBEDDED |
1869 | 1875 | ||
1870 | 1876 | ||
1871 | 1877 | ||
1872 | #ifndef KAB_EMBEDDED | 1878 | #ifndef KAB_EMBEDDED |
1873 | #include "kabcore.moc" | 1879 | #include "kabcore.moc" |
1874 | #endif //KAB_EMBEDDED | 1880 | #endif //KAB_EMBEDDED |
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index be39148..6bbdfd4 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h | |||
@@ -17,256 +17,257 @@ | |||
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #ifndef KABCORE_H | 24 | #ifndef KABCORE_H |
25 | #define KABCORE_H | 25 | #define KABCORE_H |
26 | 26 | ||
27 | #include <kabc/field.h> | 27 | #include <kabc/field.h> |
28 | 28 | ||
29 | #ifndef KAB_EMBEDDED | 29 | #ifndef KAB_EMBEDDED |
30 | #endif //KAB_EMBEDDED | 30 | #endif //KAB_EMBEDDED |
31 | #include <qdict.h> | 31 | #include <qdict.h> |
32 | 32 | ||
33 | #include <qwidget.h> | 33 | #include <qwidget.h> |
34 | #include <qpopupmenu.h> | 34 | #include <qpopupmenu.h> |
35 | 35 | ||
36 | namespace KABC { | 36 | namespace KABC { |
37 | class AddressBook; | 37 | class AddressBook; |
38 | } | 38 | } |
39 | 39 | ||
40 | #ifndef KAB_EMBEDDED | 40 | #ifndef KAB_EMBEDDED |
41 | class KAboutData; | 41 | class KAboutData; |
42 | class KConfig; | 42 | class KConfig; |
43 | 43 | ||
44 | class KAddressBookService; | 44 | class KAddressBookService; |
45 | class LDAPSearchDialog; | 45 | class LDAPSearchDialog; |
46 | #else //KAB_EMBEDDED | 46 | #else //KAB_EMBEDDED |
47 | class KAddressBookMain; | 47 | class KAddressBookMain; |
48 | //US class QAction; | 48 | //US class QAction; |
49 | #endif //KAB_EMBEDDED | 49 | #endif //KAB_EMBEDDED |
50 | class KCMultiDialog; | 50 | class KCMultiDialog; |
51 | class KXMLGUIClient; | 51 | class KXMLGUIClient; |
52 | class ExtensionManager; | 52 | class ExtensionManager; |
53 | class XXPortManager; | 53 | class XXPortManager; |
54 | class JumpButtonBar; | 54 | class JumpButtonBar; |
55 | class IncSearchWidget; | 55 | class IncSearchWidget; |
56 | class KDGanttMinimizeSplitter; | 56 | class KDGanttMinimizeSplitter; |
57 | class KAction; | 57 | class KAction; |
58 | class KActionCollection; | 58 | class KActionCollection; |
59 | class KToggleAction; | 59 | class KToggleAction; |
60 | 60 | ||
61 | class QAction; | 61 | class QAction; |
62 | class QMenuBar; | 62 | class QMenuBar; |
63 | class QSplitter; | 63 | class QSplitter; |
64 | class ViewContainer; | 64 | class ViewContainer; |
65 | class ViewManager; | 65 | class ViewManager; |
66 | class AddresseeEditorDialog; | 66 | class AddresseeEditorDialog; |
67 | class Ir; | 67 | class Ir; |
68 | 68 | ||
69 | class KABCore : public QWidget | 69 | class KABCore : public QWidget |
70 | { | 70 | { |
71 | Q_OBJECT | 71 | Q_OBJECT |
72 | 72 | ||
73 | public: | 73 | public: |
74 | KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name = 0 ); | 74 | KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name = 0 ); |
75 | 75 | ||
76 | 76 | ||
77 | ~KABCore(); | 77 | ~KABCore(); |
78 | 78 | ||
79 | 79 | ||
80 | #ifdef KAB_EMBEDDED | 80 | #ifdef KAB_EMBEDDED |
81 | //US added functionality | 81 | //US added functionality |
82 | QPopupMenu* getViewMenu() {return viewMenu;} | 82 | QPopupMenu* getViewMenu() {return viewMenu;} |
83 | QPopupMenu* getFilterMenu() {return filterMenu;} | 83 | QPopupMenu* getFilterMenu() {return filterMenu;} |
84 | QPopupMenu* getSettingsMenu() {return settingsMenu;} | 84 | QPopupMenu* getSettingsMenu() {return settingsMenu;} |
85 | void addActionsManually(); | 85 | void addActionsManually(); |
86 | #endif //KAB_EMBEDDED | 86 | #endif //KAB_EMBEDDED |
87 | /** | 87 | /** |
88 | Restores the global settings. | 88 | Restores the global settings. |
89 | */ | 89 | */ |
90 | void restoreSettings(); | 90 | void restoreSettings(); |
91 | 91 | ||
92 | /** | 92 | /** |
93 | Saves the global settings. | 93 | Saves the global settings. |
94 | */ | 94 | */ |
95 | void saveSettings(); | 95 | void saveSettings(); |
96 | 96 | ||
97 | /** | 97 | /** |
98 | Returns a pointer to the StdAddressBook of the application. | 98 | Returns a pointer to the StdAddressBook of the application. |
99 | */ | 99 | */ |
100 | KABC::AddressBook *addressBook() const; | 100 | KABC::AddressBook *addressBook() const; |
101 | 101 | ||
102 | /** | 102 | /** |
103 | Returns a pointer to the KConfig object of the application. | 103 | Returns a pointer to the KConfig object of the application. |
104 | */ | 104 | */ |
105 | static KConfig *config(); | 105 | static KConfig *config(); |
106 | 106 | ||
107 | /** | 107 | /** |
108 | Returns a pointer to the global KActionCollection object. So | 108 | Returns a pointer to the global KActionCollection object. So |
109 | other classes can register their actions easily. | 109 | other classes can register their actions easily. |
110 | */ | 110 | */ |
111 | KActionCollection *actionCollection() const; | 111 | KActionCollection *actionCollection() const; |
112 | 112 | ||
113 | /** | 113 | /** |
114 | Returns the current search field of the Incremental Search Widget. | 114 | Returns the current search field of the Incremental Search Widget. |
115 | */ | 115 | */ |
116 | KABC::Field *currentSearchField() const; | 116 | KABC::Field *currentSearchField() const; |
117 | 117 | ||
118 | /** | 118 | /** |
119 | Returns the uid list of the currently selected contacts. | 119 | Returns the uid list of the currently selected contacts. |
120 | */ | 120 | */ |
121 | QStringList selectedUIDs() const; | 121 | QStringList selectedUIDs() const; |
122 | 122 | ||
123 | /** | 123 | /** |
124 | Displays the ResourceSelectDialog and returns the selected | 124 | Displays the ResourceSelectDialog and returns the selected |
125 | resource or a null pointer if no resource was selected by | 125 | resource or a null pointer if no resource was selected by |
126 | the user. | 126 | the user. |
127 | */ | 127 | */ |
128 | KABC::Resource *requestResource( QWidget *parent ); | 128 | KABC::Resource *requestResource( QWidget *parent ); |
129 | 129 | ||
130 | #ifndef KAB_EMBEDDED | 130 | #ifndef KAB_EMBEDDED |
131 | static KAboutData *createAboutData(); | 131 | static KAboutData *createAboutData(); |
132 | #endif //KAB_EMBEDDED | 132 | #endif //KAB_EMBEDDED |
133 | 133 | ||
134 | #ifdef KAB_EMBEDDED | 134 | #ifdef KAB_EMBEDDED |
135 | inline QPopupMenu* getImportMenu() { return ImportMenu;} | 135 | inline QPopupMenu* getImportMenu() { return ImportMenu;} |
136 | inline QPopupMenu* getExportMenu() { return ExportMenu;} | 136 | inline QPopupMenu* getExportMenu() { return ExportMenu;} |
137 | #endif //KAB_EMBEDDED | 137 | #endif //KAB_EMBEDDED |
138 | 138 | ||
139 | public slots: | 139 | public slots: |
140 | #ifdef KAB_EMBEDDED | 140 | #ifdef KAB_EMBEDDED |
141 | void createAboutData(); | 141 | void createAboutData(); |
142 | #endif //KAB_EMBEDDED | 142 | #endif //KAB_EMBEDDED |
143 | 143 | ||
144 | void statusMessage(QString, int time = 0 ); | 144 | void statusMessage(QString, int time = 0 ); |
145 | void showLicence(); | ||
145 | /** | 146 | /** |
146 | Is called whenever a contact is selected in the view. | 147 | Is called whenever a contact is selected in the view. |
147 | */ | 148 | */ |
148 | void setContactSelected( const QString &uid ); | 149 | void setContactSelected( const QString &uid ); |
149 | 150 | ||
150 | /** | 151 | /** |
151 | Opens the preferred mail composer with all selected contacts as | 152 | Opens the preferred mail composer with all selected contacts as |
152 | arguments. | 153 | arguments. |
153 | */ | 154 | */ |
154 | void sendMail(); | 155 | void sendMail(); |
155 | 156 | ||
156 | /** | 157 | /** |
157 | Opens the preferred mail composer with the given contacts as | 158 | Opens the preferred mail composer with the given contacts as |
158 | arguments. | 159 | arguments. |
159 | */ | 160 | */ |
160 | void sendMail( const QString& email ); | 161 | void sendMail( const QString& email ); |
161 | 162 | ||
162 | 163 | ||
163 | void mailVCard(); | 164 | void mailVCard(); |
164 | void mailVCard(const QStringList& uids); | 165 | void mailVCard(const QStringList& uids); |
165 | 166 | ||
166 | /** | 167 | /** |
167 | Beams the "WhoAmI contact. | 168 | Beams the "WhoAmI contact. |
168 | */ | 169 | */ |
169 | void beamMySelf(); | 170 | void beamMySelf(); |
170 | 171 | ||
171 | void beamVCard(); | 172 | void beamVCard(); |
172 | void beamVCard(const QStringList& uids); | 173 | void beamVCard(const QStringList& uids); |
173 | void beamDone( Ir *ir ); | 174 | void beamDone( Ir *ir ); |
174 | 175 | ||
175 | 176 | ||
176 | /** | 177 | /** |
177 | Starts the preferred web browser with the given URL as argument. | 178 | Starts the preferred web browser with the given URL as argument. |
178 | */ | 179 | */ |
179 | void browse( const QString& url ); | 180 | void browse( const QString& url ); |
180 | 181 | ||
181 | /** | 182 | /** |
182 | Select all contacts in the view. | 183 | Select all contacts in the view. |
183 | */ | 184 | */ |
184 | void selectAllContacts(); | 185 | void selectAllContacts(); |
185 | 186 | ||
186 | /** | 187 | /** |
187 | Deletes all selected contacts from the address book. | 188 | Deletes all selected contacts from the address book. |
188 | */ | 189 | */ |
189 | void deleteContacts(); | 190 | void deleteContacts(); |
190 | 191 | ||
191 | /** | 192 | /** |
192 | Deletes given contacts from the address book. | 193 | Deletes given contacts from the address book. |
193 | 194 | ||
194 | @param uids The uids of the contacts, which shall be deleted. | 195 | @param uids The uids of the contacts, which shall be deleted. |
195 | */ | 196 | */ |
196 | void deleteContacts( const QStringList &uids ); | 197 | void deleteContacts( const QStringList &uids ); |
197 | 198 | ||
198 | /** | 199 | /** |
199 | Copys the selected contacts into clipboard for later pasting. | 200 | Copys the selected contacts into clipboard for later pasting. |
200 | */ | 201 | */ |
201 | void copyContacts(); | 202 | void copyContacts(); |
202 | 203 | ||
203 | /** | 204 | /** |
204 | Cuts the selected contacts and stores them for later pasting. | 205 | Cuts the selected contacts and stores them for later pasting. |
205 | */ | 206 | */ |
206 | void cutContacts(); | 207 | void cutContacts(); |
207 | 208 | ||
208 | /** | 209 | /** |
209 | Paste contacts from clipboard into the address book. | 210 | Paste contacts from clipboard into the address book. |
210 | */ | 211 | */ |
211 | void pasteContacts(); | 212 | void pasteContacts(); |
212 | 213 | ||
213 | /** | 214 | /** |
214 | Paste given contacts into the address book. | 215 | Paste given contacts into the address book. |
215 | 216 | ||
216 | @param list The list of addressee, which shall be pasted. | 217 | @param list The list of addressee, which shall be pasted. |
217 | */ | 218 | */ |
218 | void pasteContacts( KABC::Addressee::List &list ); | 219 | void pasteContacts( KABC::Addressee::List &list ); |
219 | 220 | ||
220 | /** | 221 | /** |
221 | Sets the whoAmI contact, that is used by many other programs to | 222 | Sets the whoAmI contact, that is used by many other programs to |
222 | get personal information about the current user. | 223 | get personal information about the current user. |
223 | */ | 224 | */ |
224 | void setWhoAmI(); | 225 | void setWhoAmI(); |
225 | 226 | ||
226 | /** | 227 | /** |
227 | Displays the category dialog and applies the result to all | 228 | Displays the category dialog and applies the result to all |
228 | selected contacts. | 229 | selected contacts. |
229 | */ | 230 | */ |
230 | void setCategories(); | 231 | void setCategories(); |
231 | 232 | ||
232 | /** | 233 | /** |
233 | Sets the field list of the Incremental Search Widget. | 234 | Sets the field list of the Incremental Search Widget. |
234 | */ | 235 | */ |
235 | void setSearchFields( const KABC::Field::List &fields ); | 236 | void setSearchFields( const KABC::Field::List &fields ); |
236 | 237 | ||
237 | /** | 238 | /** |
238 | Search with the current search field for a contact, that matches | 239 | Search with the current search field for a contact, that matches |
239 | the given text, and selects it in the view. | 240 | the given text, and selects it in the view. |
240 | */ | 241 | */ |
241 | void incrementalSearch( const QString& text ); | 242 | void incrementalSearch( const QString& text ); |
242 | 243 | ||
243 | /** | 244 | /** |
244 | Marks the address book as modified. | 245 | Marks the address book as modified. |
245 | */ | 246 | */ |
246 | void setModified(); | 247 | void setModified(); |
247 | /** | 248 | /** |
248 | Marks the address book as modified without refreshing the view. | 249 | Marks the address book as modified without refreshing the view. |
249 | */ | 250 | */ |
250 | void setModifiedWOrefresh(); | 251 | void setModifiedWOrefresh(); |
251 | 252 | ||
252 | /** | 253 | /** |
253 | Marks the address book as modified concerning the argument. | 254 | Marks the address book as modified concerning the argument. |
254 | */ | 255 | */ |
255 | void setModified( bool modified ); | 256 | void setModified( bool modified ); |
256 | 257 | ||
257 | /** | 258 | /** |
258 | Returns whether the address book is modified. | 259 | Returns whether the address book is modified. |
259 | */ | 260 | */ |
260 | bool modified() const; | 261 | bool modified() const; |
261 | 262 | ||
262 | /** | 263 | /** |
263 | Called whenever an contact is modified in the contact editor | 264 | Called whenever an contact is modified in the contact editor |
264 | dialog or the quick edit. | 265 | dialog or the quick edit. |
265 | */ | 266 | */ |
266 | void contactModified( const KABC::Addressee &addr ); | 267 | void contactModified( const KABC::Addressee &addr ); |
267 | 268 | ||
268 | /** | 269 | /** |
269 | DCOP METHODS. | 270 | DCOP METHODS. |
270 | */ | 271 | */ |
271 | void addEmail( QString addr ); | 272 | void addEmail( QString addr ); |
272 | void importVCard( const KURL& url, bool showPreview ); | 273 | void importVCard( const KURL& url, bool showPreview ); |
@@ -282,157 +283,158 @@ class KABCore : public QWidget | |||
282 | */ | 283 | */ |
283 | void save(); | 284 | void save(); |
284 | 285 | ||
285 | /** | 286 | /** |
286 | Undos the last command using the undo stack. | 287 | Undos the last command using the undo stack. |
287 | */ | 288 | */ |
288 | void undo(); | 289 | void undo(); |
289 | 290 | ||
290 | /** | 291 | /** |
291 | Redos the last command that was undone, using the redo stack. | 292 | Redos the last command that was undone, using the redo stack. |
292 | */ | 293 | */ |
293 | void redo(); | 294 | void redo(); |
294 | 295 | ||
295 | /** | 296 | /** |
296 | Shows the edit dialog for the given uid. If the uid is QString::null, | 297 | Shows the edit dialog for the given uid. If the uid is QString::null, |
297 | the method will try to find a selected addressee in the view. | 298 | the method will try to find a selected addressee in the view. |
298 | */ | 299 | */ |
299 | void editContact( const QString &uid /*US = QString::null*/ ); | 300 | void editContact( const QString &uid /*US = QString::null*/ ); |
300 | //US added a second method without defaultparameter | 301 | //US added a second method without defaultparameter |
301 | void editContact2(); | 302 | void editContact2(); |
302 | 303 | ||
303 | /** | 304 | /** |
304 | Launches the configuration dialog. | 305 | Launches the configuration dialog. |
305 | */ | 306 | */ |
306 | void openConfigDialog(); | 307 | void openConfigDialog(); |
307 | 308 | ||
308 | /** | 309 | /** |
309 | Launches the ldap search dialog. | 310 | Launches the ldap search dialog. |
310 | */ | 311 | */ |
311 | void openLDAPDialog(); | 312 | void openLDAPDialog(); |
312 | 313 | ||
313 | /** | 314 | /** |
314 | Creates a KAddressBookPrinter, which will display the print | 315 | Creates a KAddressBookPrinter, which will display the print |
315 | dialog and do the printing. | 316 | dialog and do the printing. |
316 | */ | 317 | */ |
317 | void print(); | 318 | void print(); |
318 | 319 | ||
319 | /** | 320 | /** |
320 | Registers a new GUI client, so plugins can register its actions. | 321 | Registers a new GUI client, so plugins can register its actions. |
321 | */ | 322 | */ |
322 | void addGUIClient( KXMLGUIClient *client ); | 323 | void addGUIClient( KXMLGUIClient *client ); |
323 | 324 | ||
324 | signals: | 325 | signals: |
325 | void contactSelected( const QString &name ); | 326 | void contactSelected( const QString &name ); |
326 | void contactSelected( const QPixmap &pixmap ); | 327 | void contactSelected( const QPixmap &pixmap ); |
327 | public slots: | 328 | public slots: |
328 | void setDetailsVisible( bool visible ); | 329 | void setDetailsVisible( bool visible ); |
329 | void setDetailsToState(); | 330 | void setDetailsToState(); |
330 | private slots: | 331 | private slots: |
331 | void setJumpButtonBarVisible( bool visible ); | 332 | void setJumpButtonBarVisible( bool visible ); |
332 | void importFromOL(); | 333 | void importFromOL(); |
333 | void extensionModified( const KABC::Addressee::List &list ); | 334 | void extensionModified( const KABC::Addressee::List &list ); |
334 | void clipboardDataChanged(); | 335 | void clipboardDataChanged(); |
335 | void updateActionMenu(); | 336 | void updateActionMenu(); |
336 | void configureKeyBindings(); | 337 | void configureKeyBindings(); |
337 | void removeVoice(); | 338 | void removeVoice(); |
338 | #ifdef KAB_EMBEDDED | 339 | #ifdef KAB_EMBEDDED |
339 | void configureResources(); | 340 | void configureResources(); |
340 | #endif //KAB_EMBEDDED | 341 | #endif //KAB_EMBEDDED |
341 | 342 | ||
342 | void slotEditorDestroyed( const QString &uid ); | 343 | void slotEditorDestroyed( const QString &uid ); |
343 | void configurationChanged(); | 344 | void configurationChanged(); |
344 | void addressBookChanged(); | 345 | void addressBookChanged(); |
345 | 346 | ||
346 | private: | 347 | private: |
347 | void initGUI(); | 348 | void initGUI(); |
348 | void initActions(); | 349 | void initActions(); |
349 | 350 | ||
350 | AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent, | 351 | AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent, |
351 | const char *name = 0 ); | 352 | const char *name = 0 ); |
352 | 353 | ||
353 | KXMLGUIClient *mGUIClient; | 354 | KXMLGUIClient *mGUIClient; |
354 | 355 | ||
355 | KABC::AddressBook *mAddressBook; | 356 | KABC::AddressBook *mAddressBook; |
356 | 357 | ||
357 | ViewManager *mViewManager; | 358 | ViewManager *mViewManager; |
358 | // QSplitter *mDetailsSplitter; | 359 | // QSplitter *mDetailsSplitter; |
359 | KDGanttMinimizeSplitter *mExtensionBarSplitter; | 360 | KDGanttMinimizeSplitter *mExtensionBarSplitter; |
360 | ViewContainer *mDetails; | 361 | ViewContainer *mDetails; |
361 | KDGanttMinimizeSplitter* mMiniSplitter; | 362 | KDGanttMinimizeSplitter* mMiniSplitter; |
362 | XXPortManager *mXXPortManager; | 363 | XXPortManager *mXXPortManager; |
363 | JumpButtonBar *mJumpButtonBar; | 364 | JumpButtonBar *mJumpButtonBar; |
364 | IncSearchWidget *mIncSearchWidget; | 365 | IncSearchWidget *mIncSearchWidget; |
365 | ExtensionManager *mExtensionManager; | 366 | ExtensionManager *mExtensionManager; |
366 | 367 | ||
367 | KCMultiDialog *mConfigureDialog; | 368 | KCMultiDialog *mConfigureDialog; |
368 | 369 | ||
369 | #ifndef KAB_EMBEDDED | 370 | #ifndef KAB_EMBEDDED |
370 | LDAPSearchDialog *mLdapSearchDialog; | 371 | LDAPSearchDialog *mLdapSearchDialog; |
371 | #endif //KAB_EMBEDDED | 372 | #endif //KAB_EMBEDDED |
372 | // QDict<AddresseeEditorDialog> mEditorDict; | 373 | // QDict<AddresseeEditorDialog> mEditorDict; |
373 | AddresseeEditorDialog *mEditorDialog; | 374 | AddresseeEditorDialog *mEditorDialog; |
374 | bool mReadWrite; | 375 | bool mReadWrite; |
375 | bool mModified; | 376 | bool mModified; |
376 | bool mIsPart; | 377 | bool mIsPart; |
377 | 378 | ||
378 | //US file menu | 379 | //US file menu |
379 | KAction *mActionMail; | 380 | KAction *mActionMail; |
380 | KAction *mActionBeam; | 381 | KAction *mActionBeam; |
381 | KAction* mActionPrint; | 382 | KAction* mActionPrint; |
382 | KAction* mActionNewContact; | 383 | KAction* mActionNewContact; |
383 | KAction *mActionSave; | 384 | KAction *mActionSave; |
384 | KAction *mActionEditAddressee; | 385 | KAction *mActionEditAddressee; |
385 | KAction *mActionMailVCard; | 386 | KAction *mActionMailVCard; |
386 | KAction *mActionBeamVCard; | 387 | KAction *mActionBeamVCard; |
387 | 388 | ||
388 | KAction *mActionQuit; | 389 | KAction *mActionQuit; |
389 | 390 | ||
390 | //US edit menu | 391 | //US edit menu |
391 | KAction *mActionCopy; | 392 | KAction *mActionCopy; |
392 | KAction *mActionCut; | 393 | KAction *mActionCut; |
393 | KAction *mActionPaste; | 394 | KAction *mActionPaste; |
394 | KAction *mActionSelectAll; | 395 | KAction *mActionSelectAll; |
395 | KAction *mActionUndo; | 396 | KAction *mActionUndo; |
396 | KAction *mActionRedo; | 397 | KAction *mActionRedo; |
397 | KAction *mActionDelete; | 398 | KAction *mActionDelete; |
398 | 399 | ||
399 | //US settings menu | 400 | //US settings menu |
400 | KAction *mActionConfigResources; | 401 | KAction *mActionConfigResources; |
401 | KAction *mActionConfigKAddressbook; | 402 | KAction *mActionConfigKAddressbook; |
402 | KAction *mActionConfigShortcuts; | 403 | KAction *mActionConfigShortcuts; |
403 | KAction *mActionConfigureToolbars; | 404 | KAction *mActionConfigureToolbars; |
404 | KAction *mActionKeyBindings; | 405 | KAction *mActionKeyBindings; |
405 | KToggleAction *mActionJumpBar; | 406 | KToggleAction *mActionJumpBar; |
406 | KToggleAction *mActionDetails; | 407 | KToggleAction *mActionDetails; |
407 | KAction *mActionWhoAmI; | 408 | KAction *mActionWhoAmI; |
408 | KAction *mActionCategories; | 409 | KAction *mActionCategories; |
409 | KAction *mActionAboutKAddressbook; | 410 | KAction *mActionAboutKAddressbook; |
411 | KAction *mActionLicence; | ||
410 | 412 | ||
411 | KAction *mActionDeleteView; | 413 | KAction *mActionDeleteView; |
412 | 414 | ||
413 | QPopupMenu *viewMenu; | 415 | QPopupMenu *viewMenu; |
414 | QPopupMenu *filterMenu; | 416 | QPopupMenu *filterMenu; |
415 | QPopupMenu *settingsMenu; | 417 | QPopupMenu *settingsMenu; |
416 | QPopupMenu *changeMenu; | 418 | QPopupMenu *changeMenu; |
417 | 419 | ||
418 | //US QAction *mActionSave; | 420 | //US QAction *mActionSave; |
419 | QPopupMenu *ImportMenu; | 421 | QPopupMenu *ImportMenu; |
420 | QPopupMenu *ExportMenu; | 422 | QPopupMenu *ExportMenu; |
421 | //LR additional methods | 423 | //LR additional methods |
422 | KAction *mActionRemoveVoice; | 424 | KAction *mActionRemoveVoice; |
423 | KAction * mActionImportOL; | 425 | KAction * mActionImportOL; |
424 | 426 | ||
425 | #ifndef KAB_EMBEDDED | 427 | #ifndef KAB_EMBEDDED |
426 | KAddressBookService *mAddressBookService; | 428 | KAddressBookService *mAddressBookService; |
427 | #endif //KAB_EMBEDDED | 429 | #endif //KAB_EMBEDDED |
428 | 430 | ||
429 | class KABCorePrivate; | 431 | class KABCorePrivate; |
430 | KABCorePrivate *d; | 432 | KABCorePrivate *d; |
431 | 433 | ||
432 | #ifdef KAB_EMBEDDED | 434 | #ifdef KAB_EMBEDDED |
433 | KAddressBookMain *mMainWindow; // should be the same like mGUIClient | 435 | KAddressBookMain *mMainWindow; // should be the same like mGUIClient |
434 | #endif //KAB_EMBEDDED | 436 | #endif //KAB_EMBEDDED |
435 | 437 | ||
436 | }; | 438 | }; |
437 | 439 | ||
438 | #endif | 440 | #endif |