author | kergoth <kergoth> | 2003-08-09 17:14:54 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-08-09 17:14:54 (UTC) |
commit | a7e015198a8c5ad3b6e144a9032b059086253e00 (patch) (unidiff) | |
tree | b712b6f11310d88744fe393a92b3160b741a7efe /noncore/settings/appearance2/appearance.cpp | |
parent | beba0e73306815337bf04dee39502233595e9739 (diff) | |
download | opie-a7e015198a8c5ad3b6e144a9032b059086253e00.zip opie-a7e015198a8c5ad3b6e144a9032b059086253e00.tar.gz opie-a7e015198a8c5ad3b6e144a9032b059086253e00.tar.bz2 |
Merge from BRANCH_1_0
Diffstat (limited to 'noncore/settings/appearance2/appearance.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/appearance2/appearance.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp index c376ec7..00128d3 100644 --- a/noncore/settings/appearance2/appearance.cpp +++ b/noncore/settings/appearance2/appearance.cpp | |||
@@ -75,25 +75,25 @@ | |||
75 | 75 | ||
76 | 76 | ||
77 | using namespace Opie; | 77 | using namespace Opie; |
78 | 78 | ||
79 | 79 | ||
80 | class DefaultWindowDecoration : public WindowDecorationInterface | 80 | class DefaultWindowDecoration : public WindowDecorationInterface |
81 | { | 81 | { |
82 | public: | 82 | public: |
83 | DefaultWindowDecoration() : ref(0) {} | 83 | DefaultWindowDecoration() : ref(0) {} |
84 | QString name() const { | 84 | QString name() const { |
85 | return "Default"; | 85 | return "Default"; |
86 | } | 86 | } |
87 | QPixmap icon() const { | 87 | QPixmap icon() const { |
88 | return QPixmap(); | 88 | return QPixmap(); |
89 | } | 89 | } |
90 | QRESULT queryInterface( const QUuid &uuid, QUnknownInterface **iface ) { | 90 | QRESULT queryInterface( const QUuid &uuid, QUnknownInterface **iface ) { |
91 | *iface = 0; | 91 | *iface = 0; |
92 | if ( uuid == IID_QUnknown ) | 92 | if ( uuid == IID_QUnknown ) |
93 | *iface = this; | 93 | *iface = this; |
94 | else if ( uuid == IID_WindowDecoration ) | 94 | else if ( uuid == IID_WindowDecoration ) |
95 | *iface = this; | 95 | *iface = this; |
96 | 96 | ||
97 | if ( *iface ) | 97 | if ( *iface ) |
98 | (*iface)->addRef(); | 98 | (*iface)->addRef(); |
99 | return QS_OK; | 99 | return QS_OK; |
@@ -166,25 +166,25 @@ QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg ) | |||
166 | return tab; | 166 | return tab; |
167 | } | 167 | } |
168 | 168 | ||
169 | QWidget *Appearance::createDecoTab ( QWidget *parent, Config &cfg ) | 169 | QWidget *Appearance::createDecoTab ( QWidget *parent, Config &cfg ) |
170 | { | 170 | { |
171 | QWidget* tab = new QWidget( parent, "DecoTab" ); | 171 | QWidget* tab = new QWidget( parent, "DecoTab" ); |
172 | QVBoxLayout* vertLayout = new QVBoxLayout( tab, 3, 3 ); | 172 | QVBoxLayout* vertLayout = new QVBoxLayout( tab, 3, 3 ); |
173 | 173 | ||
174 | m_deco_list = new QListBox( tab, "m_deco_list" ); | 174 | m_deco_list = new QListBox( tab, "m_deco_list" ); |
175 | vertLayout->addWidget( m_deco_list ); | 175 | vertLayout->addWidget( m_deco_list ); |
176 | QWhatsThis::add( m_deco_list, tr( "Window decorations control the way the application title bar and its buttons appear.\n\nClick here to select an available decoration." ) ); | 176 | QWhatsThis::add( m_deco_list, tr( "Window decorations control the way the application title bar and its buttons appear.\n\nClick here to select an available decoration." ) ); |
177 | 177 | ||
178 | QString s = cfg. readEntry ( "Decoration" ); | 178 | QString s = cfg. readEntry ( "Decoration", "libflat.so" ); |
179 | 179 | ||
180 | m_deco_list-> insertItem ( new DecoListItem ( "QPE" )); | 180 | m_deco_list-> insertItem ( new DecoListItem ( "QPE" )); |
181 | 181 | ||
182 | { | 182 | { |
183 | QString path = QPEApplication::qpeDir(); | 183 | QString path = QPEApplication::qpeDir(); |
184 | path.append( "/plugins/decorations/" ); | 184 | path.append( "/plugins/decorations/" ); |
185 | QStringList sl = QDir ( path, "lib*.so" ). entryList ( ); | 185 | QStringList sl = QDir ( path, "lib*.so" ). entryList ( ); |
186 | 186 | ||
187 | for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) { | 187 | for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) { |
188 | QString libstr = path; | 188 | QString libstr = path; |
189 | libstr.append( "/" ); | 189 | libstr.append( "/" ); |
190 | libstr.append( *it ); | 190 | libstr.append( *it ); |
@@ -393,45 +393,45 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | |||
393 | btngrp-> insert ( m_tabstyle_bottom ); | 393 | btngrp-> insert ( m_tabstyle_bottom ); |
394 | gridLayout-> addWidget( m_tabstyle_bottom, 1, 2 ); | 394 | gridLayout-> addWidget( m_tabstyle_bottom, 1, 2 ); |
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 ); | 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" ); | 412 | m_rotdir_flip = new QRadioButton( tab, "rotdir_flip" ); |
413 | QPixmap flip1 = Resource::loadIconSet("pass"). pixmap( ); | 413 | QPixmap flip1 = Resource::loadIconSet("pass"). pixmap( ); |
414 | QButtonGroup* rotbtngrp = new QButtonGroup( tab, "rotbuttongroup" ); | 414 | QButtonGroup* rotbtngrp = new QButtonGroup( tab, "rotbuttongroup" ); |
415 | 415 | ||
416 | rotbtngrp-> hide ( ); | 416 | rotbtngrp-> hide ( ); |
417 | rotbtngrp-> setExclusive ( true ); | 417 | rotbtngrp-> setExclusive ( true ); |
418 | rotbtngrp-> insert ( m_rotdir_cw ); | 418 | rotbtngrp-> insert ( m_rotdir_cw ); |
419 | rotbtngrp-> insert ( m_rotdir_ccw ); | 419 | rotbtngrp-> insert ( m_rotdir_ccw ); |
420 | rotbtngrp-> insert ( m_rotdir_flip ); | 420 | rotbtngrp-> insert ( m_rotdir_flip ); |
421 | 421 | ||
422 | ccw1. convertFromImage( ccwImage ); | 422 | ccw1. convertFromImage( ccwImage ); |
423 | m_rotdir_cw-> setPixmap( cw1 ); | 423 | m_rotdir_cw-> setPixmap( cw1 ); |
424 | m_rotdir_ccw-> setPixmap( ccw1 ); | 424 | m_rotdir_ccw-> setPixmap( ccw1 ); |
425 | m_rotdir_flip-> setPixmap( flip1 ); | 425 | m_rotdir_flip-> setPixmap( flip1 ); |
426 | 426 | ||
427 | rotLay-> addWidget ( rotlabel, 0 ); | 427 | rotLay-> addWidget ( rotlabel, 0 ); |
428 | rotLay-> addWidget ( m_rotdir_cw, 0 ); | 428 | rotLay-> addWidget ( m_rotdir_cw, 0 ); |
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 rotDirection = cfg.readNumEntry( "rotatedir" ); | 432 | int rotDirection = cfg.readNumEntry( "rotatedir" ); |
433 | ODirection rot = CW; | 433 | ODirection rot = CW; |
434 | 434 | ||
435 | if (rotDirection == -1) { | 435 | if (rotDirection == -1) { |
436 | rot = ODevice::inst ( )-> direction ( ); | 436 | rot = ODevice::inst ( )-> direction ( ); |
437 | } else { | 437 | } else { |
@@ -448,25 +448,26 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | |||
448 | 448 | ||
449 | Appearance::Appearance( QWidget* parent, const char* name, WFlags ) | 449 | Appearance::Appearance( QWidget* parent, const char* name, WFlags ) |
450 | : QDialog ( parent, name, true, WStyle_ContextHelp ) | 450 | : QDialog ( parent, name, true, WStyle_ContextHelp ) |
451 | { | 451 | { |
452 | setCaption( tr( "Appearance Settings" ) ); | 452 | setCaption( tr( "Appearance Settings" ) ); |
453 | 453 | ||
454 | Config config( "qpe" ); | 454 | Config config( "qpe" ); |
455 | config.setGroup( "Appearance" ); | 455 | config.setGroup( "Appearance" ); |
456 | 456 | ||
457 | QVBoxLayout *top = new QVBoxLayout ( this, 3, 3 ); | 457 | QVBoxLayout *top = new QVBoxLayout ( this, 3, 3 ); |
458 | 458 | ||
459 | m_sample = new SampleWindow ( this ); | 459 | m_sample = new SampleWindow ( this ); |
460 | m_sample-> setDecoration ( new DefaultWindowDecoration ( )); | 460 | |
461 | m_sample-> setDecoration ( new DefaultWindowDecoration ( ) ); | ||
461 | QWhatsThis::add( m_sample, tr( "This is a preview window. Look here to see your new appearance as options are changed." ) ); | 462 | QWhatsThis::add( m_sample, tr( "This is a preview window. Look here to see your new appearance as options are changed." ) ); |
462 | 463 | ||
463 | OTabWidget* tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); | 464 | OTabWidget* tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); |
464 | QWidget *styletab; | 465 | QWidget *styletab; |
465 | 466 | ||
466 | m_color_list = 0; | 467 | m_color_list = 0; |
467 | 468 | ||
468 | tw-> addTab ( styletab = createStyleTab ( tw, config ), "appearance", tr( "Style" )); | 469 | tw-> addTab ( styletab = createStyleTab ( tw, config ), "appearance", tr( "Style" )); |
469 | tw-> addTab ( createFontTab ( tw, config ), "font", tr( "Font" )); | 470 | tw-> addTab ( createFontTab ( tw, config ), "font", tr( "Font" )); |
470 | tw-> addTab ( createColorTab ( tw, config ), "appearance/color", tr( "Colors" ) ); | 471 | tw-> addTab ( createColorTab ( tw, config ), "appearance/color", tr( "Colors" ) ); |
471 | tw-> addTab ( createDecoTab ( tw, config ), "appearance/deco", tr( "Windows" ) ); | 472 | tw-> addTab ( createDecoTab ( tw, config ), "appearance/deco", tr( "Windows" ) ); |
472 | tw-> addTab ( m_advtab = createAdvancedTab ( tw, config ), "SettingsIcon", tr( "Advanced" ) ); | 473 | tw-> addTab ( m_advtab = createAdvancedTab ( tw, config ), "SettingsIcon", tr( "Advanced" ) ); |