Commit aa554832 authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

better robust initialization of Image Editor tools.

The init sequence is now linerar without race condition given by signals and slots.
This will prevent blocking cases at tool init with 0% progress in statusbar and tool settings disabled.
parent 1ccef06e
......@@ -128,7 +128,6 @@ AdjustCurvesTool::AdjustCurvesTool(QObject* const parent)
vbox->setSpacing(0);
setToolSettings(d->gboxSettings);
init();
// -------------------------------------------------------------
......
......@@ -173,6 +173,7 @@ AdjustLevelsTool::AdjustLevelsTool(QObject* const parent)
setObjectName("adjustlevels");
setToolName(i18n("Adjust Levels"));
setToolIcon(SmallIcon("adjustlevels"));
setInitPreview(true);
ImageIface iface;
d->originalImage = iface.original();
......@@ -350,7 +351,6 @@ AdjustLevelsTool::AdjustLevelsTool(QObject* const parent)
// -------------------------------------------------------------
setToolSettings(d->gboxSettings);
init();
// -------------------------------------------------------------
// Channels and scale selection slots.
......@@ -405,8 +405,6 @@ AdjustLevelsTool::AdjustLevelsTool(QObject* const parent)
connect(d->pickerColorButtonGroup, SIGNAL(buttonReleased(int)),
this, SLOT(slotPickerColorButtonActived(int)));
slotTimer();
}
AdjustLevelsTool::~AdjustLevelsTool()
......
......@@ -186,7 +186,6 @@ AutoCorrectionTool::AutoCorrectionTool(QObject* const parent)
// -------------------------------------------------------------
setToolSettings(d->gboxSettings);
init();
// -------------------------------------------------------------
......
......@@ -95,6 +95,7 @@ BCGTool::BCGTool(QObject* const parent)
setToolIcon(SmallIcon("contrast"));
setToolHelp("bcgadjusttool.anchor");
setToolCategory(FilterAction::ReproducibleFilter);
setInitPreview(true);
d->previewWidget = new ImageRegionWidget;
setToolView(d->previewWidget);
......@@ -114,7 +115,6 @@ BCGTool::BCGTool(QObject* const parent)
d->settingsView = new BCGSettings(d->gboxSettings->plainPage());
setToolSettings(d->gboxSettings);
init();
// -------------------------------------------------------------
......@@ -123,8 +123,6 @@ BCGTool::BCGTool(QObject* const parent)
connect(d->previewWidget, SIGNAL(signalResized()),
this, SLOT(slotPreview()));
slotTimer();
}
BCGTool::~BCGTool()
......
......@@ -92,6 +92,7 @@ BWSepiaTool::BWSepiaTool(QObject* const parent)
setToolName(i18n("Black and White"));
setToolIcon(SmallIcon("bwtonal"));
setToolHelp("blackandwhitetool.anchor");
setInitPreview(true);
// -------------------------------------------------------------
......@@ -114,7 +115,6 @@ BWSepiaTool::BWSepiaTool(QObject* const parent)
d->bwsepiaSettings = new BWSepiaSettings(d->gboxSettings->plainPage(), iface.original());
setToolSettings(d->gboxSettings);
init();
// -------------------------------------------------------------
......@@ -123,8 +123,6 @@ BWSepiaTool::BWSepiaTool(QObject* const parent)
connect(d->previewWidget, SIGNAL(signalResized()),
this, SLOT(slotPreview()));
slotTimer();
}
BWSepiaTool::~BWSepiaTool()
......
......@@ -88,6 +88,7 @@ CBTool::CBTool(QObject* const parent)
setObjectName("colorbalance");
setToolName(i18n("Color Balance"));
setToolIcon(SmallIcon("adjustrgb"));
setInitPreview(true);
d->previewWidget = new ImageRegionWidget;
setToolView(d->previewWidget);
......@@ -104,7 +105,6 @@ CBTool::CBTool(QObject* const parent)
d->cbSettings = new CBSettings(d->gboxSettings->plainPage());
setToolSettings(d->gboxSettings);
init();
// -------------------------------------------------------------
......@@ -113,8 +113,6 @@ CBTool::CBTool(QObject* const parent)
connect(d->previewWidget, SIGNAL(signalResized()),
this, SLOT(slotPreview()));
slotTimer();
}
CBTool::~CBTool()
......
......@@ -134,7 +134,6 @@ ChannelMixerTool::ChannelMixerTool(QObject* const parent)
vbox->setSpacing(0);
setToolSettings(d->gboxSettings);
init();
// -------------------------------------------------------------
......
......@@ -167,6 +167,7 @@ FilmTool::FilmTool(QObject* const parent)
setObjectName("film");
setToolName(i18n("Color Negative Film"));
setToolIcon(SmallIcon("colorneg"));
setInitPreview(true);
ImageIface iface;
d->originalImage = iface.original();
......@@ -324,7 +325,6 @@ FilmTool::FilmTool(QObject* const parent)
// -------------------------------------------------------------
setToolSettings(d->gboxSettings);
init();
// Button Slots -------------------------------------------------
......@@ -356,8 +356,6 @@ FilmTool::FilmTool(QObject* const parent)
connect(d->colorBalanceInput, SIGNAL(stateChanged(int)),
this, SLOT(slotColorBalanceStateChanged(int)));
slotTimer();
}
FilmTool::~FilmTool()
......
......@@ -88,6 +88,7 @@ HSLTool::HSLTool(QObject* const parent)
setToolName(i18n("Hue / Saturation / Lightness"));
setToolIcon(SmallIcon("adjusthsl"));
setToolHelp("hsladjusttool.anchor");
setInitPreview(true);
d->previewWidget = new ImageRegionWidget;
setToolView(d->previewWidget);
......@@ -106,7 +107,6 @@ HSLTool::HSLTool(QObject* const parent)
d->hslSettings = new HSLSettings(d->gboxSettings->plainPage());
setToolSettings(d->gboxSettings);
init();
// -------------------------------------------------------------
......@@ -115,8 +115,6 @@ HSLTool::HSLTool(QObject* const parent)
connect(d->hslSettings, SIGNAL(signalSettingsChanged()),
this, SLOT(slotTimer()));
slotTimer();
}
HSLTool::~HSLTool()
......
......@@ -152,8 +152,6 @@ ProfileConversionTool::ProfileConversionTool(QObject* const parent)
setToolView(d->previewWidget);
setPreviewModeMask(PreviewToolBar::AllPreviewModes);
init();
// -------------------------------------------------------------
connect(d->previewWidget, SIGNAL(signalOriginalClipFocusChanged()),
......
......@@ -94,6 +94,7 @@ WhiteBalanceTool::WhiteBalanceTool(QObject* const parent)
setObjectName("whitebalance");
setToolName(i18n("White Balance"));
setToolIcon(SmallIcon("whitebalance"));
setInitPreview(true);
// -------------------------------------------------------------
......@@ -116,7 +117,6 @@ WhiteBalanceTool::WhiteBalanceTool(QObject* const parent)
d->settingsView = new WBSettings(d->gboxSettings->plainPage());
setToolSettings(d->gboxSettings);
init();
// -------------------------------------------------------------
......@@ -138,7 +138,6 @@ WhiteBalanceTool::WhiteBalanceTool(QObject* const parent)
connect(d->previewWidget, SIGNAL(spotPositionChangedFromTarget(Digikam::DColor,QPoint)),
this, SLOT(slotColorSelectedFromTarget(Digikam::DColor)));
*/
slotTimer();
}
WhiteBalanceTool::~WhiteBalanceTool()
......
......@@ -88,7 +88,6 @@ BorderTool::BorderTool(QObject* const parent)
d->gboxSettings = new EditorToolSettings;
d->settingsView = new BorderSettings(d->gboxSettings->plainPage());
setToolSettings(d->gboxSettings);
init();
// -------------------------------------------------------------
......
......@@ -244,7 +244,6 @@ InsertTextTool::InsertTextTool(QObject* const parent)
// -------------------------------------------------------------
setToolSettings(d->gboxSettings);
init();
// -------------------------------------------------------------
......
......@@ -170,7 +170,6 @@ TextureTool::TextureTool(QObject* const parent)
setToolSettings(d->gboxSettings);
setToolView(d->previewWidget);
setPreviewModeMask(PreviewToolBar::AllPreviewModes);
init();
// -------------------------------------------------------------
......
......@@ -102,7 +102,6 @@ AntiVignettingTool::AntiVignettingTool(QObject* const parent)
d->settingsView = new AntiVignettingSettings(d->gboxSettings->plainPage());
setToolSettings(d->gboxSettings);
init();
// -------------------------------------------------------------
......
......@@ -116,7 +116,6 @@ BlurTool::BlurTool(QObject* const parent)
setPreviewModeMask(PreviewToolBar::AllPreviewModes);
setToolSettings(d->gboxSettings);
setToolView(d->previewWidget);
init();
// --------------------------------------------------------
......
......@@ -158,7 +158,6 @@ HotPixelsTool::HotPixelsTool(QObject* const parent)
setToolSettings(d->gboxSettings);
setToolView(d->previewWidget);
setPreviewModeMask(PreviewToolBar::AllPreviewModes);
init();
// -------------------------------------------------------------
......
......@@ -244,7 +244,6 @@ InPaintingTool::InPaintingTool(QObject* const parent)
GreycstorationContainer defaults;
defaults.setInpaintingDefaultSettings();
d->settingsWidget->setDefaultSettings(defaults);
init();
}
InPaintingTool::~InPaintingTool()
......
......@@ -142,8 +142,6 @@ LensAutoFixTool::LensAutoFixTool(QObject* const parent)
connect(d->showGrid, SIGNAL(toggled(bool)),
this, SLOT(slotTimer()));
init();
}
LensAutoFixTool::~LensAutoFixTool()
......
......@@ -186,7 +186,6 @@ LensDistortionTool::LensDistortionTool(QObject* const parent)
gridSettings->setSpacing(d->gboxSettings->spacingHint());
setToolSettings(d->gboxSettings);
init();
// -------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment