author | kergoth <kergoth> | 2003-03-27 05:03:39 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-03-27 05:03:39 (UTC) |
commit | cc8374957bcd95868d3dc52c854786239083cffc (patch) (side-by-side diff) | |
tree | c6bdfb92b736bd59b1329d55fb580e128aeca53d | |
parent | 72673ba6769cef021f23002cb0a8e1545ee43632 (diff) | |
download | opie-cc8374957bcd95868d3dc52c854786239083cffc.zip opie-cc8374957bcd95868d3dc52c854786239083cffc.tar.gz opie-cc8374957bcd95868d3dc52c854786239083cffc.tar.bz2 |
Add the ability to change from clockwise to counterclockwise rotation behavior.
-rw-r--r-- | noncore/settings/appearance2/appearance.cpp | 30 | ||||
-rw-r--r-- | noncore/settings/appearance2/appearance.h | 3 |
2 files changed, 33 insertions, 0 deletions
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp index db863d6..32234f0 100644 --- a/noncore/settings/appearance2/appearance.cpp +++ b/noncore/settings/appearance2/appearance.cpp @@ -379,48 +379,76 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) m_tabstyle_list-> insertItem ( tr( "Tabs" )); m_tabstyle_list-> insertItem ( tr( "Tabs w/icons" )); m_tabstyle_list-> insertItem ( tr( "Drop down list" )); m_tabstyle_list-> insertItem ( tr( "Drop down list w/icons" )); m_tabstyle_list-> setCurrentItem ( style ); gridLayout-> addMultiCellWidget ( m_tabstyle_list, 0, 0, 1, 2 ); QWhatsThis::add( m_tabstyle_list, tr( "Click here to select a desired style for tabbed dialogs (such as this application). The styles available are:\n\n1. Tabs - normal tabs with text labels only\n2. Tabs w/icons - tabs with icons for each tab, text label only appears on current tab\n3. Drop down list - a vertical listing of tabs\n4. Drop down list w/icons - a vertical listing of tabs with icons" ) ); m_tabstyle_top = new QRadioButton( tr( "Top" ), tab, "tabpostop" ); btngrp-> insert ( m_tabstyle_top ); gridLayout-> addWidget( m_tabstyle_top, 1, 1 ); QWhatsThis::add( m_tabstyle_top, tr( "Click here so that tabs appear at the top of the window." ) ); m_tabstyle_bottom = new QRadioButton( tr( "Bottom" ), tab, "tabposbottom" ); btngrp-> insert ( m_tabstyle_bottom ); gridLayout-> addWidget( m_tabstyle_bottom, 1, 2 ); QWhatsThis::add( m_tabstyle_bottom, tr( "Click here so that tabs appear at the bottom of the window." ) ); m_tabstyle_top-> setChecked ( tabtop ); m_tabstyle_bottom-> setChecked ( !tabtop ); m_original_tabstyle = style; m_original_tabpos = tabtop; + vertLayout-> addSpacing ( 3 ); + QHBoxLayout *rotLay = new QHBoxLayout ( vertLayout, 3 ); + + QLabel* rotlabel = new QLabel( tr( "Rotation direction:" ), tab ); + m_rotdir_cw = new QRadioButton( tab, "rotdir_cw" ); + QPixmap cw1 = Resource::loadIconSet("redo"). pixmap( ); + m_rotdir_ccw = new QRadioButton( tab, "rotdir_ccw" ); + QImage ccwImage = cw1. convertToImage( ). mirror( 1, 0 ); + QPixmap ccw1; + QButtonGroup* rotbtngrp = new QButtonGroup( tab, "rotbuttongroup" ); + + rotbtngrp-> hide ( ); + rotbtngrp-> setExclusive ( true ); + rotbtngrp-> insert ( m_rotdir_cw ); + rotbtngrp-> insert ( m_rotdir_ccw ); + + ccw1. convertFromImage( ccwImage ); + m_rotdir_cw-> setPixmap( cw1 ); + m_rotdir_ccw-> setPixmap( ccw1 ); + + rotLay-> addWidget ( rotlabel, 0 ); + rotLay-> addWidget ( m_rotdir_cw, 0 ); + rotLay-> addWidget ( m_rotdir_ccw, 0 ); + + bool rotcw = !(cfg. readBoolEntry ( "rotatedir", 0 )); + m_rotdir_cw-> setChecked ( rotcw ); + m_rotdir_ccw-> setChecked ( !rotcw ); + return tab; } Appearance::Appearance( QWidget* parent, const char* name, WFlags ) : QDialog ( parent, name, true, WStyle_ContextHelp ) { setCaption( tr( "Appearance Settings" ) ); Config config( "qpe" ); config.setGroup( "Appearance" ); QVBoxLayout *top = new QVBoxLayout ( this, 3, 3 ); m_sample = new SampleWindow ( this ); m_sample-> setDecoration ( new DefaultWindowDecoration ( )); QWhatsThis::add( m_sample, tr( "This is a preview window. Look here to see your new appearance as options are changed." ) ); OTabWidget* tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); QWidget *styletab; m_color_list = 0; tw-> addTab ( styletab = createStyleTab ( tw, config ), "appearance", tr( "Style" )); @@ -434,85 +462,87 @@ Appearance::Appearance( QWidget* parent, const char* name, WFlags ) tw-> setCurrentTab ( styletab ); connect ( tw, SIGNAL( currentChanged ( QWidget * )), this, SLOT( tabChanged ( QWidget * ))); m_style_changed = m_font_changed = m_color_changed = m_deco_changed = false; } Appearance::~Appearance() { } void Appearance::tabChanged ( QWidget *w ) { if ( w == m_advtab ) { m_sample-> hide ( ); updateGeometry ( ); // shouldn't be necessary ... } else m_sample-> show ( ); } void Appearance::accept ( ) { bool newtabpos = m_tabstyle_top-> isChecked ( ); + bool is_rotdir_ccw = m_rotdir_ccw-> 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. writeEntry ( "rotatedir", is_rotdir_ccw ); m_except-> setFocus ( ); // if the focus was on the embedded line-edit, we have to move it away first, so the contents are updated QStringList sl; QString exceptstr; for ( ExceptListItem *it = (ExceptListItem *) m_except-> firstChild ( ); it; it = (ExceptListItem *) it-> nextSibling ( )) { int fl = 0; fl |= ( it-> noStyle ( ) ? 0x01 : 0 ); fl |= ( it-> noFont ( ) ? 0x02 : 0 ); fl |= ( it-> noDeco ( ) ? 0x04 : 0 ); exceptstr = QString::number ( fl, 32 ); exceptstr.append( it-> pattern ( )); sl << exceptstr; } config. writeEntry ( "NoStyle", sl, ';' ); config. writeEntry ( "ForceStyle", m_force-> isChecked ( )); config. write ( ); // need to flush the config info first Global::applyStyle ( ); if ( QMessageBox::warning ( this, tr( "Restart" ), tr( "Do you want to restart %1 now?" ). arg ( ODevice::inst ( )-> system ( ) == System_Zaurus ? "Qtopia" : "Opie" ), tr( "Yes" ), tr( "No" ), 0, 0, 1 ) == 0 ) { QCopEnvelope e( "QPE/System", "restart()" ); } diff --git a/noncore/settings/appearance2/appearance.h b/noncore/settings/appearance2/appearance.h index 065dfb7..0e42298 100644 --- a/noncore/settings/appearance2/appearance.h +++ b/noncore/settings/appearance2/appearance.h @@ -94,30 +94,33 @@ private: bool m_scheme_changed; bool m_deco_changed; bool m_color_changed; int m_original_style; int m_original_deco; int m_original_tabstyle; bool m_original_tabpos; QListBox * m_style_list; QPushButton * m_style_settings; QListBox * m_deco_list; QListBox * m_color_list; OFontSelector *m_fontselect; SampleWindow *m_sample; QComboBox * m_tabstyle_list; QRadioButton *m_tabstyle_top; QRadioButton *m_tabstyle_bottom; + QRadioButton *m_rotdir_cw; + QRadioButton *m_rotdir_ccw; + QWidget * m_advtab; QListView * m_except; QCheckBox * m_force; }; #endif |