-rw-r--r-- | kaddressbook/kabcore.cpp | 87 | ||||
-rw-r--r-- | kaddressbook/kabprefs.cpp | 5 | ||||
-rw-r--r-- | kaddressbook/kabprefs.h | 1 | ||||
-rw-r--r-- | kaddressbook/kaddressbookview.h | 1 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kabconfigwidget.cpp | 7 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kabconfigwidget.h | 2 | ||||
-rw-r--r-- | kaddressbook/viewmanager.cpp | 6 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbookcardview.cpp | 5 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbookcardview.h | 1 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbookiconview.cpp | 6 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbookiconview.h | 1 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbooktableview.cpp | 6 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbooktableview.h | 1 |
13 files changed, 80 insertions, 49 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index b0cb986..4964a6c 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -1918,44 +1918,45 @@ void KABCore::addActionsManually() QPopupMenu *helpMenu = new QPopupMenu( this ); KToolBar* tb = mMainWindow->toolBar(); -#ifdef DESKTOP_VERSION - QMenuBar* mb = mMainWindow->menuBar(); - - //US setup menubar. - //Disable the following block if you do not want to have a menubar. - mb->insertItem( "&File", fileMenu ); - mb->insertItem( "&Edit", editMenu ); - mb->insertItem( "&View", viewMenu ); - mb->insertItem( "&Settings", settingsMenu ); - mb->insertItem( i18n("Synchronize"), syncMenu ); - mb->insertItem( "&Change selected", changeMenu ); - mb->insertItem( "&Help", helpMenu ); - mIncSearchWidget = new IncSearchWidget( tb ); - // tb->insertWidget(-1, 0, mIncSearchWidget); - -#else - //US setup toolbar - QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); - QPopupMenu *popupBarTB = new QPopupMenu( this ); - menuBarTB->insertItem( "ME", popupBarTB); - tb->insertWidget(-1, 0, menuBarTB); - mIncSearchWidget = new IncSearchWidget( tb ); - tb->enableMoving(false); - popupBarTB->insertItem( "&File", fileMenu ); - popupBarTB->insertItem( "&Edit", editMenu ); - popupBarTB->insertItem( "&View", viewMenu ); - popupBarTB->insertItem( "&Settings", settingsMenu ); - popupBarTB->insertItem( i18n("Synchronize"), syncMenu ); - mViewManager->getFilterAction()->plug ( popupBarTB); - popupBarTB->insertItem( "&Change selected", changeMenu ); - popupBarTB->insertItem( "&Help", helpMenu ); - if (QApplication::desktop()->width() > 320 ) { - // mViewManager->getFilterAction()->plug ( tb); + if ( KABPrefs::instance()->mFullMenuBarVisible ) { + QMenuBar* mb = mMainWindow->menuBar(); + + //US setup menubar. + //Disable the following block if you do not want to have a menubar. + mb->insertItem( "&File", fileMenu ); + mb->insertItem( "&Edit", editMenu ); + mb->insertItem( "&View", viewMenu ); + mb->insertItem( "&Settings", settingsMenu ); + mb->insertItem( i18n("Synchronize"), syncMenu ); + mb->insertItem( "&Change selected", changeMenu ); + mb->insertItem( "&Help", helpMenu ); + mIncSearchWidget = new IncSearchWidget( tb ); + // tb->insertWidget(-1, 0, mIncSearchWidget); + + } else { + //US setup toolbar + QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); + QPopupMenu *popupBarTB = new QPopupMenu( this ); + menuBarTB->insertItem( "ME", popupBarTB); + tb->insertWidget(-1, 0, menuBarTB); + mIncSearchWidget = new IncSearchWidget( tb ); + + tb->enableMoving(false); + popupBarTB->insertItem( "&File", fileMenu ); + popupBarTB->insertItem( "&Edit", editMenu ); + popupBarTB->insertItem( "&View", viewMenu ); + popupBarTB->insertItem( "&Settings", settingsMenu ); + popupBarTB->insertItem( i18n("Synchronize"), syncMenu ); + mViewManager->getFilterAction()->plug ( popupBarTB); + popupBarTB->insertItem( "&Change selected", changeMenu ); + popupBarTB->insertItem( "&Help", helpMenu ); + if (QApplication::desktop()->width() > 320 ) { + // mViewManager->getFilterAction()->plug ( tb); + } } -#endif // mActionQuit->plug ( mMainWindow->toolBar()); @@ -1967,10 +1968,10 @@ void KABCore::addActionsManually() mActionNewContact->plug( fileMenu ); mActionNewContact->plug( tb ); mActionEditAddressee->plug( fileMenu ); - if ((KGlobal::getDesktopSize() > KGlobal::Small ) || - (!KABPrefs::instance()->mMultipleViewsAtOnce )) + // if ((KGlobal::getDesktopSize() > KGlobal::Small ) || + // (!KABPrefs::instance()->mMultipleViewsAtOnce )) mActionEditAddressee->plug( tb ); fileMenu->insertSeparator(); mActionSave->plug( fileMenu ); @@ -2020,10 +2021,10 @@ void KABCore::addActionsManually() settingsMenu->insertSeparator(); mActionJumpBar->plug( settingsMenu ); mActionDetails->plug( settingsMenu ); - if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) - mActionDetails->plug( tb ); + //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) + mActionDetails->plug( tb ); settingsMenu->insertSeparator(); mActionBR->plug(settingsMenu ); settingsMenu->insertSeparator(); @@ -2041,15 +2042,15 @@ void KABCore::addActionsManually() mActionSave->plug( tb ); mViewManager->getFilterAction()->plug ( tb); if (KGlobal::getDesktopSize() == KGlobal::Desktop ) { - mActionUndo->plug( tb ); - mActionDelete->plug( tb ); - mActionRedo->plug( tb ); + mActionUndo->plug( tb ); + mActionDelete->plug( tb ); + mActionRedo->plug( tb ); } } else { - if (KABPrefs::instance()->mMultipleViewsAtOnce ) - mActionSave->plug( tb ); + mActionSave->plug( tb ); + tb->enableMoving(false); } //mActionQuit->plug ( tb ); // tb->insertWidget(-1, 0, mIncSearchWidget, 6); diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp index 3cbcc9a..db123da 100644 --- a/kaddressbook/kabprefs.cpp +++ b/kaddressbook/kabprefs.cpp @@ -66,8 +66,13 @@ KABPrefs::KABPrefs() #endif //KAB_EMBEDDED KPrefs::setCurrentGroup( "MainWindow" ); + bool m_visible = false; +#ifdef DESKTOP_VERSION + m_visible = true; +#endif + addItemBool( "FullMenuBarVisible", &mFullMenuBarVisible, m_visible ); addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false ); addItemBool( "DetailsPageVisible", &mDetailsPageVisible, true ); addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter ); addItemIntList( "DetailsSplitter", &mDetailsSplitter ); diff --git a/kaddressbook/kabprefs.h b/kaddressbook/kabprefs.h index cc8413e..1e3b48f 100644 --- a/kaddressbook/kabprefs.h +++ b/kaddressbook/kabprefs.h @@ -64,8 +64,9 @@ class KABPrefs : public KPimPrefs void usrReadConfig(); // GUI + bool mFullMenuBarVisible; bool mJumpButtonBarVisible; bool mDetailsPageVisible; bool mMultipleViewsAtOnce; bool mSearchWithReturn; diff --git a/kaddressbook/kaddressbookview.h b/kaddressbook/kaddressbookview.h index c134e96..2e91cbc 100644 --- a/kaddressbook/kaddressbookview.h +++ b/kaddressbook/kaddressbookview.h @@ -66,8 +66,9 @@ class KAddressBookView : public QWidget virtual QStringList selectedUids() = 0; virtual void doSearch( const QString& s ,KABC::Field *field ) = 0; virtual void scrollUP() = 0; virtual void scrollDOWN() = 0; + virtual void setFocusAV() = 0; /** Called whenever this view should read the config. This can be used as a sign that the config has changed, therefore the view should diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.cpp b/kaddressbook/kcmconfigs/kabconfigwidget.cpp index 936d052..8bf9bb0 100644 --- a/kaddressbook/kcmconfigs/kabconfigwidget.cpp +++ b/kaddressbook/kcmconfigs/kabconfigwidget.cpp @@ -118,8 +118,10 @@ KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char * QVBoxLayout *boxLayout = new QVBoxLayout( vBox ); boxLayout->setAlignment( Qt::AlignTop ); boxLayout->setMargin(KDialog::marginHintSmall() ); boxLayout->setSpacing( KDialog::spacingHintSmall() ); + mMenuBarBox = new QCheckBox( i18n( "Full Menu bar (restart)" ), vBox, "mremenuturn" ); + boxLayout->addWidget( mMenuBarBox ); mSearchReturnBox = new QCheckBox( i18n( "Search only after <return> key pressed" ), vBox, "mreturn" ); boxLayout->addWidget( mSearchReturnBox ); mViewsSingleClickBox = new QCheckBox( i18n( "Honor KDE single click" ), vBox, "msingle" ); boxLayout->addWidget( mViewsSingleClickBox ); @@ -164,8 +166,9 @@ KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char * boxLayout->addWidget( mConfigureButton ); extensionLayout->addWidget( groupBox ); + connect( mMenuBarBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); connect( mNameParsing, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); connect( mViewsSingleClickBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); connect( mSearchReturnBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); connect( mMultipleViewsAtOnce, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); @@ -191,9 +194,9 @@ void KABConfigWidget::usrReadConfig() KABPrefs* prefs = KABPrefs::instance(); bool blocked = signalsBlocked(); blockSignals( true ); - + mMenuBarBox->setChecked( prefs->mFullMenuBarVisible); mNameParsing->setChecked( prefs->mAutomaticNameParsing ); mViewsSingleClickBox->setChecked( prefs->mHonorSingleClick ); mSearchReturnBox->setChecked( prefs->mSearchWithReturn ); mMultipleViewsAtOnce->setChecked( prefs->mMultipleViewsAtOnce ); @@ -209,9 +212,9 @@ void KABConfigWidget::usrReadConfig() void KABConfigWidget::usrWriteConfig() { KABPrefs* prefs = KABPrefs::instance(); - + prefs->mFullMenuBarVisible = mMenuBarBox->isChecked(); prefs->mAutomaticNameParsing = mNameParsing->isChecked(); prefs->mHonorSingleClick = mViewsSingleClickBox->isChecked(); prefs->mSearchWithReturn = mSearchReturnBox->isChecked(); prefs->mMultipleViewsAtOnce = mMultipleViewsAtOnce->isChecked(); diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.h b/kaddressbook/kcmconfigs/kabconfigwidget.h index 1e71fd1..08d71b4 100644 --- a/kaddressbook/kcmconfigs/kabconfigwidget.h +++ b/kaddressbook/kcmconfigs/kabconfigwidget.h @@ -65,9 +65,9 @@ class KABConfigWidget : public KPrefsWidget QCheckBox *mNameParsing; QCheckBox *mViewsSingleClickBox; QCheckBox *mMultipleViewsAtOnce; QCheckBox *mAskForQuit; - + QCheckBox *mMenuBarBox; QPushButton *mConfigureButton; AddresseeWidget *mAddresseeWidget; }; diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp index 81e0d99..3d0c275 100644 --- a/kaddressbook/viewmanager.cpp +++ b/kaddressbook/viewmanager.cpp @@ -105,9 +105,9 @@ void ViewManager::restoreSettings() // Filter mFilterList = Filter::restore( mCore->config(), "Filter" ); mActionSelectFilter->setItems( filterNames() ); mActionSelectFilter->setCurrentItem( KABPrefs::instance()->mCurrentFilter ); - + mActionSelectFilter->setComboWidth( 100 ); // Tell the views to reread their config, since they may have // been modified by global settings QString _oldgroup = mCore->config()->group(); @@ -302,9 +302,9 @@ void ViewManager::refreshView( const QString &uid ) void ViewManager::setFocusAV() { if ( mActiveView ) - mActiveView->setFocus(); + mActiveView->setFocusAV(); } void ViewManager::editView() { if ( !mActiveView ) @@ -596,8 +596,9 @@ void ViewManager::configureFilters() uint pos = mActionSelectFilter->currentItem(); mActionSelectFilter->setItems( filterNames() ); mActionSelectFilter->setCurrentItem( pos ); setActiveFilter( pos ); + //mActionSelectFilter->setComboWidth( 150 ); } QStringList ViewManager::filterNames() const { @@ -691,9 +692,8 @@ void ViewManager::initActions() SLOT( configureFilters() ), mCore->actionCollection(), "options_edit_filters" ); mActionSelectFilter = new KSelectAction( i18n( "Select Filter" ), "filter", mCore->actionCollection(), "select_filter" ); - #if KDE_VERSION >= 309 mActionSelectFilter->setMenuAccelsEnabled( false ); #endif connect( mActionSelectFilter, SIGNAL( activated( int ) ), diff --git a/kaddressbook/views/kaddressbookcardview.cpp b/kaddressbook/views/kaddressbookcardview.cpp index a7bf6c9..7f33bb4 100644 --- a/kaddressbook/views/kaddressbookcardview.cpp +++ b/kaddressbook/views/kaddressbookcardview.cpp @@ -168,9 +168,14 @@ KAddressBookCardView::KAddressBookCardView( KABC::AddressBook *ab, KAddressBookCardView::~KAddressBookCardView() { } +void KAddressBookCardView::setFocusAV() +{ + if ( mCardView ) + mCardView->setFocus(); +} void KAddressBookCardView::scrollUP() { QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Up, 0,0 ); QApplication::postEvent( mCardView, ev ); diff --git a/kaddressbook/views/kaddressbookcardview.h b/kaddressbook/views/kaddressbookcardview.h index 45a9781..8f22d54 100644 --- a/kaddressbook/views/kaddressbookcardview.h +++ b/kaddressbook/views/kaddressbookcardview.h @@ -61,8 +61,9 @@ class KAddressBookCardView : public KAddressBookView virtual void readConfig(KConfig *config); virtual void writeConfig(KConfig *); virtual void scrollUP(); virtual void scrollDOWN(); + virtual void setFocusAV(); public slots: void refresh(QString uid = QString::null); void setSelected(QString uid/*US = QString::null*/, bool selected/*US = true*/); diff --git a/kaddressbook/views/kaddressbookiconview.cpp b/kaddressbook/views/kaddressbookiconview.cpp index f4c68b8..41c3cb2 100644 --- a/kaddressbook/views/kaddressbookiconview.cpp +++ b/kaddressbook/views/kaddressbookiconview.cpp @@ -210,8 +210,14 @@ KAddressBookIconView::KAddressBookIconView( KABC::AddressBook *ab, KAddressBookIconView::~KAddressBookIconView() { } +void KAddressBookIconView::setFocusAV() +{ + if ( mIconView ) + mIconView->setFocus(); +} + void KAddressBookIconView::scrollUP() { QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Up, 0,0 ); diff --git a/kaddressbook/views/kaddressbookiconview.h b/kaddressbook/views/kaddressbookiconview.h index acfcd71..b0b9fea 100644 --- a/kaddressbook/views/kaddressbookiconview.h +++ b/kaddressbook/views/kaddressbookiconview.h @@ -62,8 +62,9 @@ class KAddressBookIconView : public KAddressBookView virtual void readConfig(KConfig *config); virtual void scrollUP(); virtual void scrollDOWN(); + virtual void setFocusAV(); public slots: void refresh(QString uid = QString::null); #ifndef KAB_EMBEDDED diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp index 2412170..e40eb9e 100644 --- a/kaddressbook/views/kaddressbooktableview.cpp +++ b/kaddressbook/views/kaddressbooktableview.cpp @@ -50,8 +50,14 @@ KAddressBookTableView::KAddressBookTableView( KABC::AddressBook *ab, KAddressBookTableView::~KAddressBookTableView() { } +void KAddressBookTableView::setFocusAV() +{ + if ( mListView ) + mListView->setFocus(); + +} void KAddressBookTableView::scrollUP() { QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Up, 0,0 ); QApplication::postEvent( mListView, ev ); diff --git a/kaddressbook/views/kaddressbooktableview.h b/kaddressbook/views/kaddressbooktableview.h index 865f8d5..38db7b4 100644 --- a/kaddressbook/views/kaddressbooktableview.h +++ b/kaddressbook/views/kaddressbooktableview.h @@ -64,8 +64,9 @@ friend class ContactListView; virtual QString type() const { return "Table"; } void doSearch( const QString& s ,KABC::Field *field ); virtual void scrollUP(); virtual void scrollDOWN(); + virtual void setFocusAV(); public slots: virtual void reconstructListView(); |