[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/graphics/digikam
From:       Andi Clemens <andi.clemens () gmx ! net>
Date:       2008-08-24 13:45:47
Message-ID: 1219585547.458039.25282.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 851744 by aclemens:

porting new R*NumInput widgets ++

 M  +27 -24    imageplugins/lenscorrection/distortion/imageeffect_lensdistortion.cpp  \
  M  +5 -6      imageplugins/lenscorrection/distortion/imageeffect_lensdistortion.h  
 M  +36 -31    imageplugins/lenscorrection/vignetting/imageeffect_antivignetting.cpp  \
  M  +8 -9      imageplugins/lenscorrection/vignetting/imageeffect_antivignetting.h  
 M  +25 -20    libs/dialogs/imageguidedlg.cpp  


--- trunk/extragear/graphics/digikam/imageplugins/lenscorrection/distortion/imageeffect_lensdistortion.cpp \
#851743:851744 @@ -28,23 +28,22 @@
 
 // Qt includes.
 
+#include <QBrush>
+#include <QGridLayout>
 #include <QLabel>
-#include <QPixmap>
 #include <QPainter>
-#include <QBrush>
 #include <QPen>
-#include <QGridLayout>
+#include <QPixmap>
 
 // KDE includes.
 
-#include <klocale.h>
+#include <kaboutdata.h>
+#include <kapplication.h>
 #include <kconfig.h>
-#include <kaboutdata.h>
+#include <kglobal.h>
 #include <kiconloader.h>
-#include <kapplication.h>
+#include <klocale.h>
 #include <kstandarddirs.h>
-#include <knuminput.h>
-#include <kglobal.h>
 
 // LibKDcraw includes.
 
@@ -108,9 +107,10 @@
 
     QLabel *label1 = new QLabel(i18n("Main:"), gboxSettings);
 
-    m_mainInput = new KDoubleNumInput(gboxSettings);
+    m_mainInput = new RDoubleNumInput(gboxSettings);
     m_mainInput->setDecimals(1);
-    m_mainInput->setRange(-100.0, 100.0, 0.1, true);
+    m_mainInput->input()->setRange(-100.0, 100.0, 0.1, true);
+    m_mainInput->setDefaultValue(0.0);
     m_mainInput->setWhatsThis( i18n("<p>This value controls the amount of \
                distortion. Negative values "
                                     "correct lens barrel distortion, while positive \
values correct lens "  "pincushion distortion."));
@@ -119,9 +119,10 @@
 
     QLabel *label2 = new QLabel(i18n("Edge:"), gboxSettings);
 
-    m_edgeInput = new KDoubleNumInput(gboxSettings);
+    m_edgeInput = new RDoubleNumInput(gboxSettings);
     m_edgeInput->setDecimals(1);
-    m_edgeInput->setRange(-100.0, 100.0, 0.1, true);
+    m_edgeInput->input()->setRange(-100.0, 100.0, 0.1, true);
+    m_edgeInput->setDefaultValue(0.0);
     m_edgeInput->setWhatsThis( i18n("<p>This value controls in the same manner as \
                the Main control, "
                                     "but has more effect at the edges of the image \
than at the center."));  
@@ -129,18 +130,20 @@
 
     QLabel *label3 = new QLabel(i18n("Zoom:"), gboxSettings);
 
-    m_rescaleInput = new KDoubleNumInput(gboxSettings);
+    m_rescaleInput = new RDoubleNumInput(gboxSettings);
     m_rescaleInput->setDecimals(1);
-    m_rescaleInput->setRange(-100.0, 100.0, 0.1, true);
+    m_rescaleInput->input()->setRange(-100.0, 100.0, 0.1, true);
+    m_rescaleInput->setDefaultValue(0.0);
     m_rescaleInput->setWhatsThis( i18n("<p>This value rescales the overall image \
size."));  
     // -------------------------------------------------------------
 
     QLabel *label4 = new QLabel(i18n("Brighten:"), gboxSettings);
 
-    m_brightenInput = new KDoubleNumInput(gboxSettings);
+    m_brightenInput = new RDoubleNumInput(gboxSettings);
     m_brightenInput->setDecimals(1);
-    m_brightenInput->setRange(-100.0, 100.0, 0.1, true);
+    m_brightenInput->input()->setRange(-100.0, 100.0, 0.1, true);
+    m_brightenInput->setDefaultValue(0.0);
     m_brightenInput->setWhatsThis( i18n("<p>This value adjusts the brightness in \
image corners."));  
     // -------------------------------------------------------------
@@ -210,10 +213,10 @@
     m_rescaleInput->blockSignals(true);
     m_brightenInput->blockSignals(true);
 
-    m_mainInput->setValue(group.readEntry("2nd Order Distortion", 0.0));
-    m_edgeInput->setValue(group.readEntry("4th Order Distortion",0.0));
-    m_rescaleInput->setValue(group.readEntry("Zoom Factor", 0.0));
-    m_brightenInput->setValue(group.readEntry("Brighten", 0.0));
+    m_mainInput->setValue(group.readEntry("2nd Order Distortion", \
m_mainInput->defaultValue())); +    m_edgeInput->setValue(group.readEntry("4th Order \
Distortion", m_edgeInput->defaultValue())); +    \
m_rescaleInput->setValue(group.readEntry("Zoom Factor", \
m_rescaleInput->defaultValue())); +    \
m_brightenInput->setValue(group.readEntry("Brighten", \
m_brightenInput->defaultValue()));  
     m_mainInput->blockSignals(false);
     m_edgeInput->blockSignals(false);
@@ -241,10 +244,10 @@
     m_rescaleInput->blockSignals(true);
     m_brightenInput->blockSignals(true);
 
-    m_mainInput->setValue(0.0);
-    m_edgeInput->setValue(0.0);
-    m_rescaleInput->setValue(0.0);
-    m_brightenInput->setValue(0.0);
+    m_mainInput->slotReset();
+    m_edgeInput->slotReset();
+    m_rescaleInput->slotReset();
+    m_brightenInput->slotReset();
 
     m_mainInput->blockSignals(false);
     m_edgeInput->blockSignals(false);
--- trunk/extragear/graphics/digikam/imageplugins/lenscorrection/distortion/imageeffect_lensdistortion.h \
#851743:851744 @@ -36,10 +36,9 @@
 
 class QLabel;
 
-class KDoubleNumInput;
-
 namespace KDcrawIface
 {
+class RDoubleNumInput;
 }
 
 namespace DigikamLensDistortionImagesPlugin
@@ -72,10 +71,10 @@
 
     QLabel          *m_maskPreviewLabel;
 
-    KDoubleNumInput *m_mainInput;
-    KDoubleNumInput *m_edgeInput;
-    KDoubleNumInput *m_rescaleInput;
-    KDoubleNumInput *m_brightenInput;
+    KDcrawIface::RDoubleNumInput *m_mainInput;
+    KDcrawIface::RDoubleNumInput *m_edgeInput;
+    KDcrawIface::RDoubleNumInput *m_rescaleInput;
+    KDcrawIface::RDoubleNumInput *m_brightenInput;
 
     Digikam::DImg    m_previewRasterImage;
 };
