From 76e2727dc97b913a1dead96e862fd1958b39bc8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Tue, 26 Feb 2013 03:46:31 +0100 Subject: Fix unintended rename of plastikconf --- kstyles/plastik/config/CMakeLists.txt | 2 +- kstyles/plastik/config/Makefile.am | 4 +- kstyles/plastik/config/plastikconf.cpp | 223 +++++++++++++++++++++++++++++++ kstyles/plastik/config/plastikconf.h | 85 ++++++++++++ kstyles/plastik/config/plastitdeconf.cpp | 223 ------------------------------- kstyles/plastik/config/plastitdeconf.h | 85 ------------ 6 files changed, 311 insertions(+), 311 deletions(-) create mode 100644 kstyles/plastik/config/plastikconf.cpp create mode 100644 kstyles/plastik/config/plastikconf.h delete mode 100644 kstyles/plastik/config/plastitdeconf.cpp delete mode 100644 kstyles/plastik/config/plastitdeconf.h diff --git a/kstyles/plastik/config/CMakeLists.txt b/kstyles/plastik/config/CMakeLists.txt index 8de92d14a..b8534cea7 100644 --- a/kstyles/plastik/config/CMakeLists.txt +++ b/kstyles/plastik/config/CMakeLists.txt @@ -27,7 +27,7 @@ link_directories( set( target kstyle_plastik_config ) set( ${target}_SRCS - plastitdeconf.cpp + plastikconf.cpp ) tde_add_kpart( ${target} AUTOMOC diff --git a/kstyles/plastik/config/Makefile.am b/kstyles/plastik/config/Makefile.am index d97df31bb..887c7ea89 100644 --- a/kstyles/plastik/config/Makefile.am +++ b/kstyles/plastik/config/Makefile.am @@ -1,10 +1,10 @@ INCLUDES = $(all_includes) -noinst_HEADERS = plastitdeconf.h +noinst_HEADERS = plastikconf.h kde_module_LTLIBRARIES = kstyle_plastik_config.la kstyle_plastik_config_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module kstyle_plastik_config_la_LIBADD = $(LIB_TDEUI) $(LIB_QT) $(LIB_TDECORE) -kstyle_plastik_config_la_SOURCES = plastitdeconf.cpp +kstyle_plastik_config_la_SOURCES = plastikconf.cpp kstyle_plastik_config_la_METASOURCES = AUTO diff --git a/kstyles/plastik/config/plastikconf.cpp b/kstyles/plastik/config/plastikconf.cpp new file mode 100644 index 000000000..491f06ffa --- /dev/null +++ b/kstyles/plastik/config/plastikconf.cpp @@ -0,0 +1,223 @@ +/* +Copyright (C) 2003 Sandro Giessl + +based on the Keramik configuration dialog: +Copyright (c) 2003 Maksim Orlovich + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "plastikconf.h" + +extern "C" +{ + KDE_EXPORT TQWidget* allocate_kstyle_config(TQWidget* parent) + { + TDEGlobal::locale()->insertCatalogue("kstyle_plastik_config"); + return new PlastikStyleConfig(parent); + } +} + +PlastikStyleConfig::PlastikStyleConfig(TQWidget* parent): TQWidget(parent) +{ + //Should have no margins here, the dialog provides them + TQVBoxLayout* layout = new TQVBoxLayout(this, 0, 0); + TDEGlobal::locale()->insertCatalogue("kstyle_plastik_config"); + +// scrollBarLines = new TQCheckBox(i18n("Scrollbar handle lines"), this); + animateProgressBar = new TQCheckBox(i18n("Animate progress bars"), this); + drawToolBarSeparator = new TQCheckBox(i18n("Draw toolbar separator"), this); + drawToolBarItemSeparator = new TQCheckBox(i18n("Draw toolbar item separators"), this); +// drawFocusRect = new TQCheckBox(i18n("Draw focus rectangles"), this); + drawTriangularExpander = new TQCheckBox(i18n("Triangular tree expander"), this); + inputFocusHighlight = new TQCheckBox(i18n("Highlight focused text input fields"), this); + + customFocusHighlightColor = new TQCheckBox(i18n("Custom text input highlight color:"), this); + TQHBox *hbox1 = new TQHBox(this); + hbox1->layout()->addItem(new TQSpacerItem(20, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum) ); + focusHighlightColor = new KColorButton(hbox1); + + customOverHighlightColor = new TQCheckBox(i18n("Custom mouseover highlight color:"), this); + TQHBox *hbox2 = new TQHBox(this); + hbox2->layout()->addItem(new TQSpacerItem(20, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum) ); + overHighlightColor = new KColorButton(hbox2); + + customCheckMarkColor = new TQCheckBox(i18n("Custom checkmark color:"), this); + TQHBox *hbox3 = new TQHBox(this); + hbox3->layout()->addItem(new TQSpacerItem(20, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum) ); + checkMarkColor = new KColorButton(hbox3); + +// layout->add(scrollBarLines); + layout->add(animateProgressBar); + layout->add(drawToolBarSeparator); + layout->add(drawToolBarItemSeparator); +// layout->add(drawFocusRect); + layout->add(drawTriangularExpander); + layout->add(inputFocusHighlight); + layout->add(customFocusHighlightColor); + layout->add(hbox1); + layout->add(customOverHighlightColor); + layout->add(hbox2); + layout->add(customCheckMarkColor); + layout->add(hbox3); + layout->addStretch(1); + + TQSettings s; +// origScrollBarLines = s.readBoolEntry("/plastikstyle/Settings/scrollBarLines", false); +// scrollBarLines->setChecked(origScrollBarLines); + origAnimProgressBar = s.readBoolEntry("/plastikstyle/Settings/animateProgressBar", false); + animateProgressBar->setChecked(origAnimProgressBar); + origDrawToolBarSeparator = s.readBoolEntry("/plastikstyle/Settings/drawToolBarSeparator", false); + drawToolBarSeparator->setChecked(origDrawToolBarSeparator); + origDrawToolBarItemSeparator = s.readBoolEntry("/plastikstyle/Settings/drawToolBarItemSeparator", true); + drawToolBarItemSeparator->setChecked(origDrawToolBarItemSeparator); +// origDrawFocusRect = s.readBoolEntry("/plastikstyle/Settings/drawFocusRect", true); +// drawFocusRect->setChecked(origDrawFocusRect); + origDrawTriangularExpander = s.readBoolEntry("/plastikstyle/Settings/drawTriangularExpander", false); + drawTriangularExpander->setChecked(origDrawTriangularExpander); + origInputFocusHighlight = s.readBoolEntry("/plastikstyle/Settings/inputFocusHighlight", true); + inputFocusHighlight->setChecked(origInputFocusHighlight); + origCustomOverHighlightColor = s.readBoolEntry("/plastikstyle/Settings/customOverHighlightColor", false); + customOverHighlightColor->setChecked(origCustomOverHighlightColor); + origOverHighlightColor = s.readEntry("/plastikstyle/Settings/overHighlightColor", "black"); + overHighlightColor->setColor(origOverHighlightColor); + origCustomFocusHighlightColor = s.readBoolEntry("/plastikstyle/Settings/customFocusHighlightColor", false); + customFocusHighlightColor->setChecked(origCustomFocusHighlightColor); + origFocusHighlightColor = s.readEntry("/plastikstyle/Settings/focusHighlightColor", "black"); + focusHighlightColor->setColor(origFocusHighlightColor); + origCustomCheckMarkColor = s.readBoolEntry("/plastikstyle/Settings/customCheckMarkColor", false); + customCheckMarkColor->setChecked(origCustomCheckMarkColor); + origCheckMarkColor = s.readEntry("/plastikstyle/Settings/checkMarkColor", "black"); + checkMarkColor->setColor(origCheckMarkColor); + +// connect(scrollBarLines, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); + connect(animateProgressBar, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); + connect(drawToolBarSeparator, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); + connect(drawToolBarItemSeparator, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); +// connect(drawFocusRect, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); + connect(drawTriangularExpander, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); + connect(inputFocusHighlight, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); + connect(customOverHighlightColor, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); + connect(overHighlightColor, TQT_SIGNAL( changed(const TQColor&) ), TQT_SLOT( updateChanged() ) ); + connect(customFocusHighlightColor, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); + connect(focusHighlightColor, TQT_SIGNAL( changed(const TQColor&) ), TQT_SLOT( updateChanged() ) ); + connect(customCheckMarkColor, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); + connect(checkMarkColor, TQT_SIGNAL( changed(const TQColor&) ), TQT_SLOT( updateChanged() ) ); + if ( customOverHighlightColor->isChecked() ) + overHighlightColor->setEnabled(true); + else + overHighlightColor->setEnabled(false); + if ( customFocusHighlightColor->isChecked() ) + focusHighlightColor->setEnabled(true); + else + focusHighlightColor->setEnabled(false); + if ( customCheckMarkColor->isChecked() ) + checkMarkColor->setEnabled(true); + else + checkMarkColor->setEnabled(false); +} + +PlastikStyleConfig::~PlastikStyleConfig() +{ +} + + +void PlastikStyleConfig::save() +{ + TQSettings s; +// s.writeEntry("/plastikstyle/Settings/scrollBarLines", scrollBarLines->isChecked()); + s.writeEntry("/plastikstyle/Settings/animateProgressBar", animateProgressBar->isChecked()); + s.writeEntry("/plastikstyle/Settings/drawToolBarSeparator", drawToolBarSeparator->isChecked()); + s.writeEntry("/plastikstyle/Settings/drawToolBarItemSeparator", drawToolBarItemSeparator->isChecked()); +// s.writeEntry("/plastikstyle/Settings/drawFocusRect", drawFocusRect->isChecked()); + s.writeEntry("/plastikstyle/Settings/drawTriangularExpander", drawTriangularExpander->isChecked()); + s.writeEntry("/plastikstyle/Settings/inputFocusHighlight", inputFocusHighlight->isChecked()); + s.writeEntry("/plastikstyle/Settings/customOverHighlightColor", customOverHighlightColor->isChecked()); + s.writeEntry("/plastikstyle/Settings/overHighlightColor", TQColor(overHighlightColor->color()).name()); + s.writeEntry("/plastikstyle/Settings/customFocusHighlightColor", customFocusHighlightColor->isChecked()); + s.writeEntry("/plastikstyle/Settings/focusHighlightColor", TQColor(focusHighlightColor->color()).name()); + s.writeEntry("/plastikstyle/Settings/customCheckMarkColor", customCheckMarkColor->isChecked()); + s.writeEntry("/plastikstyle/Settings/checkMarkColor", TQColor(checkMarkColor->color()).name()); +} + +void PlastikStyleConfig::defaults() +{ +// scrollBarLines->setChecked(false); + animateProgressBar->setChecked(false); + drawToolBarSeparator->setChecked(false); + drawToolBarItemSeparator->setChecked(true); +// drawFocusRect->setChecked(true); + drawTriangularExpander->setChecked(false); + inputFocusHighlight->setChecked(true); + customOverHighlightColor->setChecked(false); + overHighlightColor->setColor("black"); + customFocusHighlightColor->setChecked(false); + focusHighlightColor->setColor("black"); + customCheckMarkColor->setChecked(false); + checkMarkColor->setColor("black"); + //updateChanged would be done by setChecked already +} + +void PlastikStyleConfig::updateChanged() +{ + if ( customOverHighlightColor->isChecked() ) + overHighlightColor->setEnabled(true); + else + overHighlightColor->setEnabled(false); + if ( customFocusHighlightColor->isChecked() ) + focusHighlightColor->setEnabled(true); + else + focusHighlightColor->setEnabled(false); + if ( customCheckMarkColor->isChecked() ) + checkMarkColor->setEnabled(true); + else + checkMarkColor->setEnabled(false); + + if (/*(scrollBarLines->isChecked() == origScrollBarLines) &&*/ + (animateProgressBar->isChecked() == origAnimProgressBar) && + (drawToolBarSeparator->isChecked() == origDrawToolBarSeparator) && + (drawToolBarItemSeparator->isChecked() == origDrawToolBarItemSeparator) && +// (drawFocusRect->isChecked() == origDrawFocusRect) && + (drawTriangularExpander->isChecked() == origDrawTriangularExpander) && + (inputFocusHighlight->isChecked() == origInputFocusHighlight) && + (customOverHighlightColor->isChecked() == origCustomOverHighlightColor) && + (overHighlightColor->color() == origOverHighlightColor) && + (customFocusHighlightColor->isChecked() == origCustomFocusHighlightColor) && + (focusHighlightColor->color() == origFocusHighlightColor) && + (customCheckMarkColor->isChecked() == origCustomCheckMarkColor) && + (checkMarkColor->color() == origCheckMarkColor) + ) + emit changed(false); + else + emit changed(true); +} + +#include "plastikconf.moc" diff --git a/kstyles/plastik/config/plastikconf.h b/kstyles/plastik/config/plastikconf.h new file mode 100644 index 000000000..512ad6f2e --- /dev/null +++ b/kstyles/plastik/config/plastikconf.h @@ -0,0 +1,85 @@ +/* +Copyright (C) 2003 Sandro Giessl + +based on the Keramik configuration dialog: +Copyright (c) 2003 Maksim Orlovich + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +*/ + +#ifndef PLASTIK_CONF_H +#define PLASTIK_CONF_H + +class TQCheckBox; + +class PlastikStyleConfig: public TQWidget +{ + Q_OBJECT +public: + PlastikStyleConfig(TQWidget* parent); + ~PlastikStyleConfig(); + + //This signal and the next two slots are the plugin + //page interface +signals: + void changed(bool); + +public slots: + void save(); + void defaults(); + + //Everything below this is internal. +protected slots: + void updateChanged(); + +protected: + //We store settings directly in widgets to + //avoid the hassle of sync'ing things +// TQCheckBox* scrollBarLines; + TQCheckBox* animateProgressBar; + TQCheckBox* drawToolBarSeparator; + TQCheckBox* drawToolBarItemSeparator; +// TQCheckBox* drawFocusRect; + TQCheckBox* drawTriangularExpander; + TQCheckBox* inputFocusHighlight; + TQCheckBox* customOverHighlightColor; + KColorButton* overHighlightColor; + TQCheckBox* customFocusHighlightColor; + KColorButton* focusHighlightColor; + TQCheckBox* customCheckMarkColor; + KColorButton* checkMarkColor; + + //Original settings, for accurate dirtiness tracking +// bool origScrollBarLines; + bool origAnimProgressBar; + bool origDrawToolBarSeparator; + bool origDrawToolBarItemSeparator; +// bool origDrawFocusRect; + bool origDrawTriangularExpander; + bool origInputFocusHighlight; + bool origCustomOverHighlightColor; + TQColor origOverHighlightColor; + bool origCustomFocusHighlightColor; + TQColor origFocusHighlightColor; + bool origCustomCheckMarkColor; + TQColor origCheckMarkColor; +}; + +#endif diff --git a/kstyles/plastik/config/plastitdeconf.cpp b/kstyles/plastik/config/plastitdeconf.cpp deleted file mode 100644 index 38cda2426..000000000 --- a/kstyles/plastik/config/plastitdeconf.cpp +++ /dev/null @@ -1,223 +0,0 @@ -/* -Copyright (C) 2003 Sandro Giessl - -based on the Keramik configuration dialog: -Copyright (c) 2003 Maksim Orlovich - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "plastitdeconf.h" - -extern "C" -{ - KDE_EXPORT TQWidget* allocate_kstyle_config(TQWidget* parent) - { - TDEGlobal::locale()->insertCatalogue("kstyle_plastik_config"); - return new PlastikStyleConfig(parent); - } -} - -PlastikStyleConfig::PlastikStyleConfig(TQWidget* parent): TQWidget(parent) -{ - //Should have no margins here, the dialog provides them - TQVBoxLayout* layout = new TQVBoxLayout(this, 0, 0); - TDEGlobal::locale()->insertCatalogue("kstyle_plastik_config"); - -// scrollBarLines = new TQCheckBox(i18n("Scrollbar handle lines"), this); - animateProgressBar = new TQCheckBox(i18n("Animate progress bars"), this); - drawToolBarSeparator = new TQCheckBox(i18n("Draw toolbar separator"), this); - drawToolBarItemSeparator = new TQCheckBox(i18n("Draw toolbar item separators"), this); -// drawFocusRect = new TQCheckBox(i18n("Draw focus rectangles"), this); - drawTriangularExpander = new TQCheckBox(i18n("Triangular tree expander"), this); - inputFocusHighlight = new TQCheckBox(i18n("Highlight focused text input fields"), this); - - customFocusHighlightColor = new TQCheckBox(i18n("Custom text input highlight color:"), this); - TQHBox *hbox1 = new TQHBox(this); - hbox1->layout()->addItem(new TQSpacerItem(20, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum) ); - focusHighlightColor = new KColorButton(hbox1); - - customOverHighlightColor = new TQCheckBox(i18n("Custom mouseover highlight color:"), this); - TQHBox *hbox2 = new TQHBox(this); - hbox2->layout()->addItem(new TQSpacerItem(20, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum) ); - overHighlightColor = new KColorButton(hbox2); - - customCheckMarkColor = new TQCheckBox(i18n("Custom checkmark color:"), this); - TQHBox *hbox3 = new TQHBox(this); - hbox3->layout()->addItem(new TQSpacerItem(20, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum) ); - checkMarkColor = new KColorButton(hbox3); - -// layout->add(scrollBarLines); - layout->add(animateProgressBar); - layout->add(drawToolBarSeparator); - layout->add(drawToolBarItemSeparator); -// layout->add(drawFocusRect); - layout->add(drawTriangularExpander); - layout->add(inputFocusHighlight); - layout->add(customFocusHighlightColor); - layout->add(hbox1); - layout->add(customOverHighlightColor); - layout->add(hbox2); - layout->add(customCheckMarkColor); - layout->add(hbox3); - layout->addStretch(1); - - TQSettings s; -// origScrollBarLines = s.readBoolEntry("/plastikstyle/Settings/scrollBarLines", false); -// scrollBarLines->setChecked(origScrollBarLines); - origAnimProgressBar = s.readBoolEntry("/plastikstyle/Settings/animateProgressBar", false); - animateProgressBar->setChecked(origAnimProgressBar); - origDrawToolBarSeparator = s.readBoolEntry("/plastikstyle/Settings/drawToolBarSeparator", false); - drawToolBarSeparator->setChecked(origDrawToolBarSeparator); - origDrawToolBarItemSeparator = s.readBoolEntry("/plastikstyle/Settings/drawToolBarItemSeparator", true); - drawToolBarItemSeparator->setChecked(origDrawToolBarItemSeparator); -// origDrawFocusRect = s.readBoolEntry("/plastikstyle/Settings/drawFocusRect", true); -// drawFocusRect->setChecked(origDrawFocusRect); - origDrawTriangularExpander = s.readBoolEntry("/plastikstyle/Settings/drawTriangularExpander", false); - drawTriangularExpander->setChecked(origDrawTriangularExpander); - origInputFocusHighlight = s.readBoolEntry("/plastikstyle/Settings/inputFocusHighlight", true); - inputFocusHighlight->setChecked(origInputFocusHighlight); - origCustomOverHighlightColor = s.readBoolEntry("/plastikstyle/Settings/customOverHighlightColor", false); - customOverHighlightColor->setChecked(origCustomOverHighlightColor); - origOverHighlightColor = s.readEntry("/plastikstyle/Settings/overHighlightColor", "black"); - overHighlightColor->setColor(origOverHighlightColor); - origCustomFocusHighlightColor = s.readBoolEntry("/plastikstyle/Settings/customFocusHighlightColor", false); - customFocusHighlightColor->setChecked(origCustomFocusHighlightColor); - origFocusHighlightColor = s.readEntry("/plastikstyle/Settings/focusHighlightColor", "black"); - focusHighlightColor->setColor(origFocusHighlightColor); - origCustomCheckMarkColor = s.readBoolEntry("/plastikstyle/Settings/customCheckMarkColor", false); - customCheckMarkColor->setChecked(origCustomCheckMarkColor); - origCheckMarkColor = s.readEntry("/plastikstyle/Settings/checkMarkColor", "black"); - checkMarkColor->setColor(origCheckMarkColor); - -// connect(scrollBarLines, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); - connect(animateProgressBar, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); - connect(drawToolBarSeparator, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); - connect(drawToolBarItemSeparator, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); -// connect(drawFocusRect, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); - connect(drawTriangularExpander, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); - connect(inputFocusHighlight, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); - connect(customOverHighlightColor, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); - connect(overHighlightColor, TQT_SIGNAL( changed(const TQColor&) ), TQT_SLOT( updateChanged() ) ); - connect(customFocusHighlightColor, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); - connect(focusHighlightColor, TQT_SIGNAL( changed(const TQColor&) ), TQT_SLOT( updateChanged() ) ); - connect(customCheckMarkColor, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) ); - connect(checkMarkColor, TQT_SIGNAL( changed(const TQColor&) ), TQT_SLOT( updateChanged() ) ); - if ( customOverHighlightColor->isChecked() ) - overHighlightColor->setEnabled(true); - else - overHighlightColor->setEnabled(false); - if ( customFocusHighlightColor->isChecked() ) - focusHighlightColor->setEnabled(true); - else - focusHighlightColor->setEnabled(false); - if ( customCheckMarkColor->isChecked() ) - checkMarkColor->setEnabled(true); - else - checkMarkColor->setEnabled(false); -} - -PlastikStyleConfig::~PlastikStyleConfig() -{ -} - - -void PlastikStyleConfig::save() -{ - TQSettings s; -// s.writeEntry("/plastikstyle/Settings/scrollBarLines", scrollBarLines->isChecked()); - s.writeEntry("/plastikstyle/Settings/animateProgressBar", animateProgressBar->isChecked()); - s.writeEntry("/plastikstyle/Settings/drawToolBarSeparator", drawToolBarSeparator->isChecked()); - s.writeEntry("/plastikstyle/Settings/drawToolBarItemSeparator", drawToolBarItemSeparator->isChecked()); -// s.writeEntry("/plastikstyle/Settings/drawFocusRect", drawFocusRect->isChecked()); - s.writeEntry("/plastikstyle/Settings/drawTriangularExpander", drawTriangularExpander->isChecked()); - s.writeEntry("/plastikstyle/Settings/inputFocusHighlight", inputFocusHighlight->isChecked()); - s.writeEntry("/plastikstyle/Settings/customOverHighlightColor", customOverHighlightColor->isChecked()); - s.writeEntry("/plastikstyle/Settings/overHighlightColor", TQColor(overHighlightColor->color()).name()); - s.writeEntry("/plastikstyle/Settings/customFocusHighlightColor", customFocusHighlightColor->isChecked()); - s.writeEntry("/plastikstyle/Settings/focusHighlightColor", TQColor(focusHighlightColor->color()).name()); - s.writeEntry("/plastikstyle/Settings/customCheckMarkColor", customCheckMarkColor->isChecked()); - s.writeEntry("/plastikstyle/Settings/checkMarkColor", TQColor(checkMarkColor->color()).name()); -} - -void PlastikStyleConfig::defaults() -{ -// scrollBarLines->setChecked(false); - animateProgressBar->setChecked(false); - drawToolBarSeparator->setChecked(false); - drawToolBarItemSeparator->setChecked(true); -// drawFocusRect->setChecked(true); - drawTriangularExpander->setChecked(false); - inputFocusHighlight->setChecked(true); - customOverHighlightColor->setChecked(false); - overHighlightColor->setColor("black"); - customFocusHighlightColor->setChecked(false); - focusHighlightColor->setColor("black"); - customCheckMarkColor->setChecked(false); - checkMarkColor->setColor("black"); - //updateChanged would be done by setChecked already -} - -void PlastikStyleConfig::updateChanged() -{ - if ( customOverHighlightColor->isChecked() ) - overHighlightColor->setEnabled(true); - else - overHighlightColor->setEnabled(false); - if ( customFocusHighlightColor->isChecked() ) - focusHighlightColor->setEnabled(true); - else - focusHighlightColor->setEnabled(false); - if ( customCheckMarkColor->isChecked() ) - checkMarkColor->setEnabled(true); - else - checkMarkColor->setEnabled(false); - - if (/*(scrollBarLines->isChecked() == origScrollBarLines) &&*/ - (animateProgressBar->isChecked() == origAnimProgressBar) && - (drawToolBarSeparator->isChecked() == origDrawToolBarSeparator) && - (drawToolBarItemSeparator->isChecked() == origDrawToolBarItemSeparator) && -// (drawFocusRect->isChecked() == origDrawFocusRect) && - (drawTriangularExpander->isChecked() == origDrawTriangularExpander) && - (inputFocusHighlight->isChecked() == origInputFocusHighlight) && - (customOverHighlightColor->isChecked() == origCustomOverHighlightColor) && - (overHighlightColor->color() == origOverHighlightColor) && - (customFocusHighlightColor->isChecked() == origCustomFocusHighlightColor) && - (focusHighlightColor->color() == origFocusHighlightColor) && - (customCheckMarkColor->isChecked() == origCustomCheckMarkColor) && - (checkMarkColor->color() == origCheckMarkColor) - ) - emit changed(false); - else - emit changed(true); -} - -#include "plastitdeconf.moc" diff --git a/kstyles/plastik/config/plastitdeconf.h b/kstyles/plastik/config/plastitdeconf.h deleted file mode 100644 index 512ad6f2e..000000000 --- a/kstyles/plastik/config/plastitdeconf.h +++ /dev/null @@ -1,85 +0,0 @@ -/* -Copyright (C) 2003 Sandro Giessl - -based on the Keramik configuration dialog: -Copyright (c) 2003 Maksim Orlovich - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - -*/ - -#ifndef PLASTIK_CONF_H -#define PLASTIK_CONF_H - -class TQCheckBox; - -class PlastikStyleConfig: public TQWidget -{ - Q_OBJECT -public: - PlastikStyleConfig(TQWidget* parent); - ~PlastikStyleConfig(); - - //This signal and the next two slots are the plugin - //page interface -signals: - void changed(bool); - -public slots: - void save(); - void defaults(); - - //Everything below this is internal. -protected slots: - void updateChanged(); - -protected: - //We store settings directly in widgets to - //avoid the hassle of sync'ing things -// TQCheckBox* scrollBarLines; - TQCheckBox* animateProgressBar; - TQCheckBox* drawToolBarSeparator; - TQCheckBox* drawToolBarItemSeparator; -// TQCheckBox* drawFocusRect; - TQCheckBox* drawTriangularExpander; - TQCheckBox* inputFocusHighlight; - TQCheckBox* customOverHighlightColor; - KColorButton* overHighlightColor; - TQCheckBox* customFocusHighlightColor; - KColorButton* focusHighlightColor; - TQCheckBox* customCheckMarkColor; - KColorButton* checkMarkColor; - - //Original settings, for accurate dirtiness tracking -// bool origScrollBarLines; - bool origAnimProgressBar; - bool origDrawToolBarSeparator; - bool origDrawToolBarItemSeparator; -// bool origDrawFocusRect; - bool origDrawTriangularExpander; - bool origInputFocusHighlight; - bool origCustomOverHighlightColor; - TQColor origOverHighlightColor; - bool origCustomFocusHighlightColor; - TQColor origFocusHighlightColor; - bool origCustomCheckMarkColor; - TQColor origCheckMarkColor; -}; - -#endif -- cgit v1.2.1