Changeset View
Changeset View
Standalone View
Standalone View
kstyle/demo/oxygendemodialog.cpp
Show All 28 Lines | |||||
29 | #include "oxygenbuttondemowidget.h" | 29 | #include "oxygenbuttondemowidget.h" | ||
30 | #include "oxygeninputdemowidget.h" | 30 | #include "oxygeninputdemowidget.h" | ||
31 | #include "oxygenframedemowidget.h" | 31 | #include "oxygenframedemowidget.h" | ||
32 | #include "oxygenlistdemowidget.h" | 32 | #include "oxygenlistdemowidget.h" | ||
33 | #include "oxygenmdidemowidget.h" | 33 | #include "oxygenmdidemowidget.h" | ||
34 | #include "oxygensliderdemowidget.h" | 34 | #include "oxygensliderdemowidget.h" | ||
35 | #include "oxygentabdemowidget.h" | 35 | #include "oxygentabdemowidget.h" | ||
36 | #include "config-liboxygen.h" | 36 | #include "config-liboxygen.h" | ||
37 | #ifdef HAVE_SCHEME_CHOOSER | ||||
38 | #include "oxygenschemechooser.h" | ||||
39 | #endif | ||||
37 | 40 | | |||
38 | #include <QTextStream> | 41 | #include <QTextStream> | ||
39 | #include <QShortcut> | 42 | #include <QShortcut> | ||
40 | #include <QDialogButtonBox> | 43 | #include <QDialogButtonBox> | ||
41 | 44 | | |||
42 | #include <QIcon> | 45 | #include <QIcon> | ||
43 | #include <KStandardShortcut> | 46 | #include <KStandardShortcut> | ||
44 | 47 | | |||
Show All 25 Lines | 55 | { | |||
70 | 73 | | |||
71 | // customize button box | 74 | // customize button box | ||
72 | _enableCheckBox = new QCheckBox( i18n( "Enabled" ) ); | 75 | _enableCheckBox = new QCheckBox( i18n( "Enabled" ) ); | ||
73 | _enableCheckBox->setChecked( true ); | 76 | _enableCheckBox->setChecked( true ); | ||
74 | connect( _enableCheckBox, SIGNAL(toggled(bool)), SLOT(toggleEnable(bool)) ); | 77 | connect( _enableCheckBox, SIGNAL(toggled(bool)), SLOT(toggleEnable(bool)) ); | ||
75 | buttonBox->addButton( _enableCheckBox, QDialogButtonBox::ResetRole ); | 78 | buttonBox->addButton( _enableCheckBox, QDialogButtonBox::ResetRole ); | ||
76 | 79 | | |||
77 | _rightToLeftCheckBox = new QCheckBox( i18n( "Right to left layout" ) ); | 80 | _rightToLeftCheckBox = new QCheckBox( i18n( "Right to left layout" ) ); | ||
81 | _rightToLeftCheckBox->setChecked( qApp->isRightToLeft() ); | ||||
78 | connect( _rightToLeftCheckBox, SIGNAL(toggled(bool)), SLOT(toggleRightToLeft(bool)) ); | 82 | connect( _rightToLeftCheckBox, SIGNAL(toggled(bool)), SLOT(toggleRightToLeft(bool)) ); | ||
83 | connect( qApp, SIGNAL(layoutDirectionChanged(Qt::LayoutDirection)), SLOT(layoutDirectionChanged(Qt::LayoutDirection)) ); | ||||
79 | buttonBox->addButton( _rightToLeftCheckBox, QDialogButtonBox::ResetRole ); | 84 | buttonBox->addButton( _rightToLeftCheckBox, QDialogButtonBox::ResetRole ); | ||
80 | 85 | | |||
86 | #ifdef HAVE_SCHEME_CHOOSER | ||||
87 | ColorSchemeChooser *colChooser = new ColorSchemeChooser(this); | ||||
88 | colChooser->setFlat(true); | ||||
89 | buttonBox->addButton( colChooser, QDialogButtonBox::ResetRole ); | ||||
90 | #endif | ||||
91 | | ||||
81 | // connections | 92 | // connections | ||
82 | connect( pageWidget, SIGNAL(currentPageChanged(KPageWidgetItem*,KPageWidgetItem*)), SLOT(updateWindowTitle(KPageWidgetItem*)) ); | 93 | connect( pageWidget, SIGNAL(currentPageChanged(KPageWidgetItem*,KPageWidgetItem*)), SLOT(updateWindowTitle(KPageWidgetItem*)) ); | ||
83 | connect( pageWidget, SIGNAL(currentPageChanged(KPageWidgetItem*,KPageWidgetItem*)), SLOT(updateEnableState(KPageWidgetItem*)) ); | 94 | connect( pageWidget, SIGNAL(currentPageChanged(KPageWidgetItem*,KPageWidgetItem*)), SLOT(updateEnableState(KPageWidgetItem*)) ); | ||
84 | KPageWidgetItem *page; | 95 | KPageWidgetItem *page; | ||
85 | DemoWidget *widget; | 96 | DemoWidget *widget; | ||
86 | 97 | | |||
87 | // inputs | 98 | // inputs | ||
88 | { | 99 | { | ||
▲ Show 20 Lines • Show All 124 Lines • ▼ Show 20 Line(s) | 222 | { | |||
213 | pageWidget->currentPage()->widget()->setEnabled( value ); | 224 | pageWidget->currentPage()->widget()->setEnabled( value ); | ||
214 | } | 225 | } | ||
215 | 226 | | |||
216 | //_______________________________________________________________ | 227 | //_______________________________________________________________ | ||
217 | void DemoDialog::toggleRightToLeft( bool value ) | 228 | void DemoDialog::toggleRightToLeft( bool value ) | ||
218 | { qApp->setLayoutDirection( value ? Qt::RightToLeft:Qt::LeftToRight ); } | 229 | { qApp->setLayoutDirection( value ? Qt::RightToLeft:Qt::LeftToRight ); } | ||
219 | 230 | | |||
220 | //_______________________________________________________________ | 231 | //_______________________________________________________________ | ||
232 | void DemoDialog::layoutDirectionChanged( Qt::LayoutDirection direction ) | ||||
233 | { _rightToLeftCheckBox->setChecked( direction == Qt::RightToLeft ); } | ||||
234 | | ||||
235 | //_______________________________________________________________ | ||||
221 | void DemoDialog::closeEvent( QCloseEvent* event ) | 236 | void DemoDialog::closeEvent( QCloseEvent* event ) | ||
222 | { | 237 | { | ||
223 | emit abortSimulations(); | 238 | emit abortSimulations(); | ||
224 | QDialog::closeEvent( event ); | 239 | QDialog::closeEvent( event ); | ||
225 | } | 240 | } | ||
226 | 241 | | |||
227 | //_______________________________________________________________ | 242 | //_______________________________________________________________ | ||
228 | void DemoDialog::hideEvent( QHideEvent* event ) | 243 | void DemoDialog::hideEvent( QHideEvent* event ) | ||
Show All 16 Lines |