summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/applets/rotateapplet/rotate.cpp8
-rw-r--r--noncore/settings/appearance2/appearance.cpp24
-rw-r--r--noncore/settings/appearance2/appearance.h1
3 files changed, 25 insertions, 8 deletions
diff --git a/core/applets/rotateapplet/rotate.cpp b/core/applets/rotateapplet/rotate.cpp
index 0ead016..b490626 100644
--- a/core/applets/rotateapplet/rotate.cpp
+++ b/core/applets/rotateapplet/rotate.cpp
@@ -94,26 +94,28 @@ void RotateApplet::activated ( )
94 int newRotation; 94 int newRotation;
95 95
96 Config cfg( "qpe" ); 96 Config cfg( "qpe" );
97 cfg.setGroup( "Appearance" ); 97 cfg.setGroup( "Appearance" );
98 98
99 // 0 -> 90° clockwise, 1 -> 90° counterclockwise 99 // 0 -> 90° clockwise, 1 -> 90° counterclockwise
100 bool rotDirection = cfg.readBoolEntry( "rotatedir", 0 ); 100 int rotDirection = cfg.readNumEntry( "rotatedir", 0 );
101 101
102 // hide inputs methods before rotation 102 // hide inputs methods before rotation
103 QCopEnvelope en( "QPE/TaskBar", "hideInputMethod()" ); 103 QCopEnvelope en( "QPE/TaskBar", "hideInputMethod()" );
104 104
105 if ( m_flipped ) { 105 if ( m_flipped ) {
106 // if flipped, flip back to the original state, 106 // if flipped, flip back to the original state,
107 // regardless of rotation direction 107 // regardless of rotation direction
108 newRotation = defaultRotation; 108 newRotation = defaultRotation;
109 } else { 109 } else {
110 if ( rotDirection ) { 110 if ( rotDirection == 1 ) {
111 newRotation = ( defaultRotation + 90 ) % 360; 111 newRotation = ( defaultRotation + 90 ) % 360;
112 } else { 112 } else if ( rotDirection == 0 ) {
113 newRotation = ( defaultRotation + 270 ) % 360; 113 newRotation = ( defaultRotation + 270 ) % 360;
114 } else {
115 newRotation = ( defaultRotation + 180 ) % 360;
114 } 116 }
115 } 117 }
116 118
117 QCopEnvelope env( "QPE/System", "setCurrentRotation(int)" ); 119 QCopEnvelope env( "QPE/System", "setCurrentRotation(int)" );
118 env << newRotation; 120 env << newRotation;
119 121
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp
index 32234f0..83532de 100644
--- a/noncore/settings/appearance2/appearance.cpp
+++ b/noncore/settings/appearance2/appearance.cpp
@@ -406,30 +406,36 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
406 QLabel* rotlabel = new QLabel( tr( "Rotation direction:" ), tab ); 406 QLabel* rotlabel = new QLabel( tr( "Rotation direction:" ), tab );
407 m_rotdir_cw = new QRadioButton( tab, "rotdir_cw" ); 407 m_rotdir_cw = new QRadioButton( tab, "rotdir_cw" );
408 QPixmap cw1 = Resource::loadIconSet("redo"). pixmap( ); 408 QPixmap cw1 = Resource::loadIconSet("redo"). pixmap( );
409 m_rotdir_ccw = new QRadioButton( tab, "rotdir_ccw" ); 409 m_rotdir_ccw = new QRadioButton( tab, "rotdir_ccw" );
410 QImage ccwImage = cw1. convertToImage( ). mirror( 1, 0 ); 410 QImage ccwImage = cw1. convertToImage( ). mirror( 1, 0 );
411 QPixmap ccw1; 411 QPixmap ccw1;
412 m_rotdir_flip = new QRadioButton( tab, "rotdir_flip" );
413 QPixmap flip1 = Resource::loadIconSet("pass"). pixmap( );
412 QButtonGroup* rotbtngrp = new QButtonGroup( tab, "rotbuttongroup" ); 414 QButtonGroup* rotbtngrp = new QButtonGroup( tab, "rotbuttongroup" );
413 415
414 rotbtngrp-> hide ( ); 416 rotbtngrp-> hide ( );
415 rotbtngrp-> setExclusive ( true ); 417 rotbtngrp-> setExclusive ( true );
416 rotbtngrp-> insert ( m_rotdir_cw ); 418 rotbtngrp-> insert ( m_rotdir_cw );
417 rotbtngrp-> insert ( m_rotdir_ccw ); 419 rotbtngrp-> insert ( m_rotdir_ccw );
420 rotbtngrp-> insert ( m_rotdir_flip );
418 421
419 ccw1. convertFromImage( ccwImage ); 422 ccw1. convertFromImage( ccwImage );
420 m_rotdir_cw-> setPixmap( cw1 ); 423 m_rotdir_cw-> setPixmap( cw1 );
421 m_rotdir_ccw-> setPixmap( ccw1 ); 424 m_rotdir_ccw-> setPixmap( ccw1 );
425 m_rotdir_flip-> setPixmap( flip1 );
422 426
423 rotLay-> addWidget ( rotlabel, 0 ); 427 rotLay-> addWidget ( rotlabel, 0 );
424 rotLay-> addWidget ( m_rotdir_cw, 0 ); 428 rotLay-> addWidget ( m_rotdir_cw, 0 );
425 rotLay-> addWidget ( m_rotdir_ccw, 0 ); 429 rotLay-> addWidget ( m_rotdir_ccw, 0 );
430 rotLay-> addWidget ( m_rotdir_flip, 0 );
426 431
427 bool rotcw = !(cfg. readBoolEntry ( "rotatedir", 0 )); 432 int rot = cfg. readNumEntry ( "rotatedir", 0 );
428 m_rotdir_cw-> setChecked ( rotcw ); 433 m_rotdir_cw-> setChecked ( rot == 0 );
429 m_rotdir_ccw-> setChecked ( !rotcw ); 434 m_rotdir_ccw-> setChecked ( rot == 1 );
435 m_rotdir_flip-> setChecked ( rot == 2 );
430 436
431 return tab; 437 return tab;
432} 438}
433 439
434 440
435Appearance::Appearance( QWidget* parent, const char* name, WFlags ) 441Appearance::Appearance( QWidget* parent, const char* name, WFlags )
@@ -480,13 +486,12 @@ void Appearance::tabChanged ( QWidget *w )
480 m_sample-> show ( ); 486 m_sample-> show ( );
481} 487}
482 488
483void Appearance::accept ( ) 489void Appearance::accept ( )
484{ 490{
485 bool newtabpos = m_tabstyle_top-> isChecked ( ); 491 bool newtabpos = m_tabstyle_top-> isChecked ( );
486 bool is_rotdir_ccw = m_rotdir_ccw-> isChecked ( );
487 int newtabstyle = m_tabstyle_list-> currentItem ( ); 492 int newtabstyle = m_tabstyle_list-> currentItem ( );
488 493
489 Config config ( "qpe" ); 494 Config config ( "qpe" );
490 config. setGroup ( "Appearance" ); 495 config. setGroup ( "Appearance" );
491 496
492 if ( m_style_changed ) { 497 if ( m_style_changed ) {
@@ -518,13 +523,22 @@ void Appearance::accept ( )
518 ColorListItem *item = (ColorListItem *) m_color_list-> item ( m_color_list-> currentItem ( )); 523 ColorListItem *item = (ColorListItem *) m_color_list-> item ( m_color_list-> currentItem ( ));
519 524
520 if ( item ) 525 if ( item )
521 item-> save ( config ); 526 item-> save ( config );
522 } 527 }
523 528
524 config. writeEntry ( "rotatedir", is_rotdir_ccw ); 529 bool is_rotdir_ccw = m_rotdir_ccw-> isChecked ( );
530 int rotval;
531 if (m_rotdir_ccw-> isChecked ( )) {
532 rotval = 1;
533 } else if (m_rotdir_cw-> isChecked ( )) {
534 rotval = 0;
535 } else {
536 rotval = 2;
537 }
538 config. writeEntry ( "rotatedir", rotval );
525 539
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 540 m_except-> setFocus ( ); // if the focus was on the embedded line-edit, we have to move it away first, so the contents are updated
527 541
528 QStringList sl; 542 QStringList sl;
529 QString exceptstr; 543 QString exceptstr;
530 for ( ExceptListItem *it = (ExceptListItem *) m_except-> firstChild ( ); it; it = (ExceptListItem *) it-> nextSibling ( )) { 544 for ( ExceptListItem *it = (ExceptListItem *) m_except-> firstChild ( ); it; it = (ExceptListItem *) it-> nextSibling ( )) {
diff --git a/noncore/settings/appearance2/appearance.h b/noncore/settings/appearance2/appearance.h
index 0e42298..da9e976 100644
--- a/noncore/settings/appearance2/appearance.h
+++ b/noncore/settings/appearance2/appearance.h
@@ -114,12 +114,13 @@ private:
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; 118 QRadioButton *m_rotdir_cw;
119 QRadioButton *m_rotdir_ccw; 119 QRadioButton *m_rotdir_ccw;
120 QRadioButton *m_rotdir_flip;
120 121
121 QWidget * m_advtab; 122 QWidget * m_advtab;
122 QListView * m_except; 123 QListView * m_except;
123 QCheckBox * m_force; 124 QCheckBox * m_force;
124}; 125};
125 126