--- trunk/extragear/graphics/digikam/imageplugins/lenscorrection/vignetting/imageeffect_antivignetting.cpp \
#851743:851744 @@ -24,25 +24,25 @@
 
 // Qt includes.
 
+#include <QGridLayout>
+#include <QImage>
 #include <QLabel>
-#include <QImage>
-#include <QPixmap>
 #include <QPainter>
 #include <QPen>
+#include <QPixmap>
 #include <QTabWidget>
-#include <QGridLayout>
 
 // KDE includes.
 
+#include <kaboutdata.h>
+#include <kapplication.h>
 #include <kconfig.h>
+#include <kglobal.h>
+#include <kiconloader.h>
 #include <klocale.h>
-#include <kaboutdata.h>
-#include <kiconloader.h>
-#include <kapplication.h>
-#include <kstandarddirs.h>
 #include <knuminput.h>
 #include <kseparator.h>
-#include <kglobal.h>
+#include <kstandarddirs.h>
 
 // LibKDcraw includes.
 
@@ -105,9 +105,10 @@
 
     QLabel *label1 = new QLabel(i18n("Density:"), gboxSettings);
 
-    m_densityInput = new KDoubleNumInput(gboxSettings);
+    m_densityInput = new RDoubleNumInput(gboxSettings);
     m_densityInput->setDecimals(1);
