-rw-r--r-- | kaddressbook/kabcore.cpp | 17 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 4 |
2 files changed, 21 insertions, 0 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index f2d4cd6..282560f 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -1813,96 +1813,102 @@ void KABCore::initActions() | |||
1813 | mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); | 1813 | mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); |
1814 | } | 1814 | } |
1815 | 1815 | ||
1816 | mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, | 1816 | mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, |
1817 | actionCollection(), "options_show_jump_bar" ); | 1817 | actionCollection(), "options_show_jump_bar" ); |
1818 | connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) ); | 1818 | connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) ); |
1819 | 1819 | ||
1820 | mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0, | 1820 | mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0, |
1821 | actionCollection(), "options_show_details" ); | 1821 | actionCollection(), "options_show_details" ); |
1822 | connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); | 1822 | connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); |
1823 | 1823 | ||
1824 | // misc | 1824 | // misc |
1825 | // only enable LDAP lookup if we can handle the protocol | 1825 | // only enable LDAP lookup if we can handle the protocol |
1826 | #ifndef KAB_EMBEDDED | 1826 | #ifndef KAB_EMBEDDED |
1827 | if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) { | 1827 | if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) { |
1828 | new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0, | 1828 | new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0, |
1829 | this, SLOT( openLDAPDialog() ), actionCollection(), | 1829 | this, SLOT( openLDAPDialog() ), actionCollection(), |
1830 | "ldap_lookup" ); | 1830 | "ldap_lookup" ); |
1831 | } | 1831 | } |
1832 | #else //KAB_EMBEDDED | 1832 | #else //KAB_EMBEDDED |
1833 | //qDebug("KABCore::initActions() LDAP has to be implemented"); | 1833 | //qDebug("KABCore::initActions() LDAP has to be implemented"); |
1834 | #endif //KAB_EMBEDDED | 1834 | #endif //KAB_EMBEDDED |
1835 | 1835 | ||
1836 | 1836 | ||
1837 | mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, | 1837 | mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, |
1838 | SLOT( setWhoAmI() ), actionCollection(), | 1838 | SLOT( setWhoAmI() ), actionCollection(), |
1839 | "set_personal" ); | 1839 | "set_personal" ); |
1840 | 1840 | ||
1841 | 1841 | ||
1842 | 1842 | ||
1843 | 1843 | ||
1844 | mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, | 1844 | mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, |
1845 | SLOT( setCategories() ), actionCollection(), | 1845 | SLOT( setCategories() ), actionCollection(), |
1846 | "edit_set_categories" ); | 1846 | "edit_set_categories" ); |
1847 | 1847 | ||
1848 | mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, | 1848 | mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, |
1849 | SLOT( removeVoice() ), actionCollection(), | 1849 | SLOT( removeVoice() ), actionCollection(), |
1850 | "remove_voice" ); | 1850 | "remove_voice" ); |
1851 | mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this, | 1851 | mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this, |
1852 | SLOT( importFromOL() ), actionCollection(), | 1852 | SLOT( importFromOL() ), actionCollection(), |
1853 | "import_OL" ); | 1853 | "import_OL" ); |
1854 | #ifdef KAB_EMBEDDED | 1854 | #ifdef KAB_EMBEDDED |
1855 | mActionLicence = new KAction( i18n( "Licence" ), 0, | 1855 | mActionLicence = new KAction( i18n( "Licence" ), 0, |
1856 | this, SLOT( showLicence() ), actionCollection(), | 1856 | this, SLOT( showLicence() ), actionCollection(), |
1857 | "licence_about_data" ); | 1857 | "licence_about_data" ); |
1858 | mActionFaq = new KAction( i18n( "Faq" ), 0, | 1858 | mActionFaq = new KAction( i18n( "Faq" ), 0, |
1859 | this, SLOT( faq() ), actionCollection(), | 1859 | this, SLOT( faq() ), actionCollection(), |
1860 | "faq_about_data" ); | 1860 | "faq_about_data" ); |
1861 | mActionWN = new KAction( i18n( "What's New?" ), 0, | ||
1862 | this, SLOT( whatsnew() ), actionCollection(), | ||
1863 | "wn" ); | ||
1864 | mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0, | ||
1865 | this, SLOT( synchowto() ), actionCollection(), | ||
1866 | "sync" ); | ||
1861 | 1867 | ||
1862 | mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, | 1868 | mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, |
1863 | this, SLOT( createAboutData() ), actionCollection(), | 1869 | this, SLOT( createAboutData() ), actionCollection(), |
1864 | "kaddressbook_about_data" ); | 1870 | "kaddressbook_about_data" ); |
1865 | #endif //KAB_EMBEDDED | 1871 | #endif //KAB_EMBEDDED |
1866 | 1872 | ||
1867 | clipboardDataChanged(); | 1873 | clipboardDataChanged(); |
1868 | connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); | 1874 | connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); |
1869 | connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); | 1875 | connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); |
1870 | } | 1876 | } |
1871 | 1877 | ||
1872 | //US we need this function, to plug all actions into the correct menues. | 1878 | //US we need this function, to plug all actions into the correct menues. |
1873 | // KDE uses a XML format to plug the actions, but we work her without this overhead. | 1879 | // KDE uses a XML format to plug the actions, but we work her without this overhead. |
1874 | void KABCore::addActionsManually() | 1880 | void KABCore::addActionsManually() |
1875 | { | 1881 | { |
1876 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); | 1882 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); |
1877 | 1883 | ||
1878 | #ifdef KAB_EMBEDDED | 1884 | #ifdef KAB_EMBEDDED |
1879 | QPopupMenu *fileMenu = new QPopupMenu( this ); | 1885 | QPopupMenu *fileMenu = new QPopupMenu( this ); |
1880 | QPopupMenu *editMenu = new QPopupMenu( this ); | 1886 | QPopupMenu *editMenu = new QPopupMenu( this ); |
1881 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 1887 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
1882 | 1888 | ||
1883 | KToolBar* tb = mMainWindow->toolBar(); | 1889 | KToolBar* tb = mMainWindow->toolBar(); |
1884 | 1890 | ||
1885 | #ifdef DESKTOP_VERSION | 1891 | #ifdef DESKTOP_VERSION |
1886 | QMenuBar* mb = mMainWindow->menuBar(); | 1892 | QMenuBar* mb = mMainWindow->menuBar(); |
1887 | 1893 | ||
1888 | //US setup menubar. | 1894 | //US setup menubar. |
1889 | //Disable the following block if you do not want to have a menubar. | 1895 | //Disable the following block if you do not want to have a menubar. |
1890 | mb->insertItem( "&File", fileMenu ); | 1896 | mb->insertItem( "&File", fileMenu ); |
1891 | mb->insertItem( "&Edit", editMenu ); | 1897 | mb->insertItem( "&Edit", editMenu ); |
1892 | mb->insertItem( "&View", viewMenu ); | 1898 | mb->insertItem( "&View", viewMenu ); |
1893 | mb->insertItem( "&Settings", settingsMenu ); | 1899 | mb->insertItem( "&Settings", settingsMenu ); |
1894 | mb->insertItem( i18n("Synchronize"), syncMenu ); | 1900 | mb->insertItem( i18n("Synchronize"), syncMenu ); |
1895 | mb->insertItem( "&Change selected", changeMenu ); | 1901 | mb->insertItem( "&Change selected", changeMenu ); |
1896 | mb->insertItem( "&Help", helpMenu ); | 1902 | mb->insertItem( "&Help", helpMenu ); |
1897 | mIncSearchWidget = new IncSearchWidget( tb ); | 1903 | mIncSearchWidget = new IncSearchWidget( tb ); |
1898 | // tb->insertWidget(-1, 0, mIncSearchWidget); | 1904 | // tb->insertWidget(-1, 0, mIncSearchWidget); |
1899 | 1905 | ||
1900 | #else | 1906 | #else |
1901 | //US setup toolbar | 1907 | //US setup toolbar |
1902 | QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); | 1908 | QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); |
1903 | QPopupMenu *popupBarTB = new QPopupMenu( this ); | 1909 | QPopupMenu *popupBarTB = new QPopupMenu( this ); |
1904 | menuBarTB->insertItem( "ME", popupBarTB); | 1910 | menuBarTB->insertItem( "ME", popupBarTB); |
1905 | tb->insertWidget(-1, 0, menuBarTB); | 1911 | tb->insertWidget(-1, 0, menuBarTB); |
1906 | mIncSearchWidget = new IncSearchWidget( tb ); | 1912 | mIncSearchWidget = new IncSearchWidget( tb ); |
1907 | 1913 | ||
1908 | tb->enableMoving(false); | 1914 | tb->enableMoving(false); |
@@ -1944,96 +1950,99 @@ void KABCore::addActionsManually() | |||
1944 | #ifndef DESKTOP_VERSION | 1950 | #ifndef DESKTOP_VERSION |
1945 | if ( Ir::supported() ) mActionBeamVCard->plug( fileMenu ); | 1951 | if ( Ir::supported() ) mActionBeamVCard->plug( fileMenu ); |
1946 | if ( Ir::supported() ) mActionBeam->plug(fileMenu ); | 1952 | if ( Ir::supported() ) mActionBeam->plug(fileMenu ); |
1947 | #endif | 1953 | #endif |
1948 | fileMenu->insertSeparator(); | 1954 | fileMenu->insertSeparator(); |
1949 | mActionQuit->plug( fileMenu ); | 1955 | mActionQuit->plug( fileMenu ); |
1950 | #ifdef _WIN32_ | 1956 | #ifdef _WIN32_ |
1951 | mActionImportOL->plug( ImportMenu ); | 1957 | mActionImportOL->plug( ImportMenu ); |
1952 | #endif | 1958 | #endif |
1953 | // edit menu | 1959 | // edit menu |
1954 | mActionUndo->plug( editMenu ); | 1960 | mActionUndo->plug( editMenu ); |
1955 | mActionRedo->plug( editMenu ); | 1961 | mActionRedo->plug( editMenu ); |
1956 | editMenu->insertSeparator(); | 1962 | editMenu->insertSeparator(); |
1957 | mActionCut->plug( editMenu ); | 1963 | mActionCut->plug( editMenu ); |
1958 | mActionCopy->plug( editMenu ); | 1964 | mActionCopy->plug( editMenu ); |
1959 | mActionPaste->plug( editMenu ); | 1965 | mActionPaste->plug( editMenu ); |
1960 | mActionDelete->plug( editMenu ); | 1966 | mActionDelete->plug( editMenu ); |
1961 | editMenu->insertSeparator(); | 1967 | editMenu->insertSeparator(); |
1962 | mActionSelectAll->plug( editMenu ); | 1968 | mActionSelectAll->plug( editMenu ); |
1963 | 1969 | ||
1964 | mActionRemoveVoice->plug( changeMenu ); | 1970 | mActionRemoveVoice->plug( changeMenu ); |
1965 | // settings menu | 1971 | // settings menu |
1966 | //US special menuentry to configure the addressbook resources. On KDE | 1972 | //US special menuentry to configure the addressbook resources. On KDE |
1967 | // you do that through the control center !!! | 1973 | // you do that through the control center !!! |
1968 | mActionConfigResources->plug( settingsMenu ); | 1974 | mActionConfigResources->plug( settingsMenu ); |
1969 | settingsMenu->insertSeparator(); | 1975 | settingsMenu->insertSeparator(); |
1970 | 1976 | ||
1971 | mActionConfigKAddressbook->plug( settingsMenu ); | 1977 | mActionConfigKAddressbook->plug( settingsMenu ); |
1972 | 1978 | ||
1973 | if ( mIsPart ) { | 1979 | if ( mIsPart ) { |
1974 | mActionConfigShortcuts->plug( settingsMenu ); | 1980 | mActionConfigShortcuts->plug( settingsMenu ); |
1975 | mActionConfigureToolbars->plug( settingsMenu ); | 1981 | mActionConfigureToolbars->plug( settingsMenu ); |
1976 | 1982 | ||
1977 | } else { | 1983 | } else { |
1978 | mActionKeyBindings->plug( settingsMenu ); | 1984 | mActionKeyBindings->plug( settingsMenu ); |
1979 | } | 1985 | } |
1980 | 1986 | ||
1981 | settingsMenu->insertSeparator(); | 1987 | settingsMenu->insertSeparator(); |
1982 | 1988 | ||
1983 | mActionJumpBar->plug( settingsMenu ); | 1989 | mActionJumpBar->plug( settingsMenu ); |
1984 | mActionDetails->plug( settingsMenu ); | 1990 | mActionDetails->plug( settingsMenu ); |
1985 | if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) | 1991 | if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) |
1986 | mActionDetails->plug( tb ); | 1992 | mActionDetails->plug( tb ); |
1987 | settingsMenu->insertSeparator(); | 1993 | settingsMenu->insertSeparator(); |
1988 | 1994 | ||
1989 | mActionWhoAmI->plug( settingsMenu ); | 1995 | mActionWhoAmI->plug( settingsMenu ); |
1990 | mActionCategories->plug( settingsMenu ); | 1996 | mActionCategories->plug( settingsMenu ); |
1991 | 1997 | ||
1998 | |||
1999 | mActionWN->plug( helpMenu ); | ||
2000 | mActionSyncHowto->plug( helpMenu ); | ||
1992 | mActionLicence->plug( helpMenu ); | 2001 | mActionLicence->plug( helpMenu ); |
1993 | mActionFaq->plug( helpMenu ); | 2002 | mActionFaq->plug( helpMenu ); |
1994 | mActionAboutKAddressbook->plug( helpMenu ); | 2003 | mActionAboutKAddressbook->plug( helpMenu ); |
1995 | 2004 | ||
1996 | if (KGlobal::getDesktopSize() > KGlobal::Small ) { | 2005 | if (KGlobal::getDesktopSize() > KGlobal::Small ) { |
1997 | 2006 | ||
1998 | mActionSave->plug( tb ); | 2007 | mActionSave->plug( tb ); |
1999 | mViewManager->getFilterAction()->plug ( tb); | 2008 | mViewManager->getFilterAction()->plug ( tb); |
2000 | if (KGlobal::getDesktopSize() == KGlobal::Desktop ) { | 2009 | if (KGlobal::getDesktopSize() == KGlobal::Desktop ) { |
2001 | mActionUndo->plug( tb ); | 2010 | mActionUndo->plug( tb ); |
2002 | mActionDelete->plug( tb ); | 2011 | mActionDelete->plug( tb ); |
2003 | mActionRedo->plug( tb ); | 2012 | mActionRedo->plug( tb ); |
2004 | } | 2013 | } |
2005 | } | 2014 | } |
2006 | //mActionQuit->plug ( tb ); | 2015 | //mActionQuit->plug ( tb ); |
2007 | // tb->insertWidget(-1, 0, mIncSearchWidget, 6); | 2016 | // tb->insertWidget(-1, 0, mIncSearchWidget, 6); |
2008 | 2017 | ||
2009 | //US link the searchwidget first to this. | 2018 | //US link the searchwidget first to this. |
2010 | // The real linkage to the toolbar happens later. | 2019 | // The real linkage to the toolbar happens later. |
2011 | //US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); | 2020 | //US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); |
2012 | //US tb->insertItem( mIncSearchWidget ); | 2021 | //US tb->insertItem( mIncSearchWidget ); |
2013 | /*US | 2022 | /*US |
2014 | mIncSearchWidget = new IncSearchWidget( tb ); | 2023 | mIncSearchWidget = new IncSearchWidget( tb ); |
2015 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), | 2024 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), |
2016 | SLOT( incrementalSearch( const QString& ) ) ); | 2025 | SLOT( incrementalSearch( const QString& ) ) ); |
2017 | 2026 | ||
2018 | mJumpButtonBar = new JumpButtonBar( this, this ); | 2027 | mJumpButtonBar = new JumpButtonBar( this, this ); |
2019 | 2028 | ||
2020 | //US topLayout->addWidget( mJumpButtonBar ); | 2029 | //US topLayout->addWidget( mJumpButtonBar ); |
2021 | this->layout()->add( mJumpButtonBar ); | 2030 | this->layout()->add( mJumpButtonBar ); |
2022 | */ | 2031 | */ |
2023 | 2032 | ||
2024 | #endif //KAB_EMBEDDED | 2033 | #endif //KAB_EMBEDDED |
2025 | 2034 | ||
2026 | mActionExport2phone->plug( ExportMenu ); | 2035 | mActionExport2phone->plug( ExportMenu ); |
2027 | connect ( syncMenu, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) ); | 2036 | connect ( syncMenu, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) ); |
2028 | syncManager->fillSyncMenu(); | 2037 | syncManager->fillSyncMenu(); |
2029 | 2038 | ||
2030 | } | 2039 | } |
2031 | void KABCore::showLicence() | 2040 | void KABCore::showLicence() |
2032 | { | 2041 | { |
2033 | KApplication::showLicence(); | 2042 | KApplication::showLicence(); |
2034 | } | 2043 | } |
2035 | void KABCore::removeVoice() | 2044 | void KABCore::removeVoice() |
2036 | { | 2045 | { |
2037 | 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 ) | 2046 | 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 ) |
2038 | return; | 2047 | return; |
2039 | KABC::Addressee::List list = mViewManager->selectedAddressees(); | 2048 | KABC::Addressee::List list = mViewManager->selectedAddressees(); |
@@ -2232,96 +2241,104 @@ void KABCore::requestForDetails(const QString& sourceChannel, const QString& ses | |||
2232 | } | 2241 | } |
2233 | else if ((namelist.count() > 0) && (emaillist.count() == 0)) | 2242 | else if ((namelist.count() > 0) && (emaillist.count() == 0)) |
2234 | foundUid = namelist[0].uid(); | 2243 | foundUid = namelist[0].uid(); |
2235 | else | 2244 | else |
2236 | { | 2245 | { |
2237 | for (int i = 0; i < namelist.count(); i++) | 2246 | for (int i = 0; i < namelist.count(); i++) |
2238 | { | 2247 | { |
2239 | for (int j = 0; j < emaillist.count(); j++) | 2248 | for (int j = 0; j < emaillist.count(); j++) |
2240 | { | 2249 | { |
2241 | if (namelist[i] == emaillist[j]) | 2250 | if (namelist[i] == emaillist[j]) |
2242 | { | 2251 | { |
2243 | foundUid = namelist[i].uid(); | 2252 | foundUid = namelist[i].uid(); |
2244 | } | 2253 | } |
2245 | } | 2254 | } |
2246 | } | 2255 | } |
2247 | } | 2256 | } |
2248 | } | 2257 | } |
2249 | else | 2258 | else |
2250 | { | 2259 | { |
2251 | foundUid = uid; | 2260 | foundUid = uid; |
2252 | } | 2261 | } |
2253 | 2262 | ||
2254 | if (!foundUid.isEmpty()) | 2263 | if (!foundUid.isEmpty()) |
2255 | { | 2264 | { |
2256 | 2265 | ||
2257 | // raise Ka/Pi if it is in the background | 2266 | // raise Ka/Pi if it is in the background |
2258 | #ifndef DESKTOP_VERSION | 2267 | #ifndef DESKTOP_VERSION |
2259 | #ifndef KORG_NODCOP | 2268 | #ifndef KORG_NODCOP |
2260 | //QCopEnvelope e("QPE/Application/kapi", "raise()"); | 2269 | //QCopEnvelope e("QPE/Application/kapi", "raise()"); |
2261 | #endif | 2270 | #endif |
2262 | #endif | 2271 | #endif |
2263 | 2272 | ||
2264 | mMainWindow->showMaximized(); | 2273 | mMainWindow->showMaximized(); |
2265 | mMainWindow-> raise(); | 2274 | mMainWindow-> raise(); |
2266 | 2275 | ||
2267 | mViewManager->setSelected( "", false); | 2276 | mViewManager->setSelected( "", false); |
2268 | mViewManager->refreshView( "" ); | 2277 | mViewManager->refreshView( "" ); |
2269 | mViewManager->setSelected( foundUid, true ); | 2278 | mViewManager->setSelected( foundUid, true ); |
2270 | mViewManager->refreshView( foundUid ); | 2279 | mViewManager->refreshView( foundUid ); |
2271 | 2280 | ||
2272 | if ( !mMultipleViewsAtOnce ) | 2281 | if ( !mMultipleViewsAtOnce ) |
2273 | { | 2282 | { |
2274 | setDetailsVisible( true ); | 2283 | setDetailsVisible( true ); |
2275 | mActionDetails->setChecked(true); | 2284 | mActionDetails->setChecked(true); |
2276 | } | 2285 | } |
2277 | } | 2286 | } |
2278 | } | 2287 | } |
2279 | 2288 | ||
2289 | void KABCore::whatsnew() | ||
2290 | { | ||
2291 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); | ||
2292 | } | ||
2293 | void KABCore::synchowto() | ||
2294 | { | ||
2295 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); | ||
2296 | } | ||
2280 | 2297 | ||
2281 | void KABCore::faq() | 2298 | void KABCore::faq() |
2282 | { | 2299 | { |
2283 | KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" ); | 2300 | KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" ); |
2284 | } | 2301 | } |
2285 | 2302 | ||
2286 | #include <libkcal/syncdefines.h> | 2303 | #include <libkcal/syncdefines.h> |
2287 | 2304 | ||
2288 | KABC::Addressee KABCore::getLastSyncAddressee() | 2305 | KABC::Addressee KABCore::getLastSyncAddressee() |
2289 | { | 2306 | { |
2290 | Addressee lse; | 2307 | Addressee lse; |
2291 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); | 2308 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); |
2292 | 2309 | ||
2293 | //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() ); | 2310 | //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() ); |
2294 | lse = mAddressBook->findByUid( "last-syncAddressee-"+mCurrentSyncDevice ); | 2311 | lse = mAddressBook->findByUid( "last-syncAddressee-"+mCurrentSyncDevice ); |
2295 | if (lse.isEmpty()) { | 2312 | if (lse.isEmpty()) { |
2296 | qDebug("Creating new last-syncAddressee "); | 2313 | qDebug("Creating new last-syncAddressee "); |
2297 | lse.setUid( "last-syncAddressee-"+mCurrentSyncDevice ); | 2314 | lse.setUid( "last-syncAddressee-"+mCurrentSyncDevice ); |
2298 | QString sum = ""; | 2315 | QString sum = ""; |
2299 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) | 2316 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) |
2300 | sum = "E: "; | 2317 | sum = "E: "; |
2301 | lse.setFamilyName("!"+sum+mCurrentSyncDevice + i18n(" - sync event")); | 2318 | lse.setFamilyName("!"+sum+mCurrentSyncDevice + i18n(" - sync event")); |
2302 | lse.setRevision( mLastAddressbookSync ); | 2319 | lse.setRevision( mLastAddressbookSync ); |
2303 | lse.setCategories( i18n("SyncEvent") ); | 2320 | lse.setCategories( i18n("SyncEvent") ); |
2304 | mAddressBook->insertAddressee( lse ); | 2321 | mAddressBook->insertAddressee( lse ); |
2305 | } | 2322 | } |
2306 | return lse; | 2323 | return lse; |
2307 | } | 2324 | } |
2308 | int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ) | 2325 | int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ) |
2309 | { | 2326 | { |
2310 | 2327 | ||
2311 | //void setZaurusId(int id); | 2328 | //void setZaurusId(int id); |
2312 | // int zaurusId() const; | 2329 | // int zaurusId() const; |
2313 | // void setZaurusUid(int id); | 2330 | // void setZaurusUid(int id); |
2314 | // int zaurusUid() const; | 2331 | // int zaurusUid() const; |
2315 | // void setZaurusStat(int id); | 2332 | // void setZaurusStat(int id); |
2316 | // int zaurusStat() const; | 2333 | // int zaurusStat() const; |
2317 | // 0 equal | 2334 | // 0 equal |
2318 | // 1 take local | 2335 | // 1 take local |
2319 | // 2 take remote | 2336 | // 2 take remote |
2320 | // 3 cancel | 2337 | // 3 cancel |
2321 | QDateTime lastSync = mLastAddressbookSync; | 2338 | QDateTime lastSync = mLastAddressbookSync; |
2322 | QDateTime localMod = local->revision(); | 2339 | QDateTime localMod = local->revision(); |
2323 | QDateTime remoteMod = remote->revision(); | 2340 | QDateTime remoteMod = remote->revision(); |
2324 | 2341 | ||
2325 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); | 2342 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); |
2326 | 2343 | ||
2327 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 2344 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index 04ce33d..3c33923 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h | |||
@@ -101,96 +101,98 @@ class KABCore : public QWidget, public KSyncInterface | |||
101 | */ | 101 | */ |
102 | KABC::AddressBook *addressBook() const; | 102 | KABC::AddressBook *addressBook() const; |
103 | 103 | ||
104 | /** | 104 | /** |
105 | Returns a pointer to the KConfig object of the application. | 105 | Returns a pointer to the KConfig object of the application. |
106 | */ | 106 | */ |
107 | static KConfig *config(); | 107 | static KConfig *config(); |
108 | 108 | ||
109 | /** | 109 | /** |
110 | Returns a pointer to the global KActionCollection object. So | 110 | Returns a pointer to the global KActionCollection object. So |
111 | other classes can register their actions easily. | 111 | other classes can register their actions easily. |
112 | */ | 112 | */ |
113 | KActionCollection *actionCollection() const; | 113 | KActionCollection *actionCollection() const; |
114 | 114 | ||
115 | /** | 115 | /** |
116 | Returns the current search field of the Incremental Search Widget. | 116 | Returns the current search field of the Incremental Search Widget. |
117 | */ | 117 | */ |
118 | KABC::Field *currentSearchField() const; | 118 | KABC::Field *currentSearchField() const; |
119 | 119 | ||
120 | /** | 120 | /** |
121 | Returns the uid list of the currently selected contacts. | 121 | Returns the uid list of the currently selected contacts. |
122 | */ | 122 | */ |
123 | QStringList selectedUIDs() const; | 123 | QStringList selectedUIDs() const; |
124 | 124 | ||
125 | /** | 125 | /** |
126 | Displays the ResourceSelectDialog and returns the selected | 126 | Displays the ResourceSelectDialog and returns the selected |
127 | resource or a null pointer if no resource was selected by | 127 | resource or a null pointer if no resource was selected by |
128 | the user. | 128 | the user. |
129 | */ | 129 | */ |
130 | KABC::Resource *requestResource( QWidget *parent ); | 130 | KABC::Resource *requestResource( QWidget *parent ); |
131 | 131 | ||
132 | #ifndef KAB_EMBEDDED | 132 | #ifndef KAB_EMBEDDED |
133 | static KAboutData *createAboutData(); | 133 | static KAboutData *createAboutData(); |
134 | #endif //KAB_EMBEDDED | 134 | #endif //KAB_EMBEDDED |
135 | 135 | ||
136 | #ifdef KAB_EMBEDDED | 136 | #ifdef KAB_EMBEDDED |
137 | inline QPopupMenu* getImportMenu() { return ImportMenu;} | 137 | inline QPopupMenu* getImportMenu() { return ImportMenu;} |
138 | inline QPopupMenu* getExportMenu() { return ExportMenu;} | 138 | inline QPopupMenu* getExportMenu() { return ExportMenu;} |
139 | #endif //KAB_EMBEDDED | 139 | #endif //KAB_EMBEDDED |
140 | 140 | ||
141 | public slots: | 141 | public slots: |
142 | #ifdef KAB_EMBEDDED | 142 | #ifdef KAB_EMBEDDED |
143 | void createAboutData(); | 143 | void createAboutData(); |
144 | #endif //KAB_EMBEDDED | 144 | #endif //KAB_EMBEDDED |
145 | 145 | ||
146 | void statusMessage(QString, int time = 0 ); | 146 | void statusMessage(QString, int time = 0 ); |
147 | void showLicence(); | 147 | void showLicence(); |
148 | void faq(); | 148 | void faq(); |
149 | void whatsnew() ; | ||
150 | void synchowto() ; | ||
149 | 151 | ||
150 | /** | 152 | /** |
151 | Is called whenever a contact is selected in the view. | 153 | Is called whenever a contact is selected in the view. |
152 | */ | 154 | */ |
153 | void setContactSelected( const QString &uid ); | 155 | void setContactSelected( const QString &uid ); |
154 | 156 | ||
155 | /** | 157 | /** |
156 | Opens the preferred mail composer with all selected contacts as | 158 | Opens the preferred mail composer with all selected contacts as |
157 | arguments. | 159 | arguments. |
158 | */ | 160 | */ |
159 | void sendMail(); | 161 | void sendMail(); |
160 | 162 | ||
161 | /** | 163 | /** |
162 | Opens the preferred mail composer with the given contacts as | 164 | Opens the preferred mail composer with the given contacts as |
163 | arguments. | 165 | arguments. |
164 | */ | 166 | */ |
165 | void sendMail( const QString& email ); | 167 | void sendMail( const QString& email ); |
166 | 168 | ||
167 | 169 | ||
168 | void mailVCard(); | 170 | void mailVCard(); |
169 | void mailVCard(const QStringList& uids); | 171 | void mailVCard(const QStringList& uids); |
170 | 172 | ||
171 | /** | 173 | /** |
172 | Beams the "WhoAmI contact. | 174 | Beams the "WhoAmI contact. |
173 | */ | 175 | */ |
174 | void beamMySelf(); | 176 | void beamMySelf(); |
175 | 177 | ||
176 | void beamVCard(); | 178 | void beamVCard(); |
177 | void export2phone(); | 179 | void export2phone(); |
178 | void beamVCard(const QStringList& uids); | 180 | void beamVCard(const QStringList& uids); |
179 | void beamDone( Ir *ir ); | 181 | void beamDone( Ir *ir ); |
180 | 182 | ||
181 | 183 | ||
182 | /** | 184 | /** |
183 | Starts the preferred web browser with the given URL as argument. | 185 | Starts the preferred web browser with the given URL as argument. |
184 | */ | 186 | */ |
185 | void browse( const QString& url ); | 187 | void browse( const QString& url ); |
186 | 188 | ||
187 | /** | 189 | /** |
188 | Select all contacts in the view. | 190 | Select all contacts in the view. |
189 | */ | 191 | */ |
190 | void selectAllContacts(); | 192 | void selectAllContacts(); |
191 | 193 | ||
192 | /** | 194 | /** |
193 | Deletes all selected contacts from the address book. | 195 | Deletes all selected contacts from the address book. |
194 | */ | 196 | */ |
195 | void deleteContacts(); | 197 | void deleteContacts(); |
196 | 198 | ||
@@ -390,95 +392,97 @@ class KABCore : public QWidget, public KSyncInterface | |||
390 | KCMultiDialog *mConfigureDialog; | 392 | KCMultiDialog *mConfigureDialog; |
391 | 393 | ||
392 | #ifndef KAB_EMBEDDED | 394 | #ifndef KAB_EMBEDDED |
393 | LDAPSearchDialog *mLdapSearchDialog; | 395 | LDAPSearchDialog *mLdapSearchDialog; |
394 | #endif //KAB_EMBEDDED | 396 | #endif //KAB_EMBEDDED |
395 | // QDict<AddresseeEditorDialog> mEditorDict; | 397 | // QDict<AddresseeEditorDialog> mEditorDict; |
396 | AddresseeEditorDialog *mEditorDialog; | 398 | AddresseeEditorDialog *mEditorDialog; |
397 | bool mReadWrite; | 399 | bool mReadWrite; |
398 | bool mModified; | 400 | bool mModified; |
399 | bool mIsPart; | 401 | bool mIsPart; |
400 | bool mMultipleViewsAtOnce; | 402 | bool mMultipleViewsAtOnce; |
401 | 403 | ||
402 | 404 | ||
403 | //US file menu | 405 | //US file menu |
404 | KAction *mActionMail; | 406 | KAction *mActionMail; |
405 | KAction *mActionBeam; | 407 | KAction *mActionBeam; |
406 | KAction *mActionExport2phone; | 408 | KAction *mActionExport2phone; |
407 | KAction* mActionPrint; | 409 | KAction* mActionPrint; |
408 | KAction* mActionNewContact; | 410 | KAction* mActionNewContact; |
409 | KAction *mActionSave; | 411 | KAction *mActionSave; |
410 | KAction *mActionEditAddressee; | 412 | KAction *mActionEditAddressee; |
411 | KAction *mActionMailVCard; | 413 | KAction *mActionMailVCard; |
412 | KAction *mActionBeamVCard; | 414 | KAction *mActionBeamVCard; |
413 | 415 | ||
414 | KAction *mActionQuit; | 416 | KAction *mActionQuit; |
415 | 417 | ||
416 | //US edit menu | 418 | //US edit menu |
417 | KAction *mActionCopy; | 419 | KAction *mActionCopy; |
418 | KAction *mActionCut; | 420 | KAction *mActionCut; |
419 | KAction *mActionPaste; | 421 | KAction *mActionPaste; |
420 | KAction *mActionSelectAll; | 422 | KAction *mActionSelectAll; |
421 | KAction *mActionUndo; | 423 | KAction *mActionUndo; |
422 | KAction *mActionRedo; | 424 | KAction *mActionRedo; |
423 | KAction *mActionDelete; | 425 | KAction *mActionDelete; |
424 | 426 | ||
425 | //US settings menu | 427 | //US settings menu |
426 | KAction *mActionConfigResources; | 428 | KAction *mActionConfigResources; |
427 | KAction *mActionConfigKAddressbook; | 429 | KAction *mActionConfigKAddressbook; |
428 | KAction *mActionConfigShortcuts; | 430 | KAction *mActionConfigShortcuts; |
429 | KAction *mActionConfigureToolbars; | 431 | KAction *mActionConfigureToolbars; |
430 | KAction *mActionKeyBindings; | 432 | KAction *mActionKeyBindings; |
431 | KToggleAction *mActionJumpBar; | 433 | KToggleAction *mActionJumpBar; |
432 | KToggleAction *mActionDetails; | 434 | KToggleAction *mActionDetails; |
433 | KAction *mActionWhoAmI; | 435 | KAction *mActionWhoAmI; |
434 | KAction *mActionCategories; | 436 | KAction *mActionCategories; |
435 | KAction *mActionAboutKAddressbook; | 437 | KAction *mActionAboutKAddressbook; |
436 | KAction *mActionLicence; | 438 | KAction *mActionLicence; |
437 | KAction *mActionFaq; | 439 | KAction *mActionFaq; |
440 | KAction *mActionWN; | ||
441 | KAction *mActionSyncHowto; | ||
438 | 442 | ||
439 | KAction *mActionDeleteView; | 443 | KAction *mActionDeleteView; |
440 | 444 | ||
441 | QPopupMenu *viewMenu; | 445 | QPopupMenu *viewMenu; |
442 | QPopupMenu *filterMenu; | 446 | QPopupMenu *filterMenu; |
443 | QPopupMenu *settingsMenu; | 447 | QPopupMenu *settingsMenu; |
444 | QPopupMenu *changeMenu; | 448 | QPopupMenu *changeMenu; |
445 | //US QAction *mActionSave; | 449 | //US QAction *mActionSave; |
446 | QPopupMenu *ImportMenu; | 450 | QPopupMenu *ImportMenu; |
447 | QPopupMenu *ExportMenu; | 451 | QPopupMenu *ExportMenu; |
448 | //LR additional methods | 452 | //LR additional methods |
449 | KAction *mActionRemoveVoice; | 453 | KAction *mActionRemoveVoice; |
450 | KAction * mActionImportOL; | 454 | KAction * mActionImportOL; |
451 | 455 | ||
452 | #ifndef KAB_EMBEDDED | 456 | #ifndef KAB_EMBEDDED |
453 | KAddressBookService *mAddressBookService; | 457 | KAddressBookService *mAddressBookService; |
454 | #endif //KAB_EMBEDDED | 458 | #endif //KAB_EMBEDDED |
455 | 459 | ||
456 | class KABCorePrivate; | 460 | class KABCorePrivate; |
457 | KABCorePrivate *d; | 461 | KABCorePrivate *d; |
458 | //US bool mBlockSaveFlag; | 462 | //US bool mBlockSaveFlag; |
459 | 463 | ||
460 | #ifdef KAB_EMBEDDED | 464 | #ifdef KAB_EMBEDDED |
461 | KAddressBookMain *mMainWindow; // should be the same like mGUIClient | 465 | KAddressBookMain *mMainWindow; // should be the same like mGUIClient |
462 | #endif //KAB_EMBEDDED | 466 | #endif //KAB_EMBEDDED |
463 | 467 | ||
464 | //this are the overwritten callbackmethods from the syncinterface | 468 | //this are the overwritten callbackmethods from the syncinterface |
465 | virtual bool sync(KSyncManager* manager, QString filename, int mode); | 469 | virtual bool sync(KSyncManager* manager, QString filename, int mode); |
466 | virtual bool syncExternal(KSyncManager* manager, QString resource); | 470 | virtual bool syncExternal(KSyncManager* manager, QString resource); |
467 | bool syncPhone(); | 471 | bool syncPhone(); |
468 | void message( QString m ); | 472 | void message( QString m ); |
469 | 473 | ||
470 | // LR ******************************* | 474 | // LR ******************************* |
471 | // sync stuff! | 475 | // sync stuff! |
472 | QString sentSyncFile(); | 476 | QString sentSyncFile(); |
473 | QPopupMenu *syncMenu; | 477 | QPopupMenu *syncMenu; |
474 | KSyncManager* syncManager; | 478 | KSyncManager* syncManager; |
475 | int mGlobalSyncMode; | 479 | int mGlobalSyncMode; |
476 | bool synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode); | 480 | bool synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode); |
477 | KABC::Addressee getLastSyncAddressee(); | 481 | KABC::Addressee getLastSyncAddressee(); |
478 | QDateTime mLastAddressbookSync; | 482 | QDateTime mLastAddressbookSync; |
479 | int takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ); | 483 | int takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ); |
480 | // ********************* | 484 | // ********************* |
481 | 485 | ||
482 | }; | 486 | }; |
483 | 487 | ||
484 | #endif | 488 | #endif |