summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-01-16 16:09:49 (UTC)
committer zautrix <zautrix>2005-01-16 16:09:49 (UTC)
commita704468d5fd02d30cf962c8b2d6815c7e9208e5d (patch) (unidiff)
tree2ba2253c8fd73c752a437a201df1d3be7e9e4131
parentde5f08d69c716f85cc92f20700cd24fb1ad41295 (diff)
downloadkdepimpi-a704468d5fd02d30cf962c8b2d6815c7e9208e5d.zip
kdepimpi-a704468d5fd02d30cf962c8b2d6815c7e9208e5d.tar.gz
kdepimpi-a704468d5fd02d30cf962c8b2d6815c7e9208e5d.tar.bz2
menu fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index c5a36e2..4098dda 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1948,407 +1948,411 @@ void KABCore::initActions()
1948 SLOT( undo() ), actionCollection(), 1948 SLOT( undo() ), actionCollection(),
1949 "kaddressbook_undo" ); 1949 "kaddressbook_undo" );
1950 mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z, 1950 mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z,
1951 this, SLOT( redo() ), actionCollection(), 1951 this, SLOT( redo() ), actionCollection(),
1952 "kaddressbook_redo" ); 1952 "kaddressbook_redo" );
1953 } else { 1953 } else {
1954 mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() ); 1954 mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() );
1955 mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() ); 1955 mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() );
1956 mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() ); 1956 mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() );
1957 mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() ); 1957 mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() );
1958 mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() ); 1958 mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() );
1959 mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() ); 1959 mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() );
1960 } 1960 }
1961 1961
1962 mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete", 1962 mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete",
1963 Key_Delete, this, SLOT( deleteContacts() ), 1963 Key_Delete, this, SLOT( deleteContacts() ),
1964 actionCollection(), "edit_delete" ); 1964 actionCollection(), "edit_delete" );
1965 1965
1966 mActionUndo->setEnabled( false ); 1966 mActionUndo->setEnabled( false );
1967 mActionRedo->setEnabled( false ); 1967 mActionRedo->setEnabled( false );
1968 1968
1969 // settings menu 1969 // settings menu
1970#ifdef KAB_EMBEDDED 1970#ifdef KAB_EMBEDDED
1971//US special menuentry to configure the addressbook resources. On KDE 1971//US special menuentry to configure the addressbook resources. On KDE
1972// you do that through the control center !!! 1972// you do that through the control center !!!
1973 mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this, 1973 mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this,
1974 SLOT( configureResources() ), actionCollection(), 1974 SLOT( configureResources() ), actionCollection(),
1975 "kaddressbook_configure_resources" ); 1975 "kaddressbook_configure_resources" );
1976#endif //KAB_EMBEDDED 1976#endif //KAB_EMBEDDED
1977 1977
1978 if ( mIsPart ) { 1978 if ( mIsPart ) {
1979 mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this, 1979 mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this,
1980 SLOT( openConfigDialog() ), actionCollection(), 1980 SLOT( openConfigDialog() ), actionCollection(),
1981 "kaddressbook_configure" ); 1981 "kaddressbook_configure" );
1982 1982
1983 //US not implemented yet 1983 //US not implemented yet
1984 //mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0, 1984 //mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0,
1985 // this, SLOT( configureKeyBindings() ), actionCollection(), 1985 // this, SLOT( configureKeyBindings() ), actionCollection(),
1986 // "kaddressbook_configure_shortcuts" ); 1986 // "kaddressbook_configure_shortcuts" );
1987#ifdef KAB_EMBEDDED 1987#ifdef KAB_EMBEDDED
1988 mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() ); 1988 mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() );
1989 mActionConfigureToolbars->setEnabled( false ); 1989 mActionConfigureToolbars->setEnabled( false );
1990#endif //KAB_EMBEDDED 1990#endif //KAB_EMBEDDED
1991 1991
1992 } else { 1992 } else {
1993 mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() ); 1993 mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() );
1994 1994
1995 //US not implemented yet 1995 //US not implemented yet
1996 //mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); 1996 //mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() );
1997 } 1997 }
1998 1998
1999 mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, 1999 mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0,
2000 actionCollection(), "options_show_jump_bar" ); 2000 actionCollection(), "options_show_jump_bar" );
2001 connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) ); 2001 connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) );
2002 2002
2003 mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0, 2003 mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0,
2004 actionCollection(), "options_show_details" ); 2004 actionCollection(), "options_show_details" );
2005 connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); 2005 connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) );
2006 2006
2007 2007
2008 mActionBR = new KToggleAction( i18n( "Beam receive enabled" ), "beam", 0, this, 2008 mActionBR = new KToggleAction( i18n( "Beam receive enabled" ), "beam", 0, this,
2009 SLOT( toggleBeamReceive() ), actionCollection(), 2009 SLOT( toggleBeamReceive() ), actionCollection(),
2010 "kaddressbook_beam_rec" ); 2010 "kaddressbook_beam_rec" );
2011 2011
2012 2012
2013 // misc 2013 // misc
2014 // only enable LDAP lookup if we can handle the protocol 2014 // only enable LDAP lookup if we can handle the protocol
2015#ifndef KAB_EMBEDDED 2015#ifndef KAB_EMBEDDED
2016 if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) { 2016 if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) {
2017 new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0, 2017 new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0,
2018 this, SLOT( openLDAPDialog() ), actionCollection(), 2018 this, SLOT( openLDAPDialog() ), actionCollection(),
2019 "ldap_lookup" ); 2019 "ldap_lookup" );
2020 } 2020 }
2021#else //KAB_EMBEDDED 2021#else //KAB_EMBEDDED
2022 //qDebug("KABCore::initActions() LDAP has to be implemented"); 2022 //qDebug("KABCore::initActions() LDAP has to be implemented");
2023#endif //KAB_EMBEDDED 2023#endif //KAB_EMBEDDED
2024 2024
2025 2025
2026 mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, 2026 mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this,
2027 SLOT( setWhoAmI() ), actionCollection(), 2027 SLOT( setWhoAmI() ), actionCollection(),
2028 "set_personal" ); 2028 "set_personal" );
2029 2029
2030 2030
2031 mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, 2031 mActionCategories = new KAction( i18n( "Set Categories" ), 0, this,
2032 SLOT( setCategories() ), actionCollection(), 2032 SLOT( setCategories() ), actionCollection(),
2033 "edit_set_categories" ); 2033 "edit_set_categories" );
2034 mActionEditCategories = new KAction( i18n( "Edit Categories" ), 0, this, 2034 mActionEditCategories = new KAction( i18n( "Edit Categories" ), 0, this,
2035 SLOT( editCategories() ), actionCollection(), 2035 SLOT( editCategories() ), actionCollection(),
2036 "edit__categories" ); 2036 "edit__categories" );
2037 2037
2038 mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, 2038 mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this,
2039 SLOT( removeVoice() ), actionCollection(), 2039 SLOT( removeVoice() ), actionCollection(),
2040 "remove_voice" ); 2040 "remove_voice" );
2041 mActionSetFormattedName = new KAction( i18n( "Set formatted name..." ), 0, this, 2041 mActionSetFormattedName = new KAction( i18n( "Set formatted name..." ), 0, this,
2042 SLOT( setFormattedName() ), actionCollection(), 2042 SLOT( setFormattedName() ), actionCollection(),
2043 "set_formatted" ); 2043 "set_formatted" );
2044 2044
2045 mActionManageCategories= new KAction( i18n( "Manage new categories..." ), 0, this, 2045 mActionManageCategories= new KAction( i18n( "Manage new categories..." ), 0, this,
2046 SLOT( manageCategories() ), actionCollection(), 2046 SLOT( manageCategories() ), actionCollection(),
2047 "remove_voice" ); 2047 "remove_voice" );
2048 2048
2049 2049
2050 mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this, 2050 mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this,
2051 SLOT( importFromOL() ), actionCollection(), 2051 SLOT( importFromOL() ), actionCollection(),
2052 "import_OL" ); 2052 "import_OL" );
2053#ifdef KAB_EMBEDDED 2053#ifdef KAB_EMBEDDED
2054 mActionLicence = new KAction( i18n( "Licence" ), 0, 2054 mActionLicence = new KAction( i18n( "Licence" ), 0,
2055 this, SLOT( showLicence() ), actionCollection(), 2055 this, SLOT( showLicence() ), actionCollection(),
2056 "licence_about_data" ); 2056 "licence_about_data" );
2057 mActionFaq = new KAction( i18n( "Faq" ), 0, 2057 mActionFaq = new KAction( i18n( "Faq" ), 0,
2058 this, SLOT( faq() ), actionCollection(), 2058 this, SLOT( faq() ), actionCollection(),
2059 "faq_about_data" ); 2059 "faq_about_data" );
2060 mActionWN = new KAction( i18n( "What's New?" ), 0, 2060 mActionWN = new KAction( i18n( "What's New?" ), 0,
2061 this, SLOT( whatsnew() ), actionCollection(), 2061 this, SLOT( whatsnew() ), actionCollection(),
2062 "wn" ); 2062 "wn" );
2063 mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0, 2063 mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0,
2064 this, SLOT( synchowto() ), actionCollection(), 2064 this, SLOT( synchowto() ), actionCollection(),
2065 "sync" ); 2065 "sync" );
2066 mActionKdeSyncHowto = new KAction( i18n( "Kde Sync HowTo" ), 0, 2066 mActionKdeSyncHowto = new KAction( i18n( "Kde Sync HowTo" ), 0,
2067 this, SLOT( kdesynchowto() ), actionCollection(), 2067 this, SLOT( kdesynchowto() ), actionCollection(),
2068 "kdesync" ); 2068 "kdesync" );
2069 mActionMultiSyncHowto = new KAction( i18n( "Multi Sync HowTo" ), 0, 2069 mActionMultiSyncHowto = new KAction( i18n( "Multi Sync HowTo" ), 0,
2070 this, SLOT( multisynchowto() ), actionCollection(), 2070 this, SLOT( multisynchowto() ), actionCollection(),
2071 "multisync" ); 2071 "multisync" );
2072 2072
2073 mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, 2073 mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0,
2074 this, SLOT( createAboutData() ), actionCollection(), 2074 this, SLOT( createAboutData() ), actionCollection(),
2075 "kaddressbook_about_data" ); 2075 "kaddressbook_about_data" );
2076#endif //KAB_EMBEDDED 2076#endif //KAB_EMBEDDED
2077 2077
2078 clipboardDataChanged(); 2078 clipboardDataChanged();
2079 connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); 2079 connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) );
2080 connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); 2080 connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) );
2081} 2081}
2082 2082
2083//US we need this function, to plug all actions into the correct menues. 2083//US we need this function, to plug all actions into the correct menues.
2084// KDE uses a XML format to plug the actions, but we work her without this overhead. 2084// KDE uses a XML format to plug the actions, but we work her without this overhead.
2085void KABCore::addActionsManually() 2085void KABCore::addActionsManually()
2086{ 2086{
2087//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); 2087//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart);
2088 2088
2089#ifdef KAB_EMBEDDED 2089#ifdef KAB_EMBEDDED
2090 QPopupMenu *fileMenu = new QPopupMenu( this ); 2090 QPopupMenu *fileMenu = new QPopupMenu( this );
2091 QPopupMenu *editMenu = new QPopupMenu( this ); 2091 QPopupMenu *editMenu = new QPopupMenu( this );
2092 QPopupMenu *helpMenu = new QPopupMenu( this ); 2092 QPopupMenu *helpMenu = new QPopupMenu( this );
2093 2093
2094 KToolBar* tb = mMainWindow->toolBar(); 2094 KToolBar* tb = mMainWindow->toolBar();
2095 2095
2096#ifndef DESKTOP_VERSION 2096#ifndef DESKTOP_VERSION
2097 if ( KABPrefs::instance()->mFullMenuBarVisible ) { 2097 if ( KABPrefs::instance()->mFullMenuBarVisible ) {
2098#endif 2098#endif
2099 QMenuBar* mb = mMainWindow->menuBar(); 2099 QMenuBar* mb = mMainWindow->menuBar();
2100 2100
2101 //US setup menubar. 2101 //US setup menubar.
2102 //Disable the following block if you do not want to have a menubar. 2102 //Disable the following block if you do not want to have a menubar.
2103 mb->insertItem( i18n("&File"), fileMenu ); 2103 mb->insertItem( i18n("&File"), fileMenu );
2104 mb->insertItem( i18n("&Edit"), editMenu ); 2104 mb->insertItem( i18n("&Edit"), editMenu );
2105 mb->insertItem( i18n("&View"), viewMenu ); 2105 mb->insertItem( i18n("&View"), viewMenu );
2106 mb->insertItem( i18n("&Settings"), settingsMenu ); 2106 mb->insertItem( i18n("&Settings"), settingsMenu );
2107 mb->insertItem( i18n("Synchronize"), syncMenu ); 2107 mb->insertItem( i18n("Synchronize"), syncMenu );
2108 //mb->insertItem( i18n("&Change"), changeMenu ); 2108 //mb->insertItem( i18n("&Change"), changeMenu );
2109 mb->insertItem( i18n("&Help"), helpMenu ); 2109 mb->insertItem( i18n("&Help"), helpMenu );
2110 mIncSearchWidget = new IncSearchWidget( tb ); 2110 mIncSearchWidget = new IncSearchWidget( tb );
2111 // tb->insertWidget(-1, 0, mIncSearchWidget); 2111 // tb->insertWidget(-1, 0, mIncSearchWidget);
2112#ifndef DESKTOP_VERSION 2112#ifndef DESKTOP_VERSION
2113 } else { 2113 } else {
2114 //US setup toolbar 2114 //US setup toolbar
2115 QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); 2115 QPEMenuBar *menuBarTB = new QPEMenuBar( tb );
2116 QPopupMenu *popupBarTB = new QPopupMenu( this ); 2116 QPopupMenu *popupBarTB = new QPopupMenu( this );
2117 menuBarTB->insertItem( "ME", popupBarTB); 2117 menuBarTB->insertItem( "ME", popupBarTB);
2118 tb->insertWidget(-1, 0, menuBarTB); 2118 tb->insertWidget(-1, 0, menuBarTB);
2119 mIncSearchWidget = new IncSearchWidget( tb ); 2119 mIncSearchWidget = new IncSearchWidget( tb );
2120 2120
2121 tb->enableMoving(false); 2121 tb->enableMoving(false);
2122 popupBarTB->insertItem( i18n("&File"), fileMenu ); 2122 popupBarTB->insertItem( i18n("&File"), fileMenu );
2123 popupBarTB->insertItem( i18n("&Edit"), editMenu ); 2123 popupBarTB->insertItem( i18n("&Edit"), editMenu );
2124 popupBarTB->insertItem( i18n("&View"), viewMenu ); 2124 popupBarTB->insertItem( i18n("&View"), viewMenu );
2125 popupBarTB->insertItem( i18n("&Settings"), settingsMenu ); 2125 popupBarTB->insertItem( i18n("&Settings"), settingsMenu );
2126 popupBarTB->insertItem( i18n("Synchronize"), syncMenu ); 2126 popupBarTB->insertItem( i18n("Synchronize"), syncMenu );
2127 mViewManager->getFilterAction()->plug ( popupBarTB); 2127 mViewManager->getFilterAction()->plug ( popupBarTB);
2128 //popupBarTB->insertItem( i18n("&Change selected"), changeMenu ); 2128 //popupBarTB->insertItem( i18n("&Change selected"), changeMenu );
2129 popupBarTB->insertItem( i18n("&Help"), helpMenu ); 2129 popupBarTB->insertItem( i18n("&Help"), helpMenu );
2130 if (QApplication::desktop()->width() > 320 ) { 2130 if (QApplication::desktop()->width() > 320 ) {
2131 // mViewManager->getFilterAction()->plug ( tb); 2131 // mViewManager->getFilterAction()->plug ( tb);
2132 } 2132 }
2133 } 2133 }
2134#endif 2134#endif
2135 // mActionQuit->plug ( mMainWindow->toolBar()); 2135 // mActionQuit->plug ( mMainWindow->toolBar());
2136 2136
2137 2137
2138 2138
2139 //US Now connect the actions with the menue entries. 2139 //US Now connect the actions with the menue entries.
2140#ifdef DESKTOP_VERSION
2140 mActionPrint->plug( fileMenu ); 2141 mActionPrint->plug( fileMenu );
2142#endif
2141 mActionMail->plug( fileMenu ); 2143 mActionMail->plug( fileMenu );
2142 fileMenu->insertSeparator(); 2144 fileMenu->insertSeparator();
2143 2145
2144 mActionNewContact->plug( fileMenu ); 2146 mActionNewContact->plug( fileMenu );
2145 mActionNewContact->plug( tb ); 2147 mActionNewContact->plug( tb );
2146 2148
2147 mActionEditAddressee->plug( fileMenu ); 2149 mActionEditAddressee->plug( fileMenu );
2148 // if ((KGlobal::getDesktopSize() > KGlobal::Small ) || 2150 // if ((KGlobal::getDesktopSize() > KGlobal::Small ) ||
2149 // (!KABPrefs::instance()->mMultipleViewsAtOnce )) 2151 // (!KABPrefs::instance()->mMultipleViewsAtOnce ))
2150 mActionEditAddressee->plug( tb ); 2152 mActionEditAddressee->plug( tb );
2151 2153
2152 fileMenu->insertSeparator(); 2154 fileMenu->insertSeparator();
2153 mActionSave->plug( fileMenu ); 2155 mActionSave->plug( fileMenu );
2154 fileMenu->insertItem( "&Import", ImportMenu ); 2156 fileMenu->insertItem( "&Import", ImportMenu );
2155 fileMenu->insertItem( "&Export", ExportMenu ); 2157 fileMenu->insertItem( "&Export", ExportMenu );
2156 fileMenu->insertItem( i18n("&Change"), changeMenu ); 2158 fileMenu->insertItem( i18n("&Change"), changeMenu );
2157#ifndef DESKTOP_VERSION 2159#ifndef DESKTOP_VERSION
2158 if ( Ir::supported() ) fileMenu->insertItem( i18n("&Beam"), beamMenu ); 2160 if ( Ir::supported() ) fileMenu->insertItem( i18n("&Beam"), beamMenu );
2159#endif 2161#endif
2160 2162#if 0
2163 // PENDING fix MailVCard
2161 fileMenu->insertSeparator(); 2164 fileMenu->insertSeparator();
2162 mActionMailVCard->plug( fileMenu ); 2165 mActionMailVCard->plug( fileMenu );
2166#endif
2163#ifndef DESKTOP_VERSION 2167#ifndef DESKTOP_VERSION
2164 if ( Ir::supported() ) mActionBR->plug( beamMenu ); 2168 if ( Ir::supported() ) mActionBR->plug( beamMenu );
2165 if ( Ir::supported() ) mActionBeamVCard->plug( beamMenu ); 2169 if ( Ir::supported() ) mActionBeamVCard->plug( beamMenu );
2166 if ( Ir::supported() ) mActionBeam->plug( beamMenu ); 2170 if ( Ir::supported() ) mActionBeam->plug( beamMenu );
2167#endif 2171#endif
2168 fileMenu->insertSeparator(); 2172 fileMenu->insertSeparator();
2169 mActionQuit->plug( fileMenu ); 2173 mActionQuit->plug( fileMenu );
2170#ifdef _WIN32_ 2174#ifdef _WIN32_
2171 mActionImportOL->plug( ImportMenu ); 2175 mActionImportOL->plug( ImportMenu );
2172#endif 2176#endif
2173 // edit menu 2177 // edit menu
2174 mActionUndo->plug( editMenu ); 2178 mActionUndo->plug( editMenu );
2175 mActionRedo->plug( editMenu ); 2179 mActionRedo->plug( editMenu );
2176 editMenu->insertSeparator(); 2180 editMenu->insertSeparator();
2177 mActionCut->plug( editMenu ); 2181 mActionCut->plug( editMenu );
2178 mActionCopy->plug( editMenu ); 2182 mActionCopy->plug( editMenu );
2179 mActionPaste->plug( editMenu ); 2183 mActionPaste->plug( editMenu );
2180 mActionDelete->plug( editMenu ); 2184 mActionDelete->plug( editMenu );
2181 editMenu->insertSeparator(); 2185 editMenu->insertSeparator();
2182 mActionSelectAll->plug( editMenu ); 2186 mActionSelectAll->plug( editMenu );
2183 2187
2184 mActionSetFormattedName->plug( changeMenu ); 2188 mActionSetFormattedName->plug( changeMenu );
2185 mActionRemoveVoice->plug( changeMenu ); 2189 mActionRemoveVoice->plug( changeMenu );
2186 // settings menu 2190 // settings menu
2187//US special menuentry to configure the addressbook resources. On KDE 2191//US special menuentry to configure the addressbook resources. On KDE
2188// you do that through the control center !!! 2192// you do that through the control center !!!
2189 mActionConfigResources->plug( settingsMenu ); 2193 mActionConfigResources->plug( settingsMenu );
2190 settingsMenu->insertSeparator(); 2194 settingsMenu->insertSeparator();
2191 2195
2192 mActionConfigKAddressbook->plug( settingsMenu ); 2196 mActionConfigKAddressbook->plug( settingsMenu );
2193 2197
2194 if ( mIsPart ) { 2198 if ( mIsPart ) {
2195 //US not implemented yet 2199 //US not implemented yet
2196 //mActionConfigShortcuts->plug( settingsMenu ); 2200 //mActionConfigShortcuts->plug( settingsMenu );
2197 //mActionConfigureToolbars->plug( settingsMenu ); 2201 //mActionConfigureToolbars->plug( settingsMenu );
2198 2202
2199 } else { 2203 } else {
2200 //US not implemented yet 2204 //US not implemented yet
2201 //mActionKeyBindings->plug( settingsMenu ); 2205 //mActionKeyBindings->plug( settingsMenu );
2202 } 2206 }
2203 2207
2204 settingsMenu->insertSeparator(); 2208 settingsMenu->insertSeparator();
2205 2209
2206 mActionJumpBar->plug( settingsMenu ); 2210 mActionJumpBar->plug( settingsMenu );
2207 mActionDetails->plug( settingsMenu ); 2211 mActionDetails->plug( settingsMenu );
2208 //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) 2212 //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop )
2209 mActionDetails->plug( tb ); 2213 mActionDetails->plug( tb );
2210 settingsMenu->insertSeparator(); 2214 settingsMenu->insertSeparator();
2211#ifndef DESKTOP_VERSION 2215#ifndef DESKTOP_VERSION
2212 if ( Ir::supported() ) mActionBR->plug(settingsMenu ); 2216 if ( Ir::supported() ) mActionBR->plug(settingsMenu );
2213#endif 2217#endif
2214 settingsMenu->insertSeparator(); 2218 settingsMenu->insertSeparator();
2215 2219
2216 mActionWhoAmI->plug( settingsMenu ); 2220 mActionWhoAmI->plug( settingsMenu );
2217 mActionEditCategories->plug( settingsMenu ); 2221 mActionEditCategories->plug( settingsMenu );
2218 mActionEditCategories->plug( changeMenu ); 2222 mActionEditCategories->plug( changeMenu );
2219 mActionCategories->plug( changeMenu ); 2223 mActionCategories->plug( changeMenu );
2220 mActionManageCategories->plug( changeMenu ); 2224 mActionManageCategories->plug( changeMenu );
2221 2225
2222 mActionCategories->plug( settingsMenu ); 2226 mActionCategories->plug( settingsMenu );
2223 mActionManageCategories->plug( settingsMenu ); 2227 mActionManageCategories->plug( settingsMenu );
2224 2228
2225 2229
2226 mActionWN->plug( helpMenu ); 2230 mActionWN->plug( helpMenu );
2227 mActionSyncHowto->plug( helpMenu ); 2231 mActionSyncHowto->plug( helpMenu );
2228 mActionKdeSyncHowto->plug( helpMenu ); 2232 mActionKdeSyncHowto->plug( helpMenu );
2229 mActionMultiSyncHowto->plug( helpMenu ); 2233 mActionMultiSyncHowto->plug( helpMenu );
2230 mActionFaq->plug( helpMenu ); 2234 mActionFaq->plug( helpMenu );
2231 mActionLicence->plug( helpMenu ); 2235 mActionLicence->plug( helpMenu );
2232 mActionAboutKAddressbook->plug( helpMenu ); 2236 mActionAboutKAddressbook->plug( helpMenu );
2233 2237
2234 if (KGlobal::getDesktopSize() > KGlobal::Small ) { 2238 if (KGlobal::getDesktopSize() > KGlobal::Small ) {
2235 2239
2236 mActionSave->plug( tb ); 2240 mActionSave->plug( tb );
2237 mViewManager->getFilterAction()->plug ( tb); 2241 mViewManager->getFilterAction()->plug ( tb);
2238 //LR hide filteraction on started in 480x640 2242 //LR hide filteraction on started in 480x640
2239 if (QApplication::desktop()->width() == 480 ) { 2243 if (QApplication::desktop()->width() == 480 ) {
2240 mViewManager->getFilterAction()->setComboWidth( 0 ); 2244 mViewManager->getFilterAction()->setComboWidth( 0 );
2241 } 2245 }
2242 mActionUndo->plug( tb ); 2246 mActionUndo->plug( tb );
2243 mActionDelete->plug( tb ); 2247 mActionDelete->plug( tb );
2244 mActionRedo->plug( tb ); 2248 mActionRedo->plug( tb );
2245 } else { 2249 } else {
2246 mActionSave->plug( tb ); 2250 mActionSave->plug( tb );
2247 tb->enableMoving(false); 2251 tb->enableMoving(false);
2248 } 2252 }
2249 //mActionQuit->plug ( tb ); 2253 //mActionQuit->plug ( tb );
2250 // tb->insertWidget(-1, 0, mIncSearchWidget, 6); 2254 // tb->insertWidget(-1, 0, mIncSearchWidget, 6);
2251 2255
2252 //US link the searchwidget first to this. 2256 //US link the searchwidget first to this.
2253 // The real linkage to the toolbar happens later. 2257 // The real linkage to the toolbar happens later.
2254//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); 2258//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE);
2255//US tb->insertItem( mIncSearchWidget ); 2259//US tb->insertItem( mIncSearchWidget );
2256/*US 2260/*US
2257 mIncSearchWidget = new IncSearchWidget( tb ); 2261 mIncSearchWidget = new IncSearchWidget( tb );
2258 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 2262 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
2259 SLOT( incrementalSearch( const QString& ) ) ); 2263 SLOT( incrementalSearch( const QString& ) ) );
2260 2264
2261 mJumpButtonBar = new JumpButtonBar( this, this ); 2265 mJumpButtonBar = new JumpButtonBar( this, this );
2262 2266
2263//US topLayout->addWidget( mJumpButtonBar ); 2267//US topLayout->addWidget( mJumpButtonBar );
2264 this->layout()->add( mJumpButtonBar ); 2268 this->layout()->add( mJumpButtonBar );
2265*/ 2269*/
2266 2270
2267#endif //KAB_EMBEDDED 2271#endif //KAB_EMBEDDED
2268 2272
2269 mActionExport2phone->plug( ExportMenu ); 2273 mActionExport2phone->plug( ExportMenu );
2270 connect ( syncMenu, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) ); 2274 connect ( syncMenu, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) );
2271 syncManager->fillSyncMenu(); 2275 syncManager->fillSyncMenu();
2272 2276
2273} 2277}
2274void KABCore::showLicence() 2278void KABCore::showLicence()
2275{ 2279{
2276 KApplication::showLicence(); 2280 KApplication::showLicence();
2277} 2281}
2278 2282
2279void KABCore::manageCategories( ) 2283void KABCore::manageCategories( )
2280{ 2284{
2281 KABCatPrefs* cp = new KABCatPrefs(); 2285 KABCatPrefs* cp = new KABCatPrefs();
2282 cp->show(); 2286 cp->show();
2283 int w =cp->sizeHint().width() ; 2287 int w =cp->sizeHint().width() ;
2284 int h = cp->sizeHint().height() ; 2288 int h = cp->sizeHint().height() ;
2285 int dw = QApplication::desktop()->width(); 2289 int dw = QApplication::desktop()->width();
2286 int dh = QApplication::desktop()->height(); 2290 int dh = QApplication::desktop()->height();
2287 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2291 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2288 if ( !cp->exec() ) { 2292 if ( !cp->exec() ) {
2289 delete cp; 2293 delete cp;
2290 return; 2294 return;
2291 } 2295 }
2292 int count = 0; 2296 int count = 0;
2293 message( i18n("Please wait, processing categories...")); 2297 message( i18n("Please wait, processing categories..."));
2294 if ( cp->addCat() ) { 2298 if ( cp->addCat() ) {
2295 KABC::AddressBook::Iterator it; 2299 KABC::AddressBook::Iterator it;
2296 QStringList catList = KABPrefs::instance()->mCustomCategories; 2300 QStringList catList = KABPrefs::instance()->mCustomCategories;
2297 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2301 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2298 QStringList catIncList = (*it).categories(); 2302 QStringList catIncList = (*it).categories();
2299 int i; 2303 int i;
2300 for( i = 0; i< catIncList.count(); ++i ) { 2304 for( i = 0; i< catIncList.count(); ++i ) {
2301 if ( !catList.contains (catIncList[i])) { 2305 if ( !catList.contains (catIncList[i])) {
2302 catList.append( catIncList[i] ); 2306 catList.append( catIncList[i] );
2303 //qDebug("add cat %s ", catIncList[i].latin1()); 2307 //qDebug("add cat %s ", catIncList[i].latin1());
2304 ++count; 2308 ++count;
2305 } 2309 }
2306 } 2310 }
2307 } 2311 }
2308 catList.sort(); 2312 catList.sort();
2309 KABPrefs::instance()->mCustomCategories = catList; 2313 KABPrefs::instance()->mCustomCategories = catList;
2310 KABPrefs::instance()->writeConfig(); 2314 KABPrefs::instance()->writeConfig();
2311 message(QString::number( count )+ i18n(" categories added to list! ")); 2315 message(QString::number( count )+ i18n(" categories added to list! "));
2312 } else { 2316 } else {
2313 QStringList catList = KABPrefs::instance()->mCustomCategories; 2317 QStringList catList = KABPrefs::instance()->mCustomCategories;
2314 QStringList catIncList; 2318 QStringList catIncList;
2315 QStringList newCatList; 2319 QStringList newCatList;
2316 KABC::AddressBook::Iterator it; 2320 KABC::AddressBook::Iterator it;
2317 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2321 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2318 QStringList catIncList = (*it).categories(); 2322 QStringList catIncList = (*it).categories();
2319 int i; 2323 int i;
2320 if ( catIncList.count() ) { 2324 if ( catIncList.count() ) {
2321 newCatList.clear(); 2325 newCatList.clear();
2322 for( i = 0; i< catIncList.count(); ++i ) { 2326 for( i = 0; i< catIncList.count(); ++i ) {
2323 if ( catList.contains (catIncList[i])) { 2327 if ( catList.contains (catIncList[i])) {
2324 newCatList.append( catIncList[i] ); 2328 newCatList.append( catIncList[i] );
2325 } 2329 }
2326 } 2330 }
2327 newCatList.sort(); 2331 newCatList.sort();
2328 (*it).setCategories( newCatList ); 2332 (*it).setCategories( newCatList );
2329 mAddressBook->insertAddressee( (*it) ); 2333 mAddressBook->insertAddressee( (*it) );
2330 } 2334 }
2331 } 2335 }
2332 setModified( true ); 2336 setModified( true );
2333 mViewManager->refreshView(); 2337 mViewManager->refreshView();
2334 message( i18n("Removing categories done!")); 2338 message( i18n("Removing categories done!"));
2335 } 2339 }
2336 delete cp; 2340 delete cp;
2337} 2341}
2338void KABCore::removeVoice() 2342void KABCore::removeVoice()
2339{ 2343{
2340 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 ) 2344 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 )
2341 return; 2345 return;
2342 KABC::Addressee::List list; 2346 KABC::Addressee::List list;
2343 XXPortSelectDialog dlg( this, false, this ); 2347 XXPortSelectDialog dlg( this, false, this );
2344 if ( dlg.exec() ) 2348 if ( dlg.exec() )
2345 list = dlg.contacts(); 2349 list = dlg.contacts();
2346 else 2350 else
2347 return; 2351 return;
2348 KABC::Addressee::List::Iterator it; 2352 KABC::Addressee::List::Iterator it;
2349 for ( it = list.begin(); it != list.end(); ++it ) { 2353 for ( it = list.begin(); it != list.end(); ++it ) {
2350 if ( (*it).removeVoice() ) 2354 if ( (*it).removeVoice() )
2351 addrModified((*it), false ); 2355 addrModified((*it), false );
2352 } 2356 }
2353} 2357}
2354 2358