[Digikam-devel] extragear/graphics/digikamimageplugins/sheartool

Gilles Caulier caulier.gilles at kdemail.net
Wed Jan 17 21:43:33 CET 2007


SVN commit 624720 by cgilles:

digikam from trunk : Shear Tool : fix Restore/save settings between plugin session
CCMAIL: digikam-devel at kde.org


 M  +28 -24    imageeffect_sheartool.cpp  
 M  +17 -19    imageeffect_sheartool.h  
 M  +4 -7      imageplugin_sheartool.cpp  
 M  +6 -9      imageplugin_sheartool.h  


--- trunk/extragear/graphics/digikamimageplugins/sheartool/imageeffect_sheartool.cpp #624719:624720
@@ -1,11 +1,10 @@
 /* ============================================================
- * File  : imageeffect_sheartool.cpp
- * Author: Gilles Caulier <caulier dot gilles at kdemail dot net>
- * Date  : 2004-12-23
+ * Authors: Gilles Caulier <caulier dot gilles at kdemail dot net>
+ * Date   : 2004-12-23
  * Description : a digiKam image editor plugin to process 
  *               shearing 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
@@ -45,6 +44,7 @@
 #include "version.h"
 #include "sheartool.h"
 #include "imageeffect_sheartool.h"
+#include "imageeffect_sheartool.moc"
 
 namespace DigikamShearToolImagesPlugin
 {
@@ -65,7 +65,7 @@
                                        digikamimageplugins_version,
                                        I18N_NOOP("A digiKam image plugin to shear an image."),
                                        KAboutData::License_GPL,
-                                       "(c) 2004-2006, Gilles Caulier",
+                                       "(c) 2004-2007, Gilles Caulier",
                                        0,
                                        "http://extragear.kde.org/apps/digikamimageplugins");
     
@@ -175,32 +175,27 @@
 void ImageEffect_ShearTool::readUserSettings(void)
 {
     KConfig *config = kapp->config();
-    config->setGroup("ShearTool Settings");
-
-    m_antialiasInput->setChecked( config->readBoolEntry("Anti Aliasing", true) );
-    DDebug() << "Reading ShearTool settings" << endl;
+    config->setGroup("sheartool Tool Dialog");
+    m_mainHAngleInput->setValue(config->readNumEntry("Main HAngle", 0));
+    m_mainVAngleInput->setValue(config->readNumEntry("Main VAngle", 0));
+    m_fineHAngleInput->setValue(config->readDoubleNumEntry("Fine HAngle", 0.0));
+    m_fineVAngleInput->setValue(config->readDoubleNumEntry("Fine VAngle", 0.0));
+    m_antialiasInput->setChecked(config->readBoolEntry("Anti Aliasing", true));
+    slotEffect();
 }
 
 void ImageEffect_ShearTool::writeUserSettings(void)
 {
     KConfig *config = kapp->config();
-    config->setGroup("ShearTool Settings");
-
-    config->writeEntry( "Anti Aliasing", m_antialiasInput->isChecked() );
+    config->setGroup("sheartool Tool Dialog");
+    config->writeEntry("Main HAngle", m_mainHAngleInput->value());
+    config->writeEntry("Main VAngle", m_mainVAngleInput->value());
+    config->writeEntry("Fine HAngle", m_fineHAngleInput->value());
+    config->writeEntry("Fine VAngle", m_fineVAngleInput->value());
+    config->writeEntry("Anti Aliasing", m_antialiasInput->isChecked());
     config->sync();
-    DDebug() << "Writing ShearTool settings" << endl;
 }
 
-void ImageEffect_ShearTool::renderingFinished()
-{
-    m_mainHAngleInput->setEnabled(true);
-    m_mainVAngleInput->setEnabled(true);
-    m_fineHAngleInput->setEnabled(true);
-    m_fineVAngleInput->setEnabled(true);
-    m_antialiasInput->setEnabled(true);
-    kapp->restoreOverrideCursor();
-}
-
 void ImageEffect_ShearTool::resetValues()
 {
     m_mainHAngleInput->blockSignals(true);
@@ -306,6 +301,15 @@
                            targetImage.width(), targetImage.height());
 }
 
+void ImageEffect_ShearTool::renderingFinished()
+{
+    m_mainHAngleInput->setEnabled(true);
+    m_mainVAngleInput->setEnabled(true);
+    m_fineHAngleInput->setEnabled(true);
+    m_fineVAngleInput->setEnabled(true);
+    m_antialiasInput->setEnabled(true);
+    kapp->restoreOverrideCursor();
+}
+
 }  // NameSpace DigikamShearToolImagesPlugin
 
-#include "imageeffect_sheartool.moc"
--- trunk/extragear/graphics/digikamimageplugins/sheartool/imageeffect_sheartool.h #624719:624720
@@ -1,11 +1,10 @@
 /* ============================================================
- * File  : imageeffect_sheartool.h
- * Author: Gilles Caulier <caulier dot gilles at kdemail dot net>
-  * Date  : 2004-12-23
+ * Authors: Gilles Caulier <caulier dot gilles at kdemail dot net>
+ * Date   : 2004-12-23
  * Description : a digiKam image editor plugin to process 
  *               shearing 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
@@ -46,20 +45,7 @@
 
     ImageEffect_ShearTool(QWidget* parent, QString title, QFrame* banner);
     ~ImageEffect_ShearTool();
-
-private:
-
-    QLabel          *m_newWidthLabel;
-    QLabel          *m_newHeightLabel;
-   
-    QCheckBox       *m_antialiasInput;
     
-    KIntNumInput    *m_mainHAngleInput;
-    KIntNumInput    *m_mainVAngleInput;
-
-    KDoubleNumInput *m_fineHAngleInput;
-    KDoubleNumInput *m_fineVAngleInput;
-    
 private slots:
     
     void readUserSettings(void);
@@ -72,8 +58,20 @@
     void putPreviewData(void);
     void putFinalData(void);
     void resetValues(void);   
-    void renderingFinished(void);
+    void renderingFinished(void);   
+
+private:
+
+    QLabel          *m_newWidthLabel;
+    QLabel          *m_newHeightLabel;
    
+    QCheckBox       *m_antialiasInput;
+    
+    KIntNumInput    *m_mainHAngleInput;
+    KIntNumInput    *m_mainVAngleInput;
+
+    KDoubleNumInput *m_fineHAngleInput;
+    KDoubleNumInput *m_fineVAngleInput;
 };
 
 }  // NameSpace DigikamShearToolImagesPlugin
--- trunk/extragear/graphics/digikamimageplugins/sheartool/imageplugin_sheartool.cpp #624719:624720
@@ -1,10 +1,9 @@
 /* ============================================================
- * File  : imageplugin_sheartool.cpp
- * Author: Gilles Caulier <caulier dot gilles at kdemail dot net>
- * Date  : 2004-11-23
+ * Authors: Gilles Caulier <caulier dot gilles at kdemail dot net>
+ * Date   : 2004-11-23
  * Description : 
  * 
- * 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
@@ -32,6 +31,7 @@
 #include "bannerwidget.h"
 #include "imageeffect_sheartool.h"
 #include "imageplugin_sheartool.h"
+#include "imageplugin_sheartool.moc"
 
 K_EXPORT_COMPONENT_FACTORY( digikamimageplugin_sheartool,
                             KGenericFactory<ImagePlugin_ShearTool>("digikamimageplugin_sheartool"));
@@ -66,6 +66,3 @@
     dlg.exec();
     delete headerFrame;    
 }
-
-
-#include "imageplugin_sheartool.moc"
--- trunk/extragear/graphics/digikamimageplugins/sheartool/imageplugin_sheartool.h #624719:624720
@@ -1,10 +1,9 @@
 /* ============================================================
- * File  : imageplugin_sheartool.h
- * Author: Gilles Caulier <caulier dot gilles at kdemail dot net>
- * Date  : 2004-12-23
+ * Authors: Gilles Caulier <caulier dot gilles at kdemail dot net>
+ * Date   : 2004-12-23
  * Description : 
  * 
- * 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
@@ -19,7 +18,6 @@
  * 
  * ============================================================ */
 
-
 #ifndef IMAGEPLUGIN_SHEARTOOL_H
 #define IMAGEPLUGIN_SHEARTOOL_H
 
@@ -41,14 +39,13 @@
 
     void setEnabledActions(bool enable);
 
-private:
-
-    KAction *m_sheartoolAction;
-   
 private slots:
 
     void slotShearTool();
 
+private:
+
+    KAction *m_sheartoolAction;
 };
     
 #endif /* IMAGEPLUGIN_SHEARTOOL_H */


More information about the Digikam-devel mailing list