-    m_densityInput->setRange(1.0, 20.0, 0.1, true);
+    m_densityInput->input()->setRange(1.0, 20.0, 0.1, true);
+    m_densityInput->setDefaultValue(2.0);
     m_densityInput->setWhatsThis(i18n("<p>This value controls the degree of \
                intensity attenuation "
                                       "by the filter at its point of maximum \
density."));  
@@ -115,9 +116,10 @@
 
     QLabel *label2 = new QLabel(i18n("Power:"), gboxSettings);
 
-    m_powerInput = new KDoubleNumInput(gboxSettings);
+    m_powerInput = new RDoubleNumInput(gboxSettings);
     m_powerInput->setDecimals(1);
-    m_powerInput->setRange(0.1, 2.0, 0.1, true);
+    m_powerInput->input()->setRange(0.1, 2.0, 0.1, true);
+    m_powerInput->setDefaultValue(1.0);
     m_powerInput->setWhatsThis(i18n("<p>This value is used as the exponent \
                controlling the "
                                     "fall-off in density from the center of the \
filter to the periphery."));  
@@ -125,9 +127,10 @@
 
     QLabel *label3 = new QLabel(i18n("Radius:"), gboxSettings);
 
-    m_radiusInput = new KDoubleNumInput(gboxSettings);
+    m_radiusInput = new RDoubleNumInput(gboxSettings);
     m_radiusInput->setDecimals(1);
-    m_radiusInput->setRange(-100.0, 100.0, 0.1, true);
+    m_radiusInput->input()->setRange(-100.0, 100.0, 0.1, true);
+    m_radiusInput->setDefaultValue(1.0);
     m_radiusInput->setWhatsThis(i18n("<p>This value is the radius of the center \
                filter. It is a "
                                      "multiple of the half-diagonal measure of the \
                image, at which "
                                      "the density of the filter falls to zero."));
@@ -138,28 +141,30 @@
 
     QLabel *label4 = new QLabel(i18n("Brightness:"), gboxSettings);
 
-    m_brightnessInput = new KIntNumInput(gboxSettings);
+    m_brightnessInput = new RIntNumInput(gboxSettings);
     m_brightnessInput->setRange(0, 100, 1);
     m_brightnessInput->setSliderEnabled(true);
+    m_brightnessInput->setDefaultValue(0);
     m_brightnessInput->setWhatsThis(i18n("<p>Set here the brightness re-adjustment \
of the target image."));  
     // -------------------------------------------------------------
 
     QLabel *label5 = new QLabel(i18n("Contrast:"), gboxSettings);
 
-    m_contrastInput = new KIntNumInput(gboxSettings);
+    m_contrastInput = new RIntNumInput(gboxSettings);
     m_contrastInput->setRange(0, 100, 1);
     m_contrastInput->setSliderEnabled(true);
+    m_contrastInput->setDefaultValue(0);
     m_contrastInput->setWhatsThis(i18n("<p>Set here the contrast re-adjustment of \
the target image."));  
     // -------------------------------------------------------------
 
     QLabel *label6 = new QLabel(i18n("Gamma:"), gboxSettings);
 
-    m_gammaInput = new KDoubleNumInput(gboxSettings);
+    m_gammaInput = new RDoubleNumInput(gboxSettings);
     m_gammaInput->setDecimals(2);
