diff --git a/rtgui/distortion.cc b/rtgui/distortion.cc index 52b0b2875..bfbc45e2a 100644 --- a/rtgui/distortion.cc +++ b/rtgui/distortion.cc @@ -38,6 +38,11 @@ Distortion::Distortion (): FoldableToolPanel(this, TOOL_NAME, M("TP_DISTORTION_L EvDistortionDefish = mapper->newEvent(TRANSFORM, "HISTORY_MSG_DISTORTION_DEFISH"); EvDistortionDefishVoid = mapper->newEvent(M_VOID, "HISTORY_MSG_DISTORTION_DEFISH"); + EvDistortionDefishFocalLength = mapper->newEvent(TRANSFORM, "HISTORY_MSG_DISTORTION_DEFISH_FOCAL"); + EvDistortionDefishFocalLengthVoid = mapper->newEvent(M_VOID, "HISTORY_MSG_DISTORTION_DEFISH_FOCAL"); + + setCamBasedEventsActive(); + rlistener = nullptr; autoDistor = Gtk::manage (new Gtk::Button (M("GENERAL_AUTO"))); autoDistor->set_image (*Gtk::manage (new RTImage ("distortion-auto-small", Gtk::ICON_SIZE_BUTTON))); @@ -158,6 +163,18 @@ void Distortion::defishChanged() } } +void Distortion::setCamBasedEventsActive(bool active) +{ + if (active) { + event_distortion_defish = &EvDistortionDefish; + event_distortion_defish_focal_length = &EvDistortionDefishFocalLength; + } + else { + event_distortion_defish = &EvDistortionDefishVoid; + event_distortion_defish_focal_length = &EvDistortionDefishFocalLengthVoid; + } +} + void Distortion::setAdjusterBehavior (bool vadd, bool focal_length_add) { distor->setAddMode(vadd); diff --git a/rtgui/distortion.h b/rtgui/distortion.h index ec817f543..456331cb6 100644 --- a/rtgui/distortion.h +++ b/rtgui/distortion.h @@ -43,9 +43,9 @@ public: rtengine::ProcEvent EvDistortionDefishVoid; rtengine::ProcEvent* event_distortion_defish; - rtengine::ProcEvent EvDistortionFocalLength; - rtengine::ProcEvent EvDistortionFocalLengthVoid; - rtengine::ProcEvent* event_distortion_focal_length; + rtengine::ProcEvent EvDistortionDefishFocalLength; + rtengine::ProcEvent EvDistortionDefishFocalLengthVoid; + rtengine::ProcEvent* event_distortion_defish_focal_length; static const Glib::ustring TOOL_NAME; @@ -65,4 +65,6 @@ public: rlistener = l; } void defishChanged (void); + + void setCamBasedEventsActive(bool active = true); };