1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
|
///////////////////////////////////////////////////////////////////////
// -------------------
// DeKorator window decoration for KDE
// -------------------
// Copyright (C) 2005 moty rahamim <[email protected]>
//
// Based on Example-0.8, some ideas and code have been taken from plastik and KCMicons
//
// Example window decoration for KDE
// Copyright (c) 2003, 2004 David Johnson <[email protected]>
//
// Plastik KWin window decoration
// Copyright (C) 2003-2005 Sandro Giessl <[email protected]>
//
// KCMicons for KDE
// Copyright (c) 2000 Antonio Larrosa <[email protected]>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; see the file COPYING. If not, write to
// the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
// Boston, MA 02110-1301, USA.
///////////////////////////////////////////////////////////////////////
#if defined(HAVE_CONFIG_H)
# include "config.h"
#endif
#include <tdeconfig.h>
#include <tdelocale.h>
#include <tdeglobal.h>
#include <tqbuttongroup.h>
#include <tqgroupbox.h>
#include <tqradiobutton.h>
#include <tqwhatsthis.h>
#include <tqcheckbox.h>
#include <tqcombobox.h>
#include <tqspinbox.h>
#include <tqcheckbox.h>
#include <kcolorbutton.h>
#include <tdelistview.h>
#include <kstandarddirs.h>
#include <kdebug.h>
#include "deKoratorconfig.h"
#include "configdialog.h"
#include <themes.h>
#include <kurlrequester.h>
//////////////////////////////////////////////////////////////////////////////
// DeKoratorConfig()
// -------------
// Constructor
DeKoratorConfig::DeKoratorConfig( TDEConfig* config, TQWidget* parent )
: TQObject( parent ), config_( 0 ), dialog_( 0 )
{
// create the configuration object
config_ = new TDEConfig( "twindeKoratorrc" );
TDEGlobal::locale()->insertCatalogue("twin_clients");
TDEGlobal::locale()->insertCatalogue("twin-style-dekorator");
// create and show the configuration dialog
dialog_ = new ConfigDialog( parent );
themes_ = new IconThemesConfig( dialog_, dialog_->themesKlstView /*, dialog_->removeThemBtn*/ );
dialog_->show();
// load the configuration
load( config_ );
// setup the connections
// misc
connect( dialog_->titlealign, TQ_SIGNAL( clicked( int ) ),
this, TQ_SLOT( selectionChanged( int ) ) );
connect( dialog_->useMenuImageChkBox, TQ_SIGNAL( clicked() ), TQ_SIGNAL( changed() ) );
connect( dialog_->ignoreAppIcnCol, TQ_SIGNAL( clicked() ), TQ_SIGNAL( changed() ) );
connect( dialog_->dblClkCloseChkBox, TQ_SIGNAL( clicked() ), TQ_SIGNAL( changed() ) );
connect( dialog_->showBtmBorderChkBox, TQ_SIGNAL( clicked() ), TQ_SIGNAL( changed() ) );
connect( dialog_->useShdtextChkBox, TQ_SIGNAL( clicked() ), TQ_SIGNAL( changed() ) );
connect( dialog_->activeShdtextXSpinBox, TQ_SIGNAL( valueChanged( int ) ), TQ_SIGNAL( changed() ) );
connect( dialog_->activeShdtextYSpinBox, TQ_SIGNAL( valueChanged( int ) ), TQ_SIGNAL( changed() ) );
connect( dialog_->activeShdColBtn, TQ_SIGNAL( clicked() ), TQ_SIGNAL( changed() ) );
connect( dialog_->inActiveShdtextXSpinBox, TQ_SIGNAL( valueChanged( int ) ), TQ_SIGNAL( changed() ) );
connect( dialog_->inActiveShdtextYSpinBox, TQ_SIGNAL( valueChanged( int ) ), TQ_SIGNAL( changed() ) );
connect( dialog_->inActiveShdColBtn, TQ_SIGNAL( clicked() ), TQ_SIGNAL( changed() ) );
connect( dialog_->inActiveShdColBtn, TQ_SIGNAL( clicked( ) ), TQ_SIGNAL( changed() ) );
connect( dialog_->btnShiftXSpinBox, TQ_SIGNAL( valueChanged( int ) ), TQ_SIGNAL( changed() ) );
connect( dialog_->btnShiftYSpinBox, TQ_SIGNAL( valueChanged( int ) ), TQ_SIGNAL( changed() ) );
// colors
connect( dialog_->transparencyChkBox, TQ_SIGNAL( clicked() ), TQ_SIGNAL( changed() ) );
connect( dialog_->colorizeActFramesChkBox, TQ_SIGNAL( clicked() ), TQ_SIGNAL( changed() ) );
connect( dialog_->colorizeActButtonsChkBox, TQ_SIGNAL( clicked() ), TQ_SIGNAL( changed() ) );
connect( dialog_->colorizeInActFramesChkBox, TQ_SIGNAL( clicked() ), TQ_SIGNAL( changed() ) );
connect( dialog_->colorizeInActButtonsChkBox, TQ_SIGNAL( clicked() ), TQ_SIGNAL( changed() ) );
connect( dialog_->useAnimChkBox, TQ_SIGNAL( clicked() ), TQ_SIGNAL( changed() ) );
connect( dialog_->animateEfeectsCombo, TQ_SIGNAL( activated( const TQString& ) ), TQ_SIGNAL( changed() ) );
connect( dialog_->stepsSpinBox, TQ_SIGNAL( valueChanged( int ) ), TQ_SIGNAL( changed() ) );
connect( dialog_->intervalSpinBox, TQ_SIGNAL( valueChanged( int ) ), TQ_SIGNAL( changed() ) );
connect( dialog_->KeepAnimateChkBox, TQ_SIGNAL( clicked() ), TQ_SIGNAL( changed() ) );
connect( dialog_->hoverTypeCombo, TQ_SIGNAL( activated( const TQString& ) ), TQ_SIGNAL( changed() ) );
connect( dialog_->effectsAmount_SpinBox, TQ_SIGNAL( valueChanged( int ) ), TQ_SIGNAL( changed() ) );
connect( dialog_->activeHighlightClrBtn, TQ_SIGNAL( clicked( ) ), TQ_SIGNAL( changed() ) );
connect( dialog_->inActiveHighlightClrBtn, TQ_SIGNAL( clicked( ) ), TQ_SIGNAL( changed() ) );
connect( dialog_->decoColorizeComboBox, TQ_SIGNAL( activated( const TQString& ) ), TQ_SIGNAL( changed() ) );
connect( dialog_->buttonsColorizeComboBox, TQ_SIGNAL( activated( const TQString& ) ), TQ_SIGNAL( changed() ) );
// connect( dialog_->buttonsHoverColorizeComboBox, TQ_SIGNAL( activated( const TQString& ) ), TQ_SIGNAL( changed() ) );
// buttons
connect( dialog_->useCusBtnClrChkBox, TQ_SIGNAL( clicked() ), TQ_SIGNAL( changed() ) );
connect( dialog_->cusColActBtnChkBox, TQ_SIGNAL( clicked() ), TQ_SIGNAL( changed() ) );
connect( dialog_->cusColInActBtnChkBox, TQ_SIGNAL( clicked() ), TQ_SIGNAL( changed() ) );
connect( dialog_->closeClrBtn, TQ_SIGNAL( clicked( ) ), TQ_SIGNAL( changed() ) );
connect( dialog_->minClrBtn, TQ_SIGNAL( clicked( ) ), TQ_SIGNAL( changed() ) );
connect( dialog_->maxClrBtn, TQ_SIGNAL( clicked( ) ), TQ_SIGNAL( changed() ) );
connect( dialog_->restoreClrBtn, TQ_SIGNAL( clicked( ) ), TQ_SIGNAL( changed() ) );
connect( dialog_->helpClrBtn, TQ_SIGNAL( clicked( ) ), TQ_SIGNAL( changed() ) );
connect( dialog_->menuClrBtn, TQ_SIGNAL( clicked( ) ), TQ_SIGNAL( changed() ) );
connect( dialog_->stickyClrBtn, TQ_SIGNAL( clicked( ) ), TQ_SIGNAL( changed() ) );
connect( dialog_->stickyDownClrBtn, TQ_SIGNAL( clicked( ) ), TQ_SIGNAL( changed() ) );
connect( dialog_->aboveClrBtn, TQ_SIGNAL( clicked( ) ), TQ_SIGNAL( changed() ) );
connect( dialog_->aboveDownClrBtn, TQ_SIGNAL( clicked( ) ), TQ_SIGNAL( changed() ) );
connect( dialog_->belowClrBtn, TQ_SIGNAL( clicked( ) ), TQ_SIGNAL( changed() ) );
connect( dialog_->belowDownClrBtn, TQ_SIGNAL( clicked( ) ), TQ_SIGNAL( changed() ) );
connect( dialog_->shadeClrBtn, TQ_SIGNAL( clicked( ) ), TQ_SIGNAL( changed() ) );
connect( dialog_->shadeDownClrBtn, TQ_SIGNAL( clicked( ) ), TQ_SIGNAL( changed() ) );
// path's
connect( dialog_->framesPathKurl, TQ_SIGNAL( textChanged( const TQString& ) ), TQ_SIGNAL( changed() ) );
dialog_->framesPathKurl->setMode( 2 );
connect( dialog_->buttonsPathKurl, TQ_SIGNAL( textChanged( const TQString& ) ), TQ_SIGNAL( changed() ) );
dialog_->buttonsPathKurl->setMode( 2 );
connect( dialog_->useMasks_Chkbox, TQ_SIGNAL( clicked() ), TQ_SIGNAL( changed() ) );
connect( dialog_->masksPathKurl, TQ_SIGNAL( textChanged( const TQString& ) ), TQ_SIGNAL( changed() ) );
dialog_->masksPathKurl->setMode( 2 );
// themes
connect( dialog_->themesKlstView, TQ_SIGNAL( selectionChanged( TQListViewItem * ) ),
TQ_SLOT( themeSelected( TQListViewItem * ) ) );
connect( dialog_->installthemeBtn, TQ_SIGNAL( clicked( ) ), TQ_SLOT( installNewTheme() ) );
connect( dialog_->removeThemBtn, TQ_SIGNAL( clicked( ) ), TQ_SLOT( removeSelectedTheme() ) );
connect( dialog_->applyThemeBtn, TQ_SIGNAL( clicked( ) ), TQ_SLOT( setTheme() ) );
}
//////////////////////////////////////////////////////////////////////////////
// ~DeKoratorConfig()
// --------------
// Destructor
DeKoratorConfig::~DeKoratorConfig()
{
if ( dialog_ ) delete dialog_;
if ( config_ ) delete config_;
if ( themes_ ) delete themes_;
}
//////////////////////////////////////////////////////////////////////////////
// selectionChanged()
// ------------------
// Selection has changed
void DeKoratorConfig::selectionChanged( int )
{
emit changed();
}
//////////////////////////////////////////////////////////////////////////////
// load()
// ------
// Load configuration data
void DeKoratorConfig::load( TDEConfig* )
{
// misc
config_->setGroup( "MISC" );
TQString value = config_->readEntry( "TitleAlignment", "AlignHCenter" );
TQRadioButton *button = ( TQRadioButton* ) dialog_->titlealign->child( value );
if ( button ) button->setChecked( true );
dialog_->useMenuImageChkBox->setChecked( config_->readBoolEntry( "UseMenuImage", false ) );
dialog_->ignoreAppIcnCol->setChecked( config_->readBoolEntry( "IgnoreAppIconCol", false ) );
dialog_->dblClkCloseChkBox->setChecked( config_->readBoolEntry( "DblClkClose", false ) );
dialog_->showBtmBorderChkBox->setChecked( config_->readBoolEntry( "ShowBtmBorder", false ) );
TQColor color = TQColor( 50, 50, 50 );
dialog_->useShdtextChkBox->setChecked( config_->readBoolEntry( "UseShdtext", true ) );
dialog_->activeShdtextXSpinBox->setValue( config_->readNumEntry( "ActiveShdtextX", 1 ) );
dialog_->activeShdtextYSpinBox->setValue( config_->readNumEntry( "ActiveShdtextY", 1 ) );
dialog_->activeShdColBtn->setColor( config_->readColorEntry( "ActiveShadowColor", &color ) );
dialog_->inActiveShdtextXSpinBox->setValue( config_->readNumEntry( "InActiveShdtextX", 1 ) );
dialog_->inActiveShdtextYSpinBox->setValue( config_->readNumEntry( "InActiveShdtextY", 1 ) );
dialog_->inActiveShdColBtn->setColor( config_->readColorEntry( "InActiveShadowColor", &color ) );
dialog_->btnShiftXSpinBox->setValue( config_->readNumEntry( "BtnShiftX", 0 ) );
dialog_->btnShiftYSpinBox->setValue( config_->readNumEntry( "BtnShiftY", 0 ) );
// colors
config_->setGroup( "COLORS" );
dialog_->transparencyChkBox->setChecked( config_->readBoolEntry( "Transparency", false ) );
dialog_->colorizeActFramesChkBox->setChecked( config_->readBoolEntry( "ColorizeActFrames", false ) );
dialog_->colorizeActButtonsChkBox->setChecked( config_->readBoolEntry( "ColorizeActButtons", false ) );
dialog_->colorizeInActFramesChkBox->setChecked( config_->readBoolEntry( "ColorizeInActFrames", false ) );
dialog_->colorizeInActButtonsChkBox->setChecked( config_->readBoolEntry( "ColorizeInActButtons", false ) );
dialog_->useAnimChkBox->setChecked( config_->readBoolEntry( "UseAnimation", false ) );
dialog_->animateEfeectsCombo->setCurrentText( config_->readEntry( "AnimationType", "Intensity" ) );
dialog_->stepsSpinBox->setValue( config_->readNumEntry( "AnimSteps", 5 ) );
dialog_->intervalSpinBox->setValue( config_->readNumEntry( "AnimInterval", 30 ) );
dialog_->KeepAnimateChkBox->setChecked( config_->readBoolEntry( "KeepAnimating", false ) );
dialog_->activeHighlightClrBtn->setColor( config_->readColorEntry( "ActiveHighlightColor", &color ) );
dialog_->inActiveHighlightClrBtn->setColor( config_->readColorEntry( "InActiveHighlightColor", &color ) );
dialog_->hoverTypeCombo->setCurrentText( config_->readEntry( "ButtonsHoverType", "To Gray" ) );
dialog_->effectsAmount_SpinBox->setValue( config_->readNumEntry( "EffectAmount", 5 ) );
dialog_->decoColorizeComboBox->setCurrentText( config_->readEntry( "DecoColorize", "Liquid Method" ) );
dialog_->buttonsColorizeComboBox->setCurrentText( config_->readEntry( "ButtonsColorize", "Liquid Method" ) );
// dialog_->buttonsHoverColorizeComboBox->setCurrentText( config_->readEntry( "ButtonsHoverColorize", "Liquid Method" ) );
// buttons
config_->setGroup( "BUTTONS" );
dialog_->useCusBtnClrChkBox->setChecked( config_->readBoolEntry( "UseCustomButtonsColors", false ) );
dialog_->cusColActBtnChkBox->setChecked( config_->readBoolEntry( "customColorsActiveButtons", false ) );
dialog_->cusColInActBtnChkBox->setChecked( config_->readBoolEntry( "customColorsInActiveButtons", false ) );
dialog_->closeClrBtn->setColor( config_->readColorEntry( "CloseButtonColor", &color ) );
dialog_->minClrBtn->setColor( config_->readColorEntry( "MinButtonColor", &color ) );
dialog_->maxClrBtn->setColor( config_->readColorEntry( "MaxButtonColor", &color ) );
dialog_->restoreClrBtn->setColor( config_->readColorEntry( "RestoreButtonColor", &color ) );
dialog_->helpClrBtn->setColor( config_->readColorEntry( "HelpButtonColor", &color ) );
dialog_->menuClrBtn->setColor( config_->readColorEntry( "MenuButtonColor", &color ) );
dialog_->stickyClrBtn->setColor( config_->readColorEntry( "StickyButtonColor", &color ) );
dialog_->stickyDownClrBtn->setColor( config_->readColorEntry( "StickyDownButtonColor", &color ) );
dialog_->aboveClrBtn->setColor( config_->readColorEntry( "AboveButtonColor", &color ) );
dialog_->aboveDownClrBtn->setColor( config_->readColorEntry( "AboveDownButtonColor", &color ) );
dialog_->belowClrBtn->setColor( config_->readColorEntry( "BelowButtonColor", &color ) );
dialog_->belowDownClrBtn->setColor( config_->readColorEntry( "BelowDownButtonColor", &color ) );
dialog_->shadeClrBtn->setColor( config_->readColorEntry( "ShadeButtonColor", &color ) );
dialog_->shadeDownClrBtn->setColor( config_->readColorEntry( "ShadeDownButtonColor", &color ) );
// path's
config_->setGroup( "PATHS" );
// Default theme (if installed)
TQString deftheme = locate("data", "deKorator/themes/Default-theme/");
kdDebug() << "default theme path: " << deftheme << endl;
dialog_->framesPathKurl->setURL( config_->readEntry( "FramesPath", (deftheme.isNull() ? "" : deftheme + "deco") ) );
dialog_->buttonsPathKurl->setURL( config_->readEntry( "ButtonsPath", (deftheme.isNull() ? "" : deftheme + "buttons") ) );
dialog_->useMasks_Chkbox->setChecked( config_->readBoolEntry( "UseMasks", true ) );
dialog_->masksPathKurl->setURL( config_->readEntry( "MasksPath", (deftheme.isNull() ? "" : deftheme + "masks") ) );
// Find and preselect current theme
config_->setGroup( "THEME" );
TQString curtheme = config_->readEntry( "ThemeName", "Default-theme" );
TQListViewItem *cur = dialog_->themesKlstView->findItem(curtheme, 0);
if ( cur != 0 ) {
dialog_->themesKlstView->setCurrentItem(cur);
themeSelected(cur); // update preview
}
}
//////////////////////////////////////////////////////////////////////////////
// save()
// ------
// Save configuration data
void DeKoratorConfig::save( TDEConfig* )
{
// misc
config_->setGroup( "MISC" );
TQRadioButton *button = ( TQRadioButton* ) dialog_->titlealign->selected();
if ( button ) config_->writeEntry( "TitleAlignment", TQString( button->name() ) );
config_->writeEntry( "UseMenuImage", dialog_->useMenuImageChkBox->isChecked() );
config_->writeEntry( "IgnoreAppIconCol", dialog_->ignoreAppIcnCol->isChecked() );
config_->writeEntry( "DblClkClose", dialog_->dblClkCloseChkBox->isChecked() );
config_->writeEntry( "ShowBtmBorder", dialog_->showBtmBorderChkBox->isChecked() );
config_->writeEntry( "UseShdtext", dialog_->useShdtextChkBox->isChecked() );
config_->writeEntry( "ActiveShdtextX", dialog_->activeShdtextXSpinBox->value() );
config_->writeEntry( "ActiveShdtextY", dialog_->activeShdtextYSpinBox->value() );
config_->writeEntry( "ActiveShadowColor", dialog_->activeShdColBtn->color() );
config_->writeEntry( "InActiveShdtextX", dialog_->inActiveShdtextXSpinBox->value() ); config_->writeEntry( "InActiveShdtextY", dialog_->inActiveShdtextYSpinBox->value() );
config_->writeEntry( "InActiveShadowColor", dialog_->inActiveShdColBtn->color() );
config_->writeEntry( "BtnShiftX", dialog_->btnShiftXSpinBox->value() );
config_->writeEntry( "BtnShiftY", dialog_->btnShiftYSpinBox->value() );
// colors
config_->setGroup( "COLORS" );
config_->writeEntry( "Transparency", dialog_->transparencyChkBox->isChecked() );
config_->writeEntry( "ColorizeActFrames", dialog_->colorizeActFramesChkBox->isChecked() );
config_->writeEntry( "ColorizeActButtons", dialog_->colorizeActButtonsChkBox->isChecked() );
config_->writeEntry( "ColorizeInActFrames", dialog_->colorizeInActFramesChkBox->isChecked() );
config_->writeEntry( "ColorizeInActButtons", dialog_->colorizeInActButtonsChkBox->isChecked() );
config_->writeEntry( "UseAnimation", dialog_->useAnimChkBox->isChecked() );
config_->writeEntry( "AnimationType", dialog_->animateEfeectsCombo->currentText() );
config_->writeEntry( "AnimSteps", dialog_->stepsSpinBox->value() );
config_->writeEntry( "AnimInterval", dialog_->intervalSpinBox->value() );
config_->writeEntry( "KeepAnimating", dialog_->KeepAnimateChkBox->isChecked() );
config_->writeEntry( "ButtonsHoverType", dialog_->hoverTypeCombo->currentText() );
config_->writeEntry( "EffectAmount", dialog_->effectsAmount_SpinBox->value() );
config_->writeEntry( "ActiveHighlightColor", dialog_->activeHighlightClrBtn->color() );
config_->writeEntry( "InActiveHighlightColor", dialog_->inActiveHighlightClrBtn->color() );
config_->writeEntry( "DecoColorize", dialog_->decoColorizeComboBox->currentText() );
config_->writeEntry( "ButtonsColorize", dialog_->buttonsColorizeComboBox->currentText() );
// config_->writeEntry( "ButtonsHoverColorize", dialog_->buttonsHoverColorizeComboBox->currentText() );
// buttons
config_->setGroup( "BUTTONS" );
config_->writeEntry( "UseCustomButtonsColors", dialog_->useCusBtnClrChkBox->isChecked() );
config_->writeEntry( "customColorsActiveButtons", dialog_->cusColActBtnChkBox->isChecked() );
config_->writeEntry( "customColorsInActiveButtons", dialog_->cusColInActBtnChkBox->isChecked() );
config_->writeEntry( "CloseButtonColor", dialog_->closeClrBtn->color() );
config_->writeEntry( "MinButtonColor", dialog_->minClrBtn->color() );
config_->writeEntry( "MaxButtonColor", dialog_->maxClrBtn->color() );
config_->writeEntry( "RestoreButtonColor", dialog_->restoreClrBtn->color() );
config_->writeEntry( "HelpButtonColor", dialog_->helpClrBtn->color() );
config_->writeEntry( "MenuButtonColor", dialog_->menuClrBtn->color() );
config_->writeEntry( "StickyButtonColor", dialog_->stickyClrBtn->color() );
config_->writeEntry( "StickyDownButtonColor", dialog_->stickyDownClrBtn->color() );
config_->writeEntry( "AboveButtonColor", dialog_->aboveClrBtn->color() );
config_->writeEntry( "AboveDownButtonColor", dialog_->aboveDownClrBtn->color() );
config_->writeEntry( "BelowButtonColor", dialog_->belowClrBtn->color() );
config_->writeEntry( "BelowDownButtonColor", dialog_->belowDownClrBtn->color() );
config_->writeEntry( "ShadeButtonColor", dialog_->shadeClrBtn->color() );
config_->writeEntry( "ShadeDownButtonColor", dialog_->shadeDownClrBtn->color() );
// path's
config_->setGroup( "PATHS" );
config_->writeEntry( "FramesPath", dialog_->framesPathKurl->url() );
config_->writeEntry( "ButtonsPath", dialog_->buttonsPathKurl->url() );
config_->writeEntry( "UseMasks", dialog_->useMasks_Chkbox->isChecked() );
config_->writeEntry( "MasksPath", dialog_->masksPathKurl->url() );
config_->setGroup( "THEME" );
config_->writeEntry( "ThemeName", dialog_->themesKlstView->currentItem()->text(0) );
config_->sync();
}
//////////////////////////////////////////////////////////////////////////////
// defaults()
// ----------
// Set configuration defaults
void DeKoratorConfig::defaults()
{
// misc
TQRadioButton * button =
( TQRadioButton* ) dialog_->titlealign->child( "AlignHCenter" );
if ( button ) button->setChecked( TRUE );
dialog_->useMenuImageChkBox->setChecked( FALSE );
dialog_->ignoreAppIcnCol->setChecked( FALSE );
dialog_->dblClkCloseChkBox->setChecked( FALSE );
dialog_->showBtmBorderChkBox->setChecked( FALSE );
dialog_->useShdtextChkBox->setChecked( FALSE );
dialog_->activeShdtextXSpinBox->setValue( 0 );
dialog_->activeShdtextYSpinBox->setValue( 0 );
dialog_->activeShdColBtn->setColor( TQColor( 150, 150, 150 ) );
dialog_->inActiveShdtextXSpinBox->setValue( 0 );
dialog_->inActiveShdtextYSpinBox->setValue( 0 );
dialog_->inActiveShdColBtn->setColor( TQColor( 150, 150, 150 ) );
dialog_->btnShiftXSpinBox->setValue( 0 );
dialog_->btnShiftYSpinBox->setValue( 0 );
// colors
dialog_->transparencyChkBox->setChecked( FALSE );
dialog_->colorizeActFramesChkBox->setChecked( FALSE );
dialog_->colorizeActButtonsChkBox->setChecked( FALSE );
dialog_->colorizeInActFramesChkBox->setChecked( FALSE );
dialog_->colorizeInActButtonsChkBox->setChecked( FALSE );
dialog_->useAnimChkBox->setChecked( FALSE );
dialog_->animateEfeectsCombo->setCurrentText( "Intensity" );
dialog_->stepsSpinBox->setValue( 5 );
dialog_->intervalSpinBox->setValue( 30 );
dialog_->KeepAnimateChkBox->setChecked( FALSE );
dialog_->hoverTypeCombo->setCurrentText( "To Gray" );
dialog_->effectsAmount_SpinBox->setValue( 5 );
dialog_->activeHighlightClrBtn->setColor( TQColor( 150, 150, 150 ) );
dialog_->inActiveHighlightClrBtn->setColor( TQColor( 150, 150, 150 ) );
dialog_->decoColorizeComboBox->setCurrentText( "Liquid Method" );
dialog_->buttonsColorizeComboBox->setCurrentText( "Liquid Method" );
// dialog_->buttonsHoverColorizeComboBox->setCurrentText( "Liquid Method" );
// buttons
dialog_->useCusBtnClrChkBox->setChecked( FALSE );
dialog_->cusColActBtnChkBox->setChecked( FALSE );
dialog_->cusColInActBtnChkBox->setChecked( FALSE );
dialog_->closeClrBtn->setColor( TQColor( 150, 150, 150 ) );
dialog_->minClrBtn->setColor( TQColor( 150, 150, 150 ) );
dialog_->maxClrBtn->setColor( TQColor( 150, 150, 150 ) );
dialog_->restoreClrBtn->setColor( TQColor( 150, 150, 150 ) );
dialog_->helpClrBtn->setColor( TQColor( 150, 150, 150 ) );
dialog_->menuClrBtn->setColor( TQColor( 150, 150, 150 ) );
dialog_->stickyClrBtn->setColor( TQColor( 150, 150, 150 ) );
dialog_->stickyDownClrBtn->setColor( TQColor( 150, 150, 150 ) );
dialog_->aboveClrBtn->setColor( TQColor( 150, 150, 150 ) );
dialog_->aboveDownClrBtn->setColor( TQColor( 150, 150, 150 ) );
dialog_->belowClrBtn->setColor( TQColor( 150, 150, 150 ) );
dialog_->belowDownClrBtn->setColor( TQColor( 150, 150, 150 ) );
dialog_->shadeClrBtn->setColor( TQColor( 150, 150, 150 ) );
dialog_->shadeDownClrBtn->setColor( TQColor( 150, 150, 150 ) );
// theme & paths
TQString deftheme = locate("data", "deKorator/themes/Default-theme/");
dialog_->framesPathKurl->setURL( (deftheme.isNull() ? "" : deftheme + "deco") );
dialog_->buttonsPathKurl->setURL( (deftheme.isNull() ? "" : deftheme + "buttons") );
dialog_->useMasks_Chkbox->setChecked( config_->readBoolEntry( "UseMasks", FALSE ) );
dialog_->masksPathKurl->setURL( (deftheme.isNull() ? "" : deftheme + "masks") );
if(! deftheme.isNull()) {
TQListViewItem *def = dialog_->themesKlstView->findItem("Default-theme", 0);
if ( def != 0 )
dialog_->themesKlstView->setCurrentItem(def);
themeSelected(def); // update preview
}
}
//////////////////////////////////////////////////////////////////////////////
// themeSelected()
// ----------
//
void DeKoratorConfig::themeSelected( TQListViewItem *item )
{
themes_->themeSelected( item, dialog_->previewLabael, dialog_->removeThemBtn );
}
//////////////////////////////////////////////////////////////////////////////
// installNewTheme()
// ----------
//
void DeKoratorConfig::installNewTheme()
{
themes_->installNewTheme();
}
//////////////////////////////////////////////////////////////////////////////
// removeSelectedTheme()
// ----------
//
void DeKoratorConfig::removeSelectedTheme()
{
themes_->removeSelectedTheme();
}
//////////////////////////////////////////////////////////////////////////////
// setTheme()
// ----------
//
void DeKoratorConfig::setTheme()
{
themes_->setTheme( dialog_->framesPathKurl, dialog_->buttonsPathKurl, dialog_->masksPathKurl );
}
//////////////////////////////////////////////////////////////////////////////
// Plugin Stuff //
//////////////////////////////////////////////////////////////////////////////
extern "C"
{
TDE_EXPORT TQObject * allocate_config( TDEConfig * config, TQWidget * parent )
{
return ( new DeKoratorConfig( config, parent ) );
}
}
#include "deKoratorconfig.moc"
|