From 55055b833fa220a6ae3e66d523775e3d3549adf2 Mon Sep 17 00:00:00 2001 From: Mavridis Philippe Date: Sat, 26 Jun 2021 17:29:38 +0300 Subject: =?UTF-8?q?Renamed=20*.cc=20=E2=86=92=20*.cpp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mavridis Philippe --- client/config/CMakeLists.txt | 2 +- client/config/deKoratorconfig.cc | 464 -------------------------------------- client/config/deKoratorconfig.cpp | 464 ++++++++++++++++++++++++++++++++++++++ client/config/themes.moc.cc | 110 --------- client/config/themes.moc.cpp | 110 +++++++++ 5 files changed, 575 insertions(+), 575 deletions(-) delete mode 100644 client/config/deKoratorconfig.cc create mode 100644 client/config/deKoratorconfig.cpp delete mode 100644 client/config/themes.moc.cc create mode 100644 client/config/themes.moc.cpp (limited to 'client/config') diff --git a/client/config/CMakeLists.txt b/client/config/CMakeLists.txt index e88c378..c303eb4 100644 --- a/client/config/CMakeLists.txt +++ b/client/config/CMakeLists.txt @@ -17,7 +17,7 @@ link_directories( tde_add_kpart( twin_deKorator_config AUTOMOC SOURCES - deKoratorconfig.cc + deKoratorconfig.cpp configdialog.ui themes.cpp LINK diff --git a/client/config/deKoratorconfig.cc b/client/config/deKoratorconfig.cc deleted file mode 100644 index 8373530..0000000 --- a/client/config/deKoratorconfig.cc +++ /dev/null @@ -1,464 +0,0 @@ -/////////////////////////////////////////////////////////////////////// -// ------------------- -// DeKorator window decoration for KDE -// ------------------- -// Copyright (C) 2005 moty rahamim -// -// 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 -// -// Plastik KWin window decoration -// Copyright (C) 2003-2005 Sandro Giessl -// -// KCMicons for KDE -// Copyright (c) 2000 Antonio Larrosa -// -// 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. -/////////////////////////////////////////////////////////////////////// - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "deKoratorconfig.h" -#include "configdialog.h" -#include - -#include - -////////////////////////////////////////////////////////////////////////////// -// 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_deKorator_config" ); - - - - // 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, SIGNAL( clicked( int ) ), - this, SLOT( selectionChanged( int ) ) ); - connect( dialog_->useMenuImageChkBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); - connect( dialog_->ignoreAppIcnCol, SIGNAL( clicked() ), SIGNAL( changed() ) ); - connect( dialog_->dblClkCloseChkBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); - connect( dialog_->showBtmBorderChkBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); - connect( dialog_->useShdtextChkBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); - connect( dialog_->activeShdtextXSpinBox, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) ); - connect( dialog_->activeShdtextYSpinBox, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) ); - connect( dialog_->activeShdColBtn, SIGNAL( clicked() ), SIGNAL( changed() ) ); - connect( dialog_->inActiveShdtextXSpinBox, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) ); - connect( dialog_->inActiveShdtextYSpinBox, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) ); - connect( dialog_->inActiveShdColBtn, SIGNAL( clicked() ), SIGNAL( changed() ) ); - connect( dialog_->inActiveShdColBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); - connect( dialog_->btnShiftXSpinBox, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) ); - connect( dialog_->btnShiftYSpinBox, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) ); - - - // colors - connect( dialog_->colorizeActFramesChkBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); - connect( dialog_->colorizeActButtonsChkBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); - connect( dialog_->colorizeInActFramesChkBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); - connect( dialog_->colorizeInActButtonsChkBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); - connect( dialog_->useAnimChkBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); - connect( dialog_->animateEfeectsCombo, SIGNAL( activated( const TQString& ) ), SIGNAL( changed() ) ); - - connect( dialog_->stepsSpinBox, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) ); - connect( dialog_->intervalSpinBox, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) ); - connect( dialog_->KeepAnimateChkBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); - - connect( dialog_->hoverTypeCombo, SIGNAL( activated( const TQString& ) ), SIGNAL( changed() ) ); - connect( dialog_->effectsAmount_SpinBox, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) ); - connect( dialog_->activeHighlightClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); - connect( dialog_->inActiveHighlightClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); - connect( dialog_->decoColorizeComboBox, SIGNAL( activated( const TQString& ) ), SIGNAL( changed() ) ); - connect( dialog_->buttonsColorizeComboBox, SIGNAL( activated( const TQString& ) ), SIGNAL( changed() ) ); - // connect( dialog_->buttonsHoverColorizeComboBox, SIGNAL( activated( const TQString& ) ), SIGNAL( changed() ) ); - - // buttons - connect( dialog_->useCusBtnClrChkBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); - connect( dialog_->cusColActBtnChkBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); - connect( dialog_->cusColInActBtnChkBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); - - connect( dialog_->closeClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); - connect( dialog_->minClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); - connect( dialog_->maxClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); - connect( dialog_->restoreClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); - connect( dialog_->helpClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); - connect( dialog_->menuClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); - connect( dialog_->stickyClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); - connect( dialog_->stickyDownClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); - connect( dialog_->aboveClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); - connect( dialog_->aboveDownClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); - connect( dialog_->belowClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); - connect( dialog_->belowDownClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); - connect( dialog_->shadeClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); - connect( dialog_->shadeDownClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); - - // path's - connect( dialog_->framesPathKurl, SIGNAL( textChanged( const TQString& ) ), SIGNAL( changed() ) ); - dialog_->framesPathKurl->setMode( 2 ); - connect( dialog_->buttonsPathKurl, SIGNAL( textChanged( const TQString& ) ), SIGNAL( changed() ) ); - dialog_->buttonsPathKurl->setMode( 2 ); - connect( dialog_->useMasks_Chkbox, SIGNAL( clicked() ), SIGNAL( changed() ) ); - connect( dialog_->masksPathKurl, SIGNAL( textChanged( const TQString& ) ), SIGNAL( changed() ) ); - dialog_->masksPathKurl->setMode( 2 ); - - // themes - connect( dialog_->themesKlstView, SIGNAL( selectionChanged( TQListViewItem * ) ), - SLOT( themeSelected( TQListViewItem * ) ) ); - connect( dialog_->installthemeBtn, SIGNAL( clicked( ) ), SLOT( installNewTheme() ) ); - connect( dialog_->removeThemBtn, SIGNAL( clicked( ) ), SLOT( removeSelectedTheme() ) ); - connect( dialog_->applyThemeBtn, SIGNAL( clicked( ) ), 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( 150, 150, 150 ); - dialog_->useShdtextChkBox->setChecked( config_->readBoolEntry( "UseShdtext", FALSE ) ); - dialog_->activeShdtextXSpinBox->setValue( config_->readNumEntry( "ActiveShdtextX", 0 ) ); - dialog_->activeShdtextYSpinBox->setValue( config_->readNumEntry( "ActiveShdtextY", 0 ) ); - dialog_->activeShdColBtn->setColor( config_->readColorEntry( "ActiveShadowColor", &color ) ); - dialog_->inActiveShdtextXSpinBox->setValue( config_->readNumEntry( "InActiveShdtextX", 0 ) ); - dialog_->inActiveShdtextYSpinBox->setValue( config_->readNumEntry( "InActiveShdtextY", 0 ) ); - 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_->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" ); - - dialog_->framesPathKurl->setURL( config_->readEntry( "FramesPath", "" ) ); - dialog_->buttonsPathKurl->setURL( config_->readEntry( "ButtonsPath", "" ) ); - dialog_->useMasks_Chkbox->setChecked( config_->readBoolEntry( "UseMasks", FALSE ) ); - dialog_->masksPathKurl->setURL( config_->readEntry( "MasksPath", "" ) ); -} - -////////////////////////////////////////////////////////////////////////////// -// 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( "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_->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_->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 ) ); - - // path's - dialog_->framesPathKurl->setURL( "" ); - dialog_->buttonsPathKurl->setURL( "" ); - dialog_->useMasks_Chkbox->setChecked( config_->readBoolEntry( "UseMasks", FALSE ) ); - dialog_->masksPathKurl->setURL( "" ); -} - -////////////////////////////////////////////////////////////////////////////// -// 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" -{ - TQObject * allocate_config( TDEConfig * config, TQWidget * parent ) - { - return ( new DeKoratorConfig( config, parent ) ); - } -} - -#include "deKoratorconfig.moc" diff --git a/client/config/deKoratorconfig.cpp b/client/config/deKoratorconfig.cpp new file mode 100644 index 0000000..8373530 --- /dev/null +++ b/client/config/deKoratorconfig.cpp @@ -0,0 +1,464 @@ +/////////////////////////////////////////////////////////////////////// +// ------------------- +// DeKorator window decoration for KDE +// ------------------- +// Copyright (C) 2005 moty rahamim +// +// 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 +// +// Plastik KWin window decoration +// Copyright (C) 2003-2005 Sandro Giessl +// +// KCMicons for KDE +// Copyright (c) 2000 Antonio Larrosa +// +// 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. +/////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "deKoratorconfig.h" +#include "configdialog.h" +#include + +#include + +////////////////////////////////////////////////////////////////////////////// +// 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_deKorator_config" ); + + + + // 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, SIGNAL( clicked( int ) ), + this, SLOT( selectionChanged( int ) ) ); + connect( dialog_->useMenuImageChkBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); + connect( dialog_->ignoreAppIcnCol, SIGNAL( clicked() ), SIGNAL( changed() ) ); + connect( dialog_->dblClkCloseChkBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); + connect( dialog_->showBtmBorderChkBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); + connect( dialog_->useShdtextChkBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); + connect( dialog_->activeShdtextXSpinBox, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) ); + connect( dialog_->activeShdtextYSpinBox, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) ); + connect( dialog_->activeShdColBtn, SIGNAL( clicked() ), SIGNAL( changed() ) ); + connect( dialog_->inActiveShdtextXSpinBox, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) ); + connect( dialog_->inActiveShdtextYSpinBox, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) ); + connect( dialog_->inActiveShdColBtn, SIGNAL( clicked() ), SIGNAL( changed() ) ); + connect( dialog_->inActiveShdColBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); + connect( dialog_->btnShiftXSpinBox, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) ); + connect( dialog_->btnShiftYSpinBox, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) ); + + + // colors + connect( dialog_->colorizeActFramesChkBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); + connect( dialog_->colorizeActButtonsChkBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); + connect( dialog_->colorizeInActFramesChkBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); + connect( dialog_->colorizeInActButtonsChkBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); + connect( dialog_->useAnimChkBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); + connect( dialog_->animateEfeectsCombo, SIGNAL( activated( const TQString& ) ), SIGNAL( changed() ) ); + + connect( dialog_->stepsSpinBox, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) ); + connect( dialog_->intervalSpinBox, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) ); + connect( dialog_->KeepAnimateChkBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); + + connect( dialog_->hoverTypeCombo, SIGNAL( activated( const TQString& ) ), SIGNAL( changed() ) ); + connect( dialog_->effectsAmount_SpinBox, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) ); + connect( dialog_->activeHighlightClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); + connect( dialog_->inActiveHighlightClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); + connect( dialog_->decoColorizeComboBox, SIGNAL( activated( const TQString& ) ), SIGNAL( changed() ) ); + connect( dialog_->buttonsColorizeComboBox, SIGNAL( activated( const TQString& ) ), SIGNAL( changed() ) ); + // connect( dialog_->buttonsHoverColorizeComboBox, SIGNAL( activated( const TQString& ) ), SIGNAL( changed() ) ); + + // buttons + connect( dialog_->useCusBtnClrChkBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); + connect( dialog_->cusColActBtnChkBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); + connect( dialog_->cusColInActBtnChkBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); + + connect( dialog_->closeClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); + connect( dialog_->minClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); + connect( dialog_->maxClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); + connect( dialog_->restoreClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); + connect( dialog_->helpClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); + connect( dialog_->menuClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); + connect( dialog_->stickyClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); + connect( dialog_->stickyDownClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); + connect( dialog_->aboveClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); + connect( dialog_->aboveDownClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); + connect( dialog_->belowClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); + connect( dialog_->belowDownClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); + connect( dialog_->shadeClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); + connect( dialog_->shadeDownClrBtn, SIGNAL( clicked( ) ), SIGNAL( changed() ) ); + + // path's + connect( dialog_->framesPathKurl, SIGNAL( textChanged( const TQString& ) ), SIGNAL( changed() ) ); + dialog_->framesPathKurl->setMode( 2 ); + connect( dialog_->buttonsPathKurl, SIGNAL( textChanged( const TQString& ) ), SIGNAL( changed() ) ); + dialog_->buttonsPathKurl->setMode( 2 ); + connect( dialog_->useMasks_Chkbox, SIGNAL( clicked() ), SIGNAL( changed() ) ); + connect( dialog_->masksPathKurl, SIGNAL( textChanged( const TQString& ) ), SIGNAL( changed() ) ); + dialog_->masksPathKurl->setMode( 2 ); + + // themes + connect( dialog_->themesKlstView, SIGNAL( selectionChanged( TQListViewItem * ) ), + SLOT( themeSelected( TQListViewItem * ) ) ); + connect( dialog_->installthemeBtn, SIGNAL( clicked( ) ), SLOT( installNewTheme() ) ); + connect( dialog_->removeThemBtn, SIGNAL( clicked( ) ), SLOT( removeSelectedTheme() ) ); + connect( dialog_->applyThemeBtn, SIGNAL( clicked( ) ), 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( 150, 150, 150 ); + dialog_->useShdtextChkBox->setChecked( config_->readBoolEntry( "UseShdtext", FALSE ) ); + dialog_->activeShdtextXSpinBox->setValue( config_->readNumEntry( "ActiveShdtextX", 0 ) ); + dialog_->activeShdtextYSpinBox->setValue( config_->readNumEntry( "ActiveShdtextY", 0 ) ); + dialog_->activeShdColBtn->setColor( config_->readColorEntry( "ActiveShadowColor", &color ) ); + dialog_->inActiveShdtextXSpinBox->setValue( config_->readNumEntry( "InActiveShdtextX", 0 ) ); + dialog_->inActiveShdtextYSpinBox->setValue( config_->readNumEntry( "InActiveShdtextY", 0 ) ); + 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_->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" ); + + dialog_->framesPathKurl->setURL( config_->readEntry( "FramesPath", "" ) ); + dialog_->buttonsPathKurl->setURL( config_->readEntry( "ButtonsPath", "" ) ); + dialog_->useMasks_Chkbox->setChecked( config_->readBoolEntry( "UseMasks", FALSE ) ); + dialog_->masksPathKurl->setURL( config_->readEntry( "MasksPath", "" ) ); +} + +////////////////////////////////////////////////////////////////////////////// +// 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( "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_->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_->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 ) ); + + // path's + dialog_->framesPathKurl->setURL( "" ); + dialog_->buttonsPathKurl->setURL( "" ); + dialog_->useMasks_Chkbox->setChecked( config_->readBoolEntry( "UseMasks", FALSE ) ); + dialog_->masksPathKurl->setURL( "" ); +} + +////////////////////////////////////////////////////////////////////////////// +// 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" +{ + TQObject * allocate_config( TDEConfig * config, TQWidget * parent ) + { + return ( new DeKoratorConfig( config, parent ) ); + } +} + +#include "deKoratorconfig.moc" diff --git a/client/config/themes.moc.cc b/client/config/themes.moc.cc deleted file mode 100644 index 9e25331..0000000 --- a/client/config/themes.moc.cc +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** -** IconThemesConfig meta object code from reading C++ file 'themes.h' -** -** Created: Wed Dec 7 20:20:14 2005 -** by: The TQt MOC ($Id: qt/moc_yacc.cpp 3.3.5 edited Sep 2 14:41 $) -** -** WARNING! All changes made in this file will be lost! -*****************************************************************************/ - -#undef QT_NO_COMPAT -#include "themes.h" -#include -#include - -#include -#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26) -#error "This file was generated using the moc from 3.3.5. It" -#error "cannot be used with the include files from this version of TQt." -#error "(The moc has changed too much.)" -#endif - -const char *IconThemesConfig::className() const -{ - return "IconThemesConfig"; -} - -TQMetaObject *IconThemesConfig::metaObj = 0; -static TQMetaObjectCleanUp cleanUp_IconThemesConfig( "IconThemesConfig", &IconThemesConfig::staticMetaObject ); - -#ifndef QT_NO_TRANSLATION -TQString IconThemesConfig::tr( const char *s, const char *c ) -{ - if ( tqApp ) - return tqApp->translate( "IconThemesConfig", s, c, TQApplication::DefaultCodec ); - else - return TQString::fromLatin1( s ); -} -#ifndef QT_NO_TRANSLATION_UTF8 -TQString IconThemesConfig::trUtf8( const char *s, const char *c ) -{ - if ( tqApp ) - return tqApp->translate( "IconThemesConfig", s, c, TQApplication::UnicodeUTF8 ); - else - return TQString::fromUtf8( s ); -} -#endif // QT_NO_TRANSLATION_UTF8 - -#endif // QT_NO_TRANSLATION - -TQMetaObject* IconThemesConfig::staticMetaObject() -{ - if ( metaObj ) - return metaObj; - TQMetaObject* parentObject = TDECModule::staticMetaObject(); - static const TQUParameter param_slot_0[] = { - { "item", &static_QUType_ptr, "TQListViewItem", TQUParameter::In } - }; - static const TQUMethod slot_0 = {"themeSelected", 1, param_slot_0 }; - static const TQUMethod slot_1 = {"installNewTheme", 0, 0 }; - static const TQUMethod slot_2 = {"removeSelectedTheme", 0, 0 }; - static const TQMetaData slot_tbl[] = { - { "themeSelected(TQListViewItem*)", &slot_0, TQMetaData::Protected }, - { "installNewTheme()", &slot_1, TQMetaData::Protected }, - { "removeSelectedTheme()", &slot_2, TQMetaData::Protected } - }; - metaObj = TQMetaObject::new_metaobject( - "IconThemesConfig", parentObject, - slot_tbl, 3, - 0, 0, -#ifndef QT_NO_PROPERTIES - 0, 0, - 0, 0, -#endif // QT_NO_PROPERTIES - 0, 0 ); - cleanUp_IconThemesConfig.setMetaObject( metaObj ); - return metaObj; -} - -void* IconThemesConfig::tqt_cast( const char* clname ) -{ - if ( !qstrcmp( clname, "IconThemesConfig" ) ) - return this; - return TDECModule::tqt_cast( clname ); -} - -bool IconThemesConfig::tqt_invoke( int _id, TQUObject* _o ) -{ - switch ( _id - staticMetaObject()->slotOffset() ) { - case 0: themeSelected((TQListViewItem*)static_QUType_ptr.get(_o+1)); break; - case 1: installNewTheme(); break; - case 2: removeSelectedTheme(); break; - default: - return TDECModule::tqt_invoke( _id, _o ); - } - return TRUE; -} - -bool IconThemesConfig::tqt_emit( int _id, TQUObject* _o ) -{ - return TDECModule::tqt_emit(_id,_o); -} -#ifndef QT_NO_PROPERTIES - -bool IconThemesConfig::tqt_property( int id, int f, TQVariant* v) -{ - return TDECModule::tqt_property( id, f, v); -} - -bool IconThemesConfig::tqt_static_property( TQObject* , int , int , TQVariant* ){ return FALSE; } -#endif // QT_NO_PROPERTIES diff --git a/client/config/themes.moc.cpp b/client/config/themes.moc.cpp new file mode 100644 index 0000000..9e25331 --- /dev/null +++ b/client/config/themes.moc.cpp @@ -0,0 +1,110 @@ +/**************************************************************************** +** IconThemesConfig meta object code from reading C++ file 'themes.h' +** +** Created: Wed Dec 7 20:20:14 2005 +** by: The TQt MOC ($Id: qt/moc_yacc.cpp 3.3.5 edited Sep 2 14:41 $) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#undef QT_NO_COMPAT +#include "themes.h" +#include +#include + +#include +#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26) +#error "This file was generated using the moc from 3.3.5. It" +#error "cannot be used with the include files from this version of TQt." +#error "(The moc has changed too much.)" +#endif + +const char *IconThemesConfig::className() const +{ + return "IconThemesConfig"; +} + +TQMetaObject *IconThemesConfig::metaObj = 0; +static TQMetaObjectCleanUp cleanUp_IconThemesConfig( "IconThemesConfig", &IconThemesConfig::staticMetaObject ); + +#ifndef QT_NO_TRANSLATION +TQString IconThemesConfig::tr( const char *s, const char *c ) +{ + if ( tqApp ) + return tqApp->translate( "IconThemesConfig", s, c, TQApplication::DefaultCodec ); + else + return TQString::fromLatin1( s ); +} +#ifndef QT_NO_TRANSLATION_UTF8 +TQString IconThemesConfig::trUtf8( const char *s, const char *c ) +{ + if ( tqApp ) + return tqApp->translate( "IconThemesConfig", s, c, TQApplication::UnicodeUTF8 ); + else + return TQString::fromUtf8( s ); +} +#endif // QT_NO_TRANSLATION_UTF8 + +#endif // QT_NO_TRANSLATION + +TQMetaObject* IconThemesConfig::staticMetaObject() +{ + if ( metaObj ) + return metaObj; + TQMetaObject* parentObject = TDECModule::staticMetaObject(); + static const TQUParameter param_slot_0[] = { + { "item", &static_QUType_ptr, "TQListViewItem", TQUParameter::In } + }; + static const TQUMethod slot_0 = {"themeSelected", 1, param_slot_0 }; + static const TQUMethod slot_1 = {"installNewTheme", 0, 0 }; + static const TQUMethod slot_2 = {"removeSelectedTheme", 0, 0 }; + static const TQMetaData slot_tbl[] = { + { "themeSelected(TQListViewItem*)", &slot_0, TQMetaData::Protected }, + { "installNewTheme()", &slot_1, TQMetaData::Protected }, + { "removeSelectedTheme()", &slot_2, TQMetaData::Protected } + }; + metaObj = TQMetaObject::new_metaobject( + "IconThemesConfig", parentObject, + slot_tbl, 3, + 0, 0, +#ifndef QT_NO_PROPERTIES + 0, 0, + 0, 0, +#endif // QT_NO_PROPERTIES + 0, 0 ); + cleanUp_IconThemesConfig.setMetaObject( metaObj ); + return metaObj; +} + +void* IconThemesConfig::tqt_cast( const char* clname ) +{ + if ( !qstrcmp( clname, "IconThemesConfig" ) ) + return this; + return TDECModule::tqt_cast( clname ); +} + +bool IconThemesConfig::tqt_invoke( int _id, TQUObject* _o ) +{ + switch ( _id - staticMetaObject()->slotOffset() ) { + case 0: themeSelected((TQListViewItem*)static_QUType_ptr.get(_o+1)); break; + case 1: installNewTheme(); break; + case 2: removeSelectedTheme(); break; + default: + return TDECModule::tqt_invoke( _id, _o ); + } + return TRUE; +} + +bool IconThemesConfig::tqt_emit( int _id, TQUObject* _o ) +{ + return TDECModule::tqt_emit(_id,_o); +} +#ifndef QT_NO_PROPERTIES + +bool IconThemesConfig::tqt_property( int id, int f, TQVariant* v) +{ + return TDECModule::tqt_property( id, f, v); +} + +bool IconThemesConfig::tqt_static_property( TQObject* , int , int , TQVariant* ){ return FALSE; } +#endif // QT_NO_PROPERTIES -- cgit v1.2.1