summaryrefslogtreecommitdiff
authordrw <drw>2005-03-12 00:49:08 (UTC)
committer drw <drw>2005-03-12 00:49:08 (UTC)
commit9ae22dd605f8de697c5c8d98e114a3701d8774fb (patch) (unidiff)
tree718a4ee9e4cfca8f437d2e59d2b867f7cac61e07
parentc7cda5d104efd75ab608384215e40a541697392e (diff)
downloadopie-9ae22dd605f8de697c5c8d98e114a3701d8774fb.zip
opie-9ae22dd605f8de697c5c8d98e114a3701d8774fb.tar.gz
opie-9ae22dd605f8de697c5c8d98e114a3701d8774fb.tar.bz2
Fix default settings for background in Edit tab dialog
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/launcher/tabdialog.cpp46
1 files changed, 18 insertions, 28 deletions
diff --git a/core/settings/launcher/tabdialog.cpp b/core/settings/launcher/tabdialog.cpp
index bd51628..555e64e 100644
--- a/core/settings/launcher/tabdialog.cpp
+++ b/core/settings/launcher/tabdialog.cpp
@@ -160,14 +160,7 @@ public:
160 case TabConfig::Image: { 160 case TabConfig::Image: {
161 odebug << "Loading image: " << val << "" << oendl; 161 odebug << "Loading image: " << val << "" << oendl;
162 QPixmap bg ( Resource::loadPixmap ( "wallpaper/" + val )); 162 QPixmap bg = Resource::loadPixmap ( val );
163 if ( bg. isNull ( )) { 163 if ( bg. isNull () )
164 QImageIO imgio; 164 bg = QPixmap( val );
165 imgio. setFileName ( val );
166 QSize ds = qApp-> desktop ( )-> size ( );
167 QString param ( "Scale( %1, %2, ScaleMin )" ); // No tr
168 imgio. setParameters ( param. arg ( ds. width ( )). arg ( ds. height ( )). latin1 ( ));
169 imgio. read ( );
170 bg = imgio. image ( );
171 }
172 setBackgroundPixmap ( bg ); 165 setBackgroundPixmap ( bg );
173 break; 166 break;
@@ -300,13 +293,8 @@ TabDialog::TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig
300 lay-> addWidget ( sample, 1 ); 293 lay-> addWidget ( sample, 1 );
301 294
302 m_iconsize-> setButton ( tc. m_view );
303 iconSizeClicked ( tc. m_view );
304 //m_iconcolor-> setColor ( QColor ( m_tc. m_text_color ));
305 iconColorClicked ( m_iconcolor-> color ( ));
306 m_bgtype-> setButton ( tc. m_bg_type );
307 //m_solidcolor-> setColor ( QColor ( tc. m_bg_color ));
308 m_iconcolumns->setValue( tc. m_iconcolumns );
309 m_bgimage = tc. m_bg_image; 295 m_bgimage = tc. m_bg_image;
310 bgTypeClicked ( tc. m_bg_type ); 296 m_bgtype-> setButton ( tc. m_bg_type );
297 bgTypeClicked( tc.m_bg_type );
298
311 m_fontuse-> setChecked ( tc. m_font_use ); 299 m_fontuse-> setChecked ( tc. m_font_use );
312 m_fontselect-> setSelectedFont ( QFont ( tc. m_font_family, tc. m_font_size, tc. m_font_weight, tc. m_font_italic )); 300 m_fontselect-> setSelectedFont ( QFont ( tc. m_font_family, tc. m_font_size, tc. m_font_weight, tc. m_font_italic ));
@@ -314,4 +302,9 @@ TabDialog::TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig
314 fontClicked ( m_fontselect-> selectedFont ( )); 302 fontClicked ( m_fontselect-> selectedFont ( ));
315 303
304 m_iconsize-> setButton ( tc. m_view );
305 iconSizeClicked ( tc. m_view );
306 iconColorClicked ( m_iconcolor-> color ( ));
307 m_iconcolumns->setValue( tc. m_iconcolumns );
308
316 QWhatsThis::add ( sample, tr( "This is a rough preview of what the currently selected Tab will look like." )); 309 QWhatsThis::add ( sample, tr( "This is a rough preview of what the currently selected Tab will look like." ));
317} 310}
@@ -353,4 +346,5 @@ QWidget *TabDialog::createBgTab ( QWidget *parent )
353 m_bgtype-> hide ( ); 346 m_bgtype-> hide ( );
354 m_bgtype-> setExclusive ( true ); 347 m_bgtype-> setExclusive ( true );
348 connect ( m_bgtype, SIGNAL( clicked(int)), this, SLOT( bgTypeClicked(int)));
355 349
356 QRadioButton *rb; 350 QRadioButton *rb;
@@ -393,6 +387,4 @@ QWidget *TabDialog::createBgTab ( QWidget *parent )
393 gridLayout-> addWidget ( p, 3, 1 ); 387 gridLayout-> addWidget ( p, 3, 1 );
394 388
395 connect ( m_bgtype, SIGNAL( clicked(int)), this, SLOT( bgTypeClicked(int)));
396
397 vertLayout-> addStretch ( 10 ); 389 vertLayout-> addStretch ( 10 );
398 390
@@ -462,8 +454,4 @@ void TabDialog::bgTypeClicked ( int t )
462{ 454{
463 QString s; 455 QString s;
464
465 if ( m_bgtype-> id ( m_bgtype-> selected ( )) != t )
466 m_bgtype-> setButton ( t );
467
468 m_solidcolor-> setEnabled ( t == TabConfig::SolidColor ); 456 m_solidcolor-> setEnabled ( t == TabConfig::SolidColor );
469 m_imagebrowse-> setEnabled ( t == TabConfig::Image ); 457 m_imagebrowse-> setEnabled ( t == TabConfig::Image );
@@ -472,5 +460,5 @@ void TabDialog::bgTypeClicked ( int t )
472 s = m_solidcolor-> color ( ). name ( ); 460 s = m_solidcolor-> color ( ). name ( );
473 else if ( t == TabConfig::Image ) 461 else if ( t == TabConfig::Image )
474 s = Resource::findPixmap ( m_bgimage ); 462 s = m_bgimage;
475 463
476 m_sample-> setBackgroundType ((TabConfig::BackgroundType) t, s ); 464 m_sample-> setBackgroundType ((TabConfig::BackgroundType) t, s );
@@ -479,5 +467,5 @@ void TabDialog::bgTypeClicked ( int t )
479void TabDialog::bgColorClicked ( const QColor & ) 467void TabDialog::bgColorClicked ( const QColor & )
480{ 468{
481 bgTypeClicked ( TabConfig::SolidColor ); 469 m_sample-> setBackgroundType ( TabConfig::SolidColor, m_solidcolor-> color ( ). name ( ) );
482} 470}
483 471
@@ -502,5 +490,5 @@ void TabDialog::bgImageClicked ( )
502 m_tc.m_last_directory = QFileInfo( file ).dirPath(); 490 m_tc.m_last_directory = QFileInfo( file ).dirPath();
503 m_bgimage = DocLnk ( file ). file ( ); 491 m_bgimage = DocLnk ( file ). file ( );
504 bgTypeClicked ( TabConfig::Image ); 492 m_sample-> setBackgroundType ( TabConfig::Image, m_bgimage );
505 } 493 }
506} 494}
@@ -508,6 +496,8 @@ void TabDialog::bgImageClicked ( )
508void TabDialog::bgDefaultClicked ( ) 496void TabDialog::bgDefaultClicked ( )
509{ 497{
498 m_bgtype-> setButton ( TabConfig::Image );
510 m_bgimage = "launcher/opie-background"; 499 m_bgimage = "launcher/opie-background";
511 bgTypeClicked ( TabConfig::Image ); 500 bgTypeClicked( TabConfig::Image );
501 //m_sample-> setBackgroundType ( TabConfig::Image, m_bgimage );
512} 502}
513 503