Cleanup a little CMakeLists.txt
[kdeartwork.git] / kscreensaver / kdesavers / firesaversetup.ui.h
bloba185a1b2496d3cc5a43b5fa334b3be5156ca7e03
1 /****************************************************************************
2 ** ui.h extension file, included from the uic-generated form implementation.
3 **
4 ** If you wish to add, delete or rename functions or slots use
5 ** Qt Designer which will update this file, preserving your code. Create an
6 ** init() function in place of a constructor, and a destroy() function in
7 ** place of a destructor.
8 *****************************************************************************/
11 #ifndef KFIRESAVER_SETUP_H
12 #define KFIRESAVER_SETUP_H
14 #include <qcolor.h>
15 #include <qtimer.h>
16 #include <kconfig.h>
19 void KFireSaverSetup::init()
21 readConfig();
22 fireSaverWidget = NULL;
23 updatePreview();
26 void KFireSaverSetup::destroy()
28 if ( fireSaverWidget )
29 delete fireSaverWidget;
33 void KFireSaverSetup::applyButton_clicked()
35 writeConfig();
36 updatePreview();
39 void KFireSaverSetup::updatePreview()
41 if ( fireSaverWidget )
42 delete fireSaverWidget;
43 if ( detachBox->isChecked() ) {
44 previewLabel->show();
45 fireSaverWidget = new KFireSaver;
46 fireSaverWidget->resize(640,480);
47 } else {
48 previewLabel->hide();
49 fireSaverWidget = new KFireSaver( previewFrame );
50 fireSaverWidget->move(1,1);
51 fireSaverWidget->resize(
52 previewFrame->width() - 2,
53 previewFrame->height() - 2 );
55 fireSaverWidget->show();
59 void KFireSaverSetup::writeConfig()
61 KConfig config("kfiresaverrc",false,false);
63 // show
64 config.setGroup( "Show" );
65 config.writeEntry( "ShowType", showCombo->currentItem() );
66 config.writeEntry( "FireworksFrequency", fireworksSlider->value() );
67 config.writeEntry( "ParticlesSize", particlesSlider->value() );
68 config.writeEntry( "enable-BottomFire", bottomfireBox->isChecked() );
69 config.writeEntry( "BottomFireColor", bottomfireColorButton->color() );
70 config.writeEntry( "enable-Sounds", soundsBox->isChecked() );
71 config.writeEntry( "enable-NoOverhead", overheadBox->isChecked() );
72 config.writeEntry( "enable-FrameSkip", frameskipBox->isChecked() );
74 // fireworks
75 config.setGroup( "Fireworks" );
76 if (!fire1Box->isChecked() && !fire2Box->isChecked() &&
77 !fire3Box->isChecked() && !fire4Box->isChecked() &&
78 !fire5Box->isChecked() && !fire6Box->isChecked() &&
79 !fire7Box->isChecked() && !fire8Box->isChecked())
80 fire1Box->setChecked(true);
81 config.writeEntry( "use-Classic", fire1Box->isChecked() );
82 config.writeEntry( "use-Explosion", fire2Box->isChecked() );
83 config.writeEntry( "use-FlameRing", fire3Box->isChecked() );
84 config.writeEntry( "use-FlameWorld", fire4Box->isChecked() );
85 config.writeEntry( "use-Fall", fire5Box->isChecked() );
86 config.writeEntry( "use-Splitter", fire6Box->isChecked() );
87 config.writeEntry( "use-Spirals", fire7Box->isChecked() );
88 config.writeEntry( "use-SuperNova", fire8Box->isChecked() );
89 if (!redBox->isChecked() && !orangeBox->isChecked() &&
90 !greenBox->isChecked() && !blueBox->isChecked() &&
91 !whiteBox->isChecked() && !purpleBox->isChecked() &&
92 !seagreenBox->isChecked())
93 whiteBox->setChecked(true);
94 config.writeEntry( "use-White", whiteBox->isChecked() );
95 config.writeEntry( "use-Blue", blueBox->isChecked() );
96 config.writeEntry( "use-DeepGreen", seagreenBox->isChecked() );
97 config.writeEntry( "use-Purple", purpleBox->isChecked() );
98 config.writeEntry( "use-Orange", orangeBox->isChecked() );
99 config.writeEntry( "use-Red", redBox->isChecked() );
100 config.writeEntry( "use-Green", greenBox->isChecked() );
101 config.writeEntry( "use-Multicolor", combosBox->isChecked() );
103 // specials
104 config.setGroup( "Specials" );
105 config.writeEntry( "enable-Logos", logosBox->isChecked() );
106 config.writeEntry( "LogosKonqui", logosKonquiBox->isChecked() );
107 config.writeEntry( "LogosTux", logosTuxBox->isChecked() );
108 config.writeEntry( "LogosKDEIcons", logosIconsBox->isChecked() );
109 config.writeEntry( "LogosReduceDetail", logosDetailBox->isChecked() );
110 config.writeEntry( "LogosFrequency", logosSlider->value() );
111 config.writeEntry( "enable-Stars", starsBox->isChecked() );
112 config.writeEntry( "StarsFlicker", starsFlickerBox->isChecked() );
113 config.writeEntry( "StarsGradient", starsGradientBox->isChecked() );
114 config.writeEntry( "StarsNumber", starsSlider->value() );
115 config.writeEntry( "enable-Writings", writingsBox->isChecked() );
117 // effects
118 config.setGroup( "Effects" );
119 config.writeEntry( "enable-SphericalLight", lightBox->isChecked() );
120 config.writeEntry( "enable-Flash", flashBox->isChecked() );
121 config.writeEntry( "FlashOpacity", flashSlider->value() );
122 config.writeEntry( "enable-Fade", fadeBox->isChecked() );
123 config.writeEntry( "FadeIntensity", fadeSlider->value() );
124 config.writeEntry( "enable-Flares", flaresBox->isChecked() );
125 config.writeEntry( "FlaresDimension", flaresSlider->value() );
126 config.writeEntry( "enable-Trail", trailBox->isChecked() );
130 void KFireSaverSetup::readConfig()
132 KConfig config("kfiresaverrc",true,false);
134 // show
135 config.setGroup( "Show" );
136 showCombo->setCurrentItem(config.readNumEntry( "ShowType", 1 ));
137 fireworksSlider->setValue(config.readNumEntry( "FireworksFrequency", 7 ));
138 particlesSlider->setValue(config.readNumEntry( "ParticlesSize", 0 ));
139 bottomfireBox->setChecked(config.readBoolEntry( "enable-BottomFire", true ));
140 QColor Qt::blue = Qt::darkBlue;
141 bottomfireColorButton->setColor(config.readColorEntry( "BottomFireColor", &Qt::blue ));
142 soundsBox->setChecked(config.readBoolEntry( "enable-Sounds", false ));
143 overheadBox->setChecked(config.readBoolEntry( "enable-NoOverhead", true ));
144 frameskipBox->setChecked(config.readBoolEntry( "enable-FrameSkip", true ));
146 // fireworks
147 config.setGroup( "Fireworks" );
148 fire1Box->setChecked(config.readBoolEntry( "use-Classic", true ));
149 fire2Box->setChecked(config.readBoolEntry( "use-Explosion", false ));
150 fire3Box->setChecked(config.readBoolEntry( "use-FlameRing", false ));
151 fire4Box->setChecked(config.readBoolEntry( "use-FlameWorld", false ));
152 fire5Box->setChecked(config.readBoolEntry( "use-Fall", false ));
153 fire6Box->setChecked(config.readBoolEntry( "use-Splitter", false ));
154 fire7Box->setChecked(config.readBoolEntry( "use-Spirals", false ));
155 fire8Box->setChecked(config.readBoolEntry( "use-SuperNova", false ));
156 whiteBox->setChecked(config.readBoolEntry( "use-White", true ));
157 blueBox->setChecked(config.readBoolEntry( "use-Blue", false ));
158 seagreenBox->setChecked(config.readBoolEntry( "use-DeepGreen", true ));
159 purpleBox->setChecked(config.readBoolEntry( "use-Purple", false ));
160 orangeBox->setChecked(config.readBoolEntry( "use-Orange", true ));
161 redBox->setChecked(config.readBoolEntry( "use-Red", false ));
162 greenBox->setChecked(config.readBoolEntry( "use-Green", false ));
163 combosBox->setChecked(config.readBoolEntry( "use-Multicolor", true ));
165 // specials
166 config.setGroup( "Specials" );
167 logosBox->setChecked(config.readBoolEntry( "enable-Logos", true ));
168 logosKonquiBox->setChecked(config.readBoolEntry( "LogosKonqui", true ));
169 logosTuxBox->setChecked(config.readBoolEntry( "LogosTux", true ));
170 logosIconsBox->setChecked(config.readBoolEntry( "LogosKDEIcons", true ));
171 logosDetailBox->setChecked(config.readBoolEntry( "LogosReduceDetail", true ));
172 logosSlider->setValue(config.readNumEntry( "LogosFrequency", 4 ));
173 starsBox->setChecked(config.readBoolEntry( "enable-Stars", true ));
174 starsFlickerBox->setChecked(config.readBoolEntry( "StarsFlicker", false ));
175 starsGradientBox->setChecked(config.readBoolEntry( "StarsGradient", true ));
176 starsSlider->setValue(config.readNumEntry( "StarsNumber", 4 ));
177 writingsBox->setChecked(config.readBoolEntry( "enable-Writings", true ));
179 // effects
180 config.setGroup( "Effects" );
181 lightBox->setChecked(config.readBoolEntry( "enable-SphericalLight", true ));
182 flashBox->setChecked(config.readBoolEntry( "enable-Flash", false ));
183 flashSlider->setValue(config.readNumEntry( "FlashOpacity", 5 ));
184 fadeBox->setChecked(config.readBoolEntry( "enable-Fade", false ));
185 fadeSlider->setValue(config.readNumEntry( "FadeIntensity", 3 ));
186 flaresBox->setChecked(config.readBoolEntry( "enable-Flares", true ));
187 flaresSlider->setValue(config.readNumEntry( "FlaresDimension", 5 ));
188 trailBox->setChecked(config.readBoolEntry( "enable-Trail", false ));
191 void KFireSaverSetup::useButton_clicked()
193 int ci = presetCombo->currentItem();
195 showCombo->setCurrentItem( 0 );
196 particlesSlider->setValue( 0 );
197 overheadBox->setChecked( true );
198 flashBox->setChecked( false );
199 //flashSlider->setValue( );
200 //soundsBox->setChecked( );
201 //logosDetailBox->setChecked( );
203 switch (ci){
204 case 0: // KDE default
205 showCombo->setCurrentItem( 1 );
206 fireworksSlider->setValue( 7 );
207 bottomfireBox->setChecked( true );
208 bottomfireColorButton->setColor( Qt::darkBlue );
209 frameskipBox->setChecked( true );
210 fire1Box->setChecked( true );
211 fire2Box->setChecked( false );
212 fire3Box->setChecked( false );
213 fire4Box->setChecked( false );
214 fire5Box->setChecked( false );
215 fire6Box->setChecked( false );
216 fire7Box->setChecked( false );
217 fire8Box->setChecked( false );
218 whiteBox->setChecked( true );
219 blueBox->setChecked( false );
220 seagreenBox->setChecked( true );
221 purpleBox->setChecked( false );
222 orangeBox->setChecked( true );
223 redBox->setChecked( false );
224 greenBox->setChecked( false );
225 combosBox->setChecked( true );
226 logosBox->setChecked( true );
227 logosKonquiBox->setChecked( true );
228 logosTuxBox->setChecked( true );
229 logosIconsBox->setChecked( true );
230 logosSlider->setValue( 4 );
231 starsBox->setChecked( true );
232 starsFlickerBox->setChecked( false );
233 starsGradientBox->setChecked( true );
234 starsSlider->setValue( 4 );
235 writingsBox->setChecked( true );
236 lightBox->setChecked( true );
237 fadeBox->setChecked( false );
238 //fadeSlider->setValue( );
239 flaresBox->setChecked( true );
240 flaresSlider->setValue( 5 );
241 trailBox->setChecked( false );
242 break;
243 case 1: // Elegant white
244 fireworksSlider->setValue( 7 );
245 bottomfireBox->setChecked( true );
246 bottomfireColorButton->setColor( Qt::blue );
247 frameskipBox->setChecked( true );
248 fire1Box->setChecked( true );
249 fire2Box->setChecked( false );
250 fire3Box->setChecked( false );
251 fire4Box->setChecked( false );
252 fire5Box->setChecked( true );
253 fire6Box->setChecked( true );
254 fire7Box->setChecked( false );
255 fire8Box->setChecked( false );
256 whiteBox->setChecked( true );
257 blueBox->setChecked( true );
258 seagreenBox->setChecked( false );
259 purpleBox->setChecked( false );
260 orangeBox->setChecked( false );
261 redBox->setChecked( false );
262 greenBox->setChecked( false );
263 combosBox->setChecked( true );
264 logosBox->setChecked( true );
265 logosKonquiBox->setChecked( true );
266 logosTuxBox->setChecked( false );
267 logosIconsBox->setChecked( false );
268 logosSlider->setValue( 3 );
269 starsBox->setChecked( true );
270 starsFlickerBox->setChecked( true );
271 starsGradientBox->setChecked( false );
272 starsSlider->setValue( 4 );
273 writingsBox->setChecked( true );
274 lightBox->setChecked( true );
275 fadeBox->setChecked( true );
276 fadeSlider->setValue( 3 );
277 flaresBox->setChecked( true );
278 flaresSlider->setValue( 6 );
279 trailBox->setChecked( true );
280 break;
281 case 2: // Quick simple
282 showCombo->setCurrentItem(1);
283 fireworksSlider->setValue( 4 );
284 bottomfireBox->setChecked( false );
285 //bottomfireColorButton->setColor( );
286 frameskipBox->setChecked( false );
287 fire1Box->setChecked( true );
288 fire2Box->setChecked( true );
289 fire3Box->setChecked( false );
290 fire4Box->setChecked( false );
291 fire5Box->setChecked( false );
292 fire6Box->setChecked( false );
293 fire7Box->setChecked( false );
294 fire8Box->setChecked( false );
295 whiteBox->setChecked( true );
296 blueBox->setChecked( true );
297 seagreenBox->setChecked( false );
298 purpleBox->setChecked( false );
299 orangeBox->setChecked( false );
300 redBox->setChecked( true );
301 greenBox->setChecked( true );
302 combosBox->setChecked( false );
303 logosBox->setChecked( true );
304 logosKonquiBox->setChecked( true );
305 logosTuxBox->setChecked( true );
306 logosIconsBox->setChecked( true );
307 logosSlider->setValue( 2 );
308 starsBox->setChecked( false );
309 //starsFlickerBox->setChecked( );
310 //starsGradientBox->setChecked( );
311 //starsSlider->setValue( );
312 writingsBox->setChecked( false );
313 lightBox->setChecked( false );
314 fadeBox->setChecked( false );
315 //fadeSlider->setValue( );
316 flaresBox->setChecked( false );
317 //flaresSlider->setValue( );
318 trailBox->setChecked( false );
319 break;
320 case 3: //Enhanced reality
321 fireworksSlider->setValue( 8 );
322 bottomfireBox->setChecked( true );
323 bottomfireColorButton->setColor( Qt::magenta );
324 frameskipBox->setChecked( true );
325 fire1Box->setChecked( true );
326 fire2Box->setChecked( true );
327 fire3Box->setChecked( true );
328 fire4Box->setChecked( true );
329 fire5Box->setChecked( true );
330 fire6Box->setChecked( true );
331 fire7Box->setChecked( false );
332 fire8Box->setChecked( false );
333 whiteBox->setChecked( true );
334 blueBox->setChecked( true );
335 seagreenBox->setChecked( true );
336 purpleBox->setChecked( true );
337 orangeBox->setChecked( true );
338 redBox->setChecked( true );
339 greenBox->setChecked( true );
340 combosBox->setChecked( true );
341 logosBox->setChecked( true );
342 logosKonquiBox->setChecked( false );
343 logosTuxBox->setChecked( true );
344 logosIconsBox->setChecked( false );
345 logosSlider->setValue( 2 );
346 starsBox->setChecked( true );
347 starsFlickerBox->setChecked( true );
348 starsGradientBox->setChecked( true );
349 starsSlider->setValue( 5 );
350 writingsBox->setChecked( true );
351 lightBox->setChecked( false );
352 fadeBox->setChecked( true );
353 fadeSlider->setValue( 3 );
354 flaresBox->setChecked( false );
355 //flaresSlider->setValue( );
356 trailBox->setChecked( true );
357 break;
358 case 4: //Hypnotic illusions
359 fireworksSlider->setValue( 9 );
360 bottomfireBox->setChecked( true );
361 bottomfireColorButton->setColor( Qt::red );
362 frameskipBox->setChecked( true );
363 fire1Box->setChecked( true );
364 fire2Box->setChecked( true );
365 fire3Box->setChecked( true );
366 fire4Box->setChecked( true );
367 fire5Box->setChecked( true );
368 fire6Box->setChecked( true );
369 fire7Box->setChecked( false );
370 fire8Box->setChecked( false );
371 whiteBox->setChecked( true );
372 blueBox->setChecked( true );
373 seagreenBox->setChecked( true );
374 purpleBox->setChecked( true );
375 orangeBox->setChecked( true );
376 redBox->setChecked( true );
377 greenBox->setChecked( true );
378 combosBox->setChecked( true );
379 logosBox->setChecked( false );
380 //logosKonquiBox->setChecked( true );
381 //logosTuxBox->setChecked( true );
382 //logosIconsBox->setChecked( true );
383 //logosSlider->setValue( 5 );
384 starsBox->setChecked( true );
385 starsFlickerBox->setChecked( true );
386 starsGradientBox->setChecked( true );
387 starsSlider->setValue( 8 );
388 writingsBox->setChecked( false );
389 lightBox->setChecked( false );
390 fadeBox->setChecked( true );
391 fadeSlider->setValue( 7 );
392 flaresBox->setChecked( true );
393 flaresSlider->setValue( 8 );
394 trailBox->setChecked( false );
395 break;
397 //applyButton_clicked();
400 #endif