Back to index

kdeartwork  4.3.2
firesaversetup.ui.h
Go to the documentation of this file.
00001 /****************************************************************************
00002 ** ui.h extension file, included from the uic-generated form implementation.
00003 **
00004 ** If you wish to add, delete or rename functions or slots use
00005 ** Qt Designer which will update this file, preserving your code. Create an
00006 ** init() function in place of a constructor, and a destroy() function in
00007 ** place of a destructor.
00008 *****************************************************************************/
00009 
00010 
00011 #ifndef KFIRESAVER_SETUP_H
00012 #define KFIRESAVER_SETUP_H
00013 
00014 #include <qcolor.h>
00015 #include <qtimer.h>
00016 #include <kconfig.h>
00017 
00018 
00019 void KFireSaverSetup::init()
00020 {
00021     readConfig();
00022     fireSaverWidget = NULL;
00023     updatePreview();
00024 }
00025 
00026 void KFireSaverSetup::destroy()
00027 {
00028     if ( fireSaverWidget )
00029        delete fireSaverWidget;
00030 }
00031 
00032 
00033 void KFireSaverSetup::applyButton_clicked()
00034 {
00035     writeConfig();
00036     updatePreview();
00037 }
00038 
00039 void KFireSaverSetup::updatePreview()
00040 {
00041     if ( fireSaverWidget )
00042        delete fireSaverWidget;
00043     if ( detachBox->isChecked() ) {
00044        previewLabel->show();
00045        fireSaverWidget = new KFireSaver;
00046        fireSaverWidget->resize(640,480);
00047     } else {
00048        previewLabel->hide();
00049        fireSaverWidget = new KFireSaver( previewFrame );
00050        fireSaverWidget->move(1,1);
00051        fireSaverWidget->resize(
00052               previewFrame->width() - 2,
00053               previewFrame->height() - 2 );
00054     }
00055     fireSaverWidget->show();
00056 }
00057 
00058 
00059 void KFireSaverSetup::writeConfig()
00060 {
00061     KConfig config("kfiresaverrc",false,false);
00062 
00063     // show
00064     config.setGroup( "Show" );
00065     config.writeEntry( "ShowType", showCombo->currentItem() );
00066     config.writeEntry( "FireworksFrequency", fireworksSlider->value() );
00067     config.writeEntry( "ParticlesSize", particlesSlider->value() );
00068     config.writeEntry( "enable-BottomFire", bottomfireBox->isChecked() );
00069       config.writeEntry( "BottomFireColor", bottomfireColorButton->color() );
00070     config.writeEntry( "enable-Sounds", soundsBox->isChecked() );
00071     config.writeEntry( "enable-NoOverhead", overheadBox->isChecked() );
00072     config.writeEntry( "enable-FrameSkip", frameskipBox->isChecked() );
00073 
00074     // fireworks
00075     config.setGroup( "Fireworks" );
00076     if (!fire1Box->isChecked() && !fire2Box->isChecked() &&
00077        !fire3Box->isChecked() && !fire4Box->isChecked() &&
00078        !fire5Box->isChecked() && !fire6Box->isChecked() &&
00079        !fire7Box->isChecked() && !fire8Box->isChecked())
00080        fire1Box->setChecked(true);
00081     config.writeEntry( "use-Classic", fire1Box->isChecked() );
00082     config.writeEntry( "use-Explosion", fire2Box->isChecked() );
00083     config.writeEntry( "use-FlameRing", fire3Box->isChecked() );
00084     config.writeEntry( "use-FlameWorld", fire4Box->isChecked() );
00085     config.writeEntry( "use-Fall", fire5Box->isChecked() );
00086     config.writeEntry( "use-Splitter", fire6Box->isChecked() );
00087     config.writeEntry( "use-Spirals", fire7Box->isChecked() );
00088     config.writeEntry( "use-SuperNova", fire8Box->isChecked() );
00089     if (!redBox->isChecked() && !orangeBox->isChecked() &&
00090         !greenBox->isChecked() && !blueBox->isChecked() &&
00091        !whiteBox->isChecked() && !purpleBox->isChecked() &&
00092        !seagreenBox->isChecked())
00093        whiteBox->setChecked(true);
00094     config.writeEntry( "use-White", whiteBox->isChecked() );
00095     config.writeEntry( "use-Blue", blueBox->isChecked() );
00096     config.writeEntry( "use-DeepGreen", seagreenBox->isChecked() );
00097     config.writeEntry( "use-Purple", purpleBox->isChecked() );
00098     config.writeEntry( "use-Orange", orangeBox->isChecked() );
00099     config.writeEntry( "use-Red", redBox->isChecked() );
00100     config.writeEntry( "use-Green", greenBox->isChecked() );
00101     config.writeEntry( "use-Multicolor", combosBox->isChecked() );
00102 
00103     // specials
00104     config.setGroup( "Specials" );
00105     config.writeEntry( "enable-Logos", logosBox->isChecked() );
00106       config.writeEntry( "LogosKonqui", logosKonquiBox->isChecked() );
00107       config.writeEntry( "LogosTux", logosTuxBox->isChecked() );
00108       config.writeEntry( "LogosKDEIcons", logosIconsBox->isChecked() );
00109       config.writeEntry( "LogosReduceDetail", logosDetailBox->isChecked() );
00110       config.writeEntry( "LogosFrequency", logosSlider->value() );
00111     config.writeEntry( "enable-Stars", starsBox->isChecked() );
00112       config.writeEntry( "StarsFlicker", starsFlickerBox->isChecked() );
00113       config.writeEntry( "StarsGradient", starsGradientBox->isChecked() );
00114       config.writeEntry( "StarsNumber", starsSlider->value() );
00115     config.writeEntry( "enable-Writings", writingsBox->isChecked() );
00116 
00117     // effects
00118     config.setGroup( "Effects" );
00119     config.writeEntry( "enable-SphericalLight", lightBox->isChecked() );
00120     config.writeEntry( "enable-Flash", flashBox->isChecked() );
00121       config.writeEntry( "FlashOpacity", flashSlider->value() );
00122     config.writeEntry( "enable-Fade", fadeBox->isChecked() );
00123       config.writeEntry( "FadeIntensity", fadeSlider->value() );
00124     config.writeEntry( "enable-Flares", flaresBox->isChecked() );
00125       config.writeEntry( "FlaresDimension", flaresSlider->value() );
00126     config.writeEntry( "enable-Trail", trailBox->isChecked() );
00127 }
00128 
00129 
00130 void KFireSaverSetup::readConfig()
00131 {
00132     KConfig config("kfiresaverrc",true,false);
00133 
00134     // show
00135     config.setGroup( "Show" );
00136     showCombo->setCurrentItem(config.readEntry( "ShowType", 1 ));
00137     fireworksSlider->setValue(config.readEntry( "FireworksFrequency", 7 ));
00138     particlesSlider->setValue(config.readEntry( "ParticlesSize", 0 ));
00139     bottomfireBox->setChecked(config.readEntry( "enable-BottomFire", true ));
00140     QColor Qt::blue = Qt::darkBlue;
00141     bottomfireColorButton->setColor(config.readColorEntry( "BottomFireColor", &Qt::blue ));
00142     soundsBox->setChecked(config.readEntry( "enable-Sounds", false ));
00143     overheadBox->setChecked(config.readEntry( "enable-NoOverhead", true ));
00144     frameskipBox->setChecked(config.readEntry( "enable-FrameSkip", true ));
00145 
00146     // fireworks
00147     config.setGroup( "Fireworks" );
00148     fire1Box->setChecked(config.readEntry( "use-Classic", true ));
00149     fire2Box->setChecked(config.readEntry( "use-Explosion", false ));
00150     fire3Box->setChecked(config.readEntry( "use-FlameRing", false ));
00151     fire4Box->setChecked(config.readEntry( "use-FlameWorld", false ));
00152     fire5Box->setChecked(config.readEntry( "use-Fall", false ));
00153     fire6Box->setChecked(config.readEntry( "use-Splitter", false ));
00154     fire7Box->setChecked(config.readEntry( "use-Spirals", false ));
00155     fire8Box->setChecked(config.readEntry( "use-SuperNova", false ));
00156     whiteBox->setChecked(config.readEntry( "use-White", true ));
00157     blueBox->setChecked(config.readEntry( "use-Blue", false ));
00158     seagreenBox->setChecked(config.readEntry( "use-DeepGreen", true ));
00159     purpleBox->setChecked(config.readEntry( "use-Purple", false ));
00160     orangeBox->setChecked(config.readEntry( "use-Orange", true ));
00161     redBox->setChecked(config.readEntry( "use-Red", false ));
00162     greenBox->setChecked(config.readEntry( "use-Green", false ));
00163     combosBox->setChecked(config.readEntry( "use-Multicolor", true ));
00164 
00165     // specials
00166     config.setGroup( "Specials" );
00167     logosBox->setChecked(config.readEntry( "enable-Logos", true ));
00168     logosKonquiBox->setChecked(config.readEntry( "LogosKonqui", true ));
00169     logosTuxBox->setChecked(config.readEntry( "LogosTux", true ));
00170     logosIconsBox->setChecked(config.readEntry( "LogosKDEIcons", true ));
00171     logosDetailBox->setChecked(config.readEntry( "LogosReduceDetail", true ));
00172     logosSlider->setValue(config.readEntry( "LogosFrequency", 4 ));
00173     starsBox->setChecked(config.readEntry( "enable-Stars", true ));
00174     starsFlickerBox->setChecked(config.readEntry( "StarsFlicker", false ));
00175     starsGradientBox->setChecked(config.readEntry( "StarsGradient", true ));
00176     starsSlider->setValue(config.readEntry( "StarsNumber", 4 ));
00177     writingsBox->setChecked(config.readEntry( "enable-Writings", true ));
00178 
00179     // effects
00180     config.setGroup( "Effects" );
00181     lightBox->setChecked(config.readEntry( "enable-SphericalLight", true ));
00182     flashBox->setChecked(config.readEntry( "enable-Flash", false ));
00183     flashSlider->setValue(config.readEntry( "FlashOpacity", 5 ));
00184     fadeBox->setChecked(config.readEntry( "enable-Fade", false ));
00185     fadeSlider->setValue(config.readEntry( "FadeIntensity", 3 ));
00186     flaresBox->setChecked(config.readEntry( "enable-Flares", true ));
00187     flaresSlider->setValue(config.readEntry( "FlaresDimension", 5 ));
00188     trailBox->setChecked(config.readEntry( "enable-Trail", false ));
00189 }
00190 
00191 void KFireSaverSetup::useButton_clicked()
00192 {
00193     int ci = presetCombo->currentItem();
00194 
00195     showCombo->setCurrentItem( 0 );
00196     particlesSlider->setValue( 0 );
00197     overheadBox->setChecked( true );
00198     flashBox->setChecked( false );
00199     //flashSlider->setValue( );
00200     //soundsBox->setChecked( );
00201     //logosDetailBox->setChecked( );
00202 
00203     switch (ci){
00204     case 0: // KDE default
00205        showCombo->setCurrentItem( 1 );
00206        fireworksSlider->setValue( 7 );
00207        bottomfireBox->setChecked( true );
00208        bottomfireColorButton->setColor( Qt::darkBlue );
00209        frameskipBox->setChecked( true );
00210        fire1Box->setChecked( true );
00211        fire2Box->setChecked( false );
00212        fire3Box->setChecked( false );
00213        fire4Box->setChecked( false );
00214        fire5Box->setChecked( false );
00215        fire6Box->setChecked( false );
00216        fire7Box->setChecked( false );
00217        fire8Box->setChecked( false );
00218        whiteBox->setChecked( true );
00219        blueBox->setChecked( false );
00220        seagreenBox->setChecked( true );
00221        purpleBox->setChecked( false );
00222        orangeBox->setChecked( true );
00223        redBox->setChecked( false );
00224        greenBox->setChecked( false );
00225        combosBox->setChecked( true );
00226        logosBox->setChecked( true );
00227        logosKonquiBox->setChecked( true );
00228        logosTuxBox->setChecked( true );
00229        logosIconsBox->setChecked( true );
00230        logosSlider->setValue( 4 );
00231        starsBox->setChecked( true );
00232        starsFlickerBox->setChecked( false );
00233        starsGradientBox->setChecked( true );
00234        starsSlider->setValue( 4 );
00235        writingsBox->setChecked( true );
00236        lightBox->setChecked( true );
00237        fadeBox->setChecked( false );
00238        //fadeSlider->setValue( );
00239        flaresBox->setChecked( true );
00240        flaresSlider->setValue( 5 );
00241        trailBox->setChecked( false );
00242        break;
00243     case 1:  // Elegant white
00244        fireworksSlider->setValue( 7 );
00245        bottomfireBox->setChecked( true );
00246        bottomfireColorButton->setColor( Qt::blue );
00247        frameskipBox->setChecked( true );
00248        fire1Box->setChecked( true );
00249        fire2Box->setChecked( false );
00250        fire3Box->setChecked( false );
00251        fire4Box->setChecked( false );
00252        fire5Box->setChecked( true );
00253        fire6Box->setChecked( true );
00254        fire7Box->setChecked( false );
00255        fire8Box->setChecked( false );
00256        whiteBox->setChecked( true );
00257        blueBox->setChecked( true );
00258        seagreenBox->setChecked( false );
00259        purpleBox->setChecked( false );
00260        orangeBox->setChecked( false );
00261        redBox->setChecked( false );
00262        greenBox->setChecked( false );
00263        combosBox->setChecked( true );
00264        logosBox->setChecked( true );
00265        logosKonquiBox->setChecked( true );
00266        logosTuxBox->setChecked( false );
00267        logosIconsBox->setChecked( false );
00268        logosSlider->setValue( 3 );
00269        starsBox->setChecked( true );
00270        starsFlickerBox->setChecked( true );
00271        starsGradientBox->setChecked( false );
00272        starsSlider->setValue( 4 );
00273        writingsBox->setChecked( true );
00274        lightBox->setChecked( true );
00275        fadeBox->setChecked( true );
00276        fadeSlider->setValue( 3 );
00277        flaresBox->setChecked( true );
00278        flaresSlider->setValue( 6 );
00279        trailBox->setChecked( true );
00280        break;
00281     case 2:  // Quick simple
00282        showCombo->setCurrentItem(1);
00283        fireworksSlider->setValue( 4 );
00284        bottomfireBox->setChecked( false );
00285        //bottomfireColorButton->setColor( );
00286        frameskipBox->setChecked( false );
00287        fire1Box->setChecked( true );
00288        fire2Box->setChecked( true );
00289        fire3Box->setChecked( false );
00290        fire4Box->setChecked( false );
00291        fire5Box->setChecked( false );
00292        fire6Box->setChecked( false );
00293        fire7Box->setChecked( false );
00294        fire8Box->setChecked( false );
00295        whiteBox->setChecked( true );
00296        blueBox->setChecked( true );
00297        seagreenBox->setChecked( false );
00298        purpleBox->setChecked( false );
00299        orangeBox->setChecked( false );
00300        redBox->setChecked( true );
00301        greenBox->setChecked( true );
00302        combosBox->setChecked( false );
00303        logosBox->setChecked( true );
00304        logosKonquiBox->setChecked( true );
00305        logosTuxBox->setChecked( true );
00306        logosIconsBox->setChecked( true );
00307        logosSlider->setValue( 2 );
00308        starsBox->setChecked( false );
00309        //starsFlickerBox->setChecked( );
00310        //starsGradientBox->setChecked( );
00311        //starsSlider->setValue( );
00312        writingsBox->setChecked( false );
00313        lightBox->setChecked( false );
00314        fadeBox->setChecked( false );
00315        //fadeSlider->setValue( );
00316        flaresBox->setChecked( false );
00317        //flaresSlider->setValue( );
00318        trailBox->setChecked( false );
00319        break;
00320     case 3: //Enhanced reality
00321        fireworksSlider->setValue( 8 );
00322        bottomfireBox->setChecked( true );
00323        bottomfireColorButton->setColor( Qt::magenta );
00324        frameskipBox->setChecked( true );
00325        fire1Box->setChecked( true );
00326        fire2Box->setChecked( true );
00327        fire3Box->setChecked( true );
00328        fire4Box->setChecked( true );
00329        fire5Box->setChecked( true );
00330        fire6Box->setChecked( true );
00331        fire7Box->setChecked( false );
00332        fire8Box->setChecked( false );
00333        whiteBox->setChecked( true );
00334        blueBox->setChecked( true );
00335        seagreenBox->setChecked( true );
00336        purpleBox->setChecked( true );
00337        orangeBox->setChecked( true );
00338        redBox->setChecked( true );
00339        greenBox->setChecked( true );
00340        combosBox->setChecked( true );
00341        logosBox->setChecked( true );
00342        logosKonquiBox->setChecked( false );
00343        logosTuxBox->setChecked( true );
00344        logosIconsBox->setChecked( false );
00345        logosSlider->setValue( 2 );
00346        starsBox->setChecked( true );
00347        starsFlickerBox->setChecked( true );
00348        starsGradientBox->setChecked( true );
00349        starsSlider->setValue( 5 );
00350        writingsBox->setChecked( true );
00351        lightBox->setChecked( false );
00352        fadeBox->setChecked( true );
00353        fadeSlider->setValue( 3 );
00354        flaresBox->setChecked( false );
00355        //flaresSlider->setValue( );
00356        trailBox->setChecked( true );
00357        break;
00358     case 4: //Hypnotic illusions
00359        fireworksSlider->setValue( 9 );
00360        bottomfireBox->setChecked( true );
00361        bottomfireColorButton->setColor( Qt::red );
00362        frameskipBox->setChecked( true );
00363        fire1Box->setChecked( true );
00364        fire2Box->setChecked( true );
00365        fire3Box->setChecked( true );
00366        fire4Box->setChecked( true );
00367        fire5Box->setChecked( true );
00368        fire6Box->setChecked( true );
00369        fire7Box->setChecked( false );
00370        fire8Box->setChecked( false );
00371        whiteBox->setChecked( true );
00372        blueBox->setChecked( true );
00373        seagreenBox->setChecked( true );
00374        purpleBox->setChecked( true );
00375        orangeBox->setChecked( true );
00376        redBox->setChecked( true );
00377        greenBox->setChecked( true );
00378        combosBox->setChecked( true );
00379        logosBox->setChecked( false );
00380        //logosKonquiBox->setChecked( true );
00381        //logosTuxBox->setChecked( true );
00382        //logosIconsBox->setChecked( true );
00383        //logosSlider->setValue( 5 );
00384        starsBox->setChecked( true );
00385        starsFlickerBox->setChecked( true );
00386        starsGradientBox->setChecked( true );
00387        starsSlider->setValue( 8 );
00388        writingsBox->setChecked( false );
00389        lightBox->setChecked( false );
00390        fadeBox->setChecked( true );
00391        fadeSlider->setValue( 7 );
00392        flaresBox->setChecked( true );
00393        flaresSlider->setValue( 8 );
00394        trailBox->setChecked( false );
00395        break;
00396     }
00397     //applyButton_clicked();
00398 }
00399 
00400 #endif