diff --git a/libs/widgets/files/drawdecoderwidget.cpp b/libs/widgets/files/drawdecoderwidget.cpp index b334c28a9d..563da2b9d0 100644 --- a/libs/widgets/files/drawdecoderwidget.cpp +++ b/libs/widgets/files/drawdecoderwidget.cpp @@ -1,1404 +1,1404 @@ /* ============================================================ * * This file is a part of digiKam project * http://www.digikam.org * * date : 2006-09-13 * Description : Raw Decoder settings widgets * * Copyright (C) 2006-2017 by Gilles Caulier * Copyright (C) 2006-2011 by Marcel Wiesweg * Copyright (C) 2007-2008 by Guillaume Castagnino * * 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, 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. * * ============================================================ */ #define OPTIONFIXCOLORSHIGHLIGHTSENTRY "FixColorsHighlights" #define OPTIONDECODESIXTEENBITENTRY "SixteenBitsImage" #define OPTIONWHITEBALANCEENTRY "White Balance" #define OPTIONCUSTOMWHITEBALANCEENTRY "Custom White Balance" #define OPTIONCUSTOMWBGREENENTRY "Custom White Balance Green" #define OPTIONFOURCOLORRGBENTRY "Four Color RGB" #define OPTIONUNCLIPCOLORSENTRY "Unclip Color" // krazy:endcond=spelling #define OPTIONDONTSTRETCHPIXELSSENTRY "Dont Stretch Pixels" // krazy:endcond=spelling #define OPTIONMEDIANFILTERPASSESENTRY "Median Filter Passes" #define OPTIONNOISEREDUCTIONTYPEENTRY "Noise Reduction Type" #define OPTIONNOISEREDUCTIONTHRESHOLDENTRY "Noise Reduction Threshold" #define OPTIONUSECACORRECTIONENTRY "EnableCACorrection" #define OPTIONCAREDMULTIPLIERENTRY "caRedMultiplier" #define OPTIONCABLUEMULTIPLIERENTRY "caBlueMultiplier" #define OPTIONAUTOBRIGHTNESSENTRY "AutoBrightness" #define OPTIONDECODINGQUALITYENTRY "Decoding Quality" #define OPTIONINPUTCOLORSPACEENTRY "Input Color Space" #define OPTIONOUTPUTCOLORSPACEENTRY "Output Color Space" #define OPTIONINPUTCOLORPROFILEENTRY "Input Color Profile" #define OPTIONOUTPUTCOLORPROFILEENTRY "Output Color Profile" #define OPTIONBRIGHTNESSMULTIPLIERENTRY "Brightness Multiplier" #define OPTIONUSEBLACKPOINTENTRY "Use Black Point" #define OPTIONBLACKPOINTENTRY "Black Point" #define OPTIONUSEWHITEPOINTENTRY "Use White Point" #define OPTIONWHITEPOINTENTRY "White Point" //-- Extended demosaicing settings ---------------------------------------------------------- #define OPTIONDCBITERATIONSENTRY "Dcb Iterations" #define OPTIONDCBENHANCEFLENTRY "Dcb Enhance Filter" #define OPTIONEECIREFINEENTRY "Eeci Refine" #define OPTIONESMEDPASSESENTRY "Es Median Filter Passes" #define OPTIONNRCHROMINANCETHRESHOLDENTRY "Noise Reduction Chrominance Threshold" #define OPTIONEXPOCORRECTIONENTRY "Expo Correction" #define OPTIONEXPOCORRECTIONSHIFTENTRY "Expo Correction Shift" #define OPTIONEXPOCORRECTIONHIGHLIGHTENTRY "Expo Correction Highlight" #include "drawdecoderwidget.h" // C++ includes #include // Qt includes #include #include #include #include #include #include #include // KDE includes #include // Local includes #include "drawdecoder.h" #include "dnuminput.h" #include "dcombobox.h" #include "digikam_debug.h" namespace Digikam { class Q_DECL_HIDDEN DRawDecoderWidget::Private { public: Private() { autoBrightnessBox = 0; sixteenBitsImage = 0; fourColorCheckBox = 0; brightnessLabel = 0; brightnessSpinBox = 0; blackPointCheckBox = 0; blackPointSpinBox = 0; whitePointCheckBox = 0; whitePointSpinBox = 0; whiteBalanceComboBox = 0; whiteBalanceLabel = 0; customWhiteBalanceSpinBox = 0; customWhiteBalanceLabel = 0; customWhiteBalanceGreenSpinBox = 0; customWhiteBalanceGreenLabel = 0; unclipColorLabel = 0; dontStretchPixelsCheckBox = 0; RAWQualityComboBox = 0; RAWQualityLabel = 0; noiseReductionComboBox = 0; NRSpinBox1 = 0; NRSpinBox2 = 0; NRLabel1 = 0; NRLabel2 = 0; enableCACorrectionBox = 0; autoCACorrectionBox = 0; caRedMultSpinBox = 0; caBlueMultSpinBox = 0; caRedMultLabel = 0; caBlueMultLabel = 0; unclipColorComboBox = 0; reconstructLabel = 0; reconstructSpinBox = 0; outputColorSpaceLabel = 0; outputColorSpaceComboBox = 0; demosaicingSettings = 0; whiteBalanceSettings = 0; correctionsSettings = 0; colormanSettings = 0; medianFilterPassesSpinBox = 0; medianFilterPassesLabel = 0; inIccUrlEdit = 0; outIccUrlEdit = 0; inputColorSpaceLabel = 0; inputColorSpaceComboBox = 0; fixColorsHighlightsBox = 0; refineInterpolationBox = 0; noiseReductionLabel = 0; expoCorrectionBox = 0; expoCorrectionShiftSpinBox = 0; expoCorrectionHighlightSpinBox = 0; expoCorrectionShiftLabel = 0; expoCorrectionHighlightLabel = 0; } /** Convert Exposure correction shift E.V value from GUI to Linear value needs by libraw decoder. */ double shiftExpoFromEvToLinear(double ev) const { // From GUI : -2.0EV => 0.25 // +3.0EV => 8.00 return (1.55*ev + 3.35); } /** Convert Exposure correction shift Linear value from liraw decoder to E.V value needs by GUI. */ double shiftExpoFromLinearToEv(double lin) const { // From GUI : 0.25 => -2.0EV // 8.00 => +3.0EV return ((lin-3.35) / 1.55); } public: QWidget* demosaicingSettings; QWidget* whiteBalanceSettings; QWidget* correctionsSettings; QWidget* colormanSettings; QLabel* whiteBalanceLabel; QLabel* customWhiteBalanceLabel; QLabel* customWhiteBalanceGreenLabel; QLabel* brightnessLabel; QLabel* RAWQualityLabel; QLabel* NRLabel1; QLabel* NRLabel2; QLabel* caRedMultLabel; QLabel* caBlueMultLabel; QLabel* unclipColorLabel; QLabel* reconstructLabel; QLabel* inputColorSpaceLabel; QLabel* outputColorSpaceLabel; QLabel* medianFilterPassesLabel; QLabel* noiseReductionLabel; QLabel* expoCorrectionShiftLabel; QLabel* expoCorrectionHighlightLabel; QCheckBox* blackPointCheckBox; QCheckBox* whitePointCheckBox; QCheckBox* sixteenBitsImage; QCheckBox* autoBrightnessBox; QCheckBox* fourColorCheckBox; QCheckBox* dontStretchPixelsCheckBox; QCheckBox* enableCACorrectionBox; QCheckBox* autoCACorrectionBox; QCheckBox* fixColorsHighlightsBox; QCheckBox* refineInterpolationBox; QCheckBox* expoCorrectionBox; DFileSelector* inIccUrlEdit; DFileSelector* outIccUrlEdit; DComboBox* noiseReductionComboBox; DComboBox* whiteBalanceComboBox; DComboBox* RAWQualityComboBox; DComboBox* unclipColorComboBox; DComboBox* inputColorSpaceComboBox; DComboBox* outputColorSpaceComboBox; DIntNumInput* customWhiteBalanceSpinBox; DIntNumInput* reconstructSpinBox; DIntNumInput* blackPointSpinBox; DIntNumInput* whitePointSpinBox; DIntNumInput* NRSpinBox1; DIntNumInput* NRSpinBox2; DIntNumInput* medianFilterPassesSpinBox; DDoubleNumInput* customWhiteBalanceGreenSpinBox; DDoubleNumInput* caRedMultSpinBox; DDoubleNumInput* caBlueMultSpinBox; DDoubleNumInput* brightnessSpinBox; DDoubleNumInput* expoCorrectionShiftSpinBox; DDoubleNumInput* expoCorrectionHighlightSpinBox; }; DRawDecoderWidget::DRawDecoderWidget(QWidget* const parent, int advSettings) : DExpanderBox(parent), d(new Private) { setup(advSettings); } void DRawDecoderWidget::setup(int advSettings) { setObjectName( QLatin1String("DCRawSettings Expander" )); // --------------------------------------------------------------- // DEMOSAICING Settings panel d->demosaicingSettings = new QWidget(this); QGridLayout* const demosaicingLayout = new QGridLayout(d->demosaicingSettings); int line = 0; d->sixteenBitsImage = new QCheckBox(i18nc("@option:check", "16 bits color depth"), d->demosaicingSettings); - d->sixteenBitsImage->setWhatsThis(i18nc("@info:whatsthis", "If enabled, all RAW files will " + d->sixteenBitsImage->setWhatsThis(xi18nc("@info:whatsthis", "If enabled, all RAW files will " "be decoded in 16-bit color depth using a linear gamma curve. To " "prevent dark picture rendering in the editor, it is recommended to " "use Color Management in this mode." "If disabled, all RAW files will be decoded in 8-bit color " "depth with a BT.709 gamma curve and a 99th-percentile white point. " "This mode is faster than 16-bit decoding.")); demosaicingLayout->addWidget(d->sixteenBitsImage, 0, 0, 1, 2); if (advSettings & SIXTEENBITS) { d->sixteenBitsImage->show(); line = 1; } else { d->sixteenBitsImage->hide(); } d->fourColorCheckBox = new QCheckBox(i18nc("@option:check", "Interpolate RGB as four colors"), d->demosaicingSettings); - d->fourColorCheckBox->setWhatsThis(i18nc("@info:whatsthis", "Interpolate RGB as four " + d->fourColorCheckBox->setWhatsThis(xi18nc("@info:whatsthis", "<title>Interpolate RGB as four " "colors" "The default is to assume that all green pixels are the same. " "If even-row green pixels are more sensitive to ultraviolet light " "than odd-row this difference causes a mesh pattern in the output; " "using this option solves this problem with minimal loss of detail." "To resume, this option blurs the image a little, but it " "eliminates false 2x2 mesh patterns with VNG quality method or " "mazes with AHD quality method.")); demosaicingLayout->addWidget(d->fourColorCheckBox, line, 0, 1, line == 0 ? 2 : 3); line++; QLabel* const dcrawVersion = new QLabel(d->demosaicingSettings); dcrawVersion->setAlignment(Qt::AlignRight); dcrawVersion->setToolTip(i18nc("@info:tooltip", "Visit LibRaw project website")); dcrawVersion->setOpenExternalLinks(true); dcrawVersion->setTextFormat(Qt::RichText); dcrawVersion->setTextInteractionFlags(Qt::LinksAccessibleByMouse); dcrawVersion->setText(QString::fromLatin1("%2") .arg(QLatin1String("http://www.libraw.org")) .arg(QString::fromLatin1("libraw %1").arg(DRawDecoder::librawVersion()))); demosaicingLayout->addWidget(dcrawVersion, 0, 2, 1, 1); d->dontStretchPixelsCheckBox = new QCheckBox(i18nc("@option:check", "Do not stretch or rotate pixels"), d->demosaicingSettings); - d->dontStretchPixelsCheckBox->setWhatsThis(i18nc("@info:whatsthis", + d->dontStretchPixelsCheckBox->setWhatsThis(xi18nc("@info:whatsthis", "Do not stretch or rotate pixels" "For Fuji Super CCD cameras, show the image tilted 45 degrees. " "For cameras with non-square pixels, do not stretch the image to " "its correct aspect ratio. In any case, this option guarantees that " "each output pixel corresponds to one RAW pixel.")); demosaicingLayout->addWidget(d->dontStretchPixelsCheckBox, line, 0, 1, 3); line++; d->RAWQualityLabel = new QLabel(i18nc("@label:listbox", "Quality:"), d->demosaicingSettings); d->RAWQualityComboBox = new DComboBox(d->demosaicingSettings); // Original Raw engine demosaicing methods d->RAWQualityComboBox->insertItem(DRawDecoderSettings::BILINEAR, i18nc("@item:inlistbox Quality", "Bilinear")); d->RAWQualityComboBox->insertItem(DRawDecoderSettings::VNG, i18nc("@item:inlistbox Quality", "VNG")); d->RAWQualityComboBox->insertItem(DRawDecoderSettings::PPG, i18nc("@item:inlistbox Quality", "PPG")); d->RAWQualityComboBox->insertItem(DRawDecoderSettings::AHD, i18nc("@item:inlistbox Quality", "AHD")); // Extended demosaicing method from GPL2 pack d->RAWQualityComboBox->insertItem(DRawDecoderSettings::DCB, i18nc("@item:inlistbox Quality", "DCB")); d->RAWQualityComboBox->insertItem(DRawDecoderSettings::PL_AHD, i18nc("@item:inlistbox Quality", "AHD v2")); d->RAWQualityComboBox->insertItem(DRawDecoderSettings::AFD, i18nc("@item:inlistbox Quality", "AFD")); d->RAWQualityComboBox->insertItem(DRawDecoderSettings::VCD, i18nc("@item:inlistbox Quality", "VCD")); d->RAWQualityComboBox->insertItem(DRawDecoderSettings::VCD_AHD, i18nc("@item:inlistbox Quality", "VCD & AHD")); d->RAWQualityComboBox->insertItem(DRawDecoderSettings::LMMSE, i18nc("@item:inlistbox Quality", "LMMSE")); // Extended demosaicing method from GPL3 pack d->RAWQualityComboBox->insertItem(DRawDecoderSettings::AMAZE, i18nc("@item:inlistbox Quality", "AMaZE")); d->RAWQualityComboBox->setDefaultIndex(DRawDecoderSettings::BILINEAR); d->RAWQualityComboBox->setCurrentIndex(DRawDecoderSettings::BILINEAR); - d->RAWQualityComboBox->setWhatsThis(i18nc("@info:whatsthis", "Quality (interpolation)" + d->RAWQualityComboBox->setWhatsThis(xi18nc("@info:whatsthis", "Quality (interpolation)" "Select here the demosaicing method to use when decoding RAW " "images. A demosaicing algorithm is a digital image process used to " "interpolate a complete image from the partial raw data received " "from the color-filtered image sensor, internal to many digital " "cameras, in form of a matrix of colored pixels. Also known as CFA " "interpolation or color reconstruction, another common spelling is " "demosaicing. The following methods are available for demosaicing " "RAW images:" // Original Raw engine demosaicing methods "Bilinear: use " "high-speed but low-quality bilinear interpolation (default - for " "slow computers). In this method, the red value of a non-red pixel " "is computed as the average of the adjacent red pixels, and similarly " "for blue and green." "VNG: use Variable Number " "of Gradients interpolation. This method computes gradients near " "the pixel of interest and uses the lower gradients (representing " "smoother and more similar parts of the image) to make an estimate." "PPG: use Patterned-Pixel-" "Grouping interpolation. Pixel Grouping uses assumptions about " "natural scenery in making estimates. It has fewer color artifacts " "on natural images than the Variable Number of Gradients method." "AHD: use Adaptive " "Homogeneity-Directed interpolation. This method selects the " "direction of interpolation so as to maximize a homogeneity metric, " "thus typically minimizing color artifacts." // Extended demosaicing method "DCB: DCB interpolation from " "linuxphoto.org project." "AHD v2: modified AHD " "interpolation using Variance of Color Differences method." "AFD: Adaptive Filtered " "Demosaicing interpolation through 5 pass median filter from PerfectRaw " "project." "VCD: Variance of Color " "Differences interpolation." "VCD & AHD: Mixed demosaicing " "between VCD and AHD." "LMMSE: color demosaicing via " "directional linear minimum mean-square error estimation interpolation " "from PerfectRaw." "AMaZE: Aliasing Minimization " "interpolation and Zipper Elimination to apply color aberration removal " "from RawTherapee project." "Note: some methods can be unavailable if RAW decoder have been built " "without extension packs.")); demosaicingLayout->addWidget(d->RAWQualityLabel, line, 0, 1, 1); demosaicingLayout->addWidget(d->RAWQualityComboBox, line, 1, 1, 2); line++; d->medianFilterPassesSpinBox = new DIntNumInput(d->demosaicingSettings); d->medianFilterPassesSpinBox->setRange(0, 10, 1); d->medianFilterPassesSpinBox->setDefaultValue(0); d->medianFilterPassesLabel = new QLabel(i18nc("@label:slider", "Pass:"), d->whiteBalanceSettings); - d->medianFilterPassesSpinBox->setWhatsThis( i18nc("@info:whatsthis", "Pass" + d->medianFilterPassesSpinBox->setWhatsThis(xi18nc("@info:whatsthis", "Pass" "Set here the passes used by the median filter applied after " "interpolation to Red-Green and Blue-Green channels." "This setting is only available for specific Quality options: " "Bilinear, " "VNG, PPG, " "AHD, " "DCB, and VCD & AHD.")); demosaicingLayout->addWidget(d->medianFilterPassesLabel, line, 0, 1, 1); demosaicingLayout->addWidget(d->medianFilterPassesSpinBox, line, 1, 1, 2); line++; d->refineInterpolationBox = new QCheckBox(i18nc("@option:check", "Refine interpolation"), d->demosaicingSettings); - d->refineInterpolationBox->setWhatsThis(i18nc("@info:whatsthis", "Refine interpolation" + d->refineInterpolationBox->setWhatsThis(xi18nc("@info:whatsthis", "Refine interpolation" "This setting is available only for few Quality options:" "DCB: turn on " "the enhance interpolated colors filter." "VCD & AHD: turn on the " "enhanced effective color interpolation (EECI) refine to improve " "sharpness.")); demosaicingLayout->addWidget(d->refineInterpolationBox, line, 0, 1, 2); d->medianFilterPassesLabel->setEnabled(false); d->medianFilterPassesSpinBox->setEnabled(false); d->refineInterpolationBox->setEnabled(false); addItem(d->demosaicingSettings, QIcon::fromTheme(QLatin1String("image-x-adobe-dng")).pixmap(16, 16), i18nc("@label", "Demosaicing"), QLatin1String("demosaicing"), true); // --------------------------------------------------------------- // WHITE BALANCE Settings Panel d->whiteBalanceSettings = new QWidget(this); QGridLayout* const whiteBalanceLayout = new QGridLayout(d->whiteBalanceSettings); d->whiteBalanceLabel = new QLabel(i18nc("@label:listbox", "Method:"), d->whiteBalanceSettings); d->whiteBalanceComboBox = new DComboBox(d->whiteBalanceSettings); d->whiteBalanceComboBox->insertItem(DRawDecoderSettings::NONE, i18nc("@item:inlistbox", "Default D65")); d->whiteBalanceComboBox->insertItem(DRawDecoderSettings::CAMERA, i18nc("@item:inlistbox", "Camera")); d->whiteBalanceComboBox->insertItem(DRawDecoderSettings::AUTO, i18nc("@item:inlistbox set while balance automatically", "Automatic")); d->whiteBalanceComboBox->insertItem(DRawDecoderSettings::CUSTOM, i18nc("@item:inlistbox set white balance manually", "Manual")); d->whiteBalanceComboBox->setDefaultIndex(DRawDecoderSettings::CAMERA); - d->whiteBalanceComboBox->setWhatsThis(i18nc("@info:whatsthis", "White Balance" + d->whiteBalanceComboBox->setWhatsThis(xi18nc("@info:whatsthis", "White Balance" "Configure the raw white balance:" "Default D65: " "Use a standard daylight D65 white balance." "Camera: Use the white " "balance specified by the camera. If not available, reverts to " "default neutral white balance." "Automatic: Calculates an " "automatic white balance averaging the entire image." "Manual: Set a custom " "temperature and green level values.")); d->customWhiteBalanceSpinBox = new DIntNumInput(d->whiteBalanceSettings); d->customWhiteBalanceSpinBox->setRange(2000, 12000, 10); d->customWhiteBalanceSpinBox->setDefaultValue(6500); d->customWhiteBalanceLabel = new QLabel(i18nc("@label:slider", "T(K):"), d->whiteBalanceSettings); - d->customWhiteBalanceSpinBox->setWhatsThis( i18nc("@info:whatsthis", "Temperature" + d->customWhiteBalanceSpinBox->setWhatsThis(xi18nc("@info:whatsthis", "Temperature" "Set here the color temperature in Kelvin.")); d->customWhiteBalanceGreenSpinBox = new DDoubleNumInput(d->whiteBalanceSettings); d->customWhiteBalanceGreenSpinBox->setDecimals(2); d->customWhiteBalanceGreenSpinBox->setRange(0.2, 2.5, 0.01); d->customWhiteBalanceGreenSpinBox->setDefaultValue(1.0); d->customWhiteBalanceGreenLabel = new QLabel(i18nc("@label:slider Green component", "Green:"), d->whiteBalanceSettings); - d->customWhiteBalanceGreenSpinBox->setWhatsThis(i18nc("@info:whatsthis", "Set here the " + d->customWhiteBalanceGreenSpinBox->setWhatsThis(xi18nc("@info:whatsthis", "Set here the " "green component to set magenta color cast removal level.")); d->unclipColorLabel = new QLabel(i18nc("@label:listbox", "Highlights:"), d->whiteBalanceSettings); d->unclipColorComboBox = new DComboBox(d->whiteBalanceSettings); d->unclipColorComboBox->insertItem(0, i18nc("@item:inlistbox", "Solid white")); d->unclipColorComboBox->insertItem(1, i18nc("@item:inlistbox", "Unclip")); d->unclipColorComboBox->insertItem(2, i18nc("@item:inlistbox", "Blend")); d->unclipColorComboBox->insertItem(3, i18nc("@item:inlistbox", "Rebuild")); d->unclipColorComboBox->setDefaultIndex(0); - d->unclipColorComboBox->setWhatsThis(i18nc("@info:whatsthis", "Highlights" + d->unclipColorComboBox->setWhatsThis(xi18nc("@info:whatsthis", "Highlights" "Select here the highlight clipping method:" "Solid white: " "clip all highlights to solid white" "Unclip: leave highlights " "unclipped in various shades of pink" "Blend:Blend clipped and " "unclipped values together for a gradual fade to white" "Rebuild: reconstruct " "highlights using a level value")); d->reconstructLabel = new QLabel(i18nc("@label:slider Highlight reconstruct level", "Level:"), d->whiteBalanceSettings); d->reconstructSpinBox = new DIntNumInput(d->whiteBalanceSettings); d->reconstructSpinBox->setRange(0, 6, 1); d->reconstructSpinBox->setDefaultValue(0); - d->reconstructSpinBox->setWhatsThis(i18nc("@info:whatsthis", "Level" + d->reconstructSpinBox->setWhatsThis(xi18nc("@info:whatsthis", "Level" "Specify the reconstruct highlight level. Low values favor " "whites and high values favor colors.")); d->expoCorrectionBox = new QCheckBox(i18nc("@option:check", "Exposure Correction (E.V)"), d->whiteBalanceSettings); - d->expoCorrectionBox->setWhatsThis(i18nc("@info:whatsthis", "Turn on the exposure " + d->expoCorrectionBox->setWhatsThis(xi18nc("@info:whatsthis", "Turn on the exposure " "correction before interpolation.")); d->expoCorrectionShiftLabel = new QLabel(i18nc("@label:slider", "Linear Shift:"), d->whiteBalanceSettings); d->expoCorrectionShiftSpinBox = new DDoubleNumInput(d->whiteBalanceSettings); d->expoCorrectionShiftSpinBox->setDecimals(2); d->expoCorrectionShiftSpinBox->setRange(-2.0, 3.0, 0.01); d->expoCorrectionShiftSpinBox->setDefaultValue(0.0); - d->expoCorrectionShiftSpinBox->setWhatsThis(i18nc("@info:whatsthis", "Shift" + d->expoCorrectionShiftSpinBox->setWhatsThis(xi18nc("@info:whatsthis", "Shift" "Linear Shift of exposure correction before interpolation in E.V")); d->expoCorrectionHighlightLabel = new QLabel(i18nc("@label:slider", "Highlight:"), d->whiteBalanceSettings); d->expoCorrectionHighlightSpinBox = new DDoubleNumInput(d->whiteBalanceSettings); d->expoCorrectionHighlightSpinBox->setDecimals(2); d->expoCorrectionHighlightSpinBox->setRange(0.0, 1.0, 0.01); d->expoCorrectionHighlightSpinBox->setDefaultValue(0.0); - d->expoCorrectionHighlightSpinBox->setWhatsThis(i18nc("@info:whatsthis", "Highlight" + d->expoCorrectionHighlightSpinBox->setWhatsThis(xi18nc("@info:whatsthis", "Highlight" "Amount of highlight preservation for exposure correction " "before interpolation in E.V. Only take effect if Shift Correction is > 1.0 E.V")); d->fixColorsHighlightsBox = new QCheckBox(i18nc("@option:check", "Correct false colors in highlights"), d->whiteBalanceSettings); - d->fixColorsHighlightsBox->setWhatsThis(i18nc("@info:whatsthis", "If enabled, images with " + d->fixColorsHighlightsBox->setWhatsThis(xi18nc("@info:whatsthis", "If enabled, images with " "overblown channels are processed much more accurately, without " "'pink clouds' (and blue highlights under tungsten lamps).")); d->autoBrightnessBox = new QCheckBox(i18nc("@option:check", "Auto Brightness"), d->whiteBalanceSettings); - d->autoBrightnessBox->setWhatsThis(i18nc("@info:whatsthis", "If disable, use a fixed white level " + d->autoBrightnessBox->setWhatsThis(xi18nc("@info:whatsthis", "If disable, use a fixed white level " "and ignore the image histogram to adjust brightness.")); d->brightnessLabel = new QLabel(i18nc("@label:slider", "Brightness:"), d->whiteBalanceSettings); d->brightnessSpinBox = new DDoubleNumInput(d->whiteBalanceSettings); d->brightnessSpinBox->setDecimals(2); d->brightnessSpinBox->setRange(0.0, 10.0, 0.01); d->brightnessSpinBox->setDefaultValue(1.0); - d->brightnessSpinBox->setWhatsThis(i18nc("@info:whatsthis", "Brightness" + d->brightnessSpinBox->setWhatsThis(xi18nc("@info:whatsthis", "Brightness" "Specify the brightness level of output image. The default " "value is 1.0 (works in 8-bit mode only).")); if (! (advSettings & POSTPROCESSING)) { d->brightnessLabel->hide(); d->brightnessSpinBox->hide(); } d->blackPointCheckBox = new QCheckBox(i18nc("@option:check Black point", "Black:"), d->whiteBalanceSettings); - d->blackPointCheckBox->setWhatsThis(i18nc("@info:whatsthis", "Black point" + d->blackPointCheckBox->setWhatsThis(xi18nc("@info:whatsthis", "Black point" "Use a specific black point value to decode RAW pictures. If " "you set this option to off, the Black Point value will be " "automatically computed.")); d->blackPointSpinBox = new DIntNumInput(d->whiteBalanceSettings); d->blackPointSpinBox->setRange(0, 1000, 1); d->blackPointSpinBox->setDefaultValue(0); - d->blackPointSpinBox->setWhatsThis(i18nc("@info:whatsthis", "Black point value" + d->blackPointSpinBox->setWhatsThis(xi18nc("@info:whatsthis", "Black point value" "Specify specific black point value of the output image.")); d->whitePointCheckBox = new QCheckBox(i18nc("@option:check White point", "White:"), d->whiteBalanceSettings); - d->whitePointCheckBox->setWhatsThis(i18nc("@info:whatsthis", "White point" + d->whitePointCheckBox->setWhatsThis(xi18nc("@info:whatsthis", "White point" "Use a specific white point value to decode RAW pictures. If " "you set this option to off, the White Point value will be " "automatically computed.")); d->whitePointSpinBox = new DIntNumInput(d->whiteBalanceSettings); d->whitePointSpinBox->setRange(0, 20000, 1); d->whitePointSpinBox->setDefaultValue(0); - d->whitePointSpinBox->setWhatsThis(i18nc("@info:whatsthis", "White point value" + d->whitePointSpinBox->setWhatsThis(xi18nc("@info:whatsthis", "White point value" "Specify specific white point value of the output image.")); if (! (advSettings & BLACKWHITEPOINTS)) { d->blackPointCheckBox->hide(); d->blackPointSpinBox->hide(); d->whitePointCheckBox->hide(); d->whitePointSpinBox->hide(); } const int spacing = QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing); whiteBalanceLayout->addWidget(d->whiteBalanceLabel, 0, 0, 1, 1); whiteBalanceLayout->addWidget(d->whiteBalanceComboBox, 0, 1, 1, 2); whiteBalanceLayout->addWidget(d->customWhiteBalanceLabel, 1, 0, 1, 1); whiteBalanceLayout->addWidget(d->customWhiteBalanceSpinBox, 1, 1, 1, 2); whiteBalanceLayout->addWidget(d->customWhiteBalanceGreenLabel, 2, 0, 1, 1); whiteBalanceLayout->addWidget(d->customWhiteBalanceGreenSpinBox, 2, 1, 1, 2); whiteBalanceLayout->addWidget(d->unclipColorLabel, 3, 0, 1, 1); whiteBalanceLayout->addWidget(d->unclipColorComboBox, 3, 1, 1, 2); whiteBalanceLayout->addWidget(d->reconstructLabel, 4, 0, 1, 1); whiteBalanceLayout->addWidget(d->reconstructSpinBox, 4, 1, 1, 2); whiteBalanceLayout->addWidget(d->expoCorrectionBox, 5, 0, 1, 2); whiteBalanceLayout->addWidget(d->expoCorrectionShiftLabel, 6, 0, 1, 1); whiteBalanceLayout->addWidget(d->expoCorrectionShiftSpinBox, 6, 1, 1, 2); whiteBalanceLayout->addWidget(d->expoCorrectionHighlightLabel, 7, 0, 1, 1); whiteBalanceLayout->addWidget(d->expoCorrectionHighlightSpinBox, 7, 1, 1, 2); whiteBalanceLayout->addWidget(d->fixColorsHighlightsBox, 8, 0, 1, 3); whiteBalanceLayout->addWidget(d->autoBrightnessBox, 9, 0, 1, 3); whiteBalanceLayout->addWidget(d->brightnessLabel, 10, 0, 1, 1); whiteBalanceLayout->addWidget(d->brightnessSpinBox, 10, 1, 1, 2); whiteBalanceLayout->addWidget(d->blackPointCheckBox, 11, 0, 1, 1); whiteBalanceLayout->addWidget(d->blackPointSpinBox, 11, 1, 1, 2); whiteBalanceLayout->addWidget(d->whitePointCheckBox, 12, 0, 1, 1); whiteBalanceLayout->addWidget(d->whitePointSpinBox, 12, 1, 1, 2); whiteBalanceLayout->setContentsMargins(spacing, spacing, spacing, spacing); whiteBalanceLayout->setSpacing(spacing); addItem(d->whiteBalanceSettings, QIcon::fromTheme(QLatin1String("bordertool")).pixmap(16, 16), i18nc("@label", "White Balance"), QLatin1String("whitebalance"), true); // --------------------------------------------------------------- // CORRECTIONS Settings panel d->correctionsSettings = new QWidget(this); QGridLayout* const correctionsLayout = new QGridLayout(d->correctionsSettings); d->noiseReductionLabel = new QLabel(i18nc("@label:listbox", "Noise reduction:"), d->correctionsSettings); d->noiseReductionComboBox = new DComboBox(d->colormanSettings); d->noiseReductionComboBox->insertItem(DRawDecoderSettings::NONR, i18nc("@item:inlistbox Noise Reduction", "None")); d->noiseReductionComboBox->insertItem(DRawDecoderSettings::WAVELETSNR, i18nc("@item:inlistbox Noise Reduction", "Wavelets")); d->noiseReductionComboBox->insertItem(DRawDecoderSettings::FBDDNR, i18nc("@item:inlistbox Noise Reduction", "FBDD")); d->noiseReductionComboBox->insertItem(DRawDecoderSettings::LINENR, i18nc("@item:inlistbox Noise Reduction", "CFA Line Denoise")); d->noiseReductionComboBox->insertItem(DRawDecoderSettings::IMPULSENR, i18nc("@item:inlistbox Noise Reduction", "Impulse Denoise")); d->noiseReductionComboBox->setDefaultIndex(DRawDecoderSettings::NONR); - d->noiseReductionComboBox->setWhatsThis(i18nc("@info:whatsthis", "Noise Reduction" + d->noiseReductionComboBox->setWhatsThis(xi18nc("@info:whatsthis", "Noise Reduction" "Select here the noise reduction method to apply during RAW " "decoding." "None: no " "noise reduction." "Wavelets: wavelets " "correction to erase noise while preserving real detail. It's " "applied after interpolation." "FBDD: Fake Before " "Demosaicing Denoising noise reduction. It's applied before " "interpolation." "CFA Line Denoise: Banding " "noise suppression. It's applied after interpolation." "Impulse Denoise: Impulse " "noise suppression. It's applied after interpolation.")); d->NRSpinBox1 = new DIntNumInput(d->correctionsSettings); d->NRSpinBox1->setRange(100, 1000, 1); d->NRSpinBox1->setDefaultValue(100); d->NRLabel1 = new QLabel(d->correctionsSettings); d->NRSpinBox2 = new DIntNumInput(d->correctionsSettings); d->NRSpinBox2->setRange(100, 1000, 1); d->NRSpinBox2->setDefaultValue(100); d->NRLabel2 = new QLabel(d->correctionsSettings); d->enableCACorrectionBox = new QCheckBox(i18nc("@option:check", "Enable Chromatic Aberration correction"), d->correctionsSettings); - d->enableCACorrectionBox->setWhatsThis(i18nc("@info:whatsthis", "Enable Chromatic " + d->enableCACorrectionBox->setWhatsThis(xi18nc("@info:whatsthis", "<title>Enable Chromatic " "Aberration correction" "Enlarge the raw red-green and blue-yellow axis by the given " "factors (automatic by default).")); d->autoCACorrectionBox = new QCheckBox(i18nc("@option:check", "Automatic color axis adjustments"), d->correctionsSettings); - d->autoCACorrectionBox->setWhatsThis(i18nc("@info:whatsthis", "Automatic Chromatic " + d->autoCACorrectionBox->setWhatsThis(xi18nc("@info:whatsthis", "<title>Automatic Chromatic " "Aberration correction" "If this option is turned on, it will try to shift image " "channels slightly and evaluate Chromatic Aberration change. Note " "that if you shot blue-red pattern, the method may fail. In this " "case, disable this option and tune manually color factors.")); d->caRedMultLabel = new QLabel(i18nc("@label:slider", "Red-Green:"), d->correctionsSettings); d->caRedMultSpinBox = new DDoubleNumInput(d->correctionsSettings); d->caRedMultSpinBox->setDecimals(1); d->caRedMultSpinBox->setRange(-4.0, 4.0, 0.1); d->caRedMultSpinBox->setDefaultValue(0.0); - d->caRedMultSpinBox->setWhatsThis(i18nc("@info:whatsthis", "Red-Green multiplier" + d->caRedMultSpinBox->setWhatsThis(xi18nc("@info:whatsthis", "Red-Green multiplier" "Set here the amount of correction on red-green axis")); d->caBlueMultLabel = new QLabel(i18nc("@label:slider", "Blue-Yellow:"), d->correctionsSettings); d->caBlueMultSpinBox = new DDoubleNumInput(d->correctionsSettings); d->caBlueMultSpinBox->setDecimals(1); d->caBlueMultSpinBox->setRange(-4.0, 4.0, 0.1); d->caBlueMultSpinBox->setDefaultValue(0.0); - d->caBlueMultSpinBox->setWhatsThis(i18nc("@info:whatsthis", "Blue-Yellow multiplier" + d->caBlueMultSpinBox->setWhatsThis(xi18nc("@info:whatsthis", "Blue-Yellow multiplier" "Set here the amount of correction on blue-yellow axis")); correctionsLayout->addWidget(d->noiseReductionLabel, 0, 0, 1, 1); correctionsLayout->addWidget(d->noiseReductionComboBox, 0, 1, 1, 2); correctionsLayout->addWidget(d->NRLabel1, 1, 0, 1, 1); correctionsLayout->addWidget(d->NRSpinBox1, 1, 1, 1, 2); correctionsLayout->addWidget(d->NRLabel2, 2, 0, 1, 1); correctionsLayout->addWidget(d->NRSpinBox2, 2, 1, 1, 2); correctionsLayout->addWidget(d->enableCACorrectionBox, 3, 0, 1, 3); correctionsLayout->addWidget(d->autoCACorrectionBox, 4, 0, 1, 3); correctionsLayout->addWidget(d->caRedMultLabel, 5, 0, 1, 1); correctionsLayout->addWidget(d->caRedMultSpinBox, 5, 1, 1, 2); correctionsLayout->addWidget(d->caBlueMultLabel, 6, 0, 1, 1); correctionsLayout->addWidget(d->caBlueMultSpinBox, 6, 1, 1, 2); correctionsLayout->setRowStretch(7, 10); correctionsLayout->setContentsMargins(spacing, spacing, spacing, spacing); correctionsLayout->setSpacing(spacing); addItem(d->correctionsSettings, QIcon::fromTheme(QLatin1String("document-edit")).pixmap(16, 16), i18nc("@label", "Corrections"), QLatin1String("corrections"), false); // --------------------------------------------------------------- // COLOR MANAGEMENT Settings panel d->colormanSettings = new QWidget(this); QGridLayout* const colormanLayout = new QGridLayout(d->colormanSettings); d->inputColorSpaceLabel = new QLabel(i18nc("@label:listbox", "Camera Profile:"), d->colormanSettings); d->inputColorSpaceComboBox = new DComboBox(d->colormanSettings); d->inputColorSpaceComboBox->insertItem(DRawDecoderSettings::NOINPUTCS, i18nc("@item:inlistbox Camera Profile", "None")); d->inputColorSpaceComboBox->insertItem(DRawDecoderSettings::EMBEDDED, i18nc("@item:inlistbox Camera Profile", "Embedded")); d->inputColorSpaceComboBox->insertItem(DRawDecoderSettings::CUSTOMINPUTCS, i18nc("@item:inlistbox Camera Profile", "Custom")); d->inputColorSpaceComboBox->setDefaultIndex(DRawDecoderSettings::NOINPUTCS); - d->inputColorSpaceComboBox->setWhatsThis(i18nc("@info:whatsthis", "Camera Profile" + d->inputColorSpaceComboBox->setWhatsThis(xi18nc("@info:whatsthis", "Camera Profile" "Select here the input color space used to decode RAW data." "None: no " "input color profile is used during RAW decoding." "Embedded: use embedded " "color profile from RAW file, if it exists." "Custom: use a custom " "input color space profile.")); d->inIccUrlEdit = new DFileSelector(d->colormanSettings); d->inIccUrlEdit->setFileDlgMode(DFileDialog::ExistingFile); d->inIccUrlEdit->setFileDlgFilter(i18n("ICC Files (*.icc *.icm)")); d->outputColorSpaceLabel = new QLabel(i18nc("@label:listbox", "Workspace:"), d->colormanSettings); d->outputColorSpaceComboBox = new DComboBox( d->colormanSettings ); d->outputColorSpaceComboBox->insertItem(DRawDecoderSettings::RAWCOLOR, i18nc("@item:inlistbox Workspace", "Raw (no profile)")); d->outputColorSpaceComboBox->insertItem(DRawDecoderSettings::SRGB, i18nc("@item:inlistbox Workspace", "sRGB")); d->outputColorSpaceComboBox->insertItem(DRawDecoderSettings::ADOBERGB, i18nc("@item:inlistbox Workspace", "Adobe RGB")); d->outputColorSpaceComboBox->insertItem(DRawDecoderSettings::WIDEGAMMUT, i18nc("@item:inlistbox Workspace", "Wide Gamut")); d->outputColorSpaceComboBox->insertItem(DRawDecoderSettings::PROPHOTO, i18nc("@item:inlistbox Workspace", "Pro-Photo")); d->outputColorSpaceComboBox->insertItem(DRawDecoderSettings::CUSTOMOUTPUTCS, i18nc("@item:inlistbox Workspace", "Custom")); d->outputColorSpaceComboBox->setDefaultIndex(DRawDecoderSettings::SRGB); - d->outputColorSpaceComboBox->setWhatsThis(i18nc("@info:whatsthis", "Workspace" + d->outputColorSpaceComboBox->setWhatsThis(xi18nc("@info:whatsthis", "Workspace" "Select here the output color space used to decode RAW data." "Raw (linear): " "in this mode, no output color space is used during RAW decoding." "sRGB: this is an RGB " "color space, created cooperatively by Hewlett-Packard and " "Microsoft. It is the best choice for images destined for the Web " "and portrait photography." "Adobe RGB: this color " "space is an extended RGB color space, developed by Adobe. It is " "used for photography applications such as advertising and fine " "art." "Wide Gamut: this color " "space is an expanded version of the Adobe RGB color space." "Pro-Photo: this color " "space is an RGB color space, developed by Kodak, that offers an " "especially large gamut designed for use with photographic outputs " "in mind." "Custom: use a custom " "output color space profile.")); d->outIccUrlEdit = new DFileSelector(d->colormanSettings); d->outIccUrlEdit->setFileDlgMode(DFileDialog::ExistingFile); d->outIccUrlEdit->setFileDlgFilter(i18n("ICC Files (*.icc *.icm)")); colormanLayout->addWidget(d->inputColorSpaceLabel, 0, 0, 1, 1); colormanLayout->addWidget(d->inputColorSpaceComboBox, 0, 1, 1, 2); colormanLayout->addWidget(d->inIccUrlEdit, 1, 0, 1, 3); colormanLayout->addWidget(d->outputColorSpaceLabel, 2, 0, 1, 1); colormanLayout->addWidget(d->outputColorSpaceComboBox, 2, 1, 1, 2); colormanLayout->addWidget(d->outIccUrlEdit, 3, 0, 1, 3); colormanLayout->setRowStretch(4, 10); colormanLayout->setContentsMargins(spacing, spacing, spacing, spacing); colormanLayout->setSpacing(spacing); addItem(d->colormanSettings, QIcon::fromTheme(QLatin1String("preferences-desktop-display-color")).pixmap(16, 16), i18nc("@label", "Color Management"), QLatin1String("colormanagement"), false); if (! (advSettings & COLORSPACE)) { removeItem(COLORMANAGEMENT); } addStretch(); // --------------------------------------------------------------- connect(d->unclipColorComboBox, static_cast(&DComboBox::activated), this, &DRawDecoderWidget::slotUnclipColorActivated); connect(d->whiteBalanceComboBox, static_cast(&DComboBox::activated), this, &DRawDecoderWidget::slotWhiteBalanceToggled); connect(d->noiseReductionComboBox, static_cast(&DComboBox::activated), this, &DRawDecoderWidget::slotNoiseReductionChanged); connect(d->enableCACorrectionBox, &QCheckBox::toggled, this, &DRawDecoderWidget::slotCACorrectionToggled); connect(d->autoCACorrectionBox, &QCheckBox::toggled, this, &DRawDecoderWidget::slotAutoCAToggled); connect(d->blackPointCheckBox, SIGNAL(toggled(bool)), d->blackPointSpinBox, SLOT(setEnabled(bool))); connect(d->whitePointCheckBox, SIGNAL(toggled(bool)), d->whitePointSpinBox, SLOT(setEnabled(bool))); connect(d->sixteenBitsImage, &QCheckBox::toggled, this, &DRawDecoderWidget::slotsixteenBitsImageToggled); connect(d->inputColorSpaceComboBox, static_cast(&DComboBox::activated), this, &DRawDecoderWidget::slotInputColorSpaceChanged); connect(d->outputColorSpaceComboBox, static_cast(&DComboBox::activated), this, &DRawDecoderWidget::slotOutputColorSpaceChanged); connect(d->expoCorrectionBox, &QCheckBox::toggled, this, &DRawDecoderWidget::slotExposureCorrectionToggled); connect(d->expoCorrectionShiftSpinBox, &DDoubleNumInput::valueChanged, this, &DRawDecoderWidget::slotExpoCorrectionShiftChanged); // Wrapper to emit signal when something is changed in settings. connect(d->inIccUrlEdit->lineEdit(), &QLineEdit::textChanged, this, &DRawDecoderWidget::signalSettingsChanged); connect(d->outIccUrlEdit->lineEdit(), &QLineEdit::textChanged, this, &DRawDecoderWidget::signalSettingsChanged); connect(d->whiteBalanceComboBox, static_cast(&DComboBox::activated), this, &DRawDecoderWidget::signalSettingsChanged); connect(d->RAWQualityComboBox, static_cast(&DComboBox::activated), this, &DRawDecoderWidget::slotRAWQualityChanged); connect(d->unclipColorComboBox, static_cast(&DComboBox::activated), this, &DRawDecoderWidget::signalSettingsChanged); connect(d->inputColorSpaceComboBox, static_cast(&DComboBox::activated), this, &DRawDecoderWidget::signalSettingsChanged); connect(d->outputColorSpaceComboBox, static_cast(&DComboBox::activated), this, &DRawDecoderWidget::signalSettingsChanged); connect(d->blackPointCheckBox, &QCheckBox::toggled, this, &DRawDecoderWidget::signalSettingsChanged); connect(d->whitePointCheckBox, &QCheckBox::toggled, this, &DRawDecoderWidget::signalSettingsChanged); connect(d->sixteenBitsImage, &QCheckBox::toggled, this, &DRawDecoderWidget::signalSettingsChanged); connect(d->fixColorsHighlightsBox, &QCheckBox::toggled, this, &DRawDecoderWidget::signalSettingsChanged); connect(d->autoBrightnessBox, &QCheckBox::toggled, this, &DRawDecoderWidget::signalSettingsChanged); connect(d->fourColorCheckBox, &QCheckBox::toggled, this, &DRawDecoderWidget::signalSettingsChanged); connect(d->dontStretchPixelsCheckBox, &QCheckBox::toggled, this, &DRawDecoderWidget::signalSettingsChanged); connect(d->refineInterpolationBox, &QCheckBox::toggled, this, &DRawDecoderWidget::signalSettingsChanged); connect(d->customWhiteBalanceSpinBox, &DIntNumInput::valueChanged, this, &DRawDecoderWidget::signalSettingsChanged); connect(d->reconstructSpinBox, &DIntNumInput::valueChanged, this, &DRawDecoderWidget::signalSettingsChanged); connect(d->blackPointSpinBox, &DIntNumInput::valueChanged, this, &DRawDecoderWidget::signalSettingsChanged); connect(d->whitePointSpinBox, &DIntNumInput::valueChanged, this, &DRawDecoderWidget::signalSettingsChanged); connect(d->NRSpinBox1, &DIntNumInput::valueChanged, this, &DRawDecoderWidget::signalSettingsChanged); connect(d->NRSpinBox2, &DIntNumInput::valueChanged, this, &DRawDecoderWidget::signalSettingsChanged); connect(d->medianFilterPassesSpinBox, &DIntNumInput::valueChanged, this, &DRawDecoderWidget::signalSettingsChanged); connect(d->customWhiteBalanceGreenSpinBox, &DDoubleNumInput::valueChanged, this, &DRawDecoderWidget::signalSettingsChanged); connect(d->caRedMultSpinBox, &DDoubleNumInput::valueChanged, this, &DRawDecoderWidget::signalSettingsChanged); connect(d->caBlueMultSpinBox, &DDoubleNumInput::valueChanged, this, &DRawDecoderWidget::signalSettingsChanged); connect(d->brightnessSpinBox, &DDoubleNumInput::valueChanged, this, &DRawDecoderWidget::signalSettingsChanged); connect(d->expoCorrectionHighlightSpinBox, &DDoubleNumInput::valueChanged, this, &DRawDecoderWidget::signalSettingsChanged); } DRawDecoderWidget::~DRawDecoderWidget() { delete d; } void DRawDecoderWidget::updateMinimumWidth() { int width = 0; for (int i = 0; i < count(); i++) { if (widget(i)->width() > width) { width = widget(i)->width(); } } setMinimumWidth(width); } DFileSelector* DRawDecoderWidget::inputProfileUrlEdit() const { return d->inIccUrlEdit; } DFileSelector* DRawDecoderWidget::outputProfileUrlEdit() const { return d->outIccUrlEdit; } void DRawDecoderWidget::resetToDefault() { setSettings(DRawDecoderSettings()); } void DRawDecoderWidget::slotsixteenBitsImageToggled(bool b) { setEnabledBrightnessSettings(!b); emit signalSixteenBitsImageToggled(d->sixteenBitsImage->isChecked()); } void DRawDecoderWidget::slotWhiteBalanceToggled(int v) { if (v == 3) { d->customWhiteBalanceSpinBox->setEnabled(true); d->customWhiteBalanceGreenSpinBox->setEnabled(true); d->customWhiteBalanceLabel->setEnabled(true); d->customWhiteBalanceGreenLabel->setEnabled(true); } else { d->customWhiteBalanceSpinBox->setEnabled(false); d->customWhiteBalanceGreenSpinBox->setEnabled(false); d->customWhiteBalanceLabel->setEnabled(false); d->customWhiteBalanceGreenLabel->setEnabled(false); } } void DRawDecoderWidget::slotUnclipColorActivated(int v) { if (v == 3) // Reconstruct Highlight method { d->reconstructLabel->setEnabled(true); d->reconstructSpinBox->setEnabled(true); } else { d->reconstructLabel->setEnabled(false); d->reconstructSpinBox->setEnabled(false); } } void DRawDecoderWidget::slotNoiseReductionChanged(int item) { d->NRSpinBox1->setEnabled(true); d->NRLabel1->setEnabled(true); d->NRSpinBox2->setEnabled(true); d->NRLabel2->setEnabled(true); d->NRLabel1->setText(i18nc("@label", "Threshold:")); - d->NRSpinBox1->setWhatsThis(i18nc("@info:whatsthis", "Threshold" + d->NRSpinBox1->setWhatsThis(xi18nc("@info:whatsthis", "Threshold" "Set here the noise reduction threshold value to use.")); switch(item) { case DRawDecoderSettings::WAVELETSNR: case DRawDecoderSettings::FBDDNR: case DRawDecoderSettings::LINENR: d->NRSpinBox2->setVisible(false); d->NRLabel2->setVisible(false); break; case DRawDecoderSettings::IMPULSENR: d->NRLabel1->setText(i18nc("@label", "Luminance:")); - d->NRSpinBox1->setWhatsThis(i18nc("@info:whatsthis", "Luminance" + d->NRSpinBox1->setWhatsThis(xi18nc("@info:whatsthis", "Luminance" "Amount of Luminance impulse noise reduction.")); d->NRLabel2->setText(i18nc("@label", "Chrominance:")); - d->NRSpinBox2->setWhatsThis(i18nc("@info:whatsthis", "Chrominance" + d->NRSpinBox2->setWhatsThis(xi18nc("@info:whatsthis", "Chrominance" "Amount of Chrominance impulse noise reduction.")); d->NRSpinBox2->setVisible(true); d->NRLabel2->setVisible(true); break; default: d->NRSpinBox1->setEnabled(false); d->NRLabel1->setEnabled(false); d->NRSpinBox2->setEnabled(false); d->NRLabel2->setEnabled(false); d->NRSpinBox2->setVisible(false); d->NRLabel2->setVisible(false); break; } emit signalSettingsChanged(); } void DRawDecoderWidget::slotCACorrectionToggled(bool b) { d->autoCACorrectionBox->setEnabled(b); slotAutoCAToggled(d->autoCACorrectionBox->isChecked()); } void DRawDecoderWidget::slotAutoCAToggled(bool b) { if (b) { d->caRedMultSpinBox->setValue(0.0); d->caBlueMultSpinBox->setValue(0.0); } bool mult = (!b) && (d->autoCACorrectionBox->isEnabled()); d->caRedMultSpinBox->setEnabled(mult); d->caBlueMultSpinBox->setEnabled(mult); d->caRedMultLabel->setEnabled(mult); d->caBlueMultLabel->setEnabled(mult); emit signalSettingsChanged(); } void DRawDecoderWidget::slotExposureCorrectionToggled(bool b) { d->expoCorrectionShiftLabel->setEnabled(b); d->expoCorrectionShiftSpinBox->setEnabled(b); d->expoCorrectionHighlightLabel->setEnabled(b); d->expoCorrectionHighlightSpinBox->setEnabled(b); slotExpoCorrectionShiftChanged(d->expoCorrectionShiftSpinBox->value()); } void DRawDecoderWidget::slotExpoCorrectionShiftChanged(double ev) { // Only enable Highligh exposure correction if Shift correction is >= 1.0, else this settings do not take effect. bool b = (ev >= 1.0); d->expoCorrectionHighlightLabel->setEnabled(b); d->expoCorrectionHighlightSpinBox->setEnabled(b); emit signalSettingsChanged(); } void DRawDecoderWidget::slotInputColorSpaceChanged(int item) { d->inIccUrlEdit->setEnabled(item == DRawDecoderSettings::CUSTOMINPUTCS); } void DRawDecoderWidget::slotOutputColorSpaceChanged(int item) { d->outIccUrlEdit->setEnabled(item == DRawDecoderSettings::CUSTOMOUTPUTCS); } void DRawDecoderWidget::slotRAWQualityChanged(int quality) { switch (quality) { case DRawDecoderSettings::DCB: case DRawDecoderSettings::VCD_AHD: // These options can be only avaialble if Libraw use GPL2 pack. d->medianFilterPassesLabel->setEnabled(true); d->medianFilterPassesSpinBox->setEnabled(true); d->refineInterpolationBox->setEnabled(true); break; case DRawDecoderSettings::PL_AHD: case DRawDecoderSettings::AFD: case DRawDecoderSettings::VCD: case DRawDecoderSettings::LMMSE: case DRawDecoderSettings::AMAZE: d->medianFilterPassesLabel->setEnabled(false); d->medianFilterPassesSpinBox->setEnabled(false); d->refineInterpolationBox->setEnabled(false); break; default: // BILINEAR, VNG, PPG, AHD d->medianFilterPassesLabel->setEnabled(true); d->medianFilterPassesSpinBox->setEnabled(true); d->refineInterpolationBox->setEnabled(false); break; } emit signalSettingsChanged(); } void DRawDecoderWidget::setEnabledBrightnessSettings(bool b) { d->brightnessLabel->setEnabled(b); d->brightnessSpinBox->setEnabled(b); } bool DRawDecoderWidget::brightnessSettingsIsEnabled() const { return d->brightnessSpinBox->isEnabled(); } void DRawDecoderWidget::setSettings(const DRawDecoderSettings& settings) { d->sixteenBitsImage->setChecked(settings.sixteenBitsImage); switch(settings.whiteBalance) { case DRawDecoderSettings::CAMERA: d->whiteBalanceComboBox->setCurrentIndex(1); break; case DRawDecoderSettings::AUTO: d->whiteBalanceComboBox->setCurrentIndex(2); break; case DRawDecoderSettings::CUSTOM: d->whiteBalanceComboBox->setCurrentIndex(3); break; default: d->whiteBalanceComboBox->setCurrentIndex(0); break; } slotWhiteBalanceToggled(d->whiteBalanceComboBox->currentIndex()); d->customWhiteBalanceSpinBox->setValue(settings.customWhiteBalance); d->customWhiteBalanceGreenSpinBox->setValue(settings.customWhiteBalanceGreen); d->fourColorCheckBox->setChecked(settings.RGBInterpolate4Colors); d->autoBrightnessBox->setChecked(settings.autoBrightness); d->fixColorsHighlightsBox->setChecked(settings.fixColorsHighlights); switch(settings.unclipColors) { case 0: d->unclipColorComboBox->setCurrentIndex(0); break; case 1: d->unclipColorComboBox->setCurrentIndex(1); break; case 2: d->unclipColorComboBox->setCurrentIndex(2); break; default: // Reconstruct Highlight method d->unclipColorComboBox->setCurrentIndex(3); d->reconstructSpinBox->setValue(settings.unclipColors-3); break; } slotUnclipColorActivated(d->unclipColorComboBox->currentIndex()); d->dontStretchPixelsCheckBox->setChecked(settings.DontStretchPixels); d->brightnessSpinBox->setValue(settings.brightness); d->blackPointCheckBox->setChecked(settings.enableBlackPoint); d->blackPointSpinBox->setEnabled(settings.enableBlackPoint); d->blackPointSpinBox->setValue(settings.blackPoint); d->whitePointCheckBox->setChecked(settings.enableWhitePoint); d->whitePointSpinBox->setEnabled(settings.enableWhitePoint); d->whitePointSpinBox->setValue(settings.whitePoint); int q = settings.RAWQuality; d->RAWQualityComboBox->setCurrentIndex(q); switch(q) { case DRawDecoderSettings::DCB: d->medianFilterPassesSpinBox->setValue(settings.dcbIterations); d->refineInterpolationBox->setChecked(settings.dcbEnhanceFl); break; case DRawDecoderSettings::VCD_AHD: d->medianFilterPassesSpinBox->setValue(settings.eeciRefine); d->refineInterpolationBox->setChecked(settings.eeciRefine); break; default: d->medianFilterPassesSpinBox->setValue(settings.medianFilterPasses); d->refineInterpolationBox->setChecked(false); // option not used. break; } slotRAWQualityChanged(q); d->inputColorSpaceComboBox->setCurrentIndex((int)settings.inputColorSpace); slotInputColorSpaceChanged((int)settings.inputColorSpace); d->outputColorSpaceComboBox->setCurrentIndex((int)settings.outputColorSpace); slotOutputColorSpaceChanged((int)settings.outputColorSpace); d->noiseReductionComboBox->setCurrentIndex(settings.NRType); slotNoiseReductionChanged(settings.NRType); d->NRSpinBox1->setValue(settings.NRThreshold); d->NRSpinBox2->setValue(settings.NRChroThreshold); d->enableCACorrectionBox->setChecked(settings.enableCACorrection); d->caRedMultSpinBox->setValue(settings.caMultiplier[0]); d->caBlueMultSpinBox->setValue(settings.caMultiplier[1]); d->autoCACorrectionBox->setChecked((settings.caMultiplier[0] == 0.0) && (settings.caMultiplier[1] == 0.0)); slotCACorrectionToggled(settings.enableCACorrection); d->expoCorrectionBox->setChecked(settings.expoCorrection); slotExposureCorrectionToggled(settings.expoCorrection); d->expoCorrectionShiftSpinBox->setValue(d->shiftExpoFromLinearToEv(settings.expoCorrectionShift)); d->expoCorrectionHighlightSpinBox->setValue(settings.expoCorrectionHighlight); d->inIccUrlEdit->setFileDlgPath(settings.inputProfile); d->outIccUrlEdit->setFileDlgPath(settings.outputProfile); } DRawDecoderSettings DRawDecoderWidget::settings() const { DRawDecoderSettings prm; prm.sixteenBitsImage = d->sixteenBitsImage->isChecked(); switch(d->whiteBalanceComboBox->currentIndex()) { case 1: prm.whiteBalance = DRawDecoderSettings::CAMERA; break; case 2: prm.whiteBalance = DRawDecoderSettings::AUTO; break; case 3: prm.whiteBalance = DRawDecoderSettings::CUSTOM; break; default: prm.whiteBalance = DRawDecoderSettings::NONE; break; } prm.customWhiteBalance = d->customWhiteBalanceSpinBox->value(); prm.customWhiteBalanceGreen = d->customWhiteBalanceGreenSpinBox->value(); prm.RGBInterpolate4Colors = d->fourColorCheckBox->isChecked(); prm.autoBrightness = d->autoBrightnessBox->isChecked(); prm.fixColorsHighlights = d->fixColorsHighlightsBox->isChecked(); switch(d->unclipColorComboBox->currentIndex()) { case 0: prm.unclipColors = 0; break; case 1: prm.unclipColors = 1; break; case 2: prm.unclipColors = 2; break; default: // Reconstruct Highlight method prm.unclipColors = d->reconstructSpinBox->value()+3; break; } prm.DontStretchPixels = d->dontStretchPixelsCheckBox->isChecked(); prm.brightness = d->brightnessSpinBox->value(); prm.enableBlackPoint = d->blackPointCheckBox->isChecked(); prm.blackPoint = d->blackPointSpinBox->value(); prm.enableWhitePoint = d->whitePointCheckBox->isChecked(); prm.whitePoint = d->whitePointSpinBox->value(); prm.RAWQuality = (DRawDecoderSettings::DecodingQuality)d->RAWQualityComboBox->currentIndex(); switch(prm.RAWQuality) { case DRawDecoderSettings::DCB: prm.dcbIterations = d->medianFilterPassesSpinBox->value(); prm.dcbEnhanceFl = d->refineInterpolationBox->isChecked(); break; case DRawDecoderSettings::VCD_AHD: prm.esMedPasses = d->medianFilterPassesSpinBox->value(); prm.eeciRefine = d->refineInterpolationBox->isChecked(); break; default: prm.medianFilterPasses = d->medianFilterPassesSpinBox->value(); break; } prm.NRType = (DRawDecoderSettings::NoiseReduction)d->noiseReductionComboBox->currentIndex(); switch (prm.NRType) { case DRawDecoderSettings::NONR: { prm.NRThreshold = 0; prm.NRChroThreshold = 0; break; } case DRawDecoderSettings::WAVELETSNR: case DRawDecoderSettings::FBDDNR: case DRawDecoderSettings::LINENR: { prm.NRThreshold = d->NRSpinBox1->value(); prm.NRChroThreshold = 0; break; } default: // IMPULSENR { prm.NRThreshold = d->NRSpinBox1->value(); prm.NRChroThreshold = d->NRSpinBox2->value(); break; } } prm.enableCACorrection = d->enableCACorrectionBox->isChecked(); prm.caMultiplier[0] = d->caRedMultSpinBox->value(); prm.caMultiplier[1] = d->caBlueMultSpinBox->value(); prm.expoCorrection = d->expoCorrectionBox->isChecked(); prm.expoCorrectionShift = d->shiftExpoFromEvToLinear(d->expoCorrectionShiftSpinBox->value()); prm.expoCorrectionHighlight = d->expoCorrectionHighlightSpinBox->value(); prm.inputColorSpace = (DRawDecoderSettings::InputColorSpace)(d->inputColorSpaceComboBox->currentIndex()); prm.outputColorSpace = (DRawDecoderSettings::OutputColorSpace)(d->outputColorSpaceComboBox->currentIndex()); prm.inputProfile = d->inIccUrlEdit->fileDlgPath(); prm.outputProfile = d->outIccUrlEdit->fileDlgPath(); return prm; } void DRawDecoderWidget::readSettings(KConfigGroup& group) { DRawDecoderSettings prm; readSettings(prm, group); setSettings(prm); DExpanderBox::readSettings(group); } void DRawDecoderWidget::writeSettings(KConfigGroup& group) { DRawDecoderSettings prm = settings(); writeSettings(prm, group); DExpanderBox::writeSettings(group); } void DRawDecoderWidget::readSettings(DRawDecoderSettings& prm, KConfigGroup& group) { DRawDecoderSettings defaultPrm; prm.fixColorsHighlights = group.readEntry(OPTIONFIXCOLORSHIGHLIGHTSENTRY, defaultPrm.fixColorsHighlights); prm.sixteenBitsImage = group.readEntry(OPTIONDECODESIXTEENBITENTRY, defaultPrm.sixteenBitsImage); prm.whiteBalance = (DRawDecoderSettings::WhiteBalance)group.readEntry(OPTIONWHITEBALANCEENTRY, (int)defaultPrm.whiteBalance); prm.customWhiteBalance = group.readEntry(OPTIONCUSTOMWHITEBALANCEENTRY, defaultPrm.customWhiteBalance); prm.customWhiteBalanceGreen = group.readEntry(OPTIONCUSTOMWBGREENENTRY, defaultPrm.customWhiteBalanceGreen); prm.RGBInterpolate4Colors = group.readEntry(OPTIONFOURCOLORRGBENTRY, defaultPrm.RGBInterpolate4Colors); prm.unclipColors = group.readEntry(OPTIONUNCLIPCOLORSENTRY, defaultPrm.unclipColors); prm.DontStretchPixels = group.readEntry(OPTIONDONTSTRETCHPIXELSSENTRY, defaultPrm.DontStretchPixels); prm.NRType = (DRawDecoderSettings::NoiseReduction)group.readEntry(OPTIONNOISEREDUCTIONTYPEENTRY, (int)defaultPrm.NRType); prm.brightness = group.readEntry(OPTIONBRIGHTNESSMULTIPLIERENTRY, defaultPrm.brightness); prm.enableBlackPoint = group.readEntry(OPTIONUSEBLACKPOINTENTRY, defaultPrm.enableBlackPoint); prm.blackPoint = group.readEntry(OPTIONBLACKPOINTENTRY, defaultPrm.blackPoint); prm.enableWhitePoint = group.readEntry(OPTIONUSEWHITEPOINTENTRY, defaultPrm.enableWhitePoint); prm.whitePoint = group.readEntry(OPTIONWHITEPOINTENTRY, defaultPrm.whitePoint); prm.medianFilterPasses = group.readEntry(OPTIONMEDIANFILTERPASSESENTRY, defaultPrm.medianFilterPasses); prm.NRThreshold = group.readEntry(OPTIONNOISEREDUCTIONTHRESHOLDENTRY, defaultPrm.NRThreshold); prm.enableCACorrection = group.readEntry(OPTIONUSECACORRECTIONENTRY, defaultPrm.enableCACorrection); prm.caMultiplier[0] = group.readEntry(OPTIONCAREDMULTIPLIERENTRY, defaultPrm.caMultiplier[0]); prm.caMultiplier[1] = group.readEntry(OPTIONCABLUEMULTIPLIERENTRY, defaultPrm.caMultiplier[1]); prm.RAWQuality = (DRawDecoderSettings::DecodingQuality)group.readEntry(OPTIONDECODINGQUALITYENTRY, (int)defaultPrm.RAWQuality); prm.outputColorSpace = (DRawDecoderSettings::OutputColorSpace)group.readEntry(OPTIONOUTPUTCOLORSPACEENTRY, (int)defaultPrm.outputColorSpace); prm.autoBrightness = group.readEntry(OPTIONAUTOBRIGHTNESSENTRY, defaultPrm.autoBrightness); //-- Extended demosaicing settings ---------------------------------------------------------- prm.dcbIterations = group.readEntry(OPTIONDCBITERATIONSENTRY, defaultPrm.dcbIterations); prm.dcbEnhanceFl = group.readEntry(OPTIONDCBENHANCEFLENTRY, defaultPrm.dcbEnhanceFl); prm.eeciRefine = group.readEntry(OPTIONEECIREFINEENTRY, defaultPrm.eeciRefine); prm.esMedPasses = group.readEntry(OPTIONESMEDPASSESENTRY, defaultPrm.esMedPasses); prm.NRChroThreshold = group.readEntry(OPTIONNRCHROMINANCETHRESHOLDENTRY, defaultPrm.NRChroThreshold); prm.expoCorrection = group.readEntry(OPTIONEXPOCORRECTIONENTRY, defaultPrm.expoCorrection); prm.expoCorrectionShift = group.readEntry(OPTIONEXPOCORRECTIONSHIFTENTRY, defaultPrm.expoCorrectionShift); prm.expoCorrectionHighlight = group.readEntry(OPTIONEXPOCORRECTIONHIGHLIGHTENTRY, defaultPrm.expoCorrectionHighlight); } void DRawDecoderWidget::writeSettings(const DRawDecoderSettings& prm, KConfigGroup& group) { group.writeEntry(OPTIONFIXCOLORSHIGHLIGHTSENTRY, prm.fixColorsHighlights); group.writeEntry(OPTIONDECODESIXTEENBITENTRY, prm.sixteenBitsImage); group.writeEntry(OPTIONWHITEBALANCEENTRY, (int)prm.whiteBalance); group.writeEntry(OPTIONCUSTOMWHITEBALANCEENTRY, prm.customWhiteBalance); group.writeEntry(OPTIONCUSTOMWBGREENENTRY, prm.customWhiteBalanceGreen); group.writeEntry(OPTIONFOURCOLORRGBENTRY, prm.RGBInterpolate4Colors); group.writeEntry(OPTIONUNCLIPCOLORSENTRY, prm.unclipColors); group.writeEntry(OPTIONDONTSTRETCHPIXELSSENTRY, prm.DontStretchPixels); group.writeEntry(OPTIONNOISEREDUCTIONTYPEENTRY, (int)prm.NRType); group.writeEntry(OPTIONBRIGHTNESSMULTIPLIERENTRY, prm.brightness); group.writeEntry(OPTIONUSEBLACKPOINTENTRY, prm.enableBlackPoint); group.writeEntry(OPTIONBLACKPOINTENTRY, prm.blackPoint); group.writeEntry(OPTIONUSEWHITEPOINTENTRY, prm.enableWhitePoint); group.writeEntry(OPTIONWHITEPOINTENTRY, prm.whitePoint); group.writeEntry(OPTIONMEDIANFILTERPASSESENTRY, prm.medianFilterPasses); group.writeEntry(OPTIONNOISEREDUCTIONTHRESHOLDENTRY, prm.NRThreshold); group.writeEntry(OPTIONUSECACORRECTIONENTRY, prm.enableCACorrection); group.writeEntry(OPTIONCAREDMULTIPLIERENTRY, prm.caMultiplier[0]); group.writeEntry(OPTIONCABLUEMULTIPLIERENTRY, prm.caMultiplier[1]); group.writeEntry(OPTIONDECODINGQUALITYENTRY, (int)prm.RAWQuality); group.writeEntry(OPTIONOUTPUTCOLORSPACEENTRY, (int)prm.outputColorSpace); group.writeEntry(OPTIONAUTOBRIGHTNESSENTRY, prm.autoBrightness); //-- Extended demosaicing settings ---------------------------------------------------------- group.writeEntry(OPTIONDCBITERATIONSENTRY, prm.dcbIterations); group.writeEntry(OPTIONDCBENHANCEFLENTRY, prm.dcbEnhanceFl); group.writeEntry(OPTIONEECIREFINEENTRY, prm.eeciRefine); group.writeEntry(OPTIONESMEDPASSESENTRY, prm.esMedPasses); group.writeEntry(OPTIONNRCHROMINANCETHRESHOLDENTRY, prm.NRChroThreshold); group.writeEntry(OPTIONEXPOCORRECTIONENTRY, prm.expoCorrection); group.writeEntry(OPTIONEXPOCORRECTIONSHIFTENTRY, prm.expoCorrectionShift); group.writeEntry(OPTIONEXPOCORRECTIONHIGHLIGHTENTRY, prm.expoCorrectionHighlight); } } // NameSpace Digikam diff --git a/utilities/setup/editor/setupversioning.cpp b/utilities/setup/editor/setupversioning.cpp index b6f4d7afd8..031e7bae1f 100644 --- a/utilities/setup/editor/setupversioning.cpp +++ b/utilities/setup/editor/setupversioning.cpp @@ -1,471 +1,471 @@ /* ============================================================ * * This file is a part of digiKam project * http://www.digikam.org * * Date : 2010-08-06 * Description : setup tab for image versioning * * Copyright (C) 2010 by Martin Klapetek * Copyright (C) 2012-2017 by Gilles Caulier * * 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, 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. * * ============================================================ */ #include "setupversioning.h" // Qt includes #include #include #include #include #include #include #include #include #include #include #include #include // KDE includes #include // Local includes #include "applicationsettings.h" #include "versionmanager.h" namespace Digikam { class SetupVersioning::Private { public: Private() : tab(0), nonDestructivePanel(0), workspaceGB(0), closingGB(0), snapshotGB(0), viewGB(0), enableNonDestructive(0), snapshotAfterRaw(0), snapshotSession(0), snapshotComplex(0), viewShowOriginal(0), viewShowSnapshots(0), formatBox(0), askToSave(0), autoSave(0), infoNonDestructive(0), infoFormat(0), infoSnapshot(0), infoView(0) { } QTabWidget* tab; QWidget* nonDestructivePanel; QGroupBox* workspaceGB; QGroupBox* closingGB; QGroupBox* snapshotGB; QGroupBox* viewGB; QCheckBox* enableNonDestructive; QCheckBox* snapshotAfterRaw; QCheckBox* snapshotSession; QCheckBox* snapshotComplex; QCheckBox* viewShowOriginal; QCheckBox* viewShowSnapshots; QComboBox* formatBox; QRadioButton* askToSave; QRadioButton* autoSave; QPushButton* infoNonDestructive; QPushButton* infoFormat; QPushButton* infoSnapshot; QPushButton* infoView; }; SetupVersioning::SetupVersioning(QWidget* const parent) : QScrollArea(parent), d(new Private) { d->nonDestructivePanel = new QWidget; QVBoxLayout* const nonDestructiveLayout = new QVBoxLayout; // --- QGridLayout* const gridHeader = new QGridLayout; d->enableNonDestructive = new QCheckBox; d->enableNonDestructive->setText(i18n("Enable Non-Destructive Editing and Versioning")); d->enableNonDestructive->setToolTip(i18nc("@info:tooltip", "Enable support for non-destructive editing and image versioning")); - d->enableNonDestructive->setWhatsThis(i18nc("@info:whatsthis", + d->enableNonDestructive->setWhatsThis(xi18nc("@info:whatsthis", "Non-Destructive Editing and Versioning " "allows different versions of an image to be created, " "whilst always preserving the original image. " " All steps of the editing history are recorded and can be accessed later.")); QLabel* const iconLabel = new QLabel; iconLabel->setPixmap(QIcon::fromTheme(QLatin1String("view-catalog")).pixmap(32)); d->infoNonDestructive = new QPushButton; d->infoNonDestructive->setIcon(QIcon::fromTheme(QLatin1String("dialog-information"))); d->infoNonDestructive->setToolTip(i18nc("@info:tooltip", "Get information on non-destructive editing and file versioning")); gridHeader->addWidget(iconLabel, 0, 0); gridHeader->addWidget(d->enableNonDestructive, 0, 1); gridHeader->addWidget(d->infoNonDestructive, 0, 3); gridHeader->setColumnStretch(2, 1); // -------------------------------------------------------- d->workspaceGB = new QGroupBox(i18nc("@title:group", "Workspace File Format")); QGridLayout* const wsLayout = new QGridLayout; QLabel* const workIcon = new QLabel; workIcon->setPixmap(QIcon::fromTheme(QLatin1String("document-save-as")).pixmap(32)); QLabel* const formatLabel = new QLabel(i18nc("@label", "Save files as")); // keep in sync with VersionManager::workspaceFileFormats() d->formatBox = new QComboBox; d->formatBox->addItem(i18nc("@label:listbox", "JPEG"), QLatin1String("JPG")); d->formatBox->addItem(i18nc("@label:listbox", "TIFF"), QLatin1String("TIFF")); d->formatBox->addItem(i18nc("@label:listbox", "PNG"), QLatin1String("PNG")); d->formatBox->addItem(i18nc("@label:listbox", "PGF"), QLatin1String("PGF")); d->formatBox->addItem(i18nc("@label:listbox", "JPEG 2000"), QLatin1String("JP2")); d->formatBox->insertSeparator(1); d->formatBox->insertSeparator(4); - d->formatBox->setWhatsThis(i18nc("@info:whatsthis", + d->formatBox->setWhatsThis(xi18nc("@info:whatsthis", "Default File Format for Saving" "Select the file format in which edited images are saved automatically. " "Format-specific options, like compression settings, " "can be configured on the Format Options tab." "" // Lossy: JPEG "" "JPEG: " "JPEG is the most commonly used file format, but it employs lossy compression, " "which means that with each saving operation some image information will be irreversibly lost. " "JPEG offers a good compression rate, resulting in smaller files. " "" // Traditional lossless: PNG, TIFF "" "PNG: " "A widely used format employing lossless compression. " "The files, though, will be larger because PNG does not achieve very good compression rates." "" "" "TIFF: " "A commonly used format, usually uncompressed or with modest lossless compression. " "Resulting files will be large, but without quality loss due to compression. " "" // Modern lossless: PGF, JPEG 2000 "" "PGF: " "This is a technically superior file format offering good compression rates " "with either lossy or lossless compression. " "But it is not yet widely used and supported, so your friends may not directly be able to open these files, " "and you may not be able to directly publish them on the web. " "" "" "JPEG 2000: " "JPEG 2000 is similar to PGF. Loading or saving is slower, the compression rate is better, " "and the format more widely supported, though still not comparable " "to the tradition formats JPEG, PNG or TIFF. " "" "")); d->infoFormat = new QPushButton; d->infoFormat->setIcon(QIcon::fromTheme(QLatin1String("dialog-information"))); d->infoFormat->setToolTip(i18nc("@info:tooltip", "Get information on available image file formats")); wsLayout->addWidget(workIcon, 0, 0); wsLayout->addWidget(formatLabel, 0, 1); wsLayout->addWidget(d->formatBox, 0, 2); wsLayout->addWidget(d->infoFormat, 0, 4); wsLayout->setColumnStretch(1, 1); wsLayout->setColumnStretch(2, 2); wsLayout->setColumnStretch(3, 3); d->workspaceGB->setLayout(wsLayout); // --- d->closingGB = new QGroupBox;//(i18nc("@title:group", "Automatic Saving")); QGridLayout* const closingLayout = new QGridLayout; QLabel* const closingExplanation = new QLabel(i18nc("@label", "When closing the editor")); QLabel* const closingIcon = new QLabel; closingIcon->setPixmap(QIcon::fromTheme(QLatin1String("dialog-ok-apply")).pixmap(32)); d->askToSave = new QRadioButton(i18nc("@option:radio", "Always ask to save changes")); d->autoSave = new QRadioButton(i18nc("@option:radio", "Save changes automatically")); closingLayout->addWidget(closingIcon, 0, 0); closingLayout->addWidget(closingExplanation, 0, 1); closingLayout->addWidget(d->askToSave, 1, 0, 1, 3); closingLayout->addWidget(d->autoSave, 2, 0, 1, 3); closingLayout->setColumnStretch(3, 1); d->closingGB->setLayout(closingLayout); // --- // -------------------------------------------------------- /* QGridLayout* const snapshotHeader = new QGridLayout; QLabel* const snapshotExplanation = new QLabel; snapshotExplanation->setText(i18nc("@label", "For an edited image, there is at least one file representing the current version." "digiKam can take and keep additional, intermediate snapshots during editing.")); snapshotExplanation->setWordWrap(true); snapshotHeader->addWidget(snapshotIconLabel, 0, 0); snapshotHeader->addWidget(snapshotExplanation, 0, 1); */ d->snapshotGB = new QGroupBox;//(i18nc("@title:group", "Intermediate Version Snapshots")); QGridLayout* const snapshotLayout = new QGridLayout; - QString snapshotWhatsThis = i18nc("@info:whatsthis", + QString snapshotWhatsThis = xi18nc("@info:whatsthis", "First and foremost, the original image will never be overwritten. " "Instead, when an image is edited, a new file is created: " "The current version. " "You can also create multiple versions " "deriving from the same original image. " "In addition to these files representing a current version, " "digiKam can take and keep additional, intermediate snapshots " "during the editing process. " "This can be useful if you want to preserve the intermediate steps for later " "access, for example if some editing steps cannot be automatically reproduced."); d->snapshotGB->setWhatsThis(snapshotWhatsThis); QLabel* const snapshotIconLabel = new QLabel; snapshotIconLabel->setPixmap(QIcon::fromTheme(QLatin1String("insert-image")).pixmap(32)); QLabel* const snapshotLabel = new QLabel(i18nc("@label", "Keep a snapshot of an edited image")); d->infoSnapshot = new QPushButton; d->infoSnapshot->setIcon(QIcon::fromTheme(QLatin1String("dialog-information"))); d->infoSnapshot->setToolTip(i18nc("@info:tooltip", "Get an explanation for these options")); d->snapshotAfterRaw = new QCheckBox(i18nc("@option:check", "After converting from a RAW image")); d->snapshotSession = new QCheckBox(i18nc("@option:check", "After each editing session")); d->snapshotComplex = new QCheckBox(i18nc("@option:check", "After each step that is not completely reproducible")); snapshotLayout->addWidget(snapshotIconLabel, 0, 0); snapshotLayout->addWidget(snapshotLabel, 0, 1); snapshotLayout->addWidget(d->infoSnapshot, 0, 3); snapshotLayout->addWidget(d->snapshotAfterRaw, 1, 0, 1, 4); snapshotLayout->addWidget(d->snapshotSession, 2, 0, 1, 4); snapshotLayout->addWidget(d->snapshotComplex, 3, 0, 1, 4); snapshotLayout->setColumnStretch(2, 1); d->snapshotGB->setLayout(snapshotLayout); /* / --- snapshotLayout->addLayout(snapshotHeader); snapshotLayout->addWidget(d->snapshotGB); snapshotLayout->addStretch(); d->snapshotPanel->setLayout(snapshotLayout); */ // -------------------------------------------------------- d->viewGB = new QGroupBox; QGridLayout* const viewGBLayout = new QGridLayout; - QString viewWhatsThis = i18nc("@info:whatsthis", + QString viewWhatsThis = xi18nc("@info:whatsthis", "If an image has been edited, only the current versions " "will be shown in the main thumbnail view. " "From the right sidebar, you always have access to all hidden files. " "With the options here, you can choose to show certain files permanently."); d->viewGB->setWhatsThis(viewWhatsThis); QLabel* const viewLabel = new QLabel(i18nc("@label", "In main view")); QLabel* const viewIconLabel = new QLabel; viewIconLabel->setPixmap(QIcon::fromTheme(QLatin1String("view-list-icons")).pixmap(32)); d->infoView = new QPushButton; d->infoView->setIcon(QIcon::fromTheme(QLatin1String("dialog-information"))); d->infoView->setToolTip(i18nc("@info:tooltip", "Get an explanation for these options")); d->viewShowOriginal = new QCheckBox(i18nc("@option:check", "Always show original images")); d->viewShowSnapshots = new QCheckBox(i18nc("@option:check", "Always show intermediate snapshots")); viewGBLayout->addWidget(viewIconLabel, 0, 0); viewGBLayout->addWidget(viewLabel, 0, 1); viewGBLayout->addWidget(d->infoView, 0, 3); viewGBLayout->addWidget(d->viewShowOriginal, 1, 0, 1, 4); viewGBLayout->addWidget(d->viewShowSnapshots, 2, 0, 1, 4); viewGBLayout->setColumnStretch(2, 1); d->viewGB->setLayout(viewGBLayout); // -------------------------------------------------------- connect(d->enableNonDestructive, SIGNAL(toggled(bool)), this, SLOT(enableToggled(bool))); connect(d->infoNonDestructive, SIGNAL(clicked()), this, SLOT(showNonDestructiveInformation())); connect(d->infoFormat, SIGNAL(clicked()), this, SLOT(showFormatInformation())); connect(d->infoSnapshot, SIGNAL(clicked()), this, SLOT(showSnapshotInformation())); connect(d->infoView, SIGNAL(clicked()), this, SLOT(showViewInformation())); // -------------------------------------------------------- nonDestructiveLayout->addLayout(gridHeader); nonDestructiveLayout->addWidget(d->workspaceGB); nonDestructiveLayout->addWidget(d->closingGB); nonDestructiveLayout->addWidget(d->snapshotGB); nonDestructiveLayout->addWidget(d->viewGB); nonDestructiveLayout->addStretch(); d->nonDestructivePanel->setLayout(nonDestructiveLayout); setWidget(d->nonDestructivePanel); setWidgetResizable(true); // -------------------------------------------------------- readSettings(); enableToggled(d->enableNonDestructive->isChecked()); } SetupVersioning::~SetupVersioning() { delete d; } void SetupVersioning::applySettings() { VersionManagerSettings settings; settings.enabled = d->enableNonDestructive->isChecked(); if (d->snapshotSession->isChecked()) { settings.saveIntermediateVersions |= VersionManagerSettings::AfterEachSession; } if (d->snapshotAfterRaw->isChecked()) { settings.saveIntermediateVersions |= VersionManagerSettings::AfterRawConversion; } if (d->snapshotComplex->isChecked()) { settings.saveIntermediateVersions |= VersionManagerSettings::WhenNotReproducible; } if (d->viewShowOriginal->isChecked()) { settings.showInViewFlags |= VersionManagerSettings::ShowOriginal; } else { settings.showInViewFlags &= ~VersionManagerSettings::ShowOriginal; } if (d->viewShowSnapshots->isChecked()) { settings.showInViewFlags |= VersionManagerSettings::ShowIntermediates; } if (d->autoSave->isChecked()) { settings.editorClosingMode = VersionManagerSettings::AutoSave; } else // d->askToSave->isChecked() { settings.editorClosingMode = VersionManagerSettings::AlwaysAsk; } settings.format = d->formatBox->itemData(d->formatBox->currentIndex()).toString(); ApplicationSettings::instance()->setVersionManagerSettings(settings); ApplicationSettings::instance()->saveSettings(); } void SetupVersioning::readSettings() { VersionManagerSettings settings = ApplicationSettings::instance()->getVersionManagerSettings(); d->enableNonDestructive->setChecked(settings.enabled); d->snapshotSession->setChecked(settings.saveIntermediateVersions & VersionManagerSettings::AfterEachSession); d->snapshotAfterRaw->setChecked(settings.saveIntermediateVersions & VersionManagerSettings::AfterRawConversion); d->snapshotComplex->setChecked(settings.saveIntermediateVersions & VersionManagerSettings::WhenNotReproducible); d->viewShowOriginal->setChecked(settings.showInViewFlags & VersionManagerSettings::ShowOriginal); d->viewShowSnapshots->setChecked(settings.showInViewFlags & VersionManagerSettings::ShowIntermediates); d->askToSave->setChecked(settings.editorClosingMode == VersionManagerSettings::AlwaysAsk); d->autoSave->setChecked(settings.editorClosingMode == VersionManagerSettings::AutoSave); d->formatBox->setCurrentIndex(d->formatBox->findData(settings.format)); } void SetupVersioning::showNonDestructiveInformation() { qApp->postEvent(d->enableNonDestructive, new QHelpEvent(QEvent::WhatsThis, QPoint(0, 0), d->enableNonDestructive->mapToGlobal(QPoint(0, 0)))); } void SetupVersioning::showFormatInformation() { qApp->postEvent(d->formatBox, new QHelpEvent(QEvent::WhatsThis, QPoint(0, 0), d->formatBox->mapToGlobal(QPoint(0, 0)))); } void SetupVersioning::showSnapshotInformation() { QPoint p(0, 0); qApp->postEvent(d->snapshotGB, new QHelpEvent(QEvent::WhatsThis, p, d->snapshotGB->mapToGlobal(p))); } void SetupVersioning::showViewInformation() { QPoint p(0, 0); qApp->postEvent(d->viewGB, new QHelpEvent(QEvent::WhatsThis, p, d->viewGB->mapToGlobal(p))); } void SetupVersioning::enableToggled(bool on) { d->workspaceGB->setEnabled(on); d->closingGB->setEnabled(on); d->snapshotGB->setEnabled(on); d->viewGB->setEnabled(on); } } // namespace Digikam diff --git a/utilities/setup/metadata/setupmetadata.cpp b/utilities/setup/metadata/setupmetadata.cpp index b9ff1dcb02..bb779d7a22 100644 --- a/utilities/setup/metadata/setupmetadata.cpp +++ b/utilities/setup/metadata/setupmetadata.cpp @@ -1,807 +1,807 @@ /* ============================================================ * * This file is a part of digiKam project * http://www.digikam.org * * Date : 2003-08-03 * Description : setup Metadata tab. * * Copyright (C) 2003-2004 by Ralf Holzer * Copyright (C) 2003-2017 by Gilles Caulier * Copyright (C) 2009-2012 by Marcel Wiesweg * Copyright (C) 2017 by Simon Frei * * 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, 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. * * ============================================================ */ #include "setupmetadata.h" // Qt includes #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // KDE includes #include // Local includes #include "advancedmetadatatab.h" #include "applicationsettings.h" #include "dactivelabel.h" #include "digikam_config.h" #include "digikam_debug.h" #include "metaengine.h" #include "metadatapanel.h" #include "metadatasettings.h" #include "setuputils.h" namespace Digikam { class SetupMetadata::Private { public: Private() : exifAutoRotateOriginal(false), exifAutoRotateShowedInfo(false), fieldsGroup(0), readWriteGroup(0), rotationGroup(0), rotationAdvGroup(0), saveTagsBox(0), saveCommentsBox(0), saveRatingBox(0), savePickLabelBox(0), saveColorLabelBox(0), saveDateTimeBox(0), saveTemplateBox(0), saveFaceTags(0), useLazySync(0), writeRawFilesBox(0), writeXMPSidecarBox(0), readXMPSidecarBox(0), updateFileTimeStampBox(0), rescanImageIfModifiedBox(0), writingModeCombo(0), rotateByFlag(0), rotateByContents(0), allowRotateByMetadata(0), allowLossyRotate(0), exifRotateBox(0), exifSetOrientationBox(0), saveToBalooBox(0), readFromBalooBox(0), tab(0), displaySubTab(0), tagsCfgPanel(0), advTab(0), extensionsEdit(0) { } bool exifAutoRotateOriginal; bool exifAutoRotateShowedInfo; QGroupBox* fieldsGroup; QGroupBox* readWriteGroup; QGroupBox* rotationGroup; QGroupBox* rotationAdvGroup; QCheckBox* saveTagsBox; QCheckBox* saveCommentsBox; QCheckBox* saveRatingBox; QCheckBox* savePickLabelBox; QCheckBox* saveColorLabelBox; QCheckBox* saveDateTimeBox; QCheckBox* saveTemplateBox; QCheckBox* saveFaceTags; QCheckBox* useLazySync; QCheckBox* writeRawFilesBox; QCheckBox* writeXMPSidecarBox; QCheckBox* readXMPSidecarBox; QCheckBox* updateFileTimeStampBox; QCheckBox* rescanImageIfModifiedBox; QComboBox* writingModeCombo; QRadioButton* rotateByFlag; QRadioButton* rotateByContents; QCheckBox* allowRotateByMetadata; QCheckBox* allowLossyRotate; QCheckBox* exifRotateBox; QCheckBox* exifSetOrientationBox; QCheckBox* saveToBalooBox; QCheckBox* readFromBalooBox; QTabWidget* tab; QTabWidget* displaySubTab; MetadataPanel* tagsCfgPanel; AdvancedMetadataTab* advTab; QLineEdit* extensionsEdit; }; SetupMetadata::SetupMetadata(QWidget* const parent) : QScrollArea(parent), d(new Private) { d->tab = new QTabWidget(viewport()); setWidget(d->tab); setWidgetResizable(true); QWidget* const panel = new QWidget; QVBoxLayout* const mainLayout = new QVBoxLayout; // -------------------------------------------------------- d->fieldsGroup = new QGroupBox; QGridLayout* const fieldsLayout = new QGridLayout; - d->fieldsGroup->setWhatsThis(i18nc("@info:whatsthis", + d->fieldsGroup->setWhatsThis(xi18nc("@info:whatsthis", "In addition to the pixel content, image files usually " "contain a variety of metadata. A lot of the parameters you can use " "in digiKam to manage files, such as rating or comment, can be written " "to the files' metadata. " "Storing in metadata allows one to preserve this information " "when moving or sending the files to different systems.")); QLabel* const fieldsIconLabel = new QLabel; fieldsIconLabel->setPixmap(QIcon::fromTheme(QLatin1String("format-list-unordered")).pixmap(32)); QLabel* const fieldsLabel = new QLabel(i18nc("@label", "Write This Information to the Metadata")); d->saveTagsBox = new QCheckBox; d->saveTagsBox->setText(i18nc("@option:check", "Image tags")); d->saveTagsBox->setWhatsThis(i18nc("@info:whatsthis", "Turn on this option to store the image tags " "in the XMP and IPTC tags.")); d->saveCommentsBox = new QCheckBox; d->saveCommentsBox->setText(i18nc("@option:check", "Captions and title")); d->saveCommentsBox->setWhatsThis(i18nc("@info:whatsthis", "Turn on this option to store image caption and title " "in the JFIF Comment section, the EXIF tag, the XMP tag, " "and the IPTC tag.")); d->saveRatingBox = new QCheckBox; d->saveRatingBox->setText(i18nc("@option:check", "Rating")); d->saveRatingBox->setWhatsThis(i18nc("@info:whatsthis", "Turn on this option to store the image rating " "in the EXIF tag and the XMP tags.")); d->savePickLabelBox = new QCheckBox; d->savePickLabelBox->setText(i18nc("@option:check", "Pick label")); d->savePickLabelBox->setWhatsThis(i18nc("@info:whatsthis", "Turn on this option to store the image pick label " "in the XMP tags.")); d->saveColorLabelBox = new QCheckBox; d->saveColorLabelBox->setText(i18nc("@option:check", "Color label")); d->saveColorLabelBox->setWhatsThis(i18nc("@info:whatsthis", "Turn on this option to store the image color label " "in the XMP tags.")); d->saveDateTimeBox = new QCheckBox; d->saveDateTimeBox->setText(i18nc("@option:check", "Timestamps")); d->saveDateTimeBox->setWhatsThis(i18nc("@info:whatsthis", "Turn on this option to store the image date and time " "in the EXIF, XMP, and IPTC tags.")); d->saveTemplateBox = new QCheckBox; d->saveTemplateBox->setText(i18nc("@option:check", "Metadata templates (Copyright etc.)")); d->saveTemplateBox->setWhatsThis(i18nc("@info:whatsthis", "Turn on this option to store the metadata " "template in the XMP and the IPTC tags. " "You can set template values to Template setup page.")); d->saveFaceTags = new QCheckBox; d->saveFaceTags->setText(i18nc("@option:check", "Face Tags (including face areas)")); d->saveFaceTags->setWhatsThis(i18nc("@info:whatsthis", "Turn on this option to store face tags " "with face rectangles in the XMP tags.")); fieldsLayout->addWidget(fieldsIconLabel, 0, 0, 2, 3); fieldsLayout->addWidget(fieldsLabel, 0, 1, 2, 3); fieldsLayout->addWidget(d->saveTagsBox, 2, 0, 1, 3); fieldsLayout->addWidget(d->saveCommentsBox, 3, 0, 1, 3); fieldsLayout->addWidget(d->saveRatingBox, 4, 0, 1, 3); fieldsLayout->addWidget(d->savePickLabelBox, 5, 0, 1, 3); fieldsLayout->addWidget(d->saveColorLabelBox, 6, 0, 1, 3); fieldsLayout->addWidget(d->saveDateTimeBox, 7, 0, 1, 3); fieldsLayout->addWidget(d->saveTemplateBox, 8, 0, 1, 3); fieldsLayout->addWidget(d->saveFaceTags, 9 ,0, 1, 3); fieldsLayout->setColumnStretch(3, 10); d->fieldsGroup->setLayout(fieldsLayout); // -------------------------------------------------------- d->readWriteGroup = new QGroupBox; QGridLayout* const readWriteLayout = new QGridLayout; QLabel* const readWriteIconLabel = new QLabel; readWriteIconLabel->setPixmap(QIcon::fromTheme(QLatin1String("document-open")).pixmap(32)); QLabel* const readWriteLabel = new QLabel(i18nc("@label", "Reading and Writing Metadata")); d->useLazySync = new QCheckBox; d->useLazySync->setText(i18nc("@option:check", "Use lazy synchronization")); d->useLazySync->setWhatsThis(i18nc("@info:whatsthis", "Instead of synchronizing metadata, just schedule it for synchronization." "Synchronization can be done later by triggering the apply pending, or at digikam exit")); d->writeRawFilesBox = new QCheckBox; d->writeRawFilesBox->setText(i18nc("@option:check", "If possible write Metadata to RAW files (experimental)")); d->writeRawFilesBox->setWhatsThis(i18nc("@info:whatsthis", "Turn on this option to write metadata into RAW TIFF/EP files. " "This feature requires the Exiv2 shared library, version >= 0.18.0. It is still " "experimental, and is disabled by default.")); d->writeRawFilesBox->setEnabled(MetaEngine::supportMetadataWritting(QLatin1String("image/x-raw"))); d->updateFileTimeStampBox = new QCheckBox; d->updateFileTimeStampBox->setText(i18nc("@option:check", "&Update file timestamp when files are modified")); d->updateFileTimeStampBox->setWhatsThis(i18nc("@info:whatsthis", "Turn off this option to not update file timestamps when files are changed as when you update metadata or image data. " "Note: disabling this option can introduce some dysfunctions with applications which use file timestamps properties to " "detect file modifications automatically.")); d->rescanImageIfModifiedBox = new QCheckBox; d->rescanImageIfModifiedBox->setText(i18nc("@option:check", "&Rescan file when files are modified")); d->rescanImageIfModifiedBox->setWhatsThis(i18nc("@info:whatsthis", "Turning this option on, will force digiKam to rescan files that has been modified outside digiKam. " "If a file has changed it's file size or if the last modified timestamp has changed, a rescan of that " "file will be performed when digiKam starts.")); readWriteLayout->addWidget(readWriteIconLabel, 0, 0, 2, 3); readWriteLayout->addWidget(readWriteLabel, 0, 1, 2, 3); readWriteLayout->addWidget(d->useLazySync, 2, 0, 1, 3); readWriteLayout->addWidget(d->writeRawFilesBox, 3, 0, 1, 3); readWriteLayout->addWidget(d->updateFileTimeStampBox, 4, 0, 1, 3); readWriteLayout->addWidget(d->rescanImageIfModifiedBox, 5, 0, 1, 3); readWriteLayout->setColumnStretch(3, 10); d->readWriteGroup->setLayout(readWriteLayout); // -------------------------------------------------------- QFrame* const infoBox = new QFrame; QGridLayout* const infoBoxGrid = new QGridLayout; infoBox->setFrameStyle(QFrame::StyledPanel | QFrame::Raised); DActiveLabel* const exiv2LogoLabel = new DActiveLabel(QUrl(QLatin1String("http://www.exiv2.org")), QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("digikam/data/logo-exiv2.png")), infoBox); exiv2LogoLabel->setWhatsThis(i18n("Visit Exiv2 project website")); QLabel* const explanation = new QLabel(infoBox); explanation->setOpenExternalLinks(true); explanation->setWordWrap(true); QString txt; txt.append(i18n("

