summaryrefslogtreecommitdiff
authordrw <drw>2005-06-09 20:47:58 (UTC)
committer drw <drw>2005-06-09 20:47:58 (UTC)
commit650c69e864bdfa61137e028efde767527c3c1562 (patch) (unidiff)
tree69c425ba79f1d9252e65819082c91dedfd450900
parentccc819750468aa161255e863dac4d2ca55ace253 (diff)
downloadopie-650c69e864bdfa61137e028efde767527c3c1562.zip
opie-650c69e864bdfa61137e028efde767527c3c1562.tar.gz
opie-650c69e864bdfa61137e028efde767527c3c1562.tar.bz2
Resource -> OResource
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/appearance2/appearance.cpp8
-rw-r--r--noncore/settings/appearance2/config.in2
-rw-r--r--noncore/settings/appearance2/exceptlistitem.h8
-rw-r--r--noncore/settings/appearance2/stylelistitem.h3
4 files changed, 11 insertions, 10 deletions
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp
index 93e28fa..eea1a19 100644
--- a/noncore/settings/appearance2/appearance.cpp
+++ b/noncore/settings/appearance2/appearance.cpp
@@ -174,389 +174,389 @@ QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg )
174 174
175 return tab; 175 return tab;
176} 176}
177 177
178QWidget *Appearance::createDecoTab ( QWidget *parent, Config &cfg ) 178QWidget *Appearance::createDecoTab ( QWidget *parent, Config &cfg )
179{ 179{
180 QWidget* tab = new QWidget( parent, "DecoTab" ); 180 QWidget* tab = new QWidget( parent, "DecoTab" );
181 QVBoxLayout* vertLayout = new QVBoxLayout( tab, 3, 3 ); 181 QVBoxLayout* vertLayout = new QVBoxLayout( tab, 3, 3 );
182 182
183 m_deco_list = new QListBox( tab, "m_deco_list" ); 183 m_deco_list = new QListBox( tab, "m_deco_list" );
184 vertLayout->addWidget( m_deco_list ); 184 vertLayout->addWidget( m_deco_list );
185 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." ) ); 185 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." ) );
186 186
187 QString s = cfg. readEntry ( "Decoration", "libflat.so" ); 187 QString s = cfg. readEntry ( "Decoration", "libflat.so" );
188 188
189 m_deco_list-> insertItem ( new DecoListItem ( "QPE" )); 189 m_deco_list-> insertItem ( new DecoListItem ( "QPE" ));
190 190
191 { 191 {
192 QString path = QPEApplication::qpeDir(); 192 QString path = QPEApplication::qpeDir();
193 path.append( "/plugins/decorations/" ); 193 path.append( "/plugins/decorations/" );
194 QStringList sl = QDir ( path, "lib*.so" ). entryList ( ); 194 QStringList sl = QDir ( path, "lib*.so" ). entryList ( );
195 195
196 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) 196 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
197 { 197 {
198 QString libstr = path; 198 QString libstr = path;
199 libstr.append( "/" ); 199 libstr.append( "/" );
200 libstr.append( *it ); 200 libstr.append( *it );
201 QLibrary *lib = new QLibrary ( libstr ); 201 QLibrary *lib = new QLibrary ( libstr );
202 WindowDecorationInterface *iface; 202 WindowDecorationInterface *iface;
203 203
204 if ( lib-> queryInterface ( IID_WindowDecoration, (QUnknownInterface **) &iface ) == QS_OK ) 204 if ( lib-> queryInterface ( IID_WindowDecoration, (QUnknownInterface **) &iface ) == QS_OK )
205 { 205 {
206 DecoListItem *dlit = new DecoListItem ( lib, iface ); 206 DecoListItem *dlit = new DecoListItem ( lib, iface );
207 m_deco_list-> insertItem ( dlit ); 207 m_deco_list-> insertItem ( dlit );
208 208
209 if ( dlit-> key ( ) == s ) 209 if ( dlit-> key ( ) == s )
210 m_deco_list-> setCurrentItem ( dlit ); 210 m_deco_list-> setCurrentItem ( dlit );
211 } 211 }
212 else 212 else
213 delete lib; 213 delete lib;
214 } 214 }
215 } 215 }
216 216
217 m_original_deco = m_deco_list-> currentItem ( ); 217 m_original_deco = m_deco_list-> currentItem ( );
218 if ( m_deco_list-> currentItem ( ) < 0 ) 218 if ( m_deco_list-> currentItem ( ) < 0 )
219 m_deco_list-> setCurrentItem ( 0 ); 219 m_deco_list-> setCurrentItem ( 0 );
220 decoClicked ( m_original_deco ); 220 decoClicked ( m_original_deco );
221 221
222 connect( m_deco_list, SIGNAL( highlighted(int) ), this, SLOT( decoClicked(int) ) ); 222 connect( m_deco_list, SIGNAL( highlighted(int) ), this, SLOT( decoClicked(int) ) );
223 223
224 return tab; 224 return tab;
225} 225}
226 226
227QWidget *Appearance::createFontTab ( QWidget *parent, Config &cfg ) 227QWidget *Appearance::createFontTab ( QWidget *parent, Config &cfg )
228{ 228{
229 QString familyStr = cfg. readEntry ( "FontFamily", "Helvetica" ); 229 QString familyStr = cfg. readEntry ( "FontFamily", "Helvetica" );
230 QString styleStr = cfg. readEntry ( "FontStyle", "Regular" ); 230 QString styleStr = cfg. readEntry ( "FontStyle", "Regular" );
231 int size = cfg. readNumEntry ( "FontSize", 10 ); 231 int size = cfg. readNumEntry ( "FontSize", 10 );
232 232
233 m_fontselect = new OFontSelector ( false, parent, "FontTab" ); 233 m_fontselect = new OFontSelector ( false, parent, "FontTab" );
234 m_fontselect-> setSelectedFont ( familyStr, styleStr, size ); 234 m_fontselect-> setSelectedFont ( familyStr, styleStr, size );
235 QWhatsThis::add( m_fontselect, tr( "Select the desired name, style and size of the default font applications will use." ) ); 235 QWhatsThis::add( m_fontselect, tr( "Select the desired name, style and size of the default font applications will use." ) );
236 236
237 connect( m_fontselect, SIGNAL( fontSelected(const QFont&)), 237 connect( m_fontselect, SIGNAL( fontSelected(const QFont&)),
238 this, SLOT( fontClicked(const QFont&))); 238 this, SLOT( fontClicked(const QFont&)));
239 239
240 return m_fontselect; 240 return m_fontselect;
241} 241}
242 242
243QWidget *Appearance::createColorTab ( QWidget *parent, Config &cfg ) 243QWidget *Appearance::createColorTab ( QWidget *parent, Config &cfg )
244{ 244{
245 QWidget *tab = new QWidget( parent, "ColorTab" ); 245 QWidget *tab = new QWidget( parent, "ColorTab" );
246 QGridLayout *gridLayout = new QGridLayout( tab, 0, 0, 3, 3 ); 246 QGridLayout *gridLayout = new QGridLayout( tab, 0, 0, 3, 3 );
247 gridLayout->setRowStretch ( 3, 10 ); 247 gridLayout->setRowStretch ( 3, 10 );
248 248
249 m_color_list = new QListBox ( tab ); 249 m_color_list = new QListBox ( tab );
250 gridLayout->addMultiCellWidget ( m_color_list, 0, 3, 0, 0 ); 250 gridLayout->addMultiCellWidget ( m_color_list, 0, 3, 0, 0 );
251 connect( m_color_list, SIGNAL( highlighted(int) ), this, SLOT( colorClicked(int) ) ); 251 connect( m_color_list, SIGNAL( highlighted(int) ), this, SLOT( colorClicked(int) ) );
252 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." ) ); 252 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." ) );
253 253
254 m_color_list-> insertItem ( new ColorListItem ( tr( "Current scheme" ), cfg )); 254 m_color_list-> insertItem ( new ColorListItem ( tr( "Current scheme" ), cfg ));
255 255
256 QString path = QPEApplication::qpeDir ( ); 256 QString path = QPEApplication::qpeDir ( );
257 path.append( "/etc/colors/" ); 257 path.append( "/etc/colors/" );
258 QStringList sl = QDir ( path ). entryList ( "*.scheme" ); 258 QStringList sl = QDir ( path ). entryList ( "*.scheme" );
259 259
260 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) 260 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
261 { 261 {
262 QString name = (*it). left ((*it). find ( ".scheme" )); 262 QString name = (*it). left ((*it). find ( ".scheme" ));
263 QString pathstr = path; 263 QString pathstr = path;
264 pathstr.append( *it ); 264 pathstr.append( *it );
265 Config config ( pathstr, Config::File ); 265 Config config ( pathstr, Config::File );
266 config. setGroup ( "Colors" ); 266 config. setGroup ( "Colors" );
267 267
268 m_color_list-> insertItem ( new ColorListItem ( name, config )); 268 m_color_list-> insertItem ( new ColorListItem ( name, config ));
269 } 269 }
270 270
271 m_color_list-> setCurrentItem ( 0 ); 271 m_color_list-> setCurrentItem ( 0 );
272 272
273 QPushButton* tempButton = new QPushButton( tab, "editSchemeButton" ); 273 QPushButton* tempButton = new QPushButton( tab, "editSchemeButton" );
274 tempButton->setText( tr( "Edit..." ) ); 274 tempButton->setText( tr( "Edit..." ) );
275 connect( tempButton, SIGNAL( clicked() ), this, SLOT( editSchemeClicked() ) ); 275 connect( tempButton, SIGNAL( clicked() ), this, SLOT( editSchemeClicked() ) );
276 gridLayout->addWidget( tempButton, 0, 1 ); 276 gridLayout->addWidget( tempButton, 0, 1 );
277 QWhatsThis::add( tempButton, tr( "Click here to change the colors in the current color scheme." ) ); 277 QWhatsThis::add( tempButton, tr( "Click here to change the colors in the current color scheme." ) );
278 278
279 tempButton = new QPushButton( tab, "deleteSchemeButton" ); 279 tempButton = new QPushButton( tab, "deleteSchemeButton" );
280 tempButton->setText( tr( "Delete" ) ); 280 tempButton->setText( tr( "Delete" ) );
281 connect( tempButton, SIGNAL( clicked() ), this, SLOT( deleteSchemeClicked() ) ); 281 connect( tempButton, SIGNAL( clicked() ), this, SLOT( deleteSchemeClicked() ) );
282 gridLayout->addWidget( tempButton, 1, 1 ); 282 gridLayout->addWidget( tempButton, 1, 1 );
283 QWhatsThis::add( tempButton, tr( "Click here to delete the color scheme selected in the list to the left." ) ); 283 QWhatsThis::add( tempButton, tr( "Click here to delete the color scheme selected in the list to the left." ) );
284 284
285 tempButton = new QPushButton( tab, "saveSchemeButton" ); 285 tempButton = new QPushButton( tab, "saveSchemeButton" );
286 tempButton->setText( tr( "Save" ) ); 286 tempButton->setText( tr( "Save" ) );
287 connect( tempButton, SIGNAL( clicked() ), this, SLOT( saveSchemeClicked() ) ); 287 connect( tempButton, SIGNAL( clicked() ), this, SLOT( saveSchemeClicked() ) );
288 gridLayout->addWidget( tempButton, 2, 1 ); 288 gridLayout->addWidget( tempButton, 2, 1 );
289 QWhatsThis::add( tempButton, tr( "Click here to name and save the current color scheme." ) ); 289 QWhatsThis::add( tempButton, tr( "Click here to name and save the current color scheme." ) );
290 290
291 return tab; 291 return tab;
292} 292}
293 293
294QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) 294QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
295{ 295{
296 QWidget *tab = new QWidget ( parent ); 296 QWidget *tab = new QWidget ( parent );
297 QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 ); 297 QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 );
298 298
299 /* 299 /*
300 * show scrollbars on the left? 300 * show scrollbars on the left?
301 */ 301 */
302 m_leftHand = new QCheckBox( tr("Show Scrollbars on the left"), tab ); 302 m_leftHand = new QCheckBox( tr("Show Scrollbars on the left"), tab );
303 m_leftHand->setChecked( cfg.readBoolEntry( "LeftHand", false ) ); 303 m_leftHand->setChecked( cfg.readBoolEntry( "LeftHand", false ) );
304 QWhatsThis::add( m_leftHand, tr( "Click here to display scrollbars on the left side instead of the right." ) ); 304 QWhatsThis::add( m_leftHand, tr( "Click here to display scrollbars on the left side instead of the right." ) );
305 vertLayout->addWidget( m_leftHand ); 305 vertLayout->addWidget( m_leftHand );
306 306
307 QFrame *f = new QFrame ( tab ); 307 QFrame *f = new QFrame ( tab );
308 f-> setFrameStyle ( QFrame::HLine | QFrame::Sunken ); 308 f-> setFrameStyle ( QFrame::HLine | QFrame::Sunken );
309 vertLayout-> addWidget ( f ); 309 vertLayout-> addWidget ( f );
310 vertLayout-> addSpacing ( 3 ); 310 vertLayout-> addSpacing ( 3 );
311 311
312 312
313 QGridLayout* gridLayout = new QGridLayout ( vertLayout, 0, 0, 3, 0 ); 313 QGridLayout* gridLayout = new QGridLayout ( vertLayout, 0, 0, 3, 0 );
314 314
315 int style = cfg. readNumEntry ( "TabStyle", 2 ) - 1; 315 int style = cfg. readNumEntry ( "TabStyle", 2 ) - 1;
316 bool tabtop = ( cfg. readEntry ( "TabPosition", "Top" ) == "Top" ); 316 bool tabtop = ( cfg. readEntry ( "TabPosition", "Top" ) == "Top" );
317 317
318 QLabel* label = new QLabel( tr( "Tab style:" ), tab ); 318 QLabel* label = new QLabel( tr( "Tab style:" ), tab );
319 gridLayout-> addWidget ( label, 0, 0 ); 319 gridLayout-> addWidget ( label, 0, 0 );
320 QWhatsThis::add( label, tr( "Click here to select a desired style for tabbed dialogs (such as this application). The styles available are:\n\n1. Tabs - normal tabs with text labels only\n2. Tabs w/icons - tabs with icons for each tab, text label only appears on current tab\n3. Drop down list - a vertical listing of tabs\n4. Drop down list w/icons - a vertical listing of tabs with icons" ) ); 320 QWhatsThis::add( label, tr( "Click here to select a desired style for tabbed dialogs (such as this application). The styles available are:\n\n1. Tabs - normal tabs with text labels only\n2. Tabs w/icons - tabs with icons for each tab, text label only appears on current tab\n3. Drop down list - a vertical listing of tabs\n4. Drop down list w/icons - a vertical listing of tabs with icons" ) );
321 321
322 QButtonGroup* btngrp = new QButtonGroup( tab, "buttongroup" ); 322 QButtonGroup* btngrp = new QButtonGroup( tab, "buttongroup" );
323 btngrp-> hide ( ); 323 btngrp-> hide ( );
324 btngrp-> setExclusive ( true ); 324 btngrp-> setExclusive ( true );
325 325
326 m_tabstyle_list = new QComboBox ( false, tab, "tabstyle" ); 326 m_tabstyle_list = new QComboBox ( false, tab, "tabstyle" );
327 m_tabstyle_list-> insertItem ( tr( "Tabs" )); 327 m_tabstyle_list-> insertItem ( tr( "Tabs" ));
328 m_tabstyle_list-> insertItem ( tr( "Tabs w/icons" )); 328 m_tabstyle_list-> insertItem ( tr( "Tabs w/icons" ));
329 m_tabstyle_list-> insertItem ( tr( "Drop down list" )); 329 m_tabstyle_list-> insertItem ( tr( "Drop down list" ));
330 m_tabstyle_list-> insertItem ( tr( "Drop down list w/icons" )); 330 m_tabstyle_list-> insertItem ( tr( "Drop down list w/icons" ));
331 m_tabstyle_list-> setCurrentItem ( style ); 331 m_tabstyle_list-> setCurrentItem ( style );
332 gridLayout-> addMultiCellWidget ( m_tabstyle_list, 0, 0, 1, 2 ); 332 gridLayout-> addMultiCellWidget ( m_tabstyle_list, 0, 0, 1, 2 );
333 QWhatsThis::add( m_tabstyle_list, tr( "Click here to select a desired style for tabbed dialogs (such as this application). The styles available are:\n\n1. Tabs - normal tabs with text labels only\n2. Tabs w/icons - tabs with icons for each tab, text label only appears on current tab\n3. Drop down list - a vertical listing of tabs\n4. Drop down list w/icons - a vertical listing of tabs with icons" ) ); 333 QWhatsThis::add( m_tabstyle_list, tr( "Click here to select a desired style for tabbed dialogs (such as this application). The styles available are:\n\n1. Tabs - normal tabs with text labels only\n2. Tabs w/icons - tabs with icons for each tab, text label only appears on current tab\n3. Drop down list - a vertical listing of tabs\n4. Drop down list w/icons - a vertical listing of tabs with icons" ) );
334 334
335 m_tabstyle_top = new QRadioButton( tr( "Top" ), tab, "tabpostop" ); 335 m_tabstyle_top = new QRadioButton( tr( "Top" ), tab, "tabpostop" );
336 btngrp-> insert ( m_tabstyle_top ); 336 btngrp-> insert ( m_tabstyle_top );
337 gridLayout-> addWidget( m_tabstyle_top, 1, 1 ); 337 gridLayout-> addWidget( m_tabstyle_top, 1, 1 );
338 QWhatsThis::add( m_tabstyle_top, tr( "Click here so that tabs appear at the top of the window." ) ); 338 QWhatsThis::add( m_tabstyle_top, tr( "Click here so that tabs appear at the top of the window." ) );
339 339
340 m_tabstyle_bottom = new QRadioButton( tr( "Bottom" ), tab, "tabposbottom" ); 340 m_tabstyle_bottom = new QRadioButton( tr( "Bottom" ), tab, "tabposbottom" );
341 btngrp-> insert ( m_tabstyle_bottom ); 341 btngrp-> insert ( m_tabstyle_bottom );
342 gridLayout-> addWidget( m_tabstyle_bottom, 1, 2 ); 342 gridLayout-> addWidget( m_tabstyle_bottom, 1, 2 );
343 QWhatsThis::add( m_tabstyle_bottom, tr( "Click here so that tabs appear at the bottom of the window." ) ); 343 QWhatsThis::add( m_tabstyle_bottom, tr( "Click here so that tabs appear at the bottom of the window." ) );
344 344
345 m_tabstyle_top-> setChecked ( tabtop ); 345 m_tabstyle_top-> setChecked ( tabtop );
346 m_tabstyle_bottom-> setChecked ( !tabtop ); 346 m_tabstyle_bottom-> setChecked ( !tabtop );
347 347
348 m_original_tabstyle = style; 348 m_original_tabstyle = style;
349 m_original_tabpos = tabtop; 349 m_original_tabpos = tabtop;
350 350
351 vertLayout-> addSpacing ( 3 ); 351 vertLayout-> addSpacing ( 3 );
352 QHBoxLayout *rotLay = new QHBoxLayout ( vertLayout, 3 ); 352 QHBoxLayout *rotLay = new QHBoxLayout ( vertLayout, 3 );
353 353
354 QLabel* rotlabel = new QLabel( tr( "Rotation direction:" ), tab ); 354 QLabel* rotlabel = new QLabel( tr( "Rotation direction:" ), tab );
355 m_rotdir_cw = new QRadioButton( tab, "rotdir_cw" ); 355 m_rotdir_cw = new QRadioButton( tab, "rotdir_cw" );
356 m_rotdir_ccw = new QRadioButton( tab, "rotdir_ccw" ); 356 m_rotdir_ccw = new QRadioButton( tab, "rotdir_ccw" );
357 m_rotdir_flip = new QRadioButton( tab, "rotdir_flip" ); 357 m_rotdir_flip = new QRadioButton( tab, "rotdir_flip" );
358 QButtonGroup* rotbtngrp = new QButtonGroup( tab, "rotbuttongroup" ); 358 QButtonGroup* rotbtngrp = new QButtonGroup( tab, "rotbuttongroup" );
359 359
360 rotbtngrp-> hide ( ); 360 rotbtngrp-> hide ( );
361 rotbtngrp-> setExclusive ( true ); 361 rotbtngrp-> setExclusive ( true );
362 rotbtngrp-> insert ( m_rotdir_cw ); 362 rotbtngrp-> insert ( m_rotdir_cw );
363 rotbtngrp-> insert ( m_rotdir_ccw ); 363 rotbtngrp-> insert ( m_rotdir_ccw );
364 rotbtngrp-> insert ( m_rotdir_flip ); 364 rotbtngrp-> insert ( m_rotdir_flip );
365 365
366 QImage ccwImage = Resource::loadImage( "redo" ); 366 QImage ccwImage = Opie::Core::OResource::loadImage( "redo", Opie::Core::OResource::SmallIcon );
367 QPixmap cw, ccw, flip; 367 QPixmap cw, ccw, flip;
368 cw.convertFromImage( ccwImage.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); 368 cw.convertFromImage( ccwImage );
369 ccw.convertFromImage( ccwImage.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ).mirror( 1, 0 ) ); 369 ccw.convertFromImage( ccwImage.mirror( 1, 0 ) );
370 flip.convertFromImage( Resource::loadImage( "pass" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); 370 flip.convertFromImage( Opie::Core::OResource::loadImage( "pass", Opie::Core::OResource::SmallIcon ) );
371 371
372 m_rotdir_cw-> setPixmap( cw ); 372 m_rotdir_cw-> setPixmap( cw );
373 m_rotdir_ccw-> setPixmap( ccw ); 373 m_rotdir_ccw-> setPixmap( ccw );
374 m_rotdir_flip-> setPixmap( flip ); 374 m_rotdir_flip-> setPixmap( flip );
375 375
376 rotLay-> addWidget ( rotlabel, 0 ); 376 rotLay-> addWidget ( rotlabel, 0 );
377 rotLay-> addWidget ( m_rotdir_cw, 0 ); 377 rotLay-> addWidget ( m_rotdir_cw, 0 );
378 rotLay-> addWidget ( m_rotdir_ccw, 0 ); 378 rotLay-> addWidget ( m_rotdir_ccw, 0 );
379 rotLay-> addWidget ( m_rotdir_flip, 0 ); 379 rotLay-> addWidget ( m_rotdir_flip, 0 );
380 380
381 int rotDirection = cfg.readNumEntry( "rotatedir" ); 381 int rotDirection = cfg.readNumEntry( "rotatedir" );
382 ODirection rot = CW; 382 ODirection rot = CW;
383 383
384 if (rotDirection == -1) 384 if (rotDirection == -1)
385 { 385 {
386 rot = ODevice::inst ( )-> direction ( ); 386 rot = ODevice::inst ( )-> direction ( );
387 } 387 }
388 else 388 else
389 { 389 {
390 rot = (ODirection)rotDirection; 390 rot = (ODirection)rotDirection;
391 } 391 }
392 392
393 m_rotdir_cw-> setChecked ( rot == CW ); 393 m_rotdir_cw-> setChecked ( rot == CW );
394 m_rotdir_ccw-> setChecked ( rot == CCW ); 394 m_rotdir_ccw-> setChecked ( rot == CCW );
395 m_rotdir_flip-> setChecked ( rot == Flip ); 395 m_rotdir_flip-> setChecked ( rot == Flip );
396 396
397 397
398 /* 398 /*
399 * add a spacing 399 * add a spacing
400 */ 400 */
401 vertLayout->addItem( new QSpacerItem( 1, 1, QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding ) ); 401 vertLayout->addItem( new QSpacerItem( 1, 1, QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding ) );
402 return tab; 402 return tab;
403} 403}
404 404
405 405
406Appearance::Appearance( QWidget* parent, const char* name, WFlags ) 406Appearance::Appearance( QWidget* parent, const char* name, WFlags )
407 : QDialog ( parent, name, true, WStyle_ContextHelp ) 407 : QDialog ( parent, name, true, WStyle_ContextHelp )
408{ 408{
409 setCaption( tr( "Appearance Settings" ) ); 409 setCaption( tr( "Appearance Settings" ) );
410 410
411 Config config( "qpe" ); 411 Config config( "qpe" );
412 config.setGroup( "Appearance" ); 412 config.setGroup( "Appearance" );
413 413
414 QVBoxLayout *top = new QVBoxLayout ( this, 3, 3 ); 414 QVBoxLayout *top = new QVBoxLayout ( this, 3, 3 );
415 415
416 m_sample = new SampleWindow ( this ); 416 m_sample = new SampleWindow ( this );
417 417
418 m_sample-> setDecoration ( new DefaultWindowDecoration ( ) ); 418 m_sample-> setDecoration ( new DefaultWindowDecoration ( ) );
419 QWhatsThis::add( m_sample, tr( "This is a preview window. Look here to see your new appearance as options are changed." ) ); 419 QWhatsThis::add( m_sample, tr( "This is a preview window. Look here to see your new appearance as options are changed." ) );
420 420
421 OTabWidget* tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); 421 OTabWidget* tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom );
422 QWidget *styletab; 422 QWidget *styletab;
423 423
424 m_color_list = 0; 424 m_color_list = 0;
425 425
426 tw-> addTab ( styletab = createStyleTab ( tw, config ), "appearance", tr( "Style" )); 426 tw-> addTab ( styletab = createStyleTab ( tw, config ), "appearance", tr( "Style" ));
427 tw-> addTab ( createFontTab ( tw, config ), "font", tr( "Font" )); 427 tw-> addTab ( createFontTab ( tw, config ), "font", tr( "Font" ));
428 tw-> addTab ( createColorTab ( tw, config ), "appearance/color", tr( "Colors" ) ); 428 tw-> addTab ( createColorTab ( tw, config ), "appearance/color", tr( "Colors" ) );
429 tw-> addTab ( createDecoTab ( tw, config ), "appearance/deco", tr( "Windows" ) ); 429 tw-> addTab ( createDecoTab ( tw, config ), "appearance/deco", tr( "Windows" ) );
430 tw-> addTab ( m_advtab = createAdvancedTab ( tw, config ), "SettingsIcon", tr( "Advanced" ) ); 430 tw-> addTab ( m_advtab = createAdvancedTab ( tw, config ), "SettingsIcon", tr( "Advanced" ) );
431 431
432 top-> addWidget ( tw, 10 ); 432 top-> addWidget ( tw, 10 );
433 top-> addWidget ( m_sample, 1 ); 433 top-> addWidget ( m_sample, 1 );
434 434
435 tw-> setCurrentTab ( styletab ); 435 tw-> setCurrentTab ( styletab );
436 connect ( tw, SIGNAL( currentChanged(QWidget*)), this, SLOT( tabChanged(QWidget*))); 436 connect ( tw, SIGNAL( currentChanged(QWidget*)), this, SLOT( tabChanged(QWidget*)));
437 437
438 m_style_changed = m_font_changed = m_color_changed = m_deco_changed = false; 438 m_style_changed = m_font_changed = m_color_changed = m_deco_changed = false;
439} 439}
440 440
441Appearance::~Appearance() 441Appearance::~Appearance()
442{} 442{}
443 443
444void Appearance::tabChanged ( QWidget *w ) 444void Appearance::tabChanged ( QWidget *w )
445{ 445{
446 if ( w == m_advtab ) 446 if ( w == m_advtab )
447 { 447 {
448 m_sample-> hide ( ); 448 m_sample-> hide ( );
449 updateGeometry ( ); // shouldn't be necessary ... 449 updateGeometry ( ); // shouldn't be necessary ...
450 } 450 }
451 else 451 else
452 m_sample-> show ( ); 452 m_sample-> show ( );
453} 453}
454 454
455void Appearance::accept ( ) 455void Appearance::accept ( )
456{ 456{
457 bool newtabpos = m_tabstyle_top-> isChecked ( ); 457 bool newtabpos = m_tabstyle_top-> isChecked ( );
458 int newtabstyle = m_tabstyle_list-> currentItem ( ); 458 int newtabstyle = m_tabstyle_list-> currentItem ( );
459 459
460 Config config ( "qpe" ); 460 Config config ( "qpe" );
461 config. setGroup ( "Appearance" ); 461 config. setGroup ( "Appearance" );
462 462
463 if ( m_style_changed ) 463 if ( m_style_changed )
464 { 464 {
465 StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( )); 465 StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( ));
466 if ( item ) 466 if ( item )
467 config.writeEntry( "Style", item-> key ( )); 467 config.writeEntry( "Style", item-> key ( ));
468 } 468 }
469 469
470 if ( m_deco_changed ) 470 if ( m_deco_changed )
471 { 471 {
472 DecoListItem *item = (DecoListItem *) m_deco_list-> item ( m_deco_list-> currentItem ( )); 472 DecoListItem *item = (DecoListItem *) m_deco_list-> item ( m_deco_list-> currentItem ( ));
473 if ( item ) 473 if ( item )
474 config.writeEntry( "Decoration", item-> key ( )); 474 config.writeEntry( "Decoration", item-> key ( ));
475 } 475 }
476 476
477 if (( newtabstyle != m_original_tabstyle ) || ( newtabpos != m_original_tabpos )) 477 if (( newtabstyle != m_original_tabstyle ) || ( newtabpos != m_original_tabpos ))
478 { 478 {
479 config. writeEntry ( "TabStyle", newtabstyle + 1 ); 479 config. writeEntry ( "TabStyle", newtabstyle + 1 );
480 config. writeEntry ( "TabPosition", newtabpos ? "Top" : "Bottom" ); 480 config. writeEntry ( "TabPosition", newtabpos ? "Top" : "Bottom" );
481 } 481 }
482 482
483 if ( m_font_changed ) 483 if ( m_font_changed )
484 { 484 {
485 config. writeEntry ( "FontFamily", m_fontselect-> fontFamily ( )); 485 config. writeEntry ( "FontFamily", m_fontselect-> fontFamily ( ));
486 config. writeEntry ( "FontStyle", m_fontselect-> fontStyle ( )); 486 config. writeEntry ( "FontStyle", m_fontselect-> fontStyle ( ));
487 config. writeEntry ( "FontSize", m_fontselect-> fontSize ( )); 487 config. writeEntry ( "FontSize", m_fontselect-> fontSize ( ));
488 } 488 }
489 489
490 490
491 if ( m_color_changed ) 491 if ( m_color_changed )
492 { 492 {
493 ColorListItem *item = (ColorListItem *) m_color_list-> item ( m_color_list-> currentItem ( )); 493 ColorListItem *item = (ColorListItem *) m_color_list-> item ( m_color_list-> currentItem ( ));
494 494
495 if ( item ) 495 if ( item )
496 item-> save ( config ); 496 item-> save ( config );
497 } 497 }
498 498
499 ODirection rot; 499 ODirection rot;
500 if (m_rotdir_ccw-> isChecked ( )) 500 if (m_rotdir_ccw-> isChecked ( ))
501 { 501 {
502 rot = CCW; 502 rot = CCW;
503 } 503 }
504 else if (m_rotdir_cw-> isChecked ( )) 504 else if (m_rotdir_cw-> isChecked ( ))
505 { 505 {
506 rot = CW; 506 rot = CW;
507 } 507 }
508 else 508 else
509 { 509 {
510 rot = Flip; 510 rot = Flip;
511 } 511 }
512 config. writeEntry ( "rotatedir", (int)rot ); 512 config. writeEntry ( "rotatedir", (int)rot );
513 513
514 config. writeEntry( "LeftHand", m_leftHand->isChecked() ); 514 config. writeEntry( "LeftHand", m_leftHand->isChecked() );
515 515
516 config. write ( ); // need to flush the config info first 516 config. write ( ); // need to flush the config info first
517 Global::applyStyle ( ); 517 Global::applyStyle ( );
518 518
519 QDialog::accept ( ); 519 QDialog::accept ( );
520} 520}
521 521
522void Appearance::done ( int r ) 522void Appearance::done ( int r )
523{ 523{
524 QDialog::done ( r ); 524 QDialog::done ( r );
525 close ( ); 525 close ( );
526} 526}
527 527
528 528
529void Appearance::styleClicked ( int index ) 529void Appearance::styleClicked ( int index )
530{ 530{
531 StyleListItem *sli = (StyleListItem *) m_style_list-> item ( index ); 531 StyleListItem *sli = (StyleListItem *) m_style_list-> item ( index );
532 m_style_settings-> setEnabled ( sli ? sli-> hasSettings ( ) : false ); 532 m_style_settings-> setEnabled ( sli ? sli-> hasSettings ( ) : false );
533 533
534 if ( m_sample && sli && sli-> style ( )) 534 if ( m_sample && sli && sli-> style ( ))
535 { 535 {
536 int ci = m_color_list ? m_color_list-> currentItem ( ) : -1; 536 int ci = m_color_list ? m_color_list-> currentItem ( ) : -1;
537 537
538 m_sample-> setStyle2 ( sli-> style ( ), ci < 0 ? palette ( ) : ((ColorListItem *) m_color_list-> item ( ci ))-> palette ( )); 538 m_sample-> setStyle2 ( sli-> style ( ), ci < 0 ? palette ( ) : ((ColorListItem *) m_color_list-> item ( ci ))-> palette ( ));
539 } 539 }
540 540
541 m_style_changed |= ( index != m_original_style ); 541 m_style_changed |= ( index != m_original_style );
542} 542}
543 543
544void Appearance::styleSettingsClicked ( ) 544void Appearance::styleSettingsClicked ( )
545{ 545{
546 StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( )); 546 StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( ));
547 547
548 if ( item && item-> hasSettings ( )) 548 if ( item && item-> hasSettings ( ))
549 { 549 {
550 QDialog *d = new QDialog ( this, "SETTINGS-DLG", true ); 550 QDialog *d = new QDialog ( this, "SETTINGS-DLG", true );
551 QVBoxLayout *vbox = new QVBoxLayout ( d, 3, 0 ); 551 QVBoxLayout *vbox = new QVBoxLayout ( d, 3, 0 );
552 552
553 QWidget *w = item-> settings ( d ); 553 QWidget *w = item-> settings ( d );
554 554
555 if ( w ) 555 if ( w )
556 { 556 {
557 vbox-> addWidget ( w ); 557 vbox-> addWidget ( w );
558 558
559 d-> setCaption ( w-> caption ( )); 559 d-> setCaption ( w-> caption ( ));
560 560
561 bool accepted = ( QPEApplication::execDialog ( d ) == QDialog::Accepted ); 561 bool accepted = ( QPEApplication::execDialog ( d ) == QDialog::Accepted );
562 562
diff --git a/noncore/settings/appearance2/config.in b/noncore/settings/appearance2/config.in
index 9e30429..2f23c1c 100644
--- a/noncore/settings/appearance2/config.in
+++ b/noncore/settings/appearance2/config.in
@@ -1,4 +1,4 @@
1 config APPEARANCE2 1 config APPEARANCE2
2 boolean "opie-appearance (control color, widget view etc)" 2 boolean "opie-appearance (control color, widget view etc)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2UI && LIBQTAUX 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI && LIBQTAUX
diff --git a/noncore/settings/appearance2/exceptlistitem.h b/noncore/settings/appearance2/exceptlistitem.h
index 365fa90..b8cec86 100644
--- a/noncore/settings/appearance2/exceptlistitem.h
+++ b/noncore/settings/appearance2/exceptlistitem.h
@@ -1,202 +1,202 @@
1/* 1/*
2                 This file is part of the Opie Project 2                 This file is part of the Opie Project
3 3
4 Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> 4 Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
5 =. 5 =.
6 .=l. 6 .=l.
7           .>+-= 7           .>+-=
8 _;:,     .>    :=|. This program is free software; you can 8 _;:,     .>    :=|. This program is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under 9.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software 11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License, 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version. 13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_. 14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that 15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17 : ..    .:,     . . . without even the implied warranty of 17 : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more 20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details. 21++=   -.     .`     .: details.
22:     =  ...= . :.=- 22:     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU 23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with 24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB. 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29*/ 29*/
30 30
31#ifndef EXCEPTLISTITEM_H 31#ifndef EXCEPTLISTITEM_H
32#define EXCEPTLISTITEM_H 32#define EXCEPTLISTITEM_H
33 33
34#include <qlistview.h> 34#include <qlistview.h>
35#include <qpixmap.h> 35#include <qpixmap.h>
36#include <qimage.h> 36#include <qimage.h>
37#include <qpainter.h> 37#include <qpainter.h>
38 38
39class ExceptListItem : public QListViewItem { 39class ExceptListItem : public QListViewItem {
40public: 40public:
41 ExceptListItem ( QListView *lv, QListViewItem *after, const QString &t, bool nostyle = true, bool nofont = true, bool nodeco = true ) : QListViewItem ( lv, after ) 41 ExceptListItem ( QListView *lv, QListViewItem *after, const QString &t, bool nostyle = true, bool nofont = true, bool nodeco = true ) : QListViewItem ( lv, after )
42 { 42 {
43 m_text = t; 43 m_text = t;
44 44
45 m_nofont = nofont; 45 m_nofont = nofont;
46 m_nostyle = nostyle; 46 m_nostyle = nostyle;
47 m_nodeco = nodeco; 47 m_nodeco = nodeco;
48 48
49 init ( ); 49 init ( );
50 } 50 }
51 51
52 virtual ~ExceptListItem ( ) 52 virtual ~ExceptListItem ( )
53 { 53 {
54 } 54 }
55 55
56 static void overlay ( QImage &img, const QImage &ovl ) 56 static void overlay ( QImage &img, const QImage &ovl )
57 { 57 {
58 if (( img. size ( ) != ovl. size ( )) || 58 if (( img. size ( ) != ovl. size ( )) ||
59 ( img. depth ( ) != ovl. depth ( ))) 59 ( img. depth ( ) != ovl. depth ( )))
60 return; 60 return;
61 61
62 for ( int y = 0; y != img. height ( ); y++ ) { 62 for ( int y = 0; y != img. height ( ); y++ ) {
63 QRgb *iline = (QRgb *) img. scanLine ( y ); 63 QRgb *iline = (QRgb *) img. scanLine ( y );
64 QRgb *oline = (QRgb *) ovl. scanLine ( y ); 64 QRgb *oline = (QRgb *) ovl. scanLine ( y );
65 65
66 for ( int x = 0; x != img. width ( ); x++ ) { 66 for ( int x = 0; x != img. width ( ); x++ ) {
67 QRgb i = *iline; 67 QRgb i = *iline;
68 QRgb o = *oline; 68 QRgb o = *oline;
69 69
70 *iline = qRgba (( qRed ( i ) + qRed ( o )) / 2, 70 *iline = qRgba (( qRed ( i ) + qRed ( o )) / 2,
71 ( qGreen ( i ) + qGreen ( o )) / 2, 71 ( qGreen ( i ) + qGreen ( o )) / 2,
72 ( qBlue ( i ) + qBlue ( o )) / 2, 72 ( qBlue ( i ) + qBlue ( o )) / 2,
73 ( qAlpha ( i ) + qAlpha ( o )) / 2 ); 73 ( qAlpha ( i ) + qAlpha ( o )) / 2 );
74 iline++; 74 iline++;
75 oline++; 75 oline++;
76 } 76 }
77 } 77 }
78 } 78 }
79 79
80 static void init ( ) 80 static void init ( )
81 { 81 {
82 static bool init = false; 82 static bool init = false;
83 83
84 if ( init ) 84 if ( init )
85 return; 85 return;
86 86
87 QImage noimg = Resource::loadImage ( "appearance/no.png" ); 87 QImage noimg = Opie::Core::OResource::loadImage ( "appearance/no.png", Opie::Core::OResource::SmallIcon );
88 QImage fontimg = Resource::loadImage ( "appearance/font.png" ); 88 QImage fontimg = Opie::Core::OResource::loadImage ( "appearance/font.png", Opie::Core::OResource::SmallIcon );
89 QImage styleimg = Resource::loadImage ( "appearance/style.png" ); 89 QImage styleimg = Opie::Core::OResource::loadImage ( "appearance/style.png", Opie::Core::OResource::SmallIcon );
90 QImage decoimg = Resource::loadImage ( "appearance/deco.png" ); 90 QImage decoimg = Opie::Core::OResource::loadImage ( "appearance/deco.png", Opie::Core::OResource::SmallIcon );
91 91
92 s_fontpix [0] = new QPixmap ( ); 92 s_fontpix [0] = new QPixmap ( );
93 s_fontpix [0]-> convertFromImage ( fontimg ); 93 s_fontpix [0]-> convertFromImage ( fontimg );
94 overlay ( fontimg, noimg ); 94 overlay ( fontimg, noimg );
95 s_fontpix [1] = new QPixmap ( ); 95 s_fontpix [1] = new QPixmap ( );
96 s_fontpix [1]-> convertFromImage ( fontimg ); 96 s_fontpix [1]-> convertFromImage ( fontimg );
97 97
98 s_stylepix [0] = new QPixmap ( ); 98 s_stylepix [0] = new QPixmap ( );
99 s_stylepix [0]-> convertFromImage ( styleimg ); 99 s_stylepix [0]-> convertFromImage ( styleimg );
100 overlay ( styleimg, noimg ); 100 overlay ( styleimg, noimg );
101 s_stylepix [1] = new QPixmap ( ); 101 s_stylepix [1] = new QPixmap ( );
102 s_stylepix [1]-> convertFromImage ( styleimg ); 102 s_stylepix [1]-> convertFromImage ( styleimg );
103 103
104 s_decopix [0] = new QPixmap ( ); 104 s_decopix [0] = new QPixmap ( );
105 s_decopix [0]-> convertFromImage ( decoimg ); 105 s_decopix [0]-> convertFromImage ( decoimg );
106 overlay ( decoimg, noimg ); 106 overlay ( decoimg, noimg );
107 s_decopix [1] = new QPixmap ( ); 107 s_decopix [1] = new QPixmap ( );
108 s_decopix [1]-> convertFromImage ( decoimg ); 108 s_decopix [1]-> convertFromImage ( decoimg );
109 109
110 init = true; 110 init = true;
111 } 111 }
112 112
113 bool noFont ( ) const 113 bool noFont ( ) const
114 { 114 {
115 return m_nofont; 115 return m_nofont;
116 } 116 }
117 117
118 bool noStyle ( ) const 118 bool noStyle ( ) const
119 { 119 {
120 return m_nostyle; 120 return m_nostyle;
121 } 121 }
122 122
123 bool noDeco ( ) const 123 bool noDeco ( ) const
124 { 124 {
125 return m_nodeco; 125 return m_nodeco;
126 } 126 }
127 127
128 void setNoDeco ( bool b ) 128 void setNoDeco ( bool b )
129 { 129 {
130 if ( b != m_nodeco ) { 130 if ( b != m_nodeco ) {
131 m_nodeco = b; 131 m_nodeco = b;
132 repaint ( ); 132 repaint ( );
133 } 133 }
134 } 134 }
135 135
136 void setNoStyle ( bool b ) 136 void setNoStyle ( bool b )
137 { 137 {
138 if ( b != m_nostyle ) { 138 if ( b != m_nostyle ) {
139 m_nostyle = b; 139 m_nostyle = b;
140 repaint ( ); 140 repaint ( );
141 } 141 }
142 } 142 }
143 143
144 void setNoFont ( bool b ) 144 void setNoFont ( bool b )
145 { 145 {
146 if ( b != m_nofont ) { 146 if ( b != m_nofont ) {
147 m_nofont = b; 147 m_nofont = b;
148 repaint ( ); 148 repaint ( );
149 } 149 }
150 } 150 }
151 151
152 QString pattern ( ) const 152 QString pattern ( ) const
153 { 153 {
154 return m_text; 154 return m_text;
155 } 155 }
156 156
157 void setPattern ( const QString &s ) 157 void setPattern ( const QString &s )
158 { 158 {
159 if ( s != m_text ) { 159 if ( s != m_text ) {
160 m_text = s; 160 m_text = s;
161 widthChanged ( 3 ); 161 widthChanged ( 3 );
162 repaint ( ); 162 repaint ( );
163 } 163 }
164 } 164 }
165 165
166 QString text ( int i ) const 166 QString text ( int i ) const
167 { 167 {
168 if ( i == 3 ) 168 if ( i == 3 )
169 return m_text; 169 return m_text;
170 else 170 else
171 return QString::null; 171 return QString::null;
172 172
173 } 173 }
174 174
175 const QPixmap *pixmap ( int i ) const 175 const QPixmap *pixmap ( int i ) const
176 { 176 {
177 if ( i == 0 ) 177 if ( i == 0 )
178 return (const QPixmap *) s_stylepix [m_nostyle ? 1 : 0]; 178 return (const QPixmap *) s_stylepix [m_nostyle ? 1 : 0];
179 else if ( i == 1 ) 179 else if ( i == 1 )
180 return (const QPixmap *) s_fontpix [m_nofont ? 1 : 0]; 180 return (const QPixmap *) s_fontpix [m_nofont ? 1 : 0];
181 else if ( i == 2 ) 181 else if ( i == 2 )
182 return (const QPixmap *) s_decopix [m_nodeco ? 1 : 0]; 182 return (const QPixmap *) s_decopix [m_nodeco ? 1 : 0];
183 else 183 else
184 return 0; 184 return 0;
185 } 185 }
186 186
187private: 187private:
188 QString m_text; 188 QString m_text;
189 bool m_nofont; 189 bool m_nofont;
190 bool m_nostyle; 190 bool m_nostyle;
191 bool m_nodeco; 191 bool m_nodeco;
192 192
193 static QPixmap *s_stylepix [2]; 193 static QPixmap *s_stylepix [2];
194 static QPixmap *s_fontpix [2]; 194 static QPixmap *s_fontpix [2];
195 static QPixmap *s_decopix [2]; 195 static QPixmap *s_decopix [2];
196}; 196};
197 197
198QPixmap *ExceptListItem::s_stylepix [2] = { 0, 0 }; 198QPixmap *ExceptListItem::s_stylepix [2] = { 0, 0 };
199QPixmap *ExceptListItem::s_fontpix [2] = { 0, 0 }; 199QPixmap *ExceptListItem::s_fontpix [2] = { 0, 0 };
200QPixmap *ExceptListItem::s_decopix [2] = { 0, 0 }; 200QPixmap *ExceptListItem::s_decopix [2] = { 0, 0 };
201 201
202#endif 202#endif
diff --git a/noncore/settings/appearance2/stylelistitem.h b/noncore/settings/appearance2/stylelistitem.h
index 613fa71..3946190 100644
--- a/noncore/settings/appearance2/stylelistitem.h
+++ b/noncore/settings/appearance2/stylelistitem.h
@@ -1,121 +1,122 @@
1/* 1/*
2                 This file is part of the Opie Project 2                 This file is part of the Opie Project
3 3
4 Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> 4 Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
5 =. 5 =.
6 .=l. 6 .=l.
7           .>+-= 7           .>+-=
8 _;:,     .>    :=|. This program is free software; you can 8 _;:,     .>    :=|. This program is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under 9.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software 11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License, 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version. 13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_. 14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that 15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17 : ..    .:,     . . . without even the implied warranty of 17 : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more 20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details. 21++=   -.     .`     .: details.
22:     =  ...= . :.=- 22:     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU 23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with 24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB. 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29*/ 29*/
30 30
31#ifndef STYLELISTITEM_H 31#ifndef STYLELISTITEM_H
32#define STYLELISTITEM_H 32#define STYLELISTITEM_H
33 33
34/* OPIE */ 34/* OPIE */
35#include <opie2/oresource.h>
36
35#include <qpe/styleinterface.h> 37#include <qpe/styleinterface.h>
36#include <qpe/qlibrary.h> 38#include <qpe/qlibrary.h>
37#include <qpe/resource.h>
38 39
39/* QT */ 40/* QT */
40#include <qlistbox.h> 41#include <qlistbox.h>
41#include <qfileinfo.h> 42#include <qfileinfo.h>
42 43
43#include <stdio.h> 44#include <stdio.h>
44 45
45class StyleListItem : public QListBoxText { 46class StyleListItem : public QListBoxText {
46public: 47public:
47 StyleListItem ( const QString &t, QStyle *sty ) : QListBoxText ( t ) 48 StyleListItem ( const QString &t, QStyle *sty ) : QListBoxText ( t )
48 { 49 {
49 m_lib = 0; 50 m_lib = 0;
50 m_style_if = 0; 51 m_style_if = 0;
51 m_settings_if = 0; 52 m_settings_if = 0;
52 m_style = sty; 53 m_style = sty;
53 } 54 }
54 55
55 StyleListItem ( QLibrary *lib, StyleInterface *iface ) : QListBoxText ( iface-> name ( )) 56 StyleListItem ( QLibrary *lib, StyleInterface *iface ) : QListBoxText ( iface-> name ( ))
56 { 57 {
57 m_lib = lib; 58 m_lib = lib;
58 m_style_if = iface; 59 m_style_if = iface;
59 m_settings_if = 0; 60 m_settings_if = 0;
60 m_style = iface-> style ( ); 61 m_style = iface-> style ( );
61 62
62 iface-> queryInterface ( IID_StyleExtended, (QUnknownInterface **) &m_settings_if ); 63 iface-> queryInterface ( IID_StyleExtended, (QUnknownInterface **) &m_settings_if );
63 } 64 }
64 65
65 virtual ~StyleListItem ( ) 66 virtual ~StyleListItem ( )
66 { 67 {
67 delete m_style; 68 delete m_style;
68 69
69 if ( m_settings_if ) 70 if ( m_settings_if )
70 m_settings_if-> release ( ); 71 m_settings_if-> release ( );
71 if ( m_style_if ) 72 if ( m_style_if )
72 m_style_if-> release ( ); 73 m_style_if-> release ( );
73 delete m_lib; 74 delete m_lib;
74 } 75 }
75 76
76 bool hasSettings ( ) const 77 bool hasSettings ( ) const
77 { 78 {
78 return m_settings_if ? m_settings_if-> hasSettings ( ) : false; 79 return m_settings_if ? m_settings_if-> hasSettings ( ) : false;
79 } 80 }
80 81
81 QWidget *settings ( QWidget *parent ) 82 QWidget *settings ( QWidget *parent )
82 { 83 {
83 return m_settings_if ? m_settings_if-> create ( parent ) : 0; 84 return m_settings_if ? m_settings_if-> create ( parent ) : 0;
84 } 85 }
85 86
86 bool setSettings ( bool accepted ) 87 bool setSettings ( bool accepted )
87 { 88 {
88 if ( !m_settings_if ) 89 if ( !m_settings_if )
89 return false; 90 return false;
90 91
91 if ( accepted ) 92 if ( accepted )
92 return m_settings_if-> accept ( ); 93 return m_settings_if-> accept ( );
93 else { 94 else {
94 m_settings_if-> reject ( ); 95 m_settings_if-> reject ( );
95 return false; 96 return false;
96 } 97 }
97 } 98 }
98 99
99 QString key ( ) 100 QString key ( )
100 { 101 {
101 if ( m_lib ) 102 if ( m_lib )
102 return QFileInfo ( m_lib-> library ( )). fileName ( ); 103 return QFileInfo ( m_lib-> library ( )). fileName ( );
103 else 104 else
104 return text ( ); 105 return text ( );
105 } 106 }
106 107
107 QStyle *style ( ) 108 QStyle *style ( )
108 { 109 {
109 return m_style; 110 return m_style;
110 } 111 }
111 112
112private: 113private:
113 QLibrary *m_lib; 114 QLibrary *m_lib;
114 QStyle *m_style; 115 QStyle *m_style;
115 StyleInterface *m_style_if; 116 StyleInterface *m_style_if;
116 StyleExtendedInterface *m_settings_if; 117 StyleExtendedInterface *m_settings_if;
117 118
118}; 119};
119 120
120 121
121#endif 122#endif