-    m_gammaInput->setRange(0.1, 3.0, 0.01, true);
-    m_gammaInput->setValue(1.0);
+    m_gammaInput->input()->setRange(0.1, 3.0, 0.01, true);
+    m_gammaInput->setDefaultValue(1.0);
     m_gammaInput->setWhatsThis(i18n("<p>Set here the gamma re-adjustment of the \
target image."));  
     // -------------------------------------------------------------
@@ -230,12 +235,12 @@
     m_contrastInput->blockSignals(true);
     m_gammaInput->blockSignals(true);
 
-    m_densityInput->setValue(group.readEntry("DensityAjustment", 2.0));
-    m_powerInput->setValue(group.readEntry("PowerAjustment", 1.0));
-    m_radiusInput->setValue(group.readEntry("RadiusAjustment", 1.0));
-    m_brightnessInput->setValue(group.readEntry("BrightnessAjustment", 0));
-    m_contrastInput->setValue(group.readEntry("ContrastAjustment", 0));
-    m_gammaInput->setValue(group.readEntry("GammaAjustment", 1.0));
+    m_densityInput->setValue(group.readEntry("DensityAjustment", \
m_densityInput->defaultValue())); +    \
m_powerInput->setValue(group.readEntry("PowerAjustment", \
m_powerInput->defaultValue())); +    \
m_radiusInput->setValue(group.readEntry("RadiusAjustment", \
m_radiusInput->defaultValue())); +    \
m_brightnessInput->setValue(group.readEntry("BrightnessAjustment", \
m_brightnessInput->defaultValue())); +    \
m_contrastInput->setValue(group.readEntry("ContrastAjustment", \
m_contrastInput->defaultValue())); +    \
m_gammaInput->setValue(group.readEntry("GammaAjustment", \
m_gammaInput->defaultValue()));  
     m_densityInput->blockSignals(false);
     m_powerInput->blockSignals(false);
@@ -269,12 +274,12 @@
     m_contrastInput->blockSignals(true);
     m_gammaInput->blockSignals(true);
 
-    m_densityInput->setValue(2.0);
-    m_powerInput->setValue(1.0);
-    m_radiusInput->setValue(1.0);
-    m_brightnessInput->setValue(0);
-    m_contrastInput->setValue(0);
-    m_gammaInput->setValue(1.0);
+    m_densityInput->slotReset();
+    m_powerInput->slotReset();
+    m_radiusInput->slotReset();
+    m_brightnessInput->slotReset();
+    m_contrastInput->slotReset();
+    m_gammaInput->slotReset();
 
     m_densityInput->blockSignals(false);
     m_powerInput->blockSignals(false);
--- trunk/extragear/graphics/digikam/imageplugins/lenscorrection/vignetting/imageeffect_antivignetting.h \
#851743:851744 @@ -31,11 +31,10 @@
 
 class QLabel;
 
-class KIntNumInput;
-class KDoubleNumInput;
-
 namespace KDcrawIface
 {
+class RIntNumInput;
+class RDoubleNumInput;
 }
 
 namespace DigikamAntiVignettingImagesPlugin
@@ -68,13 +67,13 @@
 
     QLabel          *m_maskPreviewLabel;
 
-    KIntNumInput    *m_brightnessInput;
-    KIntNumInput    *m_contrastInput;
+    KDcrawIface::RIntNumInput    *m_brightnessInput;
+    KDcrawIface::RIntNumInput    *m_contrastInput;
 
-    KDoubleNumInput *m_gammaInput;
-    KDoubleNumInput *m_densityInput;
-    KDoubleNumInput *m_powerInput;
-    KDoubleNumInput *m_radiusInput;
+    KDcrawIface::RDoubleNumInput *m_gammaInput;
+    KDcrawIface::RDoubleNumInput *m_densityInput;
+    KDcrawIface::RDoubleNumInput *m_powerInput;
+    KDcrawIface::RDoubleNumInput *m_radiusInput;
 };
 
 }  // NameSpace DigikamAntiVignettingImagesPlugin