EXIF - " "a standard used by most digital cameras today to store technical " "information (like aperture and shutter speed) about an image.

")); txt.append(i18n("

IPTC - " "an older standard used in digital photography to store " "photographer information in images.

")); if (MetaEngine::supportXmp()) txt.append(i18n("

XMP - " "a new standard used in digital photography, designed to replace IPTC.

")); explanation->setText(txt); infoBoxGrid->addWidget(exiv2LogoLabel, 0, 0, 1, 1); infoBoxGrid->addWidget(explanation, 0, 1, 1, 2); infoBoxGrid->setColumnStretch(1, 10); infoBoxGrid->setRowStretch(1, 10); infoBoxGrid->setSpacing(0); infoBox->setLayout(infoBoxGrid); // -------------------------------------------------------- mainLayout->addWidget(d->fieldsGroup); mainLayout->addWidget(d->readWriteGroup); mainLayout->addWidget(infoBox); panel->setLayout(mainLayout); d->tab->insertTab(Behavior, panel, i18nc("@title:tab", "Behavior")); // -------------------------------------------------------- QWidget* const rotationPanel = new QWidget(d->tab); QVBoxLayout* const rotationLayout = new QVBoxLayout; d->rotationGroup = new QGroupBox; QGridLayout* const rotationGroupLayout = new QGridLayout; QLabel* const rotationExplanation = new QLabel(i18nc("@label", "When rotating a file")); QLabel* const rotationIcon = new QLabel; rotationIcon->setPixmap(QIcon::fromTheme(QLatin1String("transform-rotate")).pixmap(32)); d->rotateByFlag = new QRadioButton(i18nc("@option:radio", "Rotate by only setting a flag")); d->rotateByContents = new QRadioButton(i18nc("@option:radio", "Rotate by changing the content if possible")); d->allowLossyRotate = new QCheckBox(i18nc("@option:check", "Even allow lossy rotation if necessary")); d->allowRotateByMetadata = new QCheckBox(i18nc("@option:check", "Write flag to metadata if possible")); connect(d->rotateByContents, SIGNAL(toggled(bool)), d->allowLossyRotate, SLOT(setEnabled(bool))); d->rotateByFlag->setChecked(false); d->rotateByContents->setChecked(false); d->allowLossyRotate->setEnabled(false); d->allowLossyRotate->setChecked(false); d->allowRotateByMetadata->setChecked(true); d->rotateByFlag->setToolTip(i18nc("@info:tooltip", "Rotate files only by changing a flag, not touching the pixel data")); - d->rotateByFlag->setWhatsThis(i18nc("@info:whatsthis", + d->rotateByFlag->setWhatsThis(xi18nc("@info:whatsthis", "A file can be rotated in two ways:
" "You can change the contents, rearranging the individual pixels of the image data.
" "Or you can set a flag that the file is to be rotated before it is shown.
" "Select this option if you always want to set only a flag. " "This is less obtrusive, but requires support if the file is accessed with another software. " "Ensure to allow setting the flag in the metadata if you want to share your files " "outside digiKam.")); d->rotateByContents->setToolTip(i18nc("@info:tooltip", "If possible rotate files by changing the pixel data")); - d->rotateByContents->setWhatsThis(i18nc("@info:whatsthis", + d->rotateByContents->setWhatsThis(xi18nc("@info:whatsthis", "A file can be rotated in two ways:
" "You can change the contents, rearranging the individual pixels of the image data.
" "Or you can set a flag that the file is to be rotated before it is shown.
" "Select this option if you want the file to be rotated by changing the content. " "This is a lossless operation for JPEG files. For other formats it is a lossy operation, " "which you need to enable explicitly. " "It is not support for RAW and other read-only formats, " "which will be rotated by flag only.")); d->allowLossyRotate->setToolTip(i18nc("@info:tooltip", "Rotate files by changing the pixel data even if the operation will incur quality loss")); d->allowLossyRotate->setWhatsThis(i18nc("@info:whatsthis", "For some file formats which apply lossy compression, " "data will be lost each time the content is rotated. " "Check this option to allow lossy rotation. " "If not enabled, these files will be rotated by flag.")); d->allowRotateByMetadata->setToolTip(i18nc("@info:tooltip", "When rotating a file by setting a flag, also change this flag in the file's metadata")); d->allowRotateByMetadata->setWhatsThis(i18nc("@info:whatsthis", "File metadata typically contains a flag describing " "that a file shall be shown rotated. " "Enable this option to allow editing this field. ")); rotationGroupLayout->addWidget(rotationIcon, 0, 0, 1, 1); rotationGroupLayout->addWidget(rotationExplanation, 0, 1, 1, 2); rotationGroupLayout->addWidget(d->rotateByFlag, 1, 0, 1, 3); rotationGroupLayout->addWidget(d->rotateByContents, 2, 0, 1, 3); rotationGroupLayout->addWidget(d->allowLossyRotate, 3, 2, 1, 1); rotationGroupLayout->addWidget(d->allowRotateByMetadata, 4, 0, 1, 3); rotationGroupLayout->setColumnStretch(3, 10); d->rotationGroup->setLayout(rotationGroupLayout); // -------------------------------------------------------- d->rotationAdvGroup = new QGroupBox; QGridLayout* const rotationAdvLayout = new QGridLayout; QLabel* const rotationAdvExpl = new QLabel(i18nc("@label", "Rotate actions")); QLabel* const rotationAdvIcon = new QLabel; rotationAdvIcon->setPixmap(QIcon::fromTheme(QLatin1String("configure")).pixmap(32)); d->exifRotateBox = new QCheckBox; d->exifRotateBox->setText(i18n("Show images/thumbnails &rotated according to orientation tag.")); d->exifSetOrientationBox = new QCheckBox; d->exifSetOrientationBox->setText(i18n("Set orientation tag to normal after rotate/flip.")); rotationAdvLayout->addWidget(rotationAdvIcon, 0, 0, 1, 1); rotationAdvLayout->addWidget(rotationAdvExpl, 0, 1, 1, 1); rotationAdvLayout->addWidget(d->exifRotateBox, 1, 0, 1, 3); rotationAdvLayout->addWidget(d->exifSetOrientationBox, 2, 0, 1, 3); rotationAdvLayout->setColumnStretch(2, 10); d->rotationAdvGroup->setLayout(rotationAdvLayout); // -------------------------------------------------------- rotationLayout->addWidget(d->rotationGroup); rotationLayout->addWidget(d->rotationAdvGroup); rotationLayout->addStretch(); rotationPanel->setLayout(rotationLayout); d->tab->insertTab(Rotation, rotationPanel, i18nc("@title:tab", "Rotation")); // -------------------------------------------------------- QWidget* const displayPanel = new QWidget; QGridLayout* const displayLayout = new QGridLayout; QLabel* const displayLabel = new QLabel(i18nc("@info:label", "Select Metadata Fields to Be Displayed")); QLabel* const displayIcon = new QLabel; displayIcon->setPixmap(QIcon::fromTheme(QLatin1String("view-list-tree")).pixmap(32)); d->displaySubTab = new QTabWidget; d->tagsCfgPanel = new MetadataPanel(d->displaySubTab); displayLayout->addWidget(displayIcon, 0, 0); displayLayout->addWidget(displayLabel, 0, 1); displayLayout->addWidget(d->displaySubTab, 1, 0, 1, 3); displayLayout->setColumnStretch(2, 1); displayPanel->setLayout(displayLayout); d->tab->insertTab(Display, displayPanel, i18nc("@title:tab", "Views")); // -------------------------------------------------------- #ifdef HAVE_KFILEMETADATA QWidget* const balooPanel = new QWidget(d->tab); QVBoxLayout* const balooLayout = new QVBoxLayout(balooPanel); QGroupBox* const balooGroup = new QGroupBox(i18n("Baloo Desktop Search"), balooPanel); QVBoxLayout* const gLayout3 = new QVBoxLayout(balooGroup); d->saveToBalooBox = new QCheckBox; d->saveToBalooBox->setText(i18n("Store metadata from digiKam in Baloo")); d->saveToBalooBox->setWhatsThis(i18n("Turn on this option to push rating, comments and tags " "from digiKam into the Baloo storage")); d->readFromBalooBox = new QCheckBox; d->readFromBalooBox->setText(i18n("Read metadata from Baloo")); d->readFromBalooBox->setWhatsThis(i18n("Turn on this option if you want to apply changes to " "rating, comments and tags made in Baloo to digiKam's metadata storage. " "Please note that image metadata will not be edited automatically.")); gLayout3->addWidget(d->saveToBalooBox); gLayout3->addWidget(d->readFromBalooBox); d->tab->insertTab(Baloo, balooPanel, i18nc("@title:tab", "Baloo")); // -------------------------------------------------------- QFrame* const balooBox = new QFrame(balooPanel); QGridLayout* const balooGrid = new QGridLayout(balooBox); balooBox->setFrameStyle(QFrame::StyledPanel | QFrame::Raised); QLabel* const balooLogoLabel = new QLabel; balooLogoLabel->setPixmap(QIcon::fromTheme(QLatin1String("baloo")).pixmap(48)); QLabel* const balooExplanation = new QLabel(balooBox); balooExplanation->setOpenExternalLinks(true); balooExplanation->setWordWrap(true); QString balootxt; balootxt.append(i18n("

