SVN commit 624224 by cgilles:
digikam from trunk : Blur and Sharpen tools remember the settings between plugin sessions CCMAIL: [hidden email] M +23 -7 imageeffect_blur.cpp M +16 -14 imageeffect_blur.h M +24 -7 imageeffect_sharpen.cpp M +11 -9 imageeffect_sharpen.h --- trunk/extragear/graphics/digikam/imageplugins/imageeffect_blur.cpp #624223:624224 @@ -1,9 +1,9 @@ /* ============================================================ - * Author: Gilles Caulier <caulier dot gilles at kdemail dot net> - * Date : 2004-07-09 - * Description : Blur image filter for ImageEditor + * Authors: Gilles Caulier <caulier dot gilles at kdemail dot net> + * Date : 2004-07-09 + * Description : a tool to blur an image * - * Copyright 2004-2006 by Gilles Caulier + * Copyright 2004-2007 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General @@ -28,6 +28,7 @@ #include <kaboutdata.h> #include <knuminput.h> +#include <kconfig.h> #include <kcursor.h> #include <klocale.h> #include <kapplication.h> @@ -41,6 +42,7 @@ // Local includes. #include "imageeffect_blur.h" +#include "imageeffect_blur.moc" namespace DigikamImagesPluginCore { @@ -77,11 +79,21 @@ { } -void ImageEffect_Blur::renderingFinished(void) +void ImageEffect_Blur::readUserSettings() { - m_radiusInput->setEnabled(true); + KConfig* config = kapp->config(); + config->setGroup("gaussianblur Tool Dialog"); + m_radiusInput->setValue(config->readNumEntry("RadiusAjustment", 0)); } +void ImageEffect_Blur::writeUserSettings() +{ + KConfig* config = kapp->config(); + config->setGroup("gaussianblur Tool Dialog"); + config->writeEntry("RadiusAjustment", m_radiusInput->value()); + config->sync(); +} + void ImageEffect_Blur::resetValues(void) { m_radiusInput->blockSignals(true); @@ -128,6 +140,10 @@ iface.putOriginalImage(i18n("Gaussian Blur"), imDest.bits()); } +void ImageEffect_Blur::renderingFinished(void) +{ + m_radiusInput->setEnabled(true); +} + } // NameSpace DigikamImagesPluginCore -#include "imageeffect_blur.moc" --- trunk/extragear/graphics/digikam/imageplugins/imageeffect_blur.h #624223:624224 @@ -1,9 +1,9 @@ /* ============================================================ - * Author: Gilles Caulier <caulier dot gilles at kdemail dot net> - * Date : 2004-07-09 - * Description : Blur image filter for ImageEditor + * Authors: Gilles Caulier <caulier dot gilles at kdemail dot net> + * Date : 2004-07-09 + * Description : a tool to blur an image * - * Copyright 2004-2006 by Gilles Caulier + * Copyright 2004-2007 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General @@ -41,17 +41,19 @@ private: + void readUserSettings(); + void writeUserSettings(); + void resetValues(); + void prepareEffect(); + void prepareFinal(); + void abortPreview(); + void putPreviewData(); + void putFinalData(); + void renderingFinished(); + +private: + KIntNumInput *m_radiusInput; - -protected: - - void prepareEffect(void); - void prepareFinal(void); - void abortPreview(void); - void putPreviewData(void); - void putFinalData(void); - void resetValues(void); - void renderingFinished(void); }; } // NameSpace DigikamImagesPluginCore --- trunk/extragear/graphics/digikam/imageplugins/imageeffect_sharpen.cpp #624223:624224 @@ -1,9 +1,9 @@ /* ============================================================ - * Author: Gilles Caulier <caulier dot gilles at kdemail dot net> - * Date : 2004-07-09 - * Description : Sharpen image filter for ImageEditor + * Authors: Gilles Caulier <caulier dot gilles at kdemail dot net> + * Date : 2004-07-09 + * Description : a tool to sharp an image * - * Copyright 2004-2006 by Gilles Caulier + * Copyright 2004-2007 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General @@ -35,7 +35,9 @@ #include <kcursor.h> #include <klocale.h> #include <kapplication.h> +#include <kconfig.h> + // Digikam includes. #include "ddebug.h" @@ -45,6 +47,7 @@ // Local includes. #include "imageeffect_sharpen.h" +#include "imageeffect_sharpen.moc" namespace DigikamImagesPluginCore { @@ -81,11 +84,21 @@ { } -void ImageEffect_Sharpen::renderingFinished(void) +void ImageEffect_Sharpen::readUserSettings() { - m_radiusInput->setEnabled(true); + KConfig* config = kapp->config(); + config->setGroup("sharpen Tool Dialog"); + m_radiusInput->setValue(config->readNumEntry("RadiusAjustment", 0)); } +void ImageEffect_Sharpen::writeUserSettings() +{ + KConfig* config = kapp->config(); + config->setGroup("sharpen Tool Dialog"); + config->writeEntry("RadiusAjustment", m_radiusInput->value()); + config->sync(); +} + void ImageEffect_Sharpen::resetValues(void) { m_radiusInput->blockSignals(true); @@ -144,6 +157,10 @@ iface.putOriginalImage(i18n("Sharpen"), imDest.bits()); } +void ImageEffect_Sharpen::renderingFinished(void) +{ + m_radiusInput->setEnabled(true); +} + } // NameSpace DigikamImagesPluginCore -#include "imageeffect_sharpen.moc" --- trunk/extragear/graphics/digikam/imageplugins/imageeffect_sharpen.h #624223:624224 @@ -1,9 +1,9 @@ /* ============================================================ - * Author: Gilles Caulier <caulier dot gilles at kdemail dot net> - * Date : 2004-07-09 - * Description : Sharpen image filter for ImageEditor + * Authors: Gilles Caulier <caulier dot gilles at kdemail dot net> + * Date : 2004-07-09 + * Description : a tool to sharp an image * - * Copyright 2004-2006 by Gilles Caulier + * Copyright 2004-2007 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General @@ -40,18 +40,20 @@ ~ImageEffect_Sharpen(); private: - - KIntNumInput *m_radiusInput; - -protected: + void readUserSettings(); + void writeUserSettings(); + void resetValues(void); void prepareEffect(void); void prepareFinal(void); void abortPreview(void); void putPreviewData(void); void putFinalData(void); - void resetValues(void); void renderingFinished(void); + +private: + + KIntNumInput *m_radiusInput; }; } // NameSpace DigikamImagesPluginCore _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
Free forum by Nabble | Edit this page |