--- trunk/extragear/graphics/digikam/libs/dialogs/imageguidedlg.cpp #851743:851744
@@ -24,35 +24,38 @@
 
 // Qt includes.
 
+#include <QFrame>
+#include <QGridLayout>
 #include <QGroupBox>
 #include <QLabel>
+#include <QProgressBar>
+#include <QSplitter>
 #include <QTimer>
-#include <QFrame>
-#include <QSpinBox>
-#include <QSplitter>
-#include <QGridLayout>
 #include <QVBoxLayout>
-#include <QProgressBar>
 
 // KDE includes.
 
-#include <kpushbutton.h>
+#include <kaboutdata.h>
+#include <kapplication.h>
+#include <kcolorbutton.h>
+#include <kconfig.h>
 #include <kcursor.h>
-#include <klocale.h>
-#include <kaboutdata.h>
+#include <kglobal.h>
+#include <kglobalsettings.h>
 #include <khelpmenu.h>
 #include <kiconloader.h>
-#include <kapplication.h>
+#include <klocale.h>
 #include <kmenu.h>
+#include <kpushbutton.h>
+#include <kseparator.h>
 #include <kstandarddirs.h>
-#include <kglobalsettings.h>
-#include <kcolorbutton.h>
-#include <kconfig.h>
-#include <kseparator.h>
-#include <kglobal.h>
 #include <ktoolinvocation.h>
 #include <kvbox.h>
 
+// LibKDcraw includes.
+
+#include <libkdcraw/rnuminput.h>
+
 // Local includes.
 
 #include "ddebug.h"
@@ -62,6 +65,8 @@
 #include "imageguidedlg.h"
 #include "imageguidedlg.moc"
 
+using namespace KDcrawIface;
+
 namespace Digikam
 {
 
@@ -110,7 +115,7 @@
     QGridLayout  *mainLayout;
     QGridLayout  *settingsLayout;
 
-    QSpinBox     *guideSize;
+    RIntNumInput *guideSize;
 
     KHBox        *hbox;
 
@@ -180,7 +185,7 @@
 
     d->hbox              = new KHBox(mainWidget());
     d->splitter          = new SidebarSplitter(d->hbox);
-    m_imagePreviewWidget = new ImageWidget(d->name, d->splitter, desc, \
prevModeOptions,  +    m_imagePreviewWidget = new ImageWidget(d->name, d->splitter, \
                desc, prevModeOptions,
                                            guideMode, guideVisible, \
useImageSelection);  
     d->splitter->setFrameStyle( QFrame::NoFrame );
@@ -216,9 +221,9 @@
     d->guideColorBt->setWhatsThis(i18n("<p>Set here the color used to draw guides \
dashed-lines."));  
     QLabel *label6 = new QLabel(i18n("Guide width:"), gboxGuideSettings);
-    d->guideSize   = new QSpinBox(gboxGuideSettings);
-    d->guideSize->setRange(1, 5);
-    d->guideSize->setSingleStep(1);
+    d->guideSize   = new RIntNumInput(gboxGuideSettings);
+    d->guideSize->setRange(1, 5, 1);
+    d->guideSize->setDefaultValue(1);
     d->guideSize->setWhatsThis(i18n("<p>Set here the width in pixels used to draw \
guides dashed-lines."));  
     grid->addWidget(line, 0, 0, 1, 3);
@@ -472,7 +477,7 @@
 
 void ImageGuideDlg::slotHelp()
 {
-    // If setAboutData() is called by plugin, well DigikamImagePlugins help is \
lauched,  +    // If setAboutData() is called by plugin, well DigikamImagePlugins \
                help is lauched,
     // else digiKam help. In this case, setHelp() method must be used to set anchor \
and handbook name.  
     if (d->aboutData)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic