summaryrefslogtreecommitdiff
authorsandman <sandman>2002-10-30 00:38:55 (UTC)
committer sandman <sandman>2002-10-30 00:38:55 (UTC)
commitdce0a0f2bf08bbc42dcd97fa9ced44739c7c7763 (patch) (side-by-side diff)
tree6044f0ac489243eb1fccb99805af89e2fc136684
parent1e294abab44c96f1fdf4fe0e7083a19fbeb970e0 (diff)
downloadopie-dce0a0f2bf08bbc42dcd97fa9ced44739c7c7763.zip
opie-dce0a0f2bf08bbc42dcd97fa9ced44739c7c7763.tar.gz
opie-dce0a0f2bf08bbc42dcd97fa9ced44739c7c7763.tar.bz2
Workaround for some obscure gcc bug -- this fixes bug #363
I had to reorderd some lines, because if ( m_style_changed ) is always false if the preceding instruction is bool newtabpos = m_tabstyle_top-> isChecked ( );
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/appearance2/appearance.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp
index 4132b30..303e0b9 100644
--- a/noncore/settings/appearance2/appearance.cpp
+++ b/noncore/settings/appearance2/appearance.cpp
@@ -335,110 +335,111 @@ QWidget *Appearance::createGuiTab ( QWidget *parent )
m_tabstyle_list-> insertItem ( tr( "Drop down list w/icons" ));
m_tabstyle_list-> setCurrentItem ( style );
gridLayout-> addMultiCellWidget ( m_tabstyle_list, 0, 0, 1, 2 );
m_tabstyle_top = new QRadioButton( tr( "Top" ), tab, "tabpostop" );
btngrp-> insert ( m_tabstyle_top );
gridLayout-> addWidget( m_tabstyle_top, 1, 1 );
m_tabstyle_bottom = new QRadioButton( tr( "Bottom" ), tab, "tabposbottom" );
btngrp-> insert ( m_tabstyle_bottom );
gridLayout-> addWidget( m_tabstyle_bottom, 1, 2 );
m_tabstyle_top-> setChecked ( tabtop );
m_tabstyle_bottom-> setChecked ( !tabtop );
m_original_tabstyle = style;
m_original_tabpos = tabtop;
return tab;
}
Appearance::Appearance( QWidget* parent, const char* name, WFlags )
: QDialog ( parent, name, true )
{
setCaption( tr( "Appearance" ) );
Config config( "qpe" );
config.setGroup( "Appearance" );
QVBoxLayout *top = new QVBoxLayout ( this, 4, 4 );
m_sample = new SampleWindow ( this );
m_sample-> setDecoration ( new DefaultWindowDecoration ( ));
OTabWidget* tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom );
QWidget *styletab;
tw-> addTab ( styletab = createStyleTab ( tw ), "appearance/styletabicon.png", tr( "Style" ));
tw-> addTab ( createFontTab ( tw ), "appearance/fonttabicon.png", tr( "Font" ));
tw-> addTab ( createColorTab ( tw ), "appearance/colorstabicon.png", tr( "Colors" ) );
tw-> addTab ( createDecoTab ( tw ), "appearance/decotabicon.png", tr( "Windows" ) );
tw-> addTab ( createGuiTab ( tw ), "appearance/advancedtabicon.png", tr( "Gui" ) );
top-> addWidget ( tw, 10 );
top-> addWidget ( m_sample, 1 );
tw-> setCurrentTab ( styletab );
+
+ m_style_changed = m_font_changed = m_color_changed = m_deco_changed = false;
}
Appearance::~Appearance()
{
}
void Appearance::accept ( )
{
- Config config("qpe");
- config.setGroup( "Appearance" );
-
- int newtabstyle = m_tabstyle_list-> currentItem ( );
bool newtabpos = m_tabstyle_top-> isChecked ( );
+ int newtabstyle = m_tabstyle_list-> currentItem ( );
+ Config config ( "qpe" );
+ config. setGroup ( "Appearance" );
if ( m_style_changed ) {
StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( ));
if ( item )
config.writeEntry( "Style", item-> key ( ));
}
if ( m_deco_changed ) {
DecoListItem *item = (DecoListItem *) m_deco_list-> item ( m_deco_list-> currentItem ( ));
if ( item )
config.writeEntry( "Decoration", item-> key ( ));
}
if (( newtabstyle != m_original_tabstyle ) || ( newtabpos != m_original_tabpos )) {
config. writeEntry ( "TabStyle", newtabstyle + 1 );
config. writeEntry ( "TabPosition", newtabpos ? "Top" : "Bottom" );
}
if ( m_font_changed ) {
config. writeEntry ( "FontFamily", m_fontselect-> fontFamily ( ));
config. writeEntry ( "FontStyle", m_fontselect-> fontStyle ( ));
config. writeEntry ( "FontSize", m_fontselect-> fontSize ( ));
}
if ( m_color_changed )
{
ColorListItem *item = (ColorListItem *) m_color_list-> item ( m_color_list-> currentItem ( ));
if ( item )
item-> save ( config );
}
config. write ( ); // need to flush the config info first
Global::applyStyle ( );
if ( QMessageBox::warning ( this, tr( "Restart" ), tr( "Do you want to restart Opie now?" ), tr( "Yes" ), tr( "No" ), 0, 0, 1 ) == 0 ) {
QCopEnvelope e( "QPE/System", "restart()" );
}
QDialog::accept ( );
}
void Appearance::done ( int r )
{
QDialog::done ( r );
close ( );
}