author | kergoth <kergoth> | 2003-03-27 05:03:39 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-03-27 05:03:39 (UTC) |
commit | cc8374957bcd95868d3dc52c854786239083cffc (patch) (unidiff) | |
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 | |||
@@ -395,16 +395,44 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | |||
395 | QWhatsThis::add( m_tabstyle_bottom, tr( "Click here so that tabs appear at the bottom of the window." ) ); | 395 | QWhatsThis::add( m_tabstyle_bottom, tr( "Click here so that tabs appear at the bottom of the window." ) ); |
396 | 396 | ||
397 | m_tabstyle_top-> setChecked ( tabtop ); | 397 | m_tabstyle_top-> setChecked ( tabtop ); |
398 | m_tabstyle_bottom-> setChecked ( !tabtop ); | 398 | m_tabstyle_bottom-> setChecked ( !tabtop ); |
399 | 399 | ||
400 | m_original_tabstyle = style; | 400 | m_original_tabstyle = style; |
401 | m_original_tabpos = tabtop; | 401 | m_original_tabpos = tabtop; |
402 | 402 | ||
403 | vertLayout-> addSpacing ( 3 ); | ||
404 | QHBoxLayout *rotLay = new QHBoxLayout ( vertLayout, 3 ); | ||
405 | |||
406 | QLabel* rotlabel = new QLabel( tr( "Rotation direction:" ), tab ); | ||
407 | m_rotdir_cw = new QRadioButton( tab, "rotdir_cw" ); | ||
408 | QPixmap cw1 = Resource::loadIconSet("redo"). pixmap( ); | ||
409 | m_rotdir_ccw = new QRadioButton( tab, "rotdir_ccw" ); | ||
410 | QImage ccwImage = cw1. convertToImage( ). mirror( 1, 0 ); | ||
411 | QPixmap ccw1; | ||
412 | QButtonGroup* rotbtngrp = new QButtonGroup( tab, "rotbuttongroup" ); | ||
413 | |||
414 | rotbtngrp-> hide ( ); | ||
415 | rotbtngrp-> setExclusive ( true ); | ||
416 | rotbtngrp-> insert ( m_rotdir_cw ); | ||
417 | rotbtngrp-> insert ( m_rotdir_ccw ); | ||
418 | |||
419 | ccw1. convertFromImage( ccwImage ); | ||
420 | m_rotdir_cw-> setPixmap( cw1 ); | ||
421 | m_rotdir_ccw-> setPixmap( ccw1 ); | ||
422 | |||
423 | rotLay-> addWidget ( rotlabel, 0 ); | ||
424 | rotLay-> addWidget ( m_rotdir_cw, 0 ); | ||
425 | rotLay-> addWidget ( m_rotdir_ccw, 0 ); | ||
426 | |||
427 | bool rotcw = !(cfg. readBoolEntry ( "rotatedir", 0 )); | ||
428 | m_rotdir_cw-> setChecked ( rotcw ); | ||
429 | m_rotdir_ccw-> setChecked ( !rotcw ); | ||
430 | |||
403 | return tab; | 431 | return tab; |
404 | } | 432 | } |
405 | 433 | ||
406 | 434 | ||
407 | Appearance::Appearance( QWidget* parent, const char* name, WFlags ) | 435 | Appearance::Appearance( QWidget* parent, const char* name, WFlags ) |
408 | : QDialog ( parent, name, true, WStyle_ContextHelp ) | 436 | : QDialog ( parent, name, true, WStyle_ContextHelp ) |
409 | { | 437 | { |
410 | setCaption( tr( "Appearance Settings" ) ); | 438 | setCaption( tr( "Appearance Settings" ) ); |
@@ -450,16 +478,17 @@ void Appearance::tabChanged ( QWidget *w ) | |||
450 | } | 478 | } |
451 | else | 479 | else |
452 | m_sample-> show ( ); | 480 | m_sample-> show ( ); |
453 | } | 481 | } |
454 | 482 | ||
455 | void Appearance::accept ( ) | 483 | void Appearance::accept ( ) |
456 | { | 484 | { |
457 | bool newtabpos = m_tabstyle_top-> isChecked ( ); | 485 | bool newtabpos = m_tabstyle_top-> isChecked ( ); |
486 | bool is_rotdir_ccw = m_rotdir_ccw-> isChecked ( ); | ||
458 | int newtabstyle = m_tabstyle_list-> currentItem ( ); | 487 | int newtabstyle = m_tabstyle_list-> currentItem ( ); |
459 | 488 | ||
460 | Config config ( "qpe" ); | 489 | Config config ( "qpe" ); |
461 | config. setGroup ( "Appearance" ); | 490 | config. setGroup ( "Appearance" ); |
462 | 491 | ||
463 | if ( m_style_changed ) { | 492 | if ( m_style_changed ) { |
464 | StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( )); | 493 | StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( )); |
465 | if ( item ) | 494 | if ( item ) |
@@ -487,16 +516,17 @@ void Appearance::accept ( ) | |||
487 | if ( m_color_changed ) | 516 | if ( m_color_changed ) |
488 | { | 517 | { |
489 | ColorListItem *item = (ColorListItem *) m_color_list-> item ( m_color_list-> currentItem ( )); | 518 | ColorListItem *item = (ColorListItem *) m_color_list-> item ( m_color_list-> currentItem ( )); |
490 | 519 | ||
491 | if ( item ) | 520 | if ( item ) |
492 | item-> save ( config ); | 521 | item-> save ( config ); |
493 | } | 522 | } |
494 | 523 | ||
524 | config. writeEntry ( "rotatedir", is_rotdir_ccw ); | ||
495 | 525 | ||
496 | m_except-> setFocus ( ); // if the focus was on the embedded line-edit, we have to move it away first, so the contents are updated | 526 | m_except-> setFocus ( ); // if the focus was on the embedded line-edit, we have to move it away first, so the contents are updated |
497 | 527 | ||
498 | QStringList sl; | 528 | QStringList sl; |
499 | QString exceptstr; | 529 | QString exceptstr; |
500 | for ( ExceptListItem *it = (ExceptListItem *) m_except-> firstChild ( ); it; it = (ExceptListItem *) it-> nextSibling ( )) { | 530 | for ( ExceptListItem *it = (ExceptListItem *) m_except-> firstChild ( ); it; it = (ExceptListItem *) it-> nextSibling ( )) { |
501 | int fl = 0; | 531 | int fl = 0; |
502 | fl |= ( it-> noStyle ( ) ? 0x01 : 0 ); | 532 | fl |= ( it-> noStyle ( ) ? 0x01 : 0 ); |
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 | |||
@@ -110,14 +110,17 @@ private: | |||
110 | OFontSelector *m_fontselect; | 110 | OFontSelector *m_fontselect; |
111 | 111 | ||
112 | SampleWindow *m_sample; | 112 | SampleWindow *m_sample; |
113 | 113 | ||
114 | QComboBox * m_tabstyle_list; | 114 | QComboBox * m_tabstyle_list; |
115 | QRadioButton *m_tabstyle_top; | 115 | QRadioButton *m_tabstyle_top; |
116 | QRadioButton *m_tabstyle_bottom; | 116 | QRadioButton *m_tabstyle_bottom; |
117 | 117 | ||
118 | QRadioButton *m_rotdir_cw; | ||
119 | QRadioButton *m_rotdir_ccw; | ||
120 | |||
118 | QWidget * m_advtab; | 121 | QWidget * m_advtab; |
119 | QListView * m_except; | 122 | QListView * m_except; |
120 | QCheckBox * m_force; | 123 | QCheckBox * m_force; |
121 | }; | 124 | }; |
122 | 125 | ||
123 | #endif | 126 | #endif |