Baloo " "provides the basis to handle all kinds of metadata on the KDE desktop in a generic fashion. " "It allows you to tag, rate and comment your files in KDE applications like Dolphin.

" "

Please set here if you want to synchronize the metadata stored by digiKam desktop-wide with the " "Baloo Desktop Search.

")); balooExplanation->setText(balootxt); balooGrid->addWidget(balooLogoLabel, 0, 0, 1, 1); balooGrid->addWidget(balooExplanation, 0, 1, 1, 2); balooGrid->setColumnStretch(1, 10); balooGrid->setRowStretch(1, 10); balooGrid->setSpacing(0); // -------------------------------------------------------- balooLayout->addWidget(balooGroup); balooLayout->addWidget(balooBox); //balooLayout->addWidget(d->resyncButton, 0, Qt::AlignRight); balooLayout->addStretch(); #endif // HAVE_KFILEMETADATA //--------------Advanced Metadata Configuration -------------- d->advTab = new AdvancedMetadataTab(this); d->tab->insertTab(AdvancedConfig, d->advTab, i18nc("@title:tab", "Advanced")); //------------------------Sidecars------------------------- QWidget* const sidecarsPanel = new QWidget(d->tab); QVBoxLayout* const sidecarsLayout = new QVBoxLayout(sidecarsPanel); // -------------------------------------------------------- QGroupBox* rwSidecarsGroup = new QGroupBox; QGridLayout* const rwSidecarsLayout = new QGridLayout; QLabel* const rwSidecarsLabel = new QLabel(i18nc("@label", "Reading and Writing to Sidecars")); d->readXMPSidecarBox = new QCheckBox; d->readXMPSidecarBox->setText(i18nc("@option:check", "Read from sidecar files")); d->readXMPSidecarBox->setWhatsThis(i18nc("@info:whatsthis", "Turn on this option to read metadata from XMP sidecar files when reading metadata.")); d->readXMPSidecarBox->setEnabled(MetaEngine::supportXmp()); d->writeXMPSidecarBox = new QCheckBox; d->writeXMPSidecarBox->setText(i18nc("@option:check", "Write to sidecar files")); d->writeXMPSidecarBox->setWhatsThis(i18nc("@info:whatsthis", "Turn on this option to save, as specified, metadata to XMP sidecar files.")); d->writeXMPSidecarBox->setEnabled(MetaEngine::supportXmp()); d->writingModeCombo = new QComboBox; d->writingModeCombo->addItem(i18n("Write to XMP sidecar for read-only image only"), MetaEngine::WRITETOSIDECARONLY4READONLYFILES); d->writingModeCombo->addItem(i18n("Write to XMP sidecar only"), MetaEngine::WRITETOSIDECARONLY); d->writingModeCombo->addItem(i18n("Write to image and XMP Sidecar"), MetaEngine::WRITETOSIDECARANDIMAGE); d->writingModeCombo->setToolTip(i18nc("@info:tooltip", "Specify the exact mode of XMP sidecar writing")); d->writingModeCombo->setEnabled(false); connect(d->writeXMPSidecarBox, SIGNAL(toggled(bool)), d->writingModeCombo, SLOT(setEnabled(bool))); rwSidecarsLayout->addWidget(rwSidecarsLabel, 0, 0, 1, 3); rwSidecarsLayout->addWidget(d->readXMPSidecarBox, 1, 0, 1, 3); rwSidecarsLayout->addWidget(d->writeXMPSidecarBox, 2, 0, 1, 3); rwSidecarsLayout->addWidget(d->writingModeCombo, 3, 1, 1, 2); rwSidecarsLayout->setColumnStretch(3, 10); rwSidecarsGroup->setLayout(rwSidecarsLayout); // -------------------------------------------------------- QGroupBox* const extensionsGroup = new QGroupBox(sidecarsPanel); QGridLayout* const extensionsGrid = new QGridLayout(extensionsGroup); QLabel* extensionsGroupLabel = new QLabel( i18n("

Add file types to be recognised as sidecars.

" "

digiKam (optionally) writes metadata to *.xmp sidecar " "files. Other programs might use different types, which " "can be specified below. digiKam will neither display these " "nor read from or write to them. But whenever a matching album " "item (e.g. \"image.dng\" for \"image.dng.pp3\") is renamed, " "moved, copied or deleted, the same operation will be done " "on these sidecar files.

" "

Multiple extensions must be separated by a semicolon " "or a space.

")); extensionsGroupLabel->setWordWrap(true); QLabel* const extensionsLogo = new QLabel(extensionsGroup); extensionsLogo->setPixmap(QIcon::fromTheme(QLatin1String("text-x-texinfo")).pixmap(48)); d->extensionsEdit = new QLineEdit(extensionsGroup); d->extensionsEdit->setWhatsThis(i18n("

Here you can add extra extensions " "of sidecars files to be processed alongside " "regular items. These files won't be visible, " "but regarded as an extension of the main file. " "Just write \"xyz abc\" to support files with " "the *.xyz and *.abc extensions. The internally " "used sidecars type *.xmp is always included.

")); d->extensionsEdit->setClearButtonEnabled(true); d->extensionsEdit->setPlaceholderText(i18n("Enter additional sidecars file extensions.")); QLabel* const extensionsLabel = new QLabel(extensionsGroup); extensionsLabel->setText(i18n("Additional &sidecar file extensions")); extensionsLabel->setBuddy(d->extensionsEdit); extensionsGrid->addWidget(extensionsGroupLabel, 0, 0, 1, -1); extensionsGrid->addWidget(extensionsLogo, 1, 0, 2, 1); extensionsGrid->addWidget(extensionsLabel, 1, 1, 1, -1); extensionsGrid->addWidget(d->extensionsEdit, 2, 1, 1, -1); extensionsGrid->setColumnStretch(1, 10); // -------------------------------------------------------- sidecarsLayout->addWidget(rwSidecarsGroup); sidecarsLayout->addWidget(extensionsGroup); sidecarsLayout->addStretch(); d->tab->insertTab(Sidecars, sidecarsPanel, i18nc("@title:tab", "Sidecars")); // -------------------------------------------------------- readSettings(); connect(d->exifRotateBox, SIGNAL(toggled(bool)), this, SLOT(slotExifAutoRotateToggled(bool))); } SetupMetadata::~SetupMetadata() { delete d; } void SetupMetadata::setActiveMainTab(MetadataTab tab) { d->tab->setCurrentIndex(tab); } void SetupMetadata::setActiveSubTab(int tab) { d->displaySubTab->setCurrentIndex(tab); } void SetupMetadata::applySettings() { MetadataSettings* const mSettings = MetadataSettings::instance(); if (!mSettings) { return; } MetadataSettingsContainer set; set.rotationBehavior = MetadataSettingsContainer::RotateByInternalFlag; if (d->allowRotateByMetadata->isChecked()) { set.rotationBehavior |= MetadataSettingsContainer::RotateByMetadataFlag; } if (d->rotateByContents->isChecked()) { set.rotationBehavior |= MetadataSettingsContainer::RotateByLosslessRotation; if (d->allowLossyRotate->isChecked()) { set.rotationBehavior |= MetadataSettingsContainer::RotateByLossyRotation; } } set.exifRotate = d->exifRotateBox->isChecked(); set.exifSetOrientation = d->exifSetOrientationBox->isChecked(); set.saveComments = d->saveCommentsBox->isChecked(); set.saveDateTime = d->saveDateTimeBox->isChecked(); set.savePickLabel = d->savePickLabelBox->isChecked(); set.saveColorLabel = d->saveColorLabelBox->isChecked(); set.saveRating = d->saveRatingBox->isChecked(); set.saveTags = d->saveTagsBox->isChecked(); set.saveTemplate = d->saveTemplateBox->isChecked(); set.saveFaceTags = d->saveFaceTags->isChecked(); set.useLazySync = d->useLazySync->isChecked(); set.writeRawFiles = d->writeRawFilesBox->isChecked(); set.useXMPSidecar4Reading = d->readXMPSidecarBox->isChecked(); if (d->writeXMPSidecarBox->isChecked()) { set.metadataWritingMode = (MetaEngine::MetadataWritingMode) d->writingModeCombo->itemData(d->writingModeCombo->currentIndex()).toInt(); } else { set.metadataWritingMode = MetaEngine::WRITETOIMAGEONLY; } set.updateFileTimeStamp = d->updateFileTimeStampBox->isChecked(); set.rescanImageIfModified = d->rescanImageIfModifiedBox->isChecked(); set.sidecarExtensions = cleanUserFilterString(d->extensionsEdit->text()); mSettings->setSettings(set); #ifdef HAVE_KFILEMETADATA ApplicationSettings* const aSettings = ApplicationSettings::instance(); if (!aSettings) { return; } aSettings->setSyncDigikamToBaloo(d->saveToBalooBox->isChecked()); aSettings->setSyncBalooToDigikam(d->readFromBalooBox->isChecked()); aSettings->saveSettings(); #endif // HAVE_KFILEMETADATA d->tagsCfgPanel->applySettings(); d->advTab->applySettings(); } void SetupMetadata::readSettings() { MetadataSettings* const mSettings = MetadataSettings::instance(); if (!mSettings) { return; } MetadataSettingsContainer set = mSettings->settings(); if (set.rotationBehavior & MetadataSettingsContainer::RotatingPixels) { d->rotateByContents->setChecked(true); } else { d->rotateByFlag->setChecked(true); } d->allowRotateByMetadata->setChecked(set.rotationBehavior & MetadataSettingsContainer::RotateByMetadataFlag); d->allowLossyRotate->setChecked(set.rotationBehavior & MetadataSettingsContainer::RotateByLossyRotation); d->exifAutoRotateOriginal = set.exifRotate; d->exifRotateBox->setChecked(d->exifAutoRotateOriginal); d->exifSetOrientationBox->setChecked(set.exifSetOrientation); d->saveTagsBox->setChecked(set.saveTags); d->saveCommentsBox->setChecked(set.saveComments); d->saveRatingBox->setChecked(set.saveRating); d->savePickLabelBox->setChecked(set.savePickLabel); d->saveColorLabelBox->setChecked(set.saveColorLabel); d->saveDateTimeBox->setChecked(set.saveDateTime); d->saveTemplateBox->setChecked(set.saveTemplate); d->saveFaceTags->setChecked(set.saveFaceTags); d->useLazySync->setChecked(set.useLazySync); d->writeRawFilesBox->setChecked(set.writeRawFiles); d->readXMPSidecarBox->setChecked(set.useXMPSidecar4Reading); d->updateFileTimeStampBox->setChecked(set.updateFileTimeStamp); d->rescanImageIfModifiedBox->setChecked(set.rescanImageIfModified); if (set.metadataWritingMode == MetaEngine::WRITETOIMAGEONLY) { d->writeXMPSidecarBox->setChecked(false); } else { d->writeXMPSidecarBox->setChecked(true); d->writingModeCombo->setCurrentIndex(d->writingModeCombo->findData(set.metadataWritingMode)); } d->extensionsEdit->setText(set.sidecarExtensions.join(QLatin1Char(' '))); #ifdef HAVE_KFILEMETADATA ApplicationSettings* const aSettings = ApplicationSettings::instance(); if (!aSettings) { return; } d->saveToBalooBox->setChecked(aSettings->getSyncDigikamToBaloo()); d->readFromBalooBox->setChecked(aSettings->getSyncBalooToDigikam()); #endif // HAVE_KFILEMETADATA } bool SetupMetadata::exifAutoRotateHasChanged() const { return d->exifAutoRotateOriginal != d->exifRotateBox->isChecked(); } void SetupMetadata::slotExifAutoRotateToggled(bool b) { // Show info if rotation was switched off, and only once. if (!b && d->exifAutoRotateShowedInfo && exifAutoRotateHasChanged()) { d->exifAutoRotateShowedInfo = true; QMessageBox::information(this, qApp->applicationName(), i18nc("@info", "Switching off exif auto rotation will most probably show your images in a wrong orientation, " "so only change this option if you explicitly require this. " "Furthermore, you need to regenerate all already stored thumbnails via " "the Tools / Maintenance menu.")); } } } // namespace Digikam