-rw-r--r-- | kaddressbook/kabcore.cpp | 87 |
1 files changed, 44 insertions, 43 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index b0cb986..4964a6c 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -1910,75 +1910,76 @@ void KABCore::initActions() | |||
1910 | // KDE uses a XML format to plug the actions, but we work her without this overhead. | 1910 | // KDE uses a XML format to plug the actions, but we work her without this overhead. |
1911 | void KABCore::addActionsManually() | 1911 | void KABCore::addActionsManually() |
1912 | { | 1912 | { |
1913 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); | 1913 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); |
1914 | 1914 | ||
1915 | #ifdef KAB_EMBEDDED | 1915 | #ifdef KAB_EMBEDDED |
1916 | QPopupMenu *fileMenu = new QPopupMenu( this ); | 1916 | QPopupMenu *fileMenu = new QPopupMenu( this ); |
1917 | QPopupMenu *editMenu = new QPopupMenu( this ); | 1917 | QPopupMenu *editMenu = new QPopupMenu( this ); |
1918 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 1918 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
1919 | 1919 | ||
1920 | KToolBar* tb = mMainWindow->toolBar(); | 1920 | KToolBar* tb = mMainWindow->toolBar(); |
1921 | 1921 | ||
1922 | #ifdef DESKTOP_VERSION | ||
1923 | QMenuBar* mb = mMainWindow->menuBar(); | ||
1924 | |||
1925 | //US setup menubar. | ||
1926 | //Disable the following block if you do not want to have a menubar. | ||
1927 | mb->insertItem( "&File", fileMenu ); | ||
1928 | mb->insertItem( "&Edit", editMenu ); | ||
1929 | mb->insertItem( "&View", viewMenu ); | ||
1930 | mb->insertItem( "&Settings", settingsMenu ); | ||
1931 | mb->insertItem( i18n("Synchronize"), syncMenu ); | ||
1932 | mb->insertItem( "&Change selected", changeMenu ); | ||
1933 | mb->insertItem( "&Help", helpMenu ); | ||
1934 | mIncSearchWidget = new IncSearchWidget( tb ); | ||
1935 | // tb->insertWidget(-1, 0, mIncSearchWidget); | ||
1936 | |||
1937 | #else | ||
1938 | //US setup toolbar | ||
1939 | QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); | ||
1940 | QPopupMenu *popupBarTB = new QPopupMenu( this ); | ||
1941 | menuBarTB->insertItem( "ME", popupBarTB); | ||
1942 | tb->insertWidget(-1, 0, menuBarTB); | ||
1943 | mIncSearchWidget = new IncSearchWidget( tb ); | ||
1944 | 1922 | ||
1945 | tb->enableMoving(false); | 1923 | if ( KABPrefs::instance()->mFullMenuBarVisible ) { |
1946 | popupBarTB->insertItem( "&File", fileMenu ); | 1924 | QMenuBar* mb = mMainWindow->menuBar(); |
1947 | popupBarTB->insertItem( "&Edit", editMenu ); | 1925 | |
1948 | popupBarTB->insertItem( "&View", viewMenu ); | 1926 | //US setup menubar. |
1949 | popupBarTB->insertItem( "&Settings", settingsMenu ); | 1927 | //Disable the following block if you do not want to have a menubar. |
1950 | popupBarTB->insertItem( i18n("Synchronize"), syncMenu ); | 1928 | mb->insertItem( "&File", fileMenu ); |
1951 | mViewManager->getFilterAction()->plug ( popupBarTB); | 1929 | mb->insertItem( "&Edit", editMenu ); |
1952 | popupBarTB->insertItem( "&Change selected", changeMenu ); | 1930 | mb->insertItem( "&View", viewMenu ); |
1953 | popupBarTB->insertItem( "&Help", helpMenu ); | 1931 | mb->insertItem( "&Settings", settingsMenu ); |
1954 | if (QApplication::desktop()->width() > 320 ) { | 1932 | mb->insertItem( i18n("Synchronize"), syncMenu ); |
1955 | // mViewManager->getFilterAction()->plug ( tb); | 1933 | mb->insertItem( "&Change selected", changeMenu ); |
1934 | mb->insertItem( "&Help", helpMenu ); | ||
1935 | mIncSearchWidget = new IncSearchWidget( tb ); | ||
1936 | // tb->insertWidget(-1, 0, mIncSearchWidget); | ||
1937 | |||
1938 | } else { | ||
1939 | //US setup toolbar | ||
1940 | QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); | ||
1941 | QPopupMenu *popupBarTB = new QPopupMenu( this ); | ||
1942 | menuBarTB->insertItem( "ME", popupBarTB); | ||
1943 | tb->insertWidget(-1, 0, menuBarTB); | ||
1944 | mIncSearchWidget = new IncSearchWidget( tb ); | ||
1945 | |||
1946 | tb->enableMoving(false); | ||
1947 | popupBarTB->insertItem( "&File", fileMenu ); | ||
1948 | popupBarTB->insertItem( "&Edit", editMenu ); | ||
1949 | popupBarTB->insertItem( "&View", viewMenu ); | ||
1950 | popupBarTB->insertItem( "&Settings", settingsMenu ); | ||
1951 | popupBarTB->insertItem( i18n("Synchronize"), syncMenu ); | ||
1952 | mViewManager->getFilterAction()->plug ( popupBarTB); | ||
1953 | popupBarTB->insertItem( "&Change selected", changeMenu ); | ||
1954 | popupBarTB->insertItem( "&Help", helpMenu ); | ||
1955 | if (QApplication::desktop()->width() > 320 ) { | ||
1956 | // mViewManager->getFilterAction()->plug ( tb); | ||
1957 | } | ||
1956 | } | 1958 | } |
1957 | #endif | ||
1958 | // mActionQuit->plug ( mMainWindow->toolBar()); | 1959 | // mActionQuit->plug ( mMainWindow->toolBar()); |
1959 | 1960 | ||
1960 | 1961 | ||
1961 | 1962 | ||
1962 | //US Now connect the actions with the menue entries. | 1963 | //US Now connect the actions with the menue entries. |
1963 | mActionPrint->plug( fileMenu ); | 1964 | mActionPrint->plug( fileMenu ); |
1964 | mActionMail->plug( fileMenu ); | 1965 | mActionMail->plug( fileMenu ); |
1965 | fileMenu->insertSeparator(); | 1966 | fileMenu->insertSeparator(); |
1966 | 1967 | ||
1967 | mActionNewContact->plug( fileMenu ); | 1968 | mActionNewContact->plug( fileMenu ); |
1968 | mActionNewContact->plug( tb ); | 1969 | mActionNewContact->plug( tb ); |
1969 | 1970 | ||
1970 | mActionEditAddressee->plug( fileMenu ); | 1971 | mActionEditAddressee->plug( fileMenu ); |
1971 | if ((KGlobal::getDesktopSize() > KGlobal::Small ) || | 1972 | // if ((KGlobal::getDesktopSize() > KGlobal::Small ) || |
1972 | (!KABPrefs::instance()->mMultipleViewsAtOnce )) | 1973 | // (!KABPrefs::instance()->mMultipleViewsAtOnce )) |
1973 | mActionEditAddressee->plug( tb ); | 1974 | mActionEditAddressee->plug( tb ); |
1974 | 1975 | ||
1975 | fileMenu->insertSeparator(); | 1976 | fileMenu->insertSeparator(); |
1976 | mActionSave->plug( fileMenu ); | 1977 | mActionSave->plug( fileMenu ); |
1977 | fileMenu->insertItem( "&Import", ImportMenu ); | 1978 | fileMenu->insertItem( "&Import", ImportMenu ); |
1978 | fileMenu->insertItem( "&Export", ExportMenu ); | 1979 | fileMenu->insertItem( "&Export", ExportMenu ); |
1979 | fileMenu->insertSeparator(); | 1980 | fileMenu->insertSeparator(); |
1980 | mActionMailVCard->plug( fileMenu ); | 1981 | mActionMailVCard->plug( fileMenu ); |
1981 | #ifndef DESKTOP_VERSION | 1982 | #ifndef DESKTOP_VERSION |
1982 | if ( Ir::supported() ) mActionBeamVCard->plug( fileMenu ); | 1983 | if ( Ir::supported() ) mActionBeamVCard->plug( fileMenu ); |
1983 | if ( Ir::supported() ) mActionBeam->plug(fileMenu ); | 1984 | if ( Ir::supported() ) mActionBeam->plug(fileMenu ); |
1984 | #endif | 1985 | #endif |
@@ -2012,52 +2013,52 @@ void KABCore::addActionsManually() | |||
2012 | //mActionConfigShortcuts->plug( settingsMenu ); | 2013 | //mActionConfigShortcuts->plug( settingsMenu ); |
2013 | //mActionConfigureToolbars->plug( settingsMenu ); | 2014 | //mActionConfigureToolbars->plug( settingsMenu ); |
2014 | 2015 | ||
2015 | } else { | 2016 | } else { |
2016 | //US not implemented yet | 2017 | //US not implemented yet |
2017 | //mActionKeyBindings->plug( settingsMenu ); | 2018 | //mActionKeyBindings->plug( settingsMenu ); |
2018 | } | 2019 | } |
2019 | 2020 | ||
2020 | settingsMenu->insertSeparator(); | 2021 | settingsMenu->insertSeparator(); |
2021 | 2022 | ||
2022 | mActionJumpBar->plug( settingsMenu ); | 2023 | mActionJumpBar->plug( settingsMenu ); |
2023 | mActionDetails->plug( settingsMenu ); | 2024 | mActionDetails->plug( settingsMenu ); |
2024 | if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) | 2025 | //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) |
2025 | mActionDetails->plug( tb ); | 2026 | mActionDetails->plug( tb ); |
2026 | settingsMenu->insertSeparator(); | 2027 | settingsMenu->insertSeparator(); |
2027 | mActionBR->plug(settingsMenu ); | 2028 | mActionBR->plug(settingsMenu ); |
2028 | settingsMenu->insertSeparator(); | 2029 | settingsMenu->insertSeparator(); |
2029 | 2030 | ||
2030 | mActionWhoAmI->plug( settingsMenu ); | 2031 | mActionWhoAmI->plug( settingsMenu ); |
2031 | mActionCategories->plug( settingsMenu ); | 2032 | mActionCategories->plug( settingsMenu ); |
2032 | 2033 | ||
2033 | 2034 | ||
2034 | mActionWN->plug( helpMenu ); | 2035 | mActionWN->plug( helpMenu ); |
2035 | mActionSyncHowto->plug( helpMenu ); | 2036 | mActionSyncHowto->plug( helpMenu ); |
2036 | mActionLicence->plug( helpMenu ); | 2037 | mActionLicence->plug( helpMenu ); |
2037 | mActionFaq->plug( helpMenu ); | 2038 | mActionFaq->plug( helpMenu ); |
2038 | mActionAboutKAddressbook->plug( helpMenu ); | 2039 | mActionAboutKAddressbook->plug( helpMenu ); |
2039 | 2040 | ||
2040 | if (KGlobal::getDesktopSize() > KGlobal::Small ) { | 2041 | if (KGlobal::getDesktopSize() > KGlobal::Small ) { |
2041 | 2042 | ||
2042 | mActionSave->plug( tb ); | 2043 | mActionSave->plug( tb ); |
2043 | mViewManager->getFilterAction()->plug ( tb); | 2044 | mViewManager->getFilterAction()->plug ( tb); |
2044 | if (KGlobal::getDesktopSize() == KGlobal::Desktop ) { | 2045 | if (KGlobal::getDesktopSize() == KGlobal::Desktop ) { |
2045 | mActionUndo->plug( tb ); | 2046 | mActionUndo->plug( tb ); |
2046 | mActionDelete->plug( tb ); | 2047 | mActionDelete->plug( tb ); |
2047 | mActionRedo->plug( tb ); | 2048 | mActionRedo->plug( tb ); |
2048 | } | 2049 | } |
2049 | } else { | 2050 | } else { |
2050 | if (KABPrefs::instance()->mMultipleViewsAtOnce ) | 2051 | mActionSave->plug( tb ); |
2051 | mActionSave->plug( tb ); | 2052 | tb->enableMoving(false); |
2052 | } | 2053 | } |
2053 | //mActionQuit->plug ( tb ); | 2054 | //mActionQuit->plug ( tb ); |
2054 | // tb->insertWidget(-1, 0, mIncSearchWidget, 6); | 2055 | // tb->insertWidget(-1, 0, mIncSearchWidget, 6); |
2055 | 2056 | ||
2056 | //US link the searchwidget first to this. | 2057 | //US link the searchwidget first to this. |
2057 | // The real linkage to the toolbar happens later. | 2058 | // The real linkage to the toolbar happens later. |
2058 | //US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); | 2059 | //US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); |
2059 | //US tb->insertItem( mIncSearchWidget ); | 2060 | //US tb->insertItem( mIncSearchWidget ); |
2060 | /*US | 2061 | /*US |
2061 | mIncSearchWidget = new IncSearchWidget( tb ); | 2062 | mIncSearchWidget = new IncSearchWidget( tb ); |
2062 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), | 2063 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), |
2063 | SLOT( incrementalSearch( const QString& ) ) ); | 2064 | SLOT( incrementalSearch( const QString& ) ) ); |