Get locallab spot name from one source

Fixes #6298.
This commit is contained in:
Lawrence Lee 2021-07-10 09:52:18 -07:00
parent d7f9e1f51c
commit 5a49ea7b8c
7 changed files with 583 additions and 573 deletions

View File

@ -703,6 +703,9 @@ void ControlSpotPanel::on_button_rename()
row[spots_.name] = newname; row[spots_.name] = newname;
treeview_->columns_autosize(); treeview_->columns_autosize();
listener->panelChanged(EvLocallabSpotName, newname); listener->panelChanged(EvLocallabSpotName, newname);
if (controlPanelListener) {
controlPanelListener->spotNameChanged(newname);
}
} }
} }
} }

View File

@ -34,6 +34,7 @@ public:
virtual ~ControlPanelListener() {}; virtual ~ControlPanelListener() {};
virtual void resetToolMaskView() = 0; virtual void resetToolMaskView() = 0;
virtual void spotNameChanged(const Glib::ustring &newName) = 0;
}; };

View File

@ -356,6 +356,7 @@ void Locallab::read(const rtengine::procparams::ProcParams* pp, const ParamsEdit
// Select active spot // Select active spot
if (pp->locallab.spots.size() > 0) { if (pp->locallab.spots.size() > 0) {
expsettings->setSelectedSpot(pp->locallab.selspot); expsettings->setSelectedSpot(pp->locallab.selspot);
spotName = pp->locallab.spots.at(pp->locallab.selspot).name;
} }
// Update each Locallab tools GUI // Update each Locallab tools GUI
@ -542,6 +543,8 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
// Update Locallab tools GUI with new created spot // Update Locallab tools GUI with new created spot
disableListener(); disableListener();
spotName = pp->locallab.spots.at(pp->locallab.selspot).name;
for (auto tool : locallabTools) { for (auto tool : locallabTools) {
tool->read(pp, pedited); tool->read(pp, pedited);
} }
@ -598,6 +601,10 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
// Update Locallab tools GUI with selected spot // Update Locallab tools GUI with selected spot
disableListener(); disableListener();
if (pp->locallab.spots.size() > 0) {
spotName = pp->locallab.spots.at(pp->locallab.selspot).name;
}
for (auto tool : locallabTools) { for (auto tool : locallabTools) {
tool->read(pp, pedited); tool->read(pp, pedited);
} }
@ -638,6 +645,10 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
expsettings->setSelectedSpot(pp->locallab.selspot); expsettings->setSelectedSpot(pp->locallab.selspot);
disableListener(); disableListener();
if (pp->locallab.spots.size() > 0) {
spotName = pp->locallab.spots.at(pp->locallab.selspot).name;
}
for (auto tool : locallabTools) { for (auto tool : locallabTools) {
tool->read(pp, pedited); tool->read(pp, pedited);
} }
@ -842,6 +853,8 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
// Update Locallab tools GUI with new created spot // Update Locallab tools GUI with new created spot
disableListener(); disableListener();
spotName = pp->locallab.spots.at(pp->locallab.selspot).name;
for (auto tool : locallabTools) { for (auto tool : locallabTools) {
tool->read(pp, pedited); tool->read(pp, pedited);
} }
@ -1180,12 +1193,18 @@ void Locallab::updateShowtooltipVisibility(bool showtooltip)
} }
} }
void Locallab::spotNameChanged(const Glib::ustring &newName)
{
spotName = newName;
}
void Locallab::addTool(Gtk::Box* where, LocallabTool* tool) void Locallab::addTool(Gtk::Box* where, LocallabTool* tool)
{ {
tool->getExpander()->setLevel(3); tool->getExpander()->setLevel(3);
where->pack_start(*tool->getExpander(), false, false); where->pack_start(*tool->getExpander(), false, false);
locallabTools.push_back(tool); locallabTools.push_back(tool);
tool->setLocallabToolListener(this); tool->setLocallabToolListener(this);
tool->setSpotNameSource(&spotName);
} }
void Locallab::setParamEditable(bool cond) void Locallab::setParamEditable(bool cond)

View File

@ -128,6 +128,8 @@ private:
// Other widgets // Other widgets
Gtk::Button* const resetshowButton; Gtk::Button* const resetshowButton;
Glib::ustring spotName;
public: public:
Locallab(); Locallab();
@ -200,6 +202,7 @@ private:
// ControlSpotListener function // ControlSpotListener function
void resetToolMaskView() override; void resetToolMaskView() override;
void spotNameChanged(const Glib::ustring &newName) override;
// LocallabToolListener function // LocallabToolListener function
void resetOtherMaskView(LocallabTool* current) override; void resetOtherMaskView(LocallabTool* current) override;

File diff suppressed because it is too large Load Diff

View File

@ -59,7 +59,7 @@ protected:
// LocallabTool parameters // LocallabTool parameters
bool needMode; bool needMode;
bool isLocActivated; bool isLocActivated;
Glib::ustring spotName; const Glib::ustring *spotNameSource;
LocallabToolListener* locToolListener; LocallabToolListener* locToolListener;
// LocallabTool generic widgets // LocallabTool generic widgets
@ -70,6 +70,8 @@ protected:
IdleRegister idle_register; IdleRegister idle_register;
Glib::ustring getSpotName() const;
public: public:
// Locallab tool constructor/destructor // Locallab tool constructor/destructor
LocallabTool(Gtk::Box* content, Glib::ustring toolName, Glib::ustring UILabel, bool need11 = false, bool needMode = true); LocallabTool(Gtk::Box* content, Glib::ustring toolName, Glib::ustring UILabel, bool need11 = false, bool needMode = true);
@ -98,10 +100,10 @@ public:
isLocActivated = cond; isLocActivated = cond;
} }
// Setter for spot name // Setter for spot name source
void setSpotName(const Glib::ustring &spotname) void setSpotNameSource(const Glib::ustring *source)
{ {
spotName = spotname; spotNameSource = source;
} }
// Setter for Locallab tool listener // Setter for Locallab tool listener

File diff suppressed because it is too large Load Diff