-rw-r--r-- | noncore/settings/appearance2/appearance.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp index e269aec..43ff24c 100644 --- a/noncore/settings/appearance2/appearance.cpp +++ b/noncore/settings/appearance2/appearance.cpp | |||
@@ -298,130 +298,130 @@ QWidget *Appearance::createColorTab ( QWidget *parent ) | |||
298 | QWidget *Appearance::createGuiTab ( QWidget *parent ) | 298 | QWidget *Appearance::createGuiTab ( QWidget *parent ) |
299 | { | 299 | { |
300 | Config config ( "qpe" ); | 300 | Config config ( "qpe" ); |
301 | config. setGroup ( "Appearance" ); | 301 | config. setGroup ( "Appearance" ); |
302 | 302 | ||
303 | QWidget *tab = new QWidget( parent, "AdvancedTab" ); | 303 | QWidget *tab = new QWidget( parent, "AdvancedTab" ); |
304 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 4, 4 ); | 304 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 4, 4 ); |
305 | 305 | ||
306 | QGridLayout* gridLayout = new QGridLayout ( vertLayout ); | 306 | QGridLayout* gridLayout = new QGridLayout ( vertLayout ); |
307 | 307 | ||
308 | int style = config. readNumEntry ( "TabStyle", 2 ) - 1; | 308 | int style = config. readNumEntry ( "TabStyle", 2 ) - 1; |
309 | bool tabtop = ( config. readEntry ( "TabPosition", "Top" ) == "Top" ); | 309 | bool tabtop = ( config. readEntry ( "TabPosition", "Top" ) == "Top" ); |
310 | 310 | ||
311 | QLabel* label = new QLabel( tr( "Tab style:" ), tab ); | 311 | QLabel* label = new QLabel( tr( "Tab style:" ), tab ); |
312 | gridLayout-> addWidget ( label, 0, 0 ); | 312 | gridLayout-> addWidget ( label, 0, 0 ); |
313 | QButtonGroup* btngrp = new QButtonGroup( tab, "buttongroup" ); | 313 | QButtonGroup* btngrp = new QButtonGroup( tab, "buttongroup" ); |
314 | btngrp-> hide ( ); | 314 | btngrp-> hide ( ); |
315 | btngrp-> setExclusive ( true ); | 315 | btngrp-> setExclusive ( true ); |
316 | 316 | ||
317 | m_tabstyle_list = new QComboBox ( false, tab, "tabstyle" ); | 317 | m_tabstyle_list = new QComboBox ( false, tab, "tabstyle" ); |
318 | m_tabstyle_list-> insertItem ( tr( "Tabs" )); | 318 | m_tabstyle_list-> insertItem ( tr( "Tabs" )); |
319 | m_tabstyle_list-> insertItem ( tr( "Tabs w/icons" )); | 319 | m_tabstyle_list-> insertItem ( tr( "Tabs w/icons" )); |
320 | m_tabstyle_list-> insertItem ( tr( "Drop down list" )); | 320 | m_tabstyle_list-> insertItem ( tr( "Drop down list" )); |
321 | m_tabstyle_list-> insertItem ( tr( "Drop down list w/icons" )); | 321 | m_tabstyle_list-> insertItem ( tr( "Drop down list w/icons" )); |
322 | m_tabstyle_list-> setCurrentItem ( style ); | 322 | m_tabstyle_list-> setCurrentItem ( style ); |
323 | gridLayout-> addMultiCellWidget ( m_tabstyle_list, 0, 0, 1, 2 ); | 323 | gridLayout-> addMultiCellWidget ( m_tabstyle_list, 0, 0, 1, 2 ); |
324 | 324 | ||
325 | m_tabstyle_top = new QRadioButton( tr( "Top" ), tab, "tabpostop" ); | 325 | m_tabstyle_top = new QRadioButton( tr( "Top" ), tab, "tabpostop" ); |
326 | btngrp-> insert ( m_tabstyle_top ); | 326 | btngrp-> insert ( m_tabstyle_top ); |
327 | gridLayout-> addWidget( m_tabstyle_top, 1, 1 ); | 327 | gridLayout-> addWidget( m_tabstyle_top, 1, 1 ); |
328 | 328 | ||
329 | m_tabstyle_bottom = new QRadioButton( tr( "Bottom" ), tab, "tabposbottom" ); | 329 | m_tabstyle_bottom = new QRadioButton( tr( "Bottom" ), tab, "tabposbottom" ); |
330 | btngrp-> insert ( m_tabstyle_bottom ); | 330 | btngrp-> insert ( m_tabstyle_bottom ); |
331 | gridLayout-> addWidget( m_tabstyle_bottom, 1, 2 ); | 331 | gridLayout-> addWidget( m_tabstyle_bottom, 1, 2 ); |
332 | 332 | ||
333 | m_tabstyle_top-> setChecked ( tabtop ); | 333 | m_tabstyle_top-> setChecked ( tabtop ); |
334 | m_tabstyle_bottom-> setChecked ( !tabtop ); | 334 | m_tabstyle_bottom-> setChecked ( !tabtop ); |
335 | 335 | ||
336 | m_original_tabstyle = style; | 336 | m_original_tabstyle = style; |
337 | m_original_tabpos = tabtop; | 337 | m_original_tabpos = tabtop; |
338 | 338 | ||
339 | return tab; | 339 | return tab; |
340 | } | 340 | } |
341 | 341 | ||
342 | 342 | ||
343 | Appearance::Appearance( QWidget* parent, const char* name, WFlags ) | 343 | Appearance::Appearance( QWidget* parent, const char* name, WFlags ) |
344 | : QDialog ( parent, name, true ) | 344 | : QDialog ( parent, name, true ) |
345 | { | 345 | { |
346 | setCaption( tr( "Appearance" ) ); | 346 | setCaption( tr( "Appearance" ) ); |
347 | 347 | ||
348 | Config config( "qpe" ); | 348 | Config config( "qpe" ); |
349 | config.setGroup( "Appearance" ); | 349 | config.setGroup( "Appearance" ); |
350 | 350 | ||
351 | QVBoxLayout *top = new QVBoxLayout ( this, 4, 4 ); | 351 | QVBoxLayout *top = new QVBoxLayout ( this, 4, 4 ); |
352 | 352 | ||
353 | m_sample = new SampleWindow ( this ); | 353 | m_sample = new SampleWindow ( this ); |
354 | m_sample-> setDecoration ( new DefaultWindowDecoration ( )); | 354 | m_sample-> setDecoration ( new DefaultWindowDecoration ( )); |
355 | 355 | ||
356 | OTabWidget* tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); | 356 | OTabWidget* tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); |
357 | QWidget *styletab; | 357 | QWidget *styletab; |
358 | 358 | ||
359 | tw-> addTab ( styletab = createStyleTab ( tw ), "appearance/styletabicon.png", tr( "Style" )); | 359 | tw-> addTab ( styletab = createStyleTab ( tw ), "appearance/styletabicon.png", tr( "Style" )); |
360 | tw-> addTab ( createFontTab ( tw ), "appearance/fonttabicon.png", tr( "Font" )); | 360 | tw-> addTab ( createFontTab ( tw ), "appearance/fonttabicon.png", tr( "Font" )); |
361 | tw-> addTab ( createColorTab ( tw ), "appearance/colorstabicon.png", tr( "Colors" ) ); | 361 | tw-> addTab ( createColorTab ( tw ), "appearance/colorstabicon.png", tr( "Colors" ) ); |
362 | tw-> addTab ( createDecoTab ( tw ), "appearance/styletabicon.png", tr( "Windows" ) ); | 362 | tw-> addTab ( createDecoTab ( tw ), "appearance/decotabicon.png", tr( "Windows" ) ); |
363 | tw-> addTab ( createGuiTab ( tw ), "appearance/backgroundtabicon.png", tr( "Gui" ) ); | 363 | tw-> addTab ( createGuiTab ( tw ), "appearance/advancedtabicon.png", tr( "Gui" ) ); |
364 | 364 | ||
365 | top-> addWidget ( tw, 10 ); | 365 | top-> addWidget ( tw, 10 ); |
366 | top-> addWidget ( m_sample, 1 ); | 366 | top-> addWidget ( m_sample, 1 ); |
367 | 367 | ||
368 | tw-> setCurrentTab ( styletab ); | 368 | tw-> setCurrentTab ( styletab ); |
369 | } | 369 | } |
370 | 370 | ||
371 | Appearance::~Appearance() | 371 | Appearance::~Appearance() |
372 | { | 372 | { |
373 | } | 373 | } |
374 | 374 | ||
375 | void Appearance::accept ( ) | 375 | void Appearance::accept ( ) |
376 | { | 376 | { |
377 | Config config("qpe"); | 377 | Config config("qpe"); |
378 | config.setGroup( "Appearance" ); | 378 | config.setGroup( "Appearance" ); |
379 | 379 | ||
380 | int newtabstyle = m_tabstyle_list-> currentItem ( ); | 380 | int newtabstyle = m_tabstyle_list-> currentItem ( ); |
381 | bool newtabpos = m_tabstyle_top-> isChecked ( ); | 381 | bool newtabpos = m_tabstyle_top-> isChecked ( ); |
382 | 382 | ||
383 | 383 | ||
384 | if ( m_style_changed ) { | 384 | if ( m_style_changed ) { |
385 | StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( )); | 385 | StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( )); |
386 | if ( item ) | 386 | if ( item ) |
387 | config.writeEntry( "Style", item-> key ( )); | 387 | config.writeEntry( "Style", item-> key ( )); |
388 | } | 388 | } |
389 | 389 | ||
390 | if (( newtabstyle != m_original_tabstyle ) || ( newtabpos != m_original_tabpos )) { | 390 | if (( newtabstyle != m_original_tabstyle ) || ( newtabpos != m_original_tabpos )) { |
391 | config. writeEntry ( "TabStyle", newtabstyle + 1 ); | 391 | config. writeEntry ( "TabStyle", newtabstyle + 1 ); |
392 | config. writeEntry ( "TabPosition", newtabpos ? "Top" : "Bottom" ); | 392 | config. writeEntry ( "TabPosition", newtabpos ? "Top" : "Bottom" ); |
393 | } | 393 | } |
394 | 394 | ||
395 | if ( m_font_changed ) { | 395 | if ( m_font_changed ) { |
396 | config. writeEntry ( "FontFamily", m_fontselect-> fontFamily ( )); | 396 | config. writeEntry ( "FontFamily", m_fontselect-> fontFamily ( )); |
397 | config. writeEntry ( "FontStyle", m_fontselect-> fontStyle ( )); | 397 | config. writeEntry ( "FontStyle", m_fontselect-> fontStyle ( )); |
398 | config. writeEntry ( "FontSize", m_fontselect-> fontSize ( )); | 398 | config. writeEntry ( "FontSize", m_fontselect-> fontSize ( )); |
399 | } | 399 | } |
400 | 400 | ||
401 | 401 | ||
402 | if ( m_color_changed ) | 402 | if ( m_color_changed ) |
403 | { | 403 | { |
404 | ColorListItem *item = (ColorListItem *) m_color_list-> item ( m_color_list-> currentItem ( )); | 404 | ColorListItem *item = (ColorListItem *) m_color_list-> item ( m_color_list-> currentItem ( )); |
405 | 405 | ||
406 | if ( item ) | 406 | if ( item ) |
407 | item-> save ( config ); | 407 | item-> save ( config ); |
408 | } | 408 | } |
409 | 409 | ||
410 | config. write ( ); // need to flush the config info first | 410 | config. write ( ); // need to flush the config info first |
411 | Global::applyStyle ( ); | 411 | Global::applyStyle ( ); |
412 | 412 | ||
413 | if ( QMessageBox::warning ( this, tr( "Restart" ), tr( "Do you want to restart Opie now?" ), tr( "Yes" ), tr( "No" ), 0, 0, 1 ) == 0 ) { | 413 | if ( QMessageBox::warning ( this, tr( "Restart" ), tr( "Do you want to restart Opie now?" ), tr( "Yes" ), tr( "No" ), 0, 0, 1 ) == 0 ) { |
414 | QCopEnvelope e( "QPE/System", "restart()" ); | 414 | QCopEnvelope e( "QPE/System", "restart()" ); |
415 | } | 415 | } |
416 | 416 | ||
417 | QDialog::accept ( ); | 417 | QDialog::accept ( ); |
418 | } | 418 | } |
419 | 419 | ||
420 | void Appearance::done ( int r ) | 420 | void Appearance::done ( int r ) |
421 | { | 421 | { |
422 | QDialog::done ( r ); | 422 | QDialog::done ( r ); |
423 | close ( ); | 423 | close ( ); |
424 | } | 424 | } |
425 | 425 | ||
426 | 426 | ||
427 | void Appearance::styleClicked ( int index ) | 427 | void Appearance::styleClicked ( int index ) |