-rw-r--r-- | noncore/settings/appearance2/appearance.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp index 83532de..c376ec7 100644 --- a/noncore/settings/appearance2/appearance.cpp +++ b/noncore/settings/appearance2/appearance.cpp | |||
@@ -429,10 +429,18 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | |||
429 | rotLay-> addWidget ( m_rotdir_ccw, 0 ); | 429 | rotLay-> addWidget ( m_rotdir_ccw, 0 ); |
430 | rotLay-> addWidget ( m_rotdir_flip, 0 ); | 430 | rotLay-> addWidget ( m_rotdir_flip, 0 ); |
431 | 431 | ||
432 | int rot = cfg. readNumEntry ( "rotatedir", 0 ); | 432 | int rotDirection = cfg.readNumEntry( "rotatedir" ); |
433 | m_rotdir_cw-> setChecked ( rot == 0 ); | 433 | ODirection rot = CW; |
434 | m_rotdir_ccw-> setChecked ( rot == 1 ); | 434 | |
435 | m_rotdir_flip-> setChecked ( rot == 2 ); | 435 | if (rotDirection == -1) { |
436 | rot = ODevice::inst ( )-> direction ( ); | ||
437 | } else { | ||
438 | rot = (ODirection)rotDirection; | ||
439 | } | ||
440 | |||
441 | m_rotdir_cw-> setChecked ( rot == CW ); | ||
442 | m_rotdir_ccw-> setChecked ( rot == CCW ); | ||
443 | m_rotdir_flip-> setChecked ( rot == Flip ); | ||
436 | 444 | ||
437 | return tab; | 445 | return tab; |
438 | } | 446 | } |
@@ -526,16 +534,15 @@ void Appearance::accept ( ) | |||
526 | item-> save ( config ); | 534 | item-> save ( config ); |
527 | } | 535 | } |
528 | 536 | ||
529 | bool is_rotdir_ccw = m_rotdir_ccw-> isChecked ( ); | 537 | ODirection rot; |
530 | int rotval; | ||
531 | if (m_rotdir_ccw-> isChecked ( )) { | 538 | if (m_rotdir_ccw-> isChecked ( )) { |
532 | rotval = 1; | 539 | rot = CCW; |
533 | } else if (m_rotdir_cw-> isChecked ( )) { | 540 | } else if (m_rotdir_cw-> isChecked ( )) { |
534 | rotval = 0; | 541 | rot = CW; |
535 | } else { | 542 | } else { |
536 | rotval = 2; | 543 | rot = Flip; |
537 | } | 544 | } |
538 | config. writeEntry ( "rotatedir", rotval ); | 545 | config. writeEntry ( "rotatedir", (int)rot ); |
539 | 546 | ||
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 | 547 | m_except-> setFocus ( ); // if the focus was on the embedded line-edit, we have to move it away first, so the contents are updated |
541 | 548 | ||