summaryrefslogtreecommitdiff
path: root/noncore/settings/appearance2
Unidiff
Diffstat (limited to 'noncore/settings/appearance2') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/appearance2/appearance.cpp24
-rw-r--r--noncore/settings/appearance2/sample.cpp4
2 files changed, 14 insertions, 14 deletions
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp
index b39203b..8ae87fe 100644
--- a/noncore/settings/appearance2/appearance.cpp
+++ b/noncore/settings/appearance2/appearance.cpp
@@ -112,25 +112,25 @@ private:
112 112
113 113
114QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg ) 114QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg )
115{ 115{
116 QWidget* tab = new QWidget( parent, "StyleTab" ); 116 QWidget* tab = new QWidget( parent, "StyleTab" );
117 QVBoxLayout* vertLayout = new QVBoxLayout( tab, 3, 3 ); 117 QVBoxLayout* vertLayout = new QVBoxLayout( tab, 3, 3 );
118 118
119 m_style_list = new QListBox( tab, "m_style_list" ); 119 m_style_list = new QListBox( tab, "m_style_list" );
120 vertLayout->addWidget( m_style_list ); 120 vertLayout->addWidget( m_style_list );
121 QWhatsThis::add( m_style_list, tr( "Styles control the way items such as buttons and scroll bars appear in all applications.\n\nClick here to select an available style." ) ); 121 QWhatsThis::add( m_style_list, tr( "Styles control the way items such as buttons and scroll bars appear in all applications.\n\nClick here to select an available style." ) );
122 122
123 m_style_settings = new QPushButton ( tr( "Settings..." ), tab ); 123 m_style_settings = new QPushButton ( tr( "Settings..." ), tab );
124 connect ( m_style_settings, SIGNAL( clicked ( )), this, SLOT( styleSettingsClicked ( ))); 124 connect ( m_style_settings, SIGNAL( clicked()), this, SLOT( styleSettingsClicked()));
125 vertLayout-> addWidget ( m_style_settings ); 125 vertLayout-> addWidget ( m_style_settings );
126 QWhatsThis::add( m_style_settings, tr( "Click here to configure the currently selected style.\n\nNote: This option is not available for all styles." ) ); 126 QWhatsThis::add( m_style_settings, tr( "Click here to configure the currently selected style.\n\nNote: This option is not available for all styles." ) );
127 127
128 QString s = cfg. readEntry ( "Style", "Light" ); 128 QString s = cfg. readEntry ( "Style", "Light" );
129 129
130 130
131#if QT_VERSION >= 300 131#if QT_VERSION >= 300
132 m_style_list->insertStringList(QStyleFactory::styles()); 132 m_style_list->insertStringList(QStyleFactory::styles());
133#else 133#else
134 m_style_list-> insertItem ( new StyleListItem ( "Windows", new QWindowsStyle ( ))); 134 m_style_list-> insertItem ( new StyleListItem ( "Windows", new QWindowsStyle ( )));
135 m_style_list-> insertItem ( new StyleListItem ( "Light", new LightStyle ( ))); 135 m_style_list-> insertItem ( new StyleListItem ( "Light", new LightStyle ( )));
136 m_style_list-> insertItem ( new StyleListItem ( "QPE", new QPEStyle ( ))); 136 m_style_list-> insertItem ( new StyleListItem ( "QPE", new QPEStyle ( )));
@@ -156,25 +156,25 @@ QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg )
156 156
157 if ( slit-> key ( ) == s ) 157 if ( slit-> key ( ) == s )
158 m_style_list-> setCurrentItem ( slit ); 158 m_style_list-> setCurrentItem ( slit );
159 } 159 }
160 else 160 else
161 delete lib; 161 delete lib;
162 } 162 }
163 } 163 }
164 164
165 m_original_style = m_style_list-> currentItem ( ); 165 m_original_style = m_style_list-> currentItem ( );
166 styleClicked ( m_original_style ); 166 styleClicked ( m_original_style );
167 167
168 connect( m_style_list, SIGNAL( highlighted( int ) ), this, SLOT( styleClicked( int ) ) ); 168 connect( m_style_list, SIGNAL( highlighted(int) ), this, SLOT( styleClicked(int) ) );
169 169
170 return tab; 170 return tab;
171} 171}
172 172
173QWidget *Appearance::createDecoTab ( QWidget *parent, Config &cfg ) 173QWidget *Appearance::createDecoTab ( QWidget *parent, Config &cfg )
174{ 174{
175 QWidget* tab = new QWidget( parent, "DecoTab" ); 175 QWidget* tab = new QWidget( parent, "DecoTab" );
176 QVBoxLayout* vertLayout = new QVBoxLayout( tab, 3, 3 ); 176 QVBoxLayout* vertLayout = new QVBoxLayout( tab, 3, 3 );
177 177
178 m_deco_list = new QListBox( tab, "m_deco_list" ); 178 m_deco_list = new QListBox( tab, "m_deco_list" );
179 vertLayout->addWidget( m_deco_list ); 179 vertLayout->addWidget( m_deco_list );
180 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." ) ); 180 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." ) );
@@ -205,54 +205,54 @@ QWidget *Appearance::createDecoTab ( QWidget *parent, Config &cfg )
205 m_deco_list-> setCurrentItem ( dlit ); 205 m_deco_list-> setCurrentItem ( dlit );
206 } 206 }
207 else 207 else
208 delete lib; 208 delete lib;
209 } 209 }
210 } 210 }
211 211
212 m_original_deco = m_deco_list-> currentItem ( ); 212 m_original_deco = m_deco_list-> currentItem ( );
213 if ( m_deco_list-> currentItem ( ) < 0 ) 213 if ( m_deco_list-> currentItem ( ) < 0 )
214 m_deco_list-> setCurrentItem ( 0 ); 214 m_deco_list-> setCurrentItem ( 0 );
215 decoClicked ( m_original_deco ); 215 decoClicked ( m_original_deco );
216 216
217 connect( m_deco_list, SIGNAL( highlighted( int ) ), this, SLOT( decoClicked( int ) ) ); 217 connect( m_deco_list, SIGNAL( highlighted(int) ), this, SLOT( decoClicked(int) ) );
218 218
219 return tab; 219 return tab;
220} 220}
221 221
222QWidget *Appearance::createFontTab ( QWidget *parent, Config &cfg ) 222QWidget *Appearance::createFontTab ( QWidget *parent, Config &cfg )
223{ 223{
224 QString familyStr = cfg. readEntry ( "FontFamily", "Helvetica" ); 224 QString familyStr = cfg. readEntry ( "FontFamily", "Helvetica" );
225 QString styleStr = cfg. readEntry ( "FontStyle", "Regular" ); 225 QString styleStr = cfg. readEntry ( "FontStyle", "Regular" );
226 int size = cfg. readNumEntry ( "FontSize", 10 ); 226 int size = cfg. readNumEntry ( "FontSize", 10 );
227 227
228 m_fontselect = new OFontSelector ( false, parent, "FontTab" ); 228 m_fontselect = new OFontSelector ( false, parent, "FontTab" );
229 m_fontselect-> setSelectedFont ( familyStr, styleStr, size ); 229 m_fontselect-> setSelectedFont ( familyStr, styleStr, size );
230 QWhatsThis::add( m_fontselect, tr( "Select the desired name, style and size of the default font applications will use." ) ); 230 QWhatsThis::add( m_fontselect, tr( "Select the desired name, style and size of the default font applications will use." ) );
231 231
232 connect( m_fontselect, SIGNAL( fontSelected ( const QFont & )), 232 connect( m_fontselect, SIGNAL( fontSelected(const QFont&)),
233 this, SLOT( fontClicked ( const QFont & ))); 233 this, SLOT( fontClicked(const QFont&)));
234 234
235 return m_fontselect; 235 return m_fontselect;
236} 236}
237 237
238QWidget *Appearance::createColorTab ( QWidget *parent, Config &cfg ) 238QWidget *Appearance::createColorTab ( QWidget *parent, Config &cfg )
239{ 239{
240 QWidget *tab = new QWidget( parent, "ColorTab" ); 240 QWidget *tab = new QWidget( parent, "ColorTab" );
241 QGridLayout *gridLayout = new QGridLayout( tab, 0, 0, 3, 3 ); 241 QGridLayout *gridLayout = new QGridLayout( tab, 0, 0, 3, 3 );
242 gridLayout->setRowStretch ( 3, 10 ); 242 gridLayout->setRowStretch ( 3, 10 );
243 243
244 m_color_list = new QListBox ( tab ); 244 m_color_list = new QListBox ( tab );
245 gridLayout->addMultiCellWidget ( m_color_list, 0, 3, 0, 0 ); 245 gridLayout->addMultiCellWidget ( m_color_list, 0, 3, 0, 0 );
246 connect( m_color_list, SIGNAL( highlighted( int ) ), this, SLOT( colorClicked( int ) ) ); 246 connect( m_color_list, SIGNAL( highlighted(int) ), this, SLOT( colorClicked(int) ) );
247 QWhatsThis::add( m_color_list, tr( "Color schemes are a collection of colors which are used for various parts of the display.\n\nClick here to select an available scheme." ) ); 247 QWhatsThis::add( m_color_list, tr( "Color schemes are a collection of colors which are used for various parts of the display.\n\nClick here to select an available scheme." ) );
248 248
249 m_color_list-> insertItem ( new ColorListItem ( tr( "Current scheme" ), cfg )); 249 m_color_list-> insertItem ( new ColorListItem ( tr( "Current scheme" ), cfg ));
250 250
251 QString path = QPEApplication::qpeDir ( ); 251 QString path = QPEApplication::qpeDir ( );
252 path.append( "/etc/colors/" ); 252 path.append( "/etc/colors/" );
253 QStringList sl = QDir ( path ). entryList ( "*.scheme" ); 253 QStringList sl = QDir ( path ). entryList ( "*.scheme" );
254 254
255 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) 255 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
256 { 256 {
257 QString name = (*it). left ((*it). find ( ".scheme" )); 257 QString name = (*it). left ((*it). find ( ".scheme" ));
258 QString pathstr = path; 258 QString pathstr = path;
@@ -311,52 +311,52 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
311 m_except-> setColumnAlignment ( 0, AlignCenter ); 311 m_except-> setColumnAlignment ( 0, AlignCenter );
312 m_except-> setColumnAlignment ( 1, AlignCenter ); 312 m_except-> setColumnAlignment ( 1, AlignCenter );
313 m_except-> setColumnAlignment ( 2, AlignCenter ); 313 m_except-> setColumnAlignment ( 2, AlignCenter );
314 m_except-> setAllColumnsShowFocus ( true ); 314 m_except-> setAllColumnsShowFocus ( true );
315 m_except-> setMinimumHeight ( 30 ); 315 m_except-> setMinimumHeight ( 30 );
316 m_except-> header ( )-> setClickEnabled ( false ); 316 m_except-> header ( )-> setClickEnabled ( false );
317 m_except-> header ( )-> setResizeEnabled ( false ); 317 m_except-> header ( )-> setResizeEnabled ( false );
318 m_except-> header ( )-> setMovingEnabled ( false ); 318 m_except-> header ( )-> setMovingEnabled ( false );
319 m_except-> setSorting ( -1 ); 319 m_except-> setSorting ( -1 );
320 lay-> addMultiCellWidget ( m_except, 2, 6, 0, 0 ); 320 lay-> addMultiCellWidget ( m_except, 2, 6, 0, 0 );
321 QWhatsThis::add( m_except, tr( "If some applications do not display correctly with the global appearance settings, certain features can be turned off for that application.\n\nThis area allows you to select an application and which settings you wish to disable." ) ); 321 QWhatsThis::add( m_except, tr( "If some applications do not display correctly with the global appearance settings, certain features can be turned off for that application.\n\nThis area allows you to select an application and which settings you wish to disable." ) );
322 322
323 connect ( m_except, SIGNAL( clicked ( QListViewItem *, const QPoint &, int )), this, SLOT( clickedExcept ( QListViewItem *, const QPoint &, int ))); 323 connect ( m_except, SIGNAL( clicked(QListViewItem*,const QPoint&,int)), this, SLOT( clickedExcept(QListViewItem*,const QPoint&,int)));
324 324
325 QToolButton *tb = new QToolButton ( tab ); 325 QToolButton *tb = new QToolButton ( tab );
326 tb-> setIconSet ( Resource::loadIconSet ( "appearance/add" )); 326 tb-> setIconSet ( Resource::loadIconSet ( "appearance/add" ));
327 tb-> setFocusPolicy ( QWidget::StrongFocus ); 327 tb-> setFocusPolicy ( QWidget::StrongFocus );
328 lay-> addWidget ( tb, 2, 1 ); 328 lay-> addWidget ( tb, 2, 1 );
329 connect ( tb, SIGNAL( clicked ( )), this, SLOT( addExcept ( ))); 329 connect ( tb, SIGNAL( clicked()), this, SLOT( addExcept()));
330 QWhatsThis::add( tb, tr( "Click here to add an application to the list above." ) ); 330 QWhatsThis::add( tb, tr( "Click here to add an application to the list above." ) );
331 331
332 tb = new QToolButton ( tab ); 332 tb = new QToolButton ( tab );
333 tb-> setIconSet ( Resource::loadIconSet ( "editdelete" )); 333 tb-> setIconSet ( Resource::loadIconSet ( "editdelete" ));
334 tb-> setFocusPolicy ( QWidget::StrongFocus ); 334 tb-> setFocusPolicy ( QWidget::StrongFocus );
335 lay-> addWidget ( tb, 3, 1 ); 335 lay-> addWidget ( tb, 3, 1 );
336 connect ( tb, SIGNAL( clicked ( )), this, SLOT( delExcept ( ))); 336 connect ( tb, SIGNAL( clicked()), this, SLOT( delExcept()));
337 QWhatsThis::add( tb, tr( "Click here to delete the currently selected application." ) ); 337 QWhatsThis::add( tb, tr( "Click here to delete the currently selected application." ) );
338 338
339 tb = new QToolButton ( tab ); 339 tb = new QToolButton ( tab );
340 tb-> setIconSet ( Resource::loadIconSet ( "up" )); 340 tb-> setIconSet ( Resource::loadIconSet ( "up" ));
341 tb-> setFocusPolicy ( QWidget::StrongFocus ); 341 tb-> setFocusPolicy ( QWidget::StrongFocus );
342 lay-> addWidget ( tb, 4, 1 ); 342 lay-> addWidget ( tb, 4, 1 );
343 connect ( tb, SIGNAL( clicked ( )), this, SLOT( upExcept ( ))); 343 connect ( tb, SIGNAL( clicked()), this, SLOT( upExcept()));
344 QWhatsThis::add( tb, tr( "Click here to move the currently selected application up in the list." ) ); 344 QWhatsThis::add( tb, tr( "Click here to move the currently selected application up in the list." ) );
345 345
346 tb = new QToolButton ( tab ); 346 tb = new QToolButton ( tab );
347 tb-> setIconSet ( Resource::loadIconSet ( "down" )); 347 tb-> setIconSet ( Resource::loadIconSet ( "down" ));
348 tb-> setFocusPolicy ( QWidget::StrongFocus ); 348 tb-> setFocusPolicy ( QWidget::StrongFocus );
349 lay-> addWidget ( tb, 5, 1 ); 349 lay-> addWidget ( tb, 5, 1 );
350 connect ( tb, SIGNAL( clicked ( )), this, SLOT( downExcept ( ))); 350 connect ( tb, SIGNAL( clicked()), this, SLOT( downExcept()));
351 QWhatsThis::add( tb, tr( "Click here to move the currently selected application down in the list." ) ); 351 QWhatsThis::add( tb, tr( "Click here to move the currently selected application down in the list." ) );
352 352
353 lay-> setRowStretch ( 6, 10 ); 353 lay-> setRowStretch ( 6, 10 );
354 lay-> setColStretch ( 0, 10 ); 354 lay-> setColStretch ( 0, 10 );
355 355
356 QStringList sl = cfg. readListEntry ( "NoStyle", ';' ); 356 QStringList sl = cfg. readListEntry ( "NoStyle", ';' );
357 QListViewItem *lvit = 0; 357 QListViewItem *lvit = 0;
358 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) 358 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
359 { 359 {
360 int fl = ( *it ). left ( 1 ). toInt ( 0, 32 ); 360 int fl = ( *it ). left ( 1 ). toInt ( 0, 32 );
361 361
362 lvit = new ExceptListItem ( m_except, lvit, ( *it ). mid ( 1 ), fl & 0x01, fl & 0x02, fl & 0x04 ); 362 lvit = new ExceptListItem ( m_except, lvit, ( *it ). mid ( 1 ), fl & 0x01, fl & 0x02, fl & 0x04 );
@@ -478,25 +478,25 @@ Appearance::Appearance( QWidget* parent, const char* name, WFlags )
478 m_color_list = 0; 478 m_color_list = 0;
479 479
480 tw-> addTab ( styletab = createStyleTab ( tw, config ), "appearance", tr( "Style" )); 480 tw-> addTab ( styletab = createStyleTab ( tw, config ), "appearance", tr( "Style" ));
481 tw-> addTab ( createFontTab ( tw, config ), "font", tr( "Font" )); 481 tw-> addTab ( createFontTab ( tw, config ), "font", tr( "Font" ));
482 tw-> addTab ( createColorTab ( tw, config ), "appearance/color", tr( "Colors" ) ); 482 tw-> addTab ( createColorTab ( tw, config ), "appearance/color", tr( "Colors" ) );
483 tw-> addTab ( createDecoTab ( tw, config ), "appearance/deco", tr( "Windows" ) ); 483 tw-> addTab ( createDecoTab ( tw, config ), "appearance/deco", tr( "Windows" ) );
484 tw-> addTab ( m_advtab = createAdvancedTab ( tw, config ), "SettingsIcon", tr( "Advanced" ) ); 484 tw-> addTab ( m_advtab = createAdvancedTab ( tw, config ), "SettingsIcon", tr( "Advanced" ) );
485 485
486 top-> addWidget ( tw, 10 ); 486 top-> addWidget ( tw, 10 );
487 top-> addWidget ( m_sample, 1 ); 487 top-> addWidget ( m_sample, 1 );
488 488
489 tw-> setCurrentTab ( styletab ); 489 tw-> setCurrentTab ( styletab );
490 connect ( tw, SIGNAL( currentChanged ( QWidget * )), this, SLOT( tabChanged ( QWidget * ))); 490 connect ( tw, SIGNAL( currentChanged(QWidget*)), this, SLOT( tabChanged(QWidget*)));
491 491
492 m_style_changed = m_font_changed = m_color_changed = m_deco_changed = false; 492 m_style_changed = m_font_changed = m_color_changed = m_deco_changed = false;
493} 493}
494 494
495Appearance::~Appearance() 495Appearance::~Appearance()
496{} 496{}
497 497
498void Appearance::tabChanged ( QWidget *w ) 498void Appearance::tabChanged ( QWidget *w )
499{ 499{
500 if ( w == m_advtab ) 500 if ( w == m_advtab )
501 { 501 {
502 m_sample-> hide ( ); 502 m_sample-> hide ( );
diff --git a/noncore/settings/appearance2/sample.cpp b/noncore/settings/appearance2/sample.cpp
index b3a9d48..f6c4dca 100644
--- a/noncore/settings/appearance2/sample.cpp
+++ b/noncore/settings/appearance2/sample.cpp
@@ -82,25 +82,25 @@ SampleWindow::SampleWindow( QWidget *parent ) : QWidget(parent), iface(0)
82 init(); 82 init();
83} 83}
84 84
85QSize SampleWindow::sizeHint() const 85QSize SampleWindow::sizeHint() const
86{ 86{
87 return container->sizeHint() + QSize( 10, 35 ); 87 return container->sizeHint() + QSize( 10, 35 );
88} 88}
89 89
90void SampleWindow::setFont( const QFont &f ) 90void SampleWindow::setFont( const QFont &f )
91{ 91{
92 QWidget::setFont( f ); 92 QWidget::setFont( f );
93 popup->setFont( f ); 93 popup->setFont( f );
94 QTimer::singleShot ( 0, this, SLOT( fixGeometry ( ))); 94 QTimer::singleShot ( 0, this, SLOT( fixGeometry()));
95} 95}
96 96
97static void setStyleRecursive ( QWidget *w, QStyle *s ) 97static void setStyleRecursive ( QWidget *w, QStyle *s )
98{ 98{
99 w->setStyle( s ); 99 w->setStyle( s );
100 QObjectList *childObjects=(QObjectList*)w->children(); 100 QObjectList *childObjects=(QObjectList*)w->children();
101 if ( childObjects ) { 101 if ( childObjects ) {
102 QObject * o; 102 QObject * o;
103 for(o=childObjects->first();o!=0;o=childObjects->next()) { 103 for(o=childObjects->first();o!=0;o=childObjects->next()) {
104 if( o->isWidgetType() ) { 104 if( o->isWidgetType() ) {
105 setStyleRecursive((QWidget *)o,s); 105 setStyleRecursive((QWidget *)o,s);
106 } 106 }
@@ -112,25 +112,25 @@ static void setStyleRecursive ( QWidget *w, QStyle *s )
112void SampleWindow::setStyle2 ( QStyle *sty, const QPalette &pal ) 112void SampleWindow::setStyle2 ( QStyle *sty, const QPalette &pal )
113{ 113{
114 typedef void (QStyle::*QDrawMenuBarItemImpl) (QPainter *, int, int, int, int, QMenuItem *, QColorGroup &, bool, bool); 114 typedef void (QStyle::*QDrawMenuBarItemImpl) (QPainter *, int, int, int, int, QMenuItem *, QColorGroup &, bool, bool);
115 115
116 extern QDrawMenuBarItemImpl qt_set_draw_menu_bar_impl(QDrawMenuBarItemImpl); 116 extern QDrawMenuBarItemImpl qt_set_draw_menu_bar_impl(QDrawMenuBarItemImpl);
117 117
118 QPixmapCache::clear ( ); 118 QPixmapCache::clear ( );
119 QPalette p = pal; // ette ( ); 119 QPalette p = pal; // ette ( );
120 sty-> polish ( p ); 120 sty-> polish ( p );
121 qt_set_draw_menu_bar_impl ( 0 ); 121 qt_set_draw_menu_bar_impl ( 0 );
122 setStyleRecursive ( this, sty ); 122 setStyleRecursive ( this, sty );
123 setPalette ( p ); 123 setPalette ( p );
124 QTimer::singleShot ( 0, this, SLOT( fixGeometry ( ))); 124 QTimer::singleShot ( 0, this, SLOT( fixGeometry()));
125} 125}
126 126
127 127
128void SampleWindow::setDecoration( WindowDecorationInterface *i ) 128void SampleWindow::setDecoration( WindowDecorationInterface *i )
129{ 129{
130 iface = i; 130 iface = i;
131 wd.rect = QRect( 0, 0, 150, 75 ); 131 wd.rect = QRect( 0, 0, 150, 75 );
132 wd.caption = tr("Sample"); 132 wd.caption = tr("Sample");
133 wd.palette = palette(); 133 wd.palette = palette();
134 wd.flags = WindowDecorationInterface::WindowData::Dialog | 134 wd.flags = WindowDecorationInterface::WindowData::Dialog |
135 WindowDecorationInterface::WindowData::Active; 135 WindowDecorationInterface::WindowData::Active;
136 wd.reserved = 1; 136 wd.reserved = 1;