From 83e686a719a18d1c05ad0110b282a10a35fef30b Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Mon, 11 Jun 2018 21:52:23 +0200 Subject: [PATCH] Fixes bugs in Black-and-White tool - Incorrect history messages were shown. - Channel mixer "Auto" behaved incorrectly. Fixes by Jacques Desmis. Closes #4570 --- rtengine/procparams.cc | 2 +- rtgui/blackwhite.cc | 17 ++++++++++++++++- rtgui/blackwhite.h | 1 + 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 00419693c..36fa4aa22 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -1842,7 +1842,7 @@ BlackWhiteParams::BlackWhiteParams() : enabledcc(true), enabled(false), filter("None"), - setting("NormalContrast"), + setting("RGB-Rel"), method("Desaturation"), mixerRed(33), mixerOrange(33), diff --git a/rtgui/blackwhite.cc b/rtgui/blackwhite.cc index 6970a2f31..507d3aee6 100644 --- a/rtgui/blackwhite.cc +++ b/rtgui/blackwhite.cc @@ -128,7 +128,7 @@ BlackWhite::BlackWhite (): FoldableToolPanel(this, "blackwhite", M("TP_BWMIX_LAB setting->append (M("TP_BWMIX_SET_ROYGCBPMREL")); setting->append (M("TP_BWMIX_SET_INFRARED")); - setting->set_active (0); + setting->set_active (11); settingHBox->pack_start (*setting); mixerVBox->pack_start (*settingHBox); settingconn = setting->signal_changed().connect ( sigc::mem_fun(*this, &BlackWhite::settingChanged) ); @@ -388,9 +388,21 @@ bool BlackWhite::BWComputed_ () disableListener (); mixerRed->setValue (nextredbw); + adjusterChanged(mixerRed, mixerRed->getValue()); mixerGreen->setValue (nextgreenbw); + adjusterChanged(mixerGreen, mixerGreen->getValue()); mixerBlue->setValue (nextbluebw); + adjusterChanged(mixerBlue, mixerBlue->getValue()); + autoconn.block (true); + autoch->set_active (true); + autoconn.block (false); + lastAuto = false; + nextcount++; enableListener (); + if (listener && nextcount <= 1 ) { + // activated only 1 time, but perhaps in some cases if we want that all is update pp3, auto, sliders : nextcount <= 2 but it cost time and result is identical + listener->panelChanged (EvAutoch, M("GENERAL_ENABLED")); + } updateRGBLabel(); @@ -789,6 +801,7 @@ void BlackWhite::filterChanged () if (listener && (multiImage || getEnabled())) { listener->panelChanged (EvBWfilter, filter->get_active_text ()); + listener->panelChanged (EvAutoch, M("GENERAL_ENABLED")); } } @@ -884,6 +897,7 @@ void BlackWhite::neutral_pressed () updateRGBLabel(); + nextcount = 0; if(listener) { listener->panelChanged (EvNeutralBW, M("GENERAL_RESET")); } @@ -1089,6 +1103,7 @@ void BlackWhite::adjusterChanged (Adjuster* a, double newval) autoch->set_inconsistent (false); } + nextcount = 0; autoconn.block(true); autoch->set_active (false); autoconn.block(false); diff --git a/rtgui/blackwhite.h b/rtgui/blackwhite.h index 5f0ffec44..07ad6a160 100644 --- a/rtgui/blackwhite.h +++ b/rtgui/blackwhite.h @@ -138,6 +138,7 @@ private: double nextredbw; double nextgreenbw; double nextbluebw; + int nextcount = 0; IdleRegister idle_register; };