author | eilers <eilers> | 2003-03-27 11:56:44 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-03-27 11:56:44 (UTC) |
commit | ff43585778968407bb08473e45ddd1d942f8d8c8 (patch) (side-by-side diff) | |
tree | 7f9b364543337ee14c93175b7a0d02d9a61d8608 | |
parent | 7a7370388ef30efd303c3ffb4f84b8e8f6830db9 (diff) | |
download | opie-ff43585778968407bb08473e45ddd1d942f8d8c8.zip opie-ff43585778968407bb08473e45ddd1d942f8d8c8.tar.gz opie-ff43585778968407bb08473e45ddd1d942f8d8c8.tar.bz2 |
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.
-rw-r--r-- | core/pim/addressbook/abconfig.cpp | 14 | ||||
-rw-r--r-- | core/pim/addressbook/abconfig.h | 3 | ||||
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 30 | ||||
-rw-r--r-- | core/pim/addressbook/configdlg.cpp | 5 | ||||
-rw-r--r-- | core/pim/addressbook/configdlg_base.ui | 61 | ||||
-rw-r--r-- | core/pim/addressbook/version.h | 2 |
6 files changed, 100 insertions, 15 deletions
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 @@ -6,16 +6,17 @@ AbConfig::AbConfig( ): m_useQtMail( true ), m_useOpieMail( false ), m_useRegExp( false ), m_beCaseSensitive( false ), m_fontSize( 1 ), m_barPos( QMainWindow::Top ), + m_fixedBars( true ), m_changed( false ) { } AbConfig::~AbConfig() { } @@ -49,16 +50,20 @@ QValueList<int> AbConfig::orderList() const return m_ordered; } QMainWindow::ToolBarDock AbConfig::getToolBarPos() const { return (QMainWindow::ToolBarDock) m_barPos; } +bool AbConfig::fixedBars() const +{ + return m_fixedBars; +} void AbConfig::setUseRegExp( bool v ) { m_useRegExp = v ; m_changed = true; } void AbConfig::setUseWildCards( bool v ) { @@ -93,16 +98,22 @@ void AbConfig::setOrderList( const QValueList<int>& list ) } void AbConfig::setToolBarDock( const QMainWindow::ToolBarDock v ) { m_barPos = v; m_changed = true; } +void AbConfig::setFixedBars( const bool fixed ) +{ + m_fixedBars = fixed; + m_changed = true; +} + void AbConfig::load() { // Read Config settings Config cfg("AddressBook"); cfg.setGroup("Font"); m_fontSize = cfg.readNumEntry( "fontSize", 1 ); @@ -128,16 +139,17 @@ void AbConfig::load() m_ordered.append( Qtopia::DefaultEmail ); m_ordered.append( Qtopia::HomePhone); m_ordered.append( Qtopia::HomeMobile); m_ordered.append( Qtopia::BusinessPhone); } cfg.setGroup("ToolBar"); m_barPos = cfg.readNumEntry( "Position", QMainWindow::Top ); + m_fixedBars= cfg.readBoolEntry( "fixedBars", true ); m_changed = false; } void AbConfig::save() { if ( m_changed ){ Config cfg("AddressBook"); @@ -155,16 +167,17 @@ void AbConfig::save() cfg.setGroup("ContactOrder"); cfg.clearGroup(); for ( uint i = 0; i < m_ordered.count(); i++ ){ cfg.writeEntry( "ContactID_"+QString::number(i), m_ordered[i] ); } 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); cfg.writeEntry( "Mainversion", MAINVERSION ); cfg.writeEntry( "SubVersion", SUBVERSION ); cfg.writeEntry( "PatchVersion", PATCHVERSION ); } @@ -175,10 +188,11 @@ void AbConfig::operator= ( const AbConfig& cnf ) { m_useQtMail = cnf.m_useQtMail; m_useOpieMail = cnf.m_useOpieMail; m_useRegExp = cnf.m_useRegExp; m_beCaseSensitive = cnf.m_beCaseSensitive; 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 @@ -14,25 +14,27 @@ public: bool useRegExp() const; bool useWildCards() const; bool beCaseSensitive() const; bool useQtMail() const; bool useOpieMail() const; int fontSize() const; QValueList<int> orderList() const; QMainWindow::ToolBarDock getToolBarPos() const; + bool fixedBars() const; void setUseRegExp( bool v ); void setUseWildCards( bool v ); void setBeCaseSensitive( bool v ); void setUseQtMail( bool v ); void setUseOpieMail( bool v ); void setFontSize( int v ); void setOrderList( const QValueList<int>& list ); void setToolBarDock( const QMainWindow::ToolBarDock v ); + void setFixedBars( const bool fixed ); void operator= ( const AbConfig& cnf ); void load(); void save(); protected: /* virtual void itemUp(); */ @@ -42,14 +44,15 @@ protected: bool m_useQtMail; bool m_useOpieMail; bool m_useRegExp; bool m_beCaseSensitive; int m_fontSize; QValueList<int> m_ordered; int m_barPos; + bool m_fixedBars; bool m_changed; }; #endif 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 @@ -82,31 +82,40 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, isLoading = true; m_config.load(); setCaption( tr("Contacts") ); 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" ), QString::null, 0, this, 0 ); connect( m_tableViewButton, SIGNAL( activated() ), this, SLOT( slotListView() ) ); m_tableViewButton->setToggleAction( true ); m_tableViewButton->addTo( listTools ); m_cardViewButton = new QAction( tr( "Card" ), Resource::loadPixmap( "day" ), QString::null, 0, this, 0 ); @@ -238,23 +247,20 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, // Letter Picker pLabel = new LetterPicker( listContainer ); connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char))); connect(m_abView, SIGNAL( signalClearLetterPicker() ), pLabel, SLOT( clear() ) ); 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 ); + // Fontsize defaultFont = new QFont( m_abView->font() ); slotSetFont(m_config.fontSize()); m_curFontSize = m_config.fontSize(); setCentralWidget(listContainer); // qDebug("adressbook contrsuction: t=%d", t.elapsed() ); 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 @@ -117,17 +117,18 @@ void ConfigDlg::setConfig( const AbConfig& cnf ) m_largeFont->setChecked( true ); break; } for( uint i = 0; i < m_config.orderList().count(); i++ ) { fieldListBox -> insertItem ( m_mapIDToStr[ m_config.orderList()[i] ] ); } - + m_fixedBars->setChecked( m_config.fixedBars() ); + m_moveBars->setChecked( !m_config.fixedBars() ); } AbConfig ConfigDlg::getConfig() { m_config.setUseRegExp( m_useRegExp->isOn() ); m_config.setUseWildCards( m_useWildCard->isOn() ); m_config.setUseQtMail( m_useQtMail->isOn() ); m_config.setUseOpieMail( m_useOpieMail->isOn() ); @@ -141,11 +142,13 @@ AbConfig ConfigDlg::getConfig() m_config.setFontSize( 2 ); QValueList<int> orderlist; for( int i = 0; i < (int)fieldListBox->count(); i++ ) { orderlist.append( m_mapStrToID[ fieldListBox->text(i) ] ); } 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 @@ -75,17 +75,17 @@ </property> <attribute> <name>title</name> <string>Misc</string> </attribute> <vbox> <property stdset="1"> <name>margin</name> - <number>5</number> + <number>2</number> </property> <property stdset="1"> <name>spacing</name> <number>6</number> </property> <widget> <class>QGroupBox</class> <property stdset="1"> @@ -250,16 +250,75 @@ </property> <property> <name>whatsThis</name> <string>Font size for list- and card view</string> </property> </widget> </hbox> </widget> + <widget> + <class>QButtonGroup</class> + <property stdset="1"> + <name>name</name> + <cstring>ButtonGroup4</cstring> + </property> + <property stdset="1"> + <name>title</name> + <string>Tool-/Menubar</string> + </property> + <hbox> + <property stdset="1"> + <name>margin</name> + <number>11</number> + </property> + <property stdset="1"> + <name>spacing</name> + <number>6</number> + </property> + <widget> + <class>QRadioButton</class> + <property stdset="1"> + <name>name</name> + <cstring>m_fixedBars</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Fixed</string> + </property> + <property stdset="1"> + <name>checked</name> + <bool>true</bool> + </property> + <property> + <name>toolTip</name> + <string></string> + </property> + <property> + <name>whatsThis</name> + <string>Switch to fixed menu-/toolbars after restarting application !</string> + </property> + </widget> + <widget> + <class>QRadioButton</class> + <property stdset="1"> + <name>name</name> + <cstring>m_moveBars</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Movable</string> + </property> + <property> + <name>whatsThis</name> + <string>Switch to moveable menu-/toolbars after restarting application !</string> + </property> + </widget> + </hbox> + </widget> <spacer> <property> <name>name</name> <cstring>Spacer3</cstring> </property> <property stdset="1"> <name>orientation</name> <enum>Vertical</enum> 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 @@ -1,10 +1,10 @@ #ifndef _VERSION_H_ #define _VERSION_H_ #define MAINVERSION "0" #define SUBVERSION "9" -#define PATCHVERSION "2" +#define PATCHVERSION "3" #define APPNAME "OPIE_ADDRESSBOOK" #endif |