From ff43585778968407bb08473e45ddd1d942f8d8c8 Mon Sep 17 00:00:00 2001 From: eilers Date: Thu, 27 Mar 2003 11:56:44 +0000 Subject: Bugfix: If menu-button is pressed, the mainmenu will now open as expected To have the same look and feel as the other pim applications, the moveable toolbar is disabled. This behaviour is changeable in the configuration. --- (limited to 'core/pim') diff --git a/core/pim/addressbook/abconfig.cpp b/core/pim/addressbook/abconfig.cpp index e58fa76..0b61614 100644 --- a/core/pim/addressbook/abconfig.cpp +++ b/core/pim/addressbook/abconfig.cpp @@ -11,6 +11,7 @@ AbConfig::AbConfig( ): m_beCaseSensitive( false ), m_fontSize( 1 ), m_barPos( QMainWindow::Top ), + m_fixedBars( true ), m_changed( false ) { } @@ -54,6 +55,10 @@ QMainWindow::ToolBarDock AbConfig::getToolBarPos() const return (QMainWindow::ToolBarDock) m_barPos; } +bool AbConfig::fixedBars() const +{ + return m_fixedBars; +} void AbConfig::setUseRegExp( bool v ) { @@ -98,6 +103,12 @@ void AbConfig::setToolBarDock( const QMainWindow::ToolBarDock v ) m_changed = true; } +void AbConfig::setFixedBars( const bool fixed ) +{ + m_fixedBars = fixed; + m_changed = true; +} + void AbConfig::load() { // Read Config settings @@ -133,6 +144,7 @@ void AbConfig::load() cfg.setGroup("ToolBar"); m_barPos = cfg.readNumEntry( "Position", QMainWindow::Top ); + m_fixedBars= cfg.readBoolEntry( "fixedBars", true ); m_changed = false; } @@ -160,6 +172,7 @@ void AbConfig::save() cfg.setGroup("ToolBar"); cfg.writeEntry( "Position", m_barPos ); + cfg.writeEntry( "fixedBars", m_fixedBars ); cfg.setGroup("Version"); cfg.writeEntry( "AppName", APPNAME + QString(" V" ) + MAINVERSION + QString(".") + SUBVERSION + QString(".") + PATCHVERSION); @@ -180,5 +193,6 @@ void AbConfig::operator= ( const AbConfig& cnf ) m_fontSize = cnf.m_fontSize; m_ordered = cnf.m_ordered; m_barPos = cnf.m_barPos; + m_fixedBars = cnf.m_fixedBars; } diff --git a/core/pim/addressbook/abconfig.h b/core/pim/addressbook/abconfig.h index b8460d7..ce51b4c 100644 --- a/core/pim/addressbook/abconfig.h +++ b/core/pim/addressbook/abconfig.h @@ -19,6 +19,7 @@ public: int fontSize() const; QValueList orderList() const; QMainWindow::ToolBarDock getToolBarPos() const; + bool fixedBars() const; void setUseRegExp( bool v ); void setUseWildCards( bool v ); @@ -28,6 +29,7 @@ public: void setFontSize( int v ); void setOrderList( const QValueList& list ); void setToolBarDock( const QMainWindow::ToolBarDock v ); + void setFixedBars( const bool fixed ); void operator= ( const AbConfig& cnf ); @@ -47,6 +49,7 @@ protected: int m_fontSize; QValueList m_ordered; int m_barPos; + bool m_fixedBars; bool m_changed; }; diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index 14e5b3f..a5bf19b 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp @@ -87,21 +87,30 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, setIcon( Resource::loadPixmap( "AddressBook" ) ); // Settings for Main Menu - setToolBarsMovable( true ); + // setToolBarsMovable( false ); + setToolBarsMovable( !m_config.fixedBars() ); setRightJustification( true ); - // Create Toolbar - listTools = new QPEToolBar( this, "list operations" ); - listTools->setHorizontalStretchable( true ); - addToolBar( listTools ); - moveToolBar( listTools, m_config.getToolBarPos() ); + QPEToolBar *bar = new QPEToolBar( this ); + bar->setHorizontalStretchable( TRUE ); - QPEMenuBar *mbList = new QPEMenuBar( this ); + QPEMenuBar *mbList = new QPEMenuBar( bar ); mbList->setMargin( 0 ); QPopupMenu *edit = new QPopupMenu( mbList ); mbList->insertItem( tr( "Contact" ), edit ); + // Category Menu + catMenu = new QPopupMenu( this ); + catMenu->setCheckable( TRUE ); + connect( catMenu, SIGNAL(activated(int)), this, SLOT(slotSetCategory(int)) ); + mbList->insertItem( tr("View"), catMenu ); + + // Create Toolbar + listTools = new QPEToolBar( this, "list operations" ); + listTools->setHorizontalStretchable( true ); + addToolBar( listTools ); + moveToolBar( listTools, m_config.getToolBarPos() ); // View Icons m_tableViewButton = new QAction( tr( "List" ), Resource::loadPixmap( "addressbook/weeklst" ), @@ -243,14 +252,11 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, vb->addWidget( pLabel ); - // Category Menu - catMenu = new QPopupMenu( this ); - catMenu->setCheckable( TRUE ); - connect( catMenu, SIGNAL(activated(int)), this, SLOT(slotSetCategory(int)) ); + // All Categories into view-menu.. populateCategories(); - mbList->insertItem( tr("View"), catMenu ); - defaultFont = new QFont( m_abView->font() ); + // Fontsize + defaultFont = new QFont( m_abView->font() ); slotSetFont(m_config.fontSize()); m_curFontSize = m_config.fontSize(); diff --git a/core/pim/addressbook/configdlg.cpp b/core/pim/addressbook/configdlg.cpp index f2f4141..629feef 100644 --- a/core/pim/addressbook/configdlg.cpp +++ b/core/pim/addressbook/configdlg.cpp @@ -122,7 +122,8 @@ void ConfigDlg::setConfig( const AbConfig& cnf ) fieldListBox -> insertItem ( m_mapIDToStr[ m_config.orderList()[i] ] ); } - + m_fixedBars->setChecked( m_config.fixedBars() ); + m_moveBars->setChecked( !m_config.fixedBars() ); } AbConfig ConfigDlg::getConfig() @@ -146,6 +147,8 @@ AbConfig ConfigDlg::getConfig() } m_config.setOrderList( orderlist ); + m_config.setFixedBars( m_fixedBars->isChecked() ); + return m_config; } diff --git a/core/pim/addressbook/configdlg_base.ui b/core/pim/addressbook/configdlg_base.ui index 308e138..1b5ac17 100644 --- a/core/pim/addressbook/configdlg_base.ui +++ b/core/pim/addressbook/configdlg_base.ui @@ -80,7 +80,7 @@ margin - 5 + 2 spacing @@ -255,6 +255,65 @@ + + QButtonGroup + + name + ButtonGroup4 + + + title + Tool-/Menubar + + + + margin + 11 + + + spacing + 6 + + + QRadioButton + + name + m_fixedBars + + + text + Fixed + + + checked + true + + + toolTip + + + + whatsThis + Switch to fixed menu-/toolbars after restarting application ! + + + + QRadioButton + + name + m_moveBars + + + text + Movable + + + whatsThis + Switch to moveable menu-/toolbars after restarting application ! + + + + name diff --git a/core/pim/addressbook/version.h b/core/pim/addressbook/version.h index 999ce67..d590a86 100644 --- a/core/pim/addressbook/version.h +++ b/core/pim/addressbook/version.h @@ -3,7 +3,7 @@ #define MAINVERSION "0" #define SUBVERSION "9" -#define PATCHVERSION "2" +#define PATCHVERSION "3" #define APPNAME "OPIE_ADDRESSBOOK" -- cgit v0.9.0.2