summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2004-09-07 22:51:29 (UTC)
committer zautrix <zautrix>2004-09-07 22:51:29 (UTC)
commit2676646d4744ccceab1063dc02d772a26a203c61 (patch) (unidiff)
tree0a0d5261b9a804a29b61a38f68339979051282e2 /kaddressbook
parent64a8ef1629f523df3006de5cb2b9882a50d96a05 (diff)
downloadkdepimpi-2676646d4744ccceab1063dc02d772a26a203c61.zip
kdepimpi-2676646d4744ccceab1063dc02d772a26a203c61.tar.gz
kdepimpi-2676646d4744ccceab1063dc02d772a26a203c61.tar.bz2
Implemented Ompi - kapi connection
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 2f9f1df..6522ccc 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1662,460 +1662,478 @@ void KABCore::initActions()
1662 mMainWindow, SLOT( exit() ), 1662 mMainWindow, SLOT( exit() ),
1663 actionCollection(), "quit" ); 1663 actionCollection(), "quit" );
1664#endif //KAB_EMBEDDED 1664#endif //KAB_EMBEDDED
1665 1665
1666 // edit menu 1666 // edit menu
1667 if ( mIsPart ) { 1667 if ( mIsPart ) {
1668 mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this, 1668 mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this,
1669 SLOT( copyContacts() ), actionCollection(), 1669 SLOT( copyContacts() ), actionCollection(),
1670 "kaddressbook_copy" ); 1670 "kaddressbook_copy" );
1671 mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this, 1671 mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this,
1672 SLOT( cutContacts() ), actionCollection(), 1672 SLOT( cutContacts() ), actionCollection(),
1673 "kaddressbook_cut" ); 1673 "kaddressbook_cut" );
1674 mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this, 1674 mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this,
1675 SLOT( pasteContacts() ), actionCollection(), 1675 SLOT( pasteContacts() ), actionCollection(),
1676 "kaddressbook_paste" ); 1676 "kaddressbook_paste" );
1677 mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this, 1677 mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this,
1678 SLOT( selectAllContacts() ), actionCollection(), 1678 SLOT( selectAllContacts() ), actionCollection(),
1679 "kaddressbook_select_all" ); 1679 "kaddressbook_select_all" );
1680 mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this, 1680 mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this,
1681 SLOT( undo() ), actionCollection(), 1681 SLOT( undo() ), actionCollection(),
1682 "kaddressbook_undo" ); 1682 "kaddressbook_undo" );
1683 mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z, 1683 mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z,
1684 this, SLOT( redo() ), actionCollection(), 1684 this, SLOT( redo() ), actionCollection(),
1685 "kaddressbook_redo" ); 1685 "kaddressbook_redo" );
1686 } else { 1686 } else {
1687 mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() ); 1687 mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() );
1688 mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() ); 1688 mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() );
1689 mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() ); 1689 mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() );
1690 mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() ); 1690 mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() );
1691 mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() ); 1691 mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() );
1692 mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() ); 1692 mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() );
1693 } 1693 }
1694 1694
1695 mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete", 1695 mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete",
1696 Key_Delete, this, SLOT( deleteContacts() ), 1696 Key_Delete, this, SLOT( deleteContacts() ),
1697 actionCollection(), "edit_delete" ); 1697 actionCollection(), "edit_delete" );
1698 1698
1699 mActionUndo->setEnabled( false ); 1699 mActionUndo->setEnabled( false );
1700 mActionRedo->setEnabled( false ); 1700 mActionRedo->setEnabled( false );
1701 1701
1702 // settings menu 1702 // settings menu
1703#ifdef KAB_EMBEDDED 1703#ifdef KAB_EMBEDDED
1704//US special menuentry to configure the addressbook resources. On KDE 1704//US special menuentry to configure the addressbook resources. On KDE
1705// you do that through the control center !!! 1705// you do that through the control center !!!
1706 mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this, 1706 mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this,
1707 SLOT( configureResources() ), actionCollection(), 1707 SLOT( configureResources() ), actionCollection(),
1708 "kaddressbook_configure_resources" ); 1708 "kaddressbook_configure_resources" );
1709#endif //KAB_EMBEDDED 1709#endif //KAB_EMBEDDED
1710 1710
1711 if ( mIsPart ) { 1711 if ( mIsPart ) {
1712 mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this, 1712 mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this,
1713 SLOT( openConfigDialog() ), actionCollection(), 1713 SLOT( openConfigDialog() ), actionCollection(),
1714 "kaddressbook_configure" ); 1714 "kaddressbook_configure" );
1715 1715
1716 mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0, 1716 mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0,
1717 this, SLOT( configureKeyBindings() ), actionCollection(), 1717 this, SLOT( configureKeyBindings() ), actionCollection(),
1718 "kaddressbook_configure_shortcuts" ); 1718 "kaddressbook_configure_shortcuts" );
1719#ifdef KAB_EMBEDDED 1719#ifdef KAB_EMBEDDED
1720 mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() ); 1720 mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() );
1721 mActionConfigureToolbars->setEnabled( false ); 1721 mActionConfigureToolbars->setEnabled( false );
1722#endif //KAB_EMBEDDED 1722#endif //KAB_EMBEDDED
1723 1723
1724 } else { 1724 } else {
1725 mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() ); 1725 mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() );
1726 1726
1727 mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); 1727 mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() );
1728 } 1728 }
1729 1729
1730 mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, 1730 mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0,
1731 actionCollection(), "options_show_jump_bar" ); 1731 actionCollection(), "options_show_jump_bar" );
1732 connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) ); 1732 connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) );
1733 1733
1734 mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0, 1734 mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0,
1735 actionCollection(), "options_show_details" ); 1735 actionCollection(), "options_show_details" );
1736 connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); 1736 connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) );
1737 1737
1738 // misc 1738 // misc
1739 // only enable LDAP lookup if we can handle the protocol 1739 // only enable LDAP lookup if we can handle the protocol
1740#ifndef KAB_EMBEDDED 1740#ifndef KAB_EMBEDDED
1741 if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) { 1741 if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) {
1742 new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0, 1742 new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0,
1743 this, SLOT( openLDAPDialog() ), actionCollection(), 1743 this, SLOT( openLDAPDialog() ), actionCollection(),
1744 "ldap_lookup" ); 1744 "ldap_lookup" );
1745 } 1745 }
1746#else //KAB_EMBEDDED 1746#else //KAB_EMBEDDED
1747 //qDebug("KABCore::initActions() LDAP has to be implemented"); 1747 //qDebug("KABCore::initActions() LDAP has to be implemented");
1748#endif //KAB_EMBEDDED 1748#endif //KAB_EMBEDDED
1749 1749
1750 1750
1751 mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, 1751 mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this,
1752 SLOT( setWhoAmI() ), actionCollection(), 1752 SLOT( setWhoAmI() ), actionCollection(),
1753 "set_personal" ); 1753 "set_personal" );
1754 1754
1755 1755
1756 1756
1757 1757
1758 mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, 1758 mActionCategories = new KAction( i18n( "Set Categories" ), 0, this,
1759 SLOT( setCategories() ), actionCollection(), 1759 SLOT( setCategories() ), actionCollection(),
1760 "edit_set_categories" ); 1760 "edit_set_categories" );
1761 1761
1762 mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, 1762 mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this,
1763 SLOT( removeVoice() ), actionCollection(), 1763 SLOT( removeVoice() ), actionCollection(),
1764 "remove_voice" ); 1764 "remove_voice" );
1765 mActionImportOL = new KAction( i18n( "Import from OL..." ), 0, this, 1765 mActionImportOL = new KAction( i18n( "Import from OL..." ), 0, this,
1766 SLOT( importFromOL() ), actionCollection(), 1766 SLOT( importFromOL() ), actionCollection(),
1767 "import_OL" ); 1767 "import_OL" );
1768#ifdef KAB_EMBEDDED 1768#ifdef KAB_EMBEDDED
1769 mActionLicence = new KAction( i18n( "Licence" ), 0, 1769 mActionLicence = new KAction( i18n( "Licence" ), 0,
1770 this, SLOT( showLicence() ), actionCollection(), 1770 this, SLOT( showLicence() ), actionCollection(),
1771 "licence_about_data" ); 1771 "licence_about_data" );
1772 mActionFaq = new KAction( i18n( "Faq" ), 0, 1772 mActionFaq = new KAction( i18n( "Faq" ), 0,
1773 this, SLOT( faq() ), actionCollection(), 1773 this, SLOT( faq() ), actionCollection(),
1774 "faq_about_data" ); 1774 "faq_about_data" );
1775 1775
1776 mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, 1776 mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0,
1777 this, SLOT( createAboutData() ), actionCollection(), 1777 this, SLOT( createAboutData() ), actionCollection(),
1778 "kaddressbook_about_data" ); 1778 "kaddressbook_about_data" );
1779#endif //KAB_EMBEDDED 1779#endif //KAB_EMBEDDED
1780 1780
1781 clipboardDataChanged(); 1781 clipboardDataChanged();
1782 connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); 1782 connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) );
1783 connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); 1783 connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) );
1784} 1784}
1785 1785
1786//US we need this function, to plug all actions into the correct menues. 1786//US we need this function, to plug all actions into the correct menues.
1787// KDE uses a XML format to plug the actions, but we work her without this overhead. 1787// KDE uses a XML format to plug the actions, but we work her without this overhead.
1788void KABCore::addActionsManually() 1788void KABCore::addActionsManually()
1789{ 1789{
1790//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); 1790//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart);
1791 1791
1792#ifdef KAB_EMBEDDED 1792#ifdef KAB_EMBEDDED
1793 QPopupMenu *fileMenu = new QPopupMenu( this ); 1793 QPopupMenu *fileMenu = new QPopupMenu( this );
1794 QPopupMenu *editMenu = new QPopupMenu( this ); 1794 QPopupMenu *editMenu = new QPopupMenu( this );
1795 QPopupMenu *helpMenu = new QPopupMenu( this ); 1795 QPopupMenu *helpMenu = new QPopupMenu( this );
1796 1796
1797 KToolBar* tb = mMainWindow->toolBar(); 1797 KToolBar* tb = mMainWindow->toolBar();
1798 1798
1799#ifdef DESKTOP_VERSION 1799#ifdef DESKTOP_VERSION
1800 QMenuBar* mb = mMainWindow->menuBar(); 1800 QMenuBar* mb = mMainWindow->menuBar();
1801 1801
1802 //US setup menubar. 1802 //US setup menubar.
1803 //Disable the following block if you do not want to have a menubar. 1803 //Disable the following block if you do not want to have a menubar.
1804 mb->insertItem( "&File", fileMenu ); 1804 mb->insertItem( "&File", fileMenu );
1805 mb->insertItem( "&Edit", editMenu ); 1805 mb->insertItem( "&Edit", editMenu );
1806 mb->insertItem( "&View", viewMenu ); 1806 mb->insertItem( "&View", viewMenu );
1807 mb->insertItem( "&Settings", settingsMenu ); 1807 mb->insertItem( "&Settings", settingsMenu );
1808 mb->insertItem( "&Change selected", changeMenu ); 1808 mb->insertItem( "&Change selected", changeMenu );
1809 mb->insertItem( "&Help", helpMenu ); 1809 mb->insertItem( "&Help", helpMenu );
1810 mIncSearchWidget = new IncSearchWidget( tb ); 1810 mIncSearchWidget = new IncSearchWidget( tb );
1811 // tb->insertWidget(-1, 0, mIncSearchWidget); 1811 // tb->insertWidget(-1, 0, mIncSearchWidget);
1812 1812
1813#else 1813#else
1814 //US setup toolbar 1814 //US setup toolbar
1815 QMenuBar *menuBarTB = new QMenuBar( tb ); 1815 QMenuBar *menuBarTB = new QMenuBar( tb );
1816 QPopupMenu *popupBarTB = new QPopupMenu( this ); 1816 QPopupMenu *popupBarTB = new QPopupMenu( this );
1817 menuBarTB->insertItem( "ME", popupBarTB); 1817 menuBarTB->insertItem( "ME", popupBarTB);
1818 tb->insertWidget(-1, 0, menuBarTB); 1818 tb->insertWidget(-1, 0, menuBarTB);
1819 mIncSearchWidget = new IncSearchWidget( tb ); 1819 mIncSearchWidget = new IncSearchWidget( tb );
1820 1820
1821 tb->enableMoving(false); 1821 tb->enableMoving(false);
1822 popupBarTB->insertItem( "&File", fileMenu ); 1822 popupBarTB->insertItem( "&File", fileMenu );
1823 popupBarTB->insertItem( "&Edit", editMenu ); 1823 popupBarTB->insertItem( "&Edit", editMenu );
1824 popupBarTB->insertItem( "&View", viewMenu ); 1824 popupBarTB->insertItem( "&View", viewMenu );
1825 popupBarTB->insertItem( "&Settings", settingsMenu ); 1825 popupBarTB->insertItem( "&Settings", settingsMenu );
1826 mViewManager->getFilterAction()->plug ( popupBarTB); 1826 mViewManager->getFilterAction()->plug ( popupBarTB);
1827 popupBarTB->insertItem( "&Change selected", changeMenu ); 1827 popupBarTB->insertItem( "&Change selected", changeMenu );
1828 popupBarTB->insertItem( "&Help", helpMenu ); 1828 popupBarTB->insertItem( "&Help", helpMenu );
1829 if (QApplication::desktop()->width() > 320 ) { 1829 if (QApplication::desktop()->width() > 320 ) {
1830 // mViewManager->getFilterAction()->plug ( tb); 1830 // mViewManager->getFilterAction()->plug ( tb);
1831 } 1831 }
1832#endif 1832#endif
1833 // mActionQuit->plug ( mMainWindow->toolBar()); 1833 // mActionQuit->plug ( mMainWindow->toolBar());
1834 1834
1835 1835
1836 1836
1837 //US Now connect the actions with the menue entries. 1837 //US Now connect the actions with the menue entries.
1838 mActionPrint->plug( fileMenu ); 1838 mActionPrint->plug( fileMenu );
1839 mActionMail->plug( fileMenu ); 1839 mActionMail->plug( fileMenu );
1840 fileMenu->insertSeparator(); 1840 fileMenu->insertSeparator();
1841 1841
1842 mActionNewContact->plug( fileMenu ); 1842 mActionNewContact->plug( fileMenu );
1843 mActionNewContact->plug( tb ); 1843 mActionNewContact->plug( tb );
1844 1844
1845 mActionEditAddressee->plug( fileMenu ); 1845 mActionEditAddressee->plug( fileMenu );
1846 if ((KGlobal::getDesktopSize() > KGlobal::Small ) || 1846 if ((KGlobal::getDesktopSize() > KGlobal::Small ) ||
1847 (!KABPrefs::instance()->mMultipleViewsAtOnce )) 1847 (!KABPrefs::instance()->mMultipleViewsAtOnce ))
1848 mActionEditAddressee->plug( tb ); 1848 mActionEditAddressee->plug( tb );
1849 1849
1850 fileMenu->insertSeparator(); 1850 fileMenu->insertSeparator();
1851 mActionSave->plug( fileMenu ); 1851 mActionSave->plug( fileMenu );
1852 fileMenu->insertItem( "&Import", ImportMenu ); 1852 fileMenu->insertItem( "&Import", ImportMenu );
1853 fileMenu->insertItem( "&Emport", ExportMenu ); 1853 fileMenu->insertItem( "&Emport", ExportMenu );
1854 fileMenu->insertSeparator(); 1854 fileMenu->insertSeparator();
1855 mActionMailVCard->plug( fileMenu ); 1855 mActionMailVCard->plug( fileMenu );
1856#ifndef DESKTOP_VERSION 1856#ifndef DESKTOP_VERSION
1857 if ( Ir::supported() ) mActionBeamVCard->plug( fileMenu ); 1857 if ( Ir::supported() ) mActionBeamVCard->plug( fileMenu );
1858 if ( Ir::supported() ) mActionBeam->plug(fileMenu ); 1858 if ( Ir::supported() ) mActionBeam->plug(fileMenu );
1859#endif 1859#endif
1860 fileMenu->insertSeparator(); 1860 fileMenu->insertSeparator();
1861 mActionQuit->plug( fileMenu ); 1861 mActionQuit->plug( fileMenu );
1862#ifdef _WIN32_ 1862#ifdef _WIN32_
1863 mActionImportOL->plug( ImportMenu ); 1863 mActionImportOL->plug( ImportMenu );
1864#endif 1864#endif
1865 // edit menu 1865 // edit menu
1866 mActionUndo->plug( editMenu ); 1866 mActionUndo->plug( editMenu );
1867 mActionRedo->plug( editMenu ); 1867 mActionRedo->plug( editMenu );
1868 editMenu->insertSeparator(); 1868 editMenu->insertSeparator();
1869 mActionCut->plug( editMenu ); 1869 mActionCut->plug( editMenu );
1870 mActionCopy->plug( editMenu ); 1870 mActionCopy->plug( editMenu );
1871 mActionPaste->plug( editMenu ); 1871 mActionPaste->plug( editMenu );
1872 mActionDelete->plug( editMenu ); 1872 mActionDelete->plug( editMenu );
1873 editMenu->insertSeparator(); 1873 editMenu->insertSeparator();
1874 mActionSelectAll->plug( editMenu ); 1874 mActionSelectAll->plug( editMenu );
1875 1875
1876 mActionRemoveVoice->plug( changeMenu ); 1876 mActionRemoveVoice->plug( changeMenu );
1877 // settings menu 1877 // settings menu
1878//US special menuentry to configure the addressbook resources. On KDE 1878//US special menuentry to configure the addressbook resources. On KDE
1879// you do that through the control center !!! 1879// you do that through the control center !!!
1880 mActionConfigResources->plug( settingsMenu ); 1880 mActionConfigResources->plug( settingsMenu );
1881 settingsMenu->insertSeparator(); 1881 settingsMenu->insertSeparator();
1882 1882
1883 mActionConfigKAddressbook->plug( settingsMenu ); 1883 mActionConfigKAddressbook->plug( settingsMenu );
1884 1884
1885 if ( mIsPart ) { 1885 if ( mIsPart ) {
1886 mActionConfigShortcuts->plug( settingsMenu ); 1886 mActionConfigShortcuts->plug( settingsMenu );
1887 mActionConfigureToolbars->plug( settingsMenu ); 1887 mActionConfigureToolbars->plug( settingsMenu );
1888 1888
1889 } else { 1889 } else {
1890 mActionKeyBindings->plug( settingsMenu ); 1890 mActionKeyBindings->plug( settingsMenu );
1891 } 1891 }
1892 1892
1893 settingsMenu->insertSeparator(); 1893 settingsMenu->insertSeparator();
1894 1894
1895 mActionJumpBar->plug( settingsMenu ); 1895 mActionJumpBar->plug( settingsMenu );
1896 mActionDetails->plug( settingsMenu ); 1896 mActionDetails->plug( settingsMenu );
1897 if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) 1897 if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop )
1898 mActionDetails->plug( tb ); 1898 mActionDetails->plug( tb );
1899 settingsMenu->insertSeparator(); 1899 settingsMenu->insertSeparator();
1900 1900
1901 mActionWhoAmI->plug( settingsMenu ); 1901 mActionWhoAmI->plug( settingsMenu );
1902 mActionCategories->plug( settingsMenu ); 1902 mActionCategories->plug( settingsMenu );
1903 1903
1904 mActionLicence->plug( helpMenu ); 1904 mActionLicence->plug( helpMenu );
1905 mActionFaq->plug( helpMenu ); 1905 mActionFaq->plug( helpMenu );
1906 mActionAboutKAddressbook->plug( helpMenu ); 1906 mActionAboutKAddressbook->plug( helpMenu );
1907 1907
1908 if (KGlobal::getDesktopSize() > KGlobal::Small ) { 1908 if (KGlobal::getDesktopSize() > KGlobal::Small ) {
1909 1909
1910 mActionSave->plug( tb ); 1910 mActionSave->plug( tb );
1911 mViewManager->getFilterAction()->plug ( tb); 1911 mViewManager->getFilterAction()->plug ( tb);
1912 if (KGlobal::getDesktopSize() == KGlobal::Desktop ) { 1912 if (KGlobal::getDesktopSize() == KGlobal::Desktop ) {
1913 mActionUndo->plug( tb ); 1913 mActionUndo->plug( tb );
1914 mActionDelete->plug( tb ); 1914 mActionDelete->plug( tb );
1915 mActionRedo->plug( tb ); 1915 mActionRedo->plug( tb );
1916 } 1916 }
1917 } 1917 }
1918 //mActionQuit->plug ( tb ); 1918 //mActionQuit->plug ( tb );
1919 // tb->insertWidget(-1, 0, mIncSearchWidget, 6); 1919 // tb->insertWidget(-1, 0, mIncSearchWidget, 6);
1920 1920
1921 //US link the searchwidget first to this. 1921 //US link the searchwidget first to this.
1922 // The real linkage to the toolbar happens later. 1922 // The real linkage to the toolbar happens later.
1923//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); 1923//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE);
1924//US tb->insertItem( mIncSearchWidget ); 1924//US tb->insertItem( mIncSearchWidget );
1925/*US 1925/*US
1926 mIncSearchWidget = new IncSearchWidget( tb ); 1926 mIncSearchWidget = new IncSearchWidget( tb );
1927 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 1927 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
1928 SLOT( incrementalSearch( const QString& ) ) ); 1928 SLOT( incrementalSearch( const QString& ) ) );
1929 1929
1930 mJumpButtonBar = new JumpButtonBar( this, this ); 1930 mJumpButtonBar = new JumpButtonBar( this, this );
1931 1931
1932//US topLayout->addWidget( mJumpButtonBar ); 1932//US topLayout->addWidget( mJumpButtonBar );
1933 this->layout()->add( mJumpButtonBar ); 1933 this->layout()->add( mJumpButtonBar );
1934*/ 1934*/
1935 1935
1936#endif //KAB_EMBEDDED 1936#endif //KAB_EMBEDDED
1937} 1937}
1938void KABCore::showLicence() 1938void KABCore::showLicence()
1939{ 1939{
1940 KApplication::showLicence(); 1940 KApplication::showLicence();
1941} 1941}
1942void KABCore::removeVoice() 1942void KABCore::removeVoice()
1943{ 1943{
1944 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 ) 1944 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 )
1945 return; 1945 return;
1946 KABC::Addressee::List list = mViewManager->selectedAddressees(); 1946 KABC::Addressee::List list = mViewManager->selectedAddressees();
1947 KABC::Addressee::List::Iterator it; 1947 KABC::Addressee::List::Iterator it;
1948 for ( it = list.begin(); it != list.end(); ++it ) { 1948 for ( it = list.begin(); it != list.end(); ++it ) {
1949 PhoneNumber::List phoneNumbers = (*it).phoneNumbers(); 1949 PhoneNumber::List phoneNumbers = (*it).phoneNumbers();
1950 PhoneNumber::List::Iterator phoneIt; 1950 PhoneNumber::List::Iterator phoneIt;
1951 bool found = false; 1951 bool found = false;
1952 for ( phoneIt = phoneNumbers.begin(); phoneIt != phoneNumbers.end(); ++phoneIt ) { 1952 for ( phoneIt = phoneNumbers.begin(); phoneIt != phoneNumbers.end(); ++phoneIt ) {
1953 if ( (*phoneIt).type() & PhoneNumber::Voice) { // voice found 1953 if ( (*phoneIt).type() & PhoneNumber::Voice) { // voice found
1954 if ((*phoneIt).type() - PhoneNumber::Voice ) { 1954 if ((*phoneIt).type() - PhoneNumber::Voice ) {
1955 (*phoneIt).setType((*phoneIt).type() - PhoneNumber::Voice ); 1955 (*phoneIt).setType((*phoneIt).type() - PhoneNumber::Voice );
1956 (*it).insertPhoneNumber( (*phoneIt) ); 1956 (*it).insertPhoneNumber( (*phoneIt) );
1957 found = true; 1957 found = true;
1958 } 1958 }
1959 } 1959 }
1960 1960
1961 } 1961 }
1962 if ( found ) 1962 if ( found )
1963 contactModified((*it) ); 1963 contactModified((*it) );
1964 } 1964 }
1965} 1965}
1966 1966
1967 1967
1968 1968
1969void KABCore::clipboardDataChanged() 1969void KABCore::clipboardDataChanged()
1970{ 1970{
1971 1971
1972 if ( mReadWrite ) 1972 if ( mReadWrite )
1973 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); 1973 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() );
1974 1974
1975} 1975}
1976 1976
1977void KABCore::updateActionMenu() 1977void KABCore::updateActionMenu()
1978{ 1978{
1979 UndoStack *undo = UndoStack::instance(); 1979 UndoStack *undo = UndoStack::instance();
1980 RedoStack *redo = RedoStack::instance(); 1980 RedoStack *redo = RedoStack::instance();
1981 1981
1982 if ( undo->isEmpty() ) 1982 if ( undo->isEmpty() )
1983 mActionUndo->setText( i18n( "Undo" ) ); 1983 mActionUndo->setText( i18n( "Undo" ) );
1984 else 1984 else
1985 mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); 1985 mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) );
1986 1986
1987 mActionUndo->setEnabled( !undo->isEmpty() ); 1987 mActionUndo->setEnabled( !undo->isEmpty() );
1988 1988
1989 if ( !redo->top() ) 1989 if ( !redo->top() )
1990 mActionRedo->setText( i18n( "Redo" ) ); 1990 mActionRedo->setText( i18n( "Redo" ) );
1991 else 1991 else
1992 mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); 1992 mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) );
1993 1993
1994 mActionRedo->setEnabled( !redo->isEmpty() ); 1994 mActionRedo->setEnabled( !redo->isEmpty() );
1995} 1995}
1996 1996
1997void KABCore::configureKeyBindings() 1997void KABCore::configureKeyBindings()
1998{ 1998{
1999#ifndef KAB_EMBEDDED 1999#ifndef KAB_EMBEDDED
2000 KKeyDialog::configure( actionCollection(), true ); 2000 KKeyDialog::configure( actionCollection(), true );
2001#else //KAB_EMBEDDED 2001#else //KAB_EMBEDDED
2002 qDebug("KABCore::configureKeyBindings() not implemented"); 2002 qDebug("KABCore::configureKeyBindings() not implemented");
2003#endif //KAB_EMBEDDED 2003#endif //KAB_EMBEDDED
2004} 2004}
2005 2005
2006#ifdef KAB_EMBEDDED 2006#ifdef KAB_EMBEDDED
2007void KABCore::configureResources() 2007void KABCore::configureResources()
2008{ 2008{
2009 KRES::KCMKResources dlg( this, "" , 0 ); 2009 KRES::KCMKResources dlg( this, "" , 0 );
2010 2010
2011 if ( !dlg.exec() ) 2011 if ( !dlg.exec() )
2012 return; 2012 return;
2013 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); 2013 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") );
2014} 2014}
2015#endif //KAB_EMBEDDED 2015#endif //KAB_EMBEDDED
2016 2016
2017 2017
2018/* this method will be called through the QCop interface from Ko/Pi to select addresses 2018/* this method will be called through the QCop interface from Ko/Pi to select addresses
2019 * for the attendees list of an event. 2019 * for the attendees list of an event.
2020 */ 2020 */
2021void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) 2021void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid)
2022{ 2022{
2023 QStringList nameList; 2023 QStringList nameList;
2024 QStringList emailList; 2024 QStringList emailList;
2025 QStringList uidList; 2025 QStringList uidList;
2026 2026
2027 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); 2027 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this);
2028 uint i=0; 2028 uint i=0;
2029 for (i=0; i < list.count(); i++) 2029 for (i=0; i < list.count(); i++)
2030 { 2030 {
2031 nameList.append(list[i].realName()); 2031 nameList.append(list[i].realName());
2032 emailList.append(list[i].preferredEmail()); 2032 emailList.append(list[i].preferredEmail());
2033 uidList.append(list[i].uid()); 2033 uidList.append(list[i].uid());
2034 } 2034 }
2035 2035
2036 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList); 2036 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList);
2037 2037
2038} 2038}
2039 2039
2040/* this method will be called through the QCop interface from other apps to show details of a contact. 2040/* this method will be called through the QCop interface from other apps to show details of a contact.
2041 */ 2041 */
2042void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) 2042void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid)
2043{ 2043{
2044 //qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1()); 2044 //qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1());
2045 2045
2046 QString foundUid = QString::null; 2046 QString foundUid = QString::null;
2047 if (uid.isEmpty()) 2047 if ( ! uid.isEmpty() ) {
2048 Addressee adrr = mAddressBook->findByUid( uid );
2049 if ( !adrr.isEmpty() ) {
2050 foundUid = uid;
2051 if ( email == "sendbacklist" ) {
2052 QStringList nameList;
2053 QStringList emailList;
2054 QStringList uidList;
2055 nameList.append(adrr.realName());
2056 emailList = adrr.emails();
2057 uidList.append( adrr.preferredEmail());
2058 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList);
2059 }
2060 }
2061 }
2062
2063 if ( email == "sendback" )
2064 return;
2065 if (foundUid.isEmpty())
2048 { 2066 {
2049 //find the uid of the person first 2067 //find the uid of the person first
2050 Addressee::List namelist; 2068 Addressee::List namelist;
2051 Addressee::List emaillist; 2069 Addressee::List emaillist;
2052 2070
2053 if (!name.isEmpty()) 2071 if (!name.isEmpty())
2054 namelist = mAddressBook->findByName( name ); 2072 namelist = mAddressBook->findByName( name );
2055 2073
2056 if (!email.isEmpty()) 2074 if (!email.isEmpty())
2057 emaillist = mAddressBook->findByEmail( email ); 2075 emaillist = mAddressBook->findByEmail( email );
2058 qDebug("count %d %d ", namelist.count(),emaillist.count() ); 2076 qDebug("count %d %d ", namelist.count(),emaillist.count() );
2059 //check if we have a match in Namelist and Emaillist 2077 //check if we have a match in Namelist and Emaillist
2060 if ((namelist.count() == 0) && (emaillist.count() > 0)) { 2078 if ((namelist.count() == 0) && (emaillist.count() > 0)) {
2061 foundUid = emaillist[0].uid(); 2079 foundUid = emaillist[0].uid();
2062 } 2080 }
2063 else if ((namelist.count() > 0) && (emaillist.count() == 0)) 2081 else if ((namelist.count() > 0) && (emaillist.count() == 0))
2064 foundUid = namelist[0].uid(); 2082 foundUid = namelist[0].uid();
2065 else 2083 else
2066 { 2084 {
2067 for (int i = 0; i < namelist.count(); i++) 2085 for (int i = 0; i < namelist.count(); i++)
2068 { 2086 {
2069 for (int j = 0; j < emaillist.count(); j++) 2087 for (int j = 0; j < emaillist.count(); j++)
2070 { 2088 {
2071 if (namelist[i] == emaillist[j]) 2089 if (namelist[i] == emaillist[j])
2072 { 2090 {
2073 foundUid = namelist[i].uid(); 2091 foundUid = namelist[i].uid();
2074 } 2092 }
2075 } 2093 }
2076 } 2094 }
2077 } 2095 }
2078 } 2096 }
2079 else 2097 else
2080 { 2098 {
2081 foundUid = uid; 2099 foundUid = uid;
2082 } 2100 }
2083 2101
2084 if (!foundUid.isEmpty()) 2102 if (!foundUid.isEmpty())
2085 { 2103 {
2086 2104
2087 // raise Ka/Pi if it is in the background 2105 // raise Ka/Pi if it is in the background
2088#ifndef DESKTOP_VERSION 2106#ifndef DESKTOP_VERSION
2089#ifndef KORG_NODCOP 2107#ifndef KORG_NODCOP
2090 //QCopEnvelope e("QPE/Application/kapi", "raise()"); 2108 //QCopEnvelope e("QPE/Application/kapi", "raise()");
2091#endif 2109#endif
2092#endif 2110#endif
2093 2111
2094 mMainWindow->showMaximized(); 2112 mMainWindow->showMaximized();
2095 mMainWindow-> raise(); 2113 mMainWindow-> raise();
2096 2114
2097 mViewManager->setSelected( "", false); 2115 mViewManager->setSelected( "", false);
2098 mViewManager->refreshView( "" ); 2116 mViewManager->refreshView( "" );
2099 mViewManager->setSelected( foundUid, true ); 2117 mViewManager->setSelected( foundUid, true );
2100 mViewManager->refreshView( foundUid ); 2118 mViewManager->refreshView( foundUid );
2101 2119
2102 if ( !mMultipleViewsAtOnce ) 2120 if ( !mMultipleViewsAtOnce )
2103 { 2121 {
2104 setDetailsVisible( true ); 2122 setDetailsVisible( true );
2105 mActionDetails->setChecked(true); 2123 mActionDetails->setChecked(true);
2106 } 2124 }
2107 } 2125 }
2108} 2126}
2109 2127
2110 2128
2111void KABCore::faq() 2129void KABCore::faq()
2112{ 2130{
2113 KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" ); 2131 KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" );
2114} 2132}
2115 2133
2116 2134
2117 2135
2118 2136
2119#ifndef KAB_EMBEDDED 2137#ifndef KAB_EMBEDDED
2120#include "kabcore.moc" 2138#include "kabcore.moc"
2121#endif //KAB_EMBEDDED 2139#endif //KAB_EMBEDDED