author | kergoth <kergoth> | 2003-04-15 03:04:15 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-04-15 03:04:15 (UTC) |
commit | a0dd69741995f33de4eea6a5f97f46b91dff4cb8 (patch) (unidiff) | |
tree | 2214fb9416b1914355d438cd5d0200b51d1fd2f4 /noncore/settings/appearance2/appearance.cpp | |
parent | f1379d479d192f8c1dc99cd982aaaf545c4867f6 (diff) | |
download | opie-a0dd69741995f33de4eea6a5f97f46b91dff4cb8.zip opie-a0dd69741995f33de4eea6a5f97f46b91dff4cb8.tar.gz opie-a0dd69741995f33de4eea6a5f97f46b91dff4cb8.tar.bz2 |
Add a third rotation direction, for 180 degree.
Diffstat (limited to 'noncore/settings/appearance2/appearance.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/appearance2/appearance.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
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 | |||
@@ -400,42 +400,48 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | |||
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 ); | 403 | vertLayout-> addSpacing ( 3 ); |
404 | QHBoxLayout *rotLay = new QHBoxLayout ( vertLayout, 3 ); | 404 | QHBoxLayout *rotLay = new QHBoxLayout ( vertLayout, 3 ); |
405 | 405 | ||
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 | ||
435 | Appearance::Appearance( QWidget* parent, const char* name, WFlags ) | 441 | Appearance::Appearance( QWidget* parent, const char* name, WFlags ) |
436 | : QDialog ( parent, name, true, WStyle_ContextHelp ) | 442 | : QDialog ( parent, name, true, WStyle_ContextHelp ) |
437 | { | 443 | { |
438 | setCaption( tr( "Appearance Settings" ) ); | 444 | setCaption( tr( "Appearance Settings" ) ); |
439 | 445 | ||
440 | Config config( "qpe" ); | 446 | Config config( "qpe" ); |
441 | config.setGroup( "Appearance" ); | 447 | config.setGroup( "Appearance" ); |
@@ -474,25 +480,24 @@ void Appearance::tabChanged ( QWidget *w ) | |||
474 | { | 480 | { |
475 | if ( w == m_advtab ) { | 481 | if ( w == m_advtab ) { |
476 | m_sample-> hide ( ); | 482 | m_sample-> hide ( ); |
477 | updateGeometry ( ); // shouldn't be necessary ... | 483 | updateGeometry ( ); // shouldn't be necessary ... |
478 | } | 484 | } |
479 | else | 485 | else |
480 | m_sample-> show ( ); | 486 | m_sample-> show ( ); |
481 | } | 487 | } |
482 | 488 | ||
483 | void Appearance::accept ( ) | 489 | void 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 ) { |
493 | StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( )); | 498 | StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( )); |
494 | if ( item ) | 499 | if ( item ) |
495 | config.writeEntry( "Style", item-> key ( )); | 500 | config.writeEntry( "Style", item-> key ( )); |
496 | } | 501 | } |
497 | 502 | ||
498 | if ( m_deco_changed ) { | 503 | if ( m_deco_changed ) { |
@@ -512,25 +517,34 @@ void Appearance::accept ( ) | |||
512 | config. writeEntry ( "FontSize", m_fontselect-> fontSize ( )); | 517 | config. writeEntry ( "FontSize", m_fontselect-> fontSize ( )); |
513 | } | 518 | } |
514 | 519 | ||
515 | 520 | ||
516 | if ( m_color_changed ) | 521 | if ( m_color_changed ) |
517 | { | 522 | { |
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 ( )) { |
531 | int fl = 0; | 545 | int fl = 0; |
532 | fl |= ( it-> noStyle ( ) ? 0x01 : 0 ); | 546 | fl |= ( it-> noStyle ( ) ? 0x01 : 0 ); |
533 | fl |= ( it-> noFont ( ) ? 0x02 : 0 ); | 547 | fl |= ( it-> noFont ( ) ? 0x02 : 0 ); |
534 | fl |= ( it-> noDeco ( ) ? 0x04 : 0 ); | 548 | fl |= ( it-> noDeco ( ) ? 0x04 : 0 ); |
535 | exceptstr = QString::number ( fl, 32 ); | 549 | exceptstr = QString::number ( fl, 32 ); |
536 | exceptstr.append( it-> pattern ( )); | 550 | exceptstr.append( it-> pattern ( )); |