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;
treeview_->columns_autosize();
listener->panelChanged(EvLocallabSpotName, newname);
if (controlPanelListener) {
controlPanelListener->spotNameChanged(newname);
}
}
}
}

View File

@ -34,6 +34,7 @@ public:
virtual ~ControlPanelListener() {};
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
if (pp->locallab.spots.size() > 0) {
expsettings->setSelectedSpot(pp->locallab.selspot);
spotName = pp->locallab.spots.at(pp->locallab.selspot).name;
}
// 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
disableListener();
spotName = pp->locallab.spots.at(pp->locallab.selspot).name;
for (auto tool : locallabTools) {
tool->read(pp, pedited);
}
@ -598,6 +601,10 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
// Update Locallab tools GUI with selected spot
disableListener();
if (pp->locallab.spots.size() > 0) {
spotName = pp->locallab.spots.at(pp->locallab.selspot).name;
}
for (auto tool : locallabTools) {
tool->read(pp, pedited);
}
@ -638,6 +645,10 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
expsettings->setSelectedSpot(pp->locallab.selspot);
disableListener();
if (pp->locallab.spots.size() > 0) {
spotName = pp->locallab.spots.at(pp->locallab.selspot).name;
}
for (auto tool : locallabTools) {
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
disableListener();
spotName = pp->locallab.spots.at(pp->locallab.selspot).name;
for (auto tool : locallabTools) {
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)
{
tool->getExpander()->setLevel(3);
where->pack_start(*tool->getExpander(), false, false);
locallabTools.push_back(tool);
tool->setLocallabToolListener(this);
tool->setSpotNameSource(&spotName);
}
void Locallab::setParamEditable(bool cond)

View File

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

File diff suppressed because it is too large Load Diff

View File

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

File diff suppressed because it is too large Load Diff