diff --git a/rtdata/languages/default b/rtdata/languages/default index d2cb3f939..c5e0f44eb 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1925,7 +1925,6 @@ TP_LOCALLAB_ENH;Enhanced TP_LOCALLAB_ENHDEN;Enhanced + chroma denoise TP_LOCALLAB_THRES;Threshold chroma TP_LOCALLAB_PROXI;Iterations -TP_LOCALLAB_ANBSPOT_TOOLTIP;Provisory control (I hope somebody can help to manage events!! and suppress this bad function) TP_LOCALLAB_LIGHTNESS;Lightness TP_LOCALLAB_METHOD_TOOLTIP;'Enhanced + chroma denoise' significantly increases processing times.\nBut reduce artifacts. TP_LOCALLAB_RADIUS;Radius @@ -1942,8 +1941,6 @@ TP_LOCALLAB_SENSIH;Hue Scope TP_LOCALLAB_SENSIH_TOOLTIP;Adjust scope of action:\nSmall values limit action to colors very similar to those under the center spot.\nHigh values let the tool act upon a wider range of colors.\nValues smaller than 20 lead to a better algorithm. TP_LOCALLAB_SHAPETYPE;Shape RT-spot area TP_LOCALLAB_SHAPE_TOOLTIP;Rectangle is only in normal mode. -TP_LOCALLAB_SPOTDUPLI;Duplicate Current Spot -TP_LOCALLAB_SPOTDUPLI_TOOLTIP;If check, a copy of all datas will be done, except center X=200 and centerY=200\nto show it is a duplicated spot.\nYou must first increase Control spot.\nIf the spot (current) is not empty, datas will be crushed. TP_LOCALLAB_ELI;Elipse TP_LOCALLAB_RECT;Rectangle TP_LOCALLAB_SHARP;Sharpening @@ -1967,6 +1964,22 @@ TP_LOCALLAB_TRANSIT_TOOLTIP;Adjust smoothness of transition between affected and TP_LOCALLAB_VIBRANCE;Vibrance TP_LOCALLAB_WARM;Warm - Cool & Color artifacts TP_LOCALLAB_WARM_TOOLTIP;This slider use Ciecam algorithm and acts as White Balance, it can warm or cool the area selected.\nIt can also in some cases reduce color artifacts. +TP_LOCALLAB_SPOTNAME;Control Spot # +TP_LOCALLAB_BUTTON_ADD;Add +TP_LOCALLAB_BUTTON_DEL;Delete +TP_LOCALLAB_BUTTON_DUPL;Duplicate +TP_LOCALLAB_BUTTON_REN;Rename +TP_LOCALLAB_BUTTON_VIS;Show/Hide +TP_LOCALLAB_COL_NAME;Name +TP_LOCALLAB_COL_VIS;Status +TP_LOCALLAB_ROW_VIS;Visible +TP_LOCALLAB_ROW_NVIS;Not visible +TP_LOCALLAB_EV_VIS;Show +TP_LOCALLAB_EV_NVIS;Hide +TP_LOCALLAB_REN_DIALOG_NAME;Renaming Control Spot +TP_LOCALLAB_REN_DIALOG_LAB;Enter the new Control Spot name +TP_LOCALLAB_EV_DUPL;Copy of +TP_LOCALLAB_DUPLSPOTNAME;Copy TP_LOCAL_HEIGHT;Bottom TP_LOCAL_HEIGHT_T;Top TP_LOCAL_WIDTH;Right diff --git a/rtgui/controlspotpanel.cc b/rtgui/controlspotpanel.cc index e285c2fc6..e8d70fadf 100644 --- a/rtgui/controlspotpanel.cc +++ b/rtgui/controlspotpanel.cc @@ -33,9 +33,12 @@ ControlSpotPanel::ControlSpotPanel(): EditSubscriber(ET_OBJECTS), FoldableToolPanel(this, "controlspotpanel", M("TP_LOCALLAB_SETTINGS")), - button_add_("Add"), - button_delete_("Delete"), - button_rename_("Rename"), + button_add_(M("TP_LOCALLAB_BUTTON_ADD")), + button_delete_(M("TP_LOCALLAB_BUTTON_DEL")), + button_duplicate_(M("TP_LOCALLAB_BUTTON_DUPL")), + + button_rename_(M("TP_LOCALLAB_BUTTON_REN")), + button_visibility_(M("TP_LOCALLAB_BUTTON_VIS")), shape_(Gtk::manage(new MyComboBoxText())), spotMethod_(Gtk::manage(new MyComboBoxText())), @@ -60,29 +63,40 @@ ControlSpotPanel::ControlSpotPanel(): nbSpotChanged_(false), selSpotChanged_(false), nameChanged_(false), + visibilityChanged_(false), eventType(0), excluFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_EXCLUF")))) { - treeview_.set_grid_lines(Gtk::TREE_VIEW_GRID_LINES_VERTICAL); + Gtk::HBox* const hbox1_ = Gtk::manage(new Gtk::HBox(true, 4)); + hbox1_->pack_start(button_add_); + hbox1_->pack_start(button_delete_); + hbox1_->pack_start(button_duplicate_); + pack_start(*hbox1_); - scrolledwindow_.add(treeview_); - scrolledwindow_.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); - scrolledwindow_.set_min_content_height(150); - - pack_start(buttonbox_); - pack_start(scrolledwindow_); - - buttonbox_.pack_start(button_add_, Gtk::PACK_SHRINK, 4); - buttonbox_.pack_start(button_delete_, Gtk::PACK_SHRINK, 4); - buttonbox_.pack_start(button_rename_); - buttonbox_.set_layout(Gtk::BUTTONBOX_START); + Gtk::HBox* const hbox2_ = Gtk::manage(new Gtk::HBox(true, 4)); + hbox2_->pack_start(button_rename_); + hbox2_->pack_start(button_visibility_); + pack_start(*hbox2_); buttonaddconn_ = button_add_.signal_clicked().connect( sigc::mem_fun(*this, &ControlSpotPanel::on_button_add)); buttondeleteconn_ = button_delete_.signal_clicked().connect( sigc::mem_fun(*this, &ControlSpotPanel::on_button_delete)); + buttonduplicateconn_ = button_duplicate_.signal_clicked().connect( + sigc::mem_fun(*this, &ControlSpotPanel::on_button_duplicate)); + + buttonrenameconn_ = button_rename_.signal_clicked().connect( sigc::mem_fun(*this, &ControlSpotPanel::on_button_rename)); + buttonvisibilityconn_ = button_visibility_.signal_clicked().connect( + sigc::mem_fun(*this, &ControlSpotPanel::on_button_visibility)); + + treeview_.set_grid_lines(Gtk::TREE_VIEW_GRID_LINES_VERTICAL); + + scrolledwindow_.add(treeview_); + scrolledwindow_.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); + scrolledwindow_.set_min_content_height(150); + pack_start(scrolledwindow_); treemodel_ = Gtk::ListStore::create(spots_); @@ -102,7 +116,7 @@ ControlSpotPanel::ControlSpotPanel(): } cell = Gtk::manage(new Gtk::CellRendererText()); - cols_count = treeview_.append_column("Name", *cell); + cols_count = treeview_.append_column(M("TP_LOCALLAB_COL_NAME"), *cell); col = treeview_.get_column(cols_count - 1); if (col) { @@ -112,7 +126,7 @@ ControlSpotPanel::ControlSpotPanel(): } cell = Gtk::manage(new Gtk::CellRendererText()); - cols_count = treeview_.append_column("Status", *cell); + cols_count = treeview_.append_column(M("TP_LOCALLAB_COL_VIS"), *cell); col = treeview_.get_column(cols_count - 1); if (col) { @@ -257,9 +271,9 @@ void ControlSpotPanel::render_isvisible( auto value = row[spots_.isvisible]; if (value) { - ct->property_text() = "Visible"; + ct->property_text() = M("TP_LOCALLAB_ROW_VIS"); } else { - ct->property_text() = "Not visible"; + ct->property_text() = M("TP_LOCALLAB_ROW_NVIS"); } } @@ -295,6 +309,28 @@ void ControlSpotPanel::on_button_delete() listener->panelChanged(EvLocallabSpotDeleted, "ID#" + std::to_string(delId)); } +void ControlSpotPanel::on_button_duplicate() +{ + printf("on_button_duplicate\n"); + + if (!listener) { + return; + } + + // Raise event + const int selId = getSelectedSpot(); + if (selId == 0) { // No selected spot to duplicate + return; + } + nbSpotChanged_ = true; + selSpotChanged_ = true; + eventType = 4; // 4 = Spot duplication event + const int newId = getNewId(); + listener->panelChanged(EvLocallabSpotCreated, "ID#" + std::to_string(newId) + + " (" + M("TP_LOCALLAB_EV_DUPL") + " ID#" + + std::to_string(selId) + ")"); +} + void ControlSpotPanel::on_button_rename() { printf("on_button_rename\n"); @@ -329,6 +365,39 @@ void ControlSpotPanel::on_button_rename() } } +void ControlSpotPanel::on_button_visibility() +{ + printf("on_button_visibility\n"); + + if (!listener) { + return; + } + + // Get selected control spot + const auto s = treeview_.get_selection(); + + if (!s->count_selected_rows()) { + return; + } + + const auto iter = s->get_selected(); + const Gtk::TreeModel::Row row = *iter; + + // Update visibility + row[spots_.isvisible] = !(bool)row[spots_.isvisible]; + updateControlSpotCurve(row); + + // Raise event + visibilityChanged_ = true; + const int id = getSelectedSpot(); + + if ((bool)row[spots_.isvisible]) { + listener->panelChanged(EvLocallabSpotVisibility, M("TP_LOCALLAB_EV_VIS") + " ID#" + std::to_string(id)); + } else { + listener->panelChanged(EvLocallabSpotVisibility, M("TP_LOCALLAB_EV_NVIS") + " ID#" + std::to_string(id)); + } +} + void ControlSpotPanel::load_ControlSpot_param() { printf("load_ControlSpot_param\n"); @@ -740,7 +809,9 @@ void ControlSpotPanel::disableParamlistener(bool cond) treeviewconn_.block(cond); buttonaddconn_.block(cond); buttondeleteconn_.block(cond); + buttonduplicateconn_.block(cond); buttonrenameconn_.block(cond); + buttonvisibilityconn_.block(cond); shapeconn_.block(cond); spotMethodconn_.block(cond); sensiexclu_->block(cond); @@ -910,6 +981,7 @@ void ControlSpotPanel::updateControlSpotCurve(Gtk::TreeModel::Row row) const int locY_ = static_cast(row[spots_.locY]); const int locYT_ = static_cast(row[spots_.locYT]); const int shape_ = static_cast(row[spots_.shape]); + const bool isvisible_ = static_cast(row[spots_.isvisible]); printf("updateControlSpotCurve: %d\n", curveid_); @@ -991,31 +1063,67 @@ void ControlSpotPanel::updateControlSpotCurve(Gtk::TreeModel::Row row) updateRectangle(visibleGeometry.at((curveid_ - 1) * 10 + 9)); updateRectangle(mouseOverGeometry.at((curveid_ - 1) * 10 + 9)); - // Update Arcellipse/Rectangle visibility according to shape - if (shape_ == 0) { // 0 = Ellipse - EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 5)->setActive(true); // arc1 - EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 6)->setActive(true); // arc2 - EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 7)->setActive(true); // arc3 - EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 8)->setActive(true); // arc4 - EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 9)->setActive(false); // rec + // Update Arcellipse/Rectangle visibility according to shape and visibility + if (isvisible_) { + EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10)->setActive(true); + EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 1)->setActive(true); + EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 2)->setActive(true); + EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 3)->setActive(true); + EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 4)->setActive(true); - EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 5)->setActive(true); // arc1 - EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 6)->setActive(true); // arc2 - EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 7)->setActive(true); // arc3 - EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 8)->setActive(true); // arc4 - EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 9)->setActive(false); // rec - } else { // 1 = Rectangle - EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 5)->setActive(false); // arc1 - EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 6)->setActive(false); // arc2 - EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 7)->setActive(false); // arc3 - EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 8)->setActive(false); // arc4 - EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 9)->setActive(true); // rec + EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10)->setActive(true); + EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 1)->setActive(true); + EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 2)->setActive(true); + EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 3)->setActive(true); + EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 4)->setActive(true); - EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 5)->setActive(false); // arc1 - EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 6)->setActive(false); // arc2 - EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 7)->setActive(false); // arc3 - EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 8)->setActive(false); // arc4 - EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 9)->setActive(true); // rec + if (shape_ == 0) { // 0 = Ellipse + EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 5)->setActive(true); // arc1 + EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 6)->setActive(true); // arc2 + EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 7)->setActive(true); // arc3 + EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 8)->setActive(true); // arc4 + EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 9)->setActive(false); // rec + + EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 5)->setActive(true); // arc1 + EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 6)->setActive(true); // arc2 + EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 7)->setActive(true); // arc3 + EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 8)->setActive(true); // arc4 + EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 9)->setActive(false); // rec + } else { // 1 = Rectangle + EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 5)->setActive(false); // arc1 + EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 6)->setActive(false); // arc2 + EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 7)->setActive(false); // arc3 + EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 8)->setActive(false); // arc4 + EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 9)->setActive(true); // rec + + EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 5)->setActive(false); // arc1 + EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 6)->setActive(false); // arc2 + EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 7)->setActive(false); // arc3 + EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 8)->setActive(false); // arc4 + EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 9)->setActive(true); // rec + } + } else { + EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10)->setActive(false); + EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 1)->setActive(false); + EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 2)->setActive(false); + EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 3)->setActive(false); + EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 4)->setActive(false); + EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 5)->setActive(false); + EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 6)->setActive(false); + EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 7)->setActive(false); + EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 8)->setActive(false); + EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 9)->setActive(false); + + EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10)->setActive(false); + EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 1)->setActive(false); + EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 2)->setActive(false); + EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 3)->setActive(false); + EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 4)->setActive(false); + EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 5)->setActive(false); + EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 6)->setActive(false); + EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 7)->setActive(false); + EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 8)->setActive(false); + EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 9)->setActive(false); } } @@ -1635,7 +1743,13 @@ ControlSpotPanel::SpotEdited* ControlSpotPanel::getEditedStates() se->name = false; } - se->isvisible = false; // TODO isvisible + if (visibilityChanged_) { + se->isvisible = true; + // visibilityChanged_ = false; + } else { + se->isvisible = false; + } + se->shape = shape_->get_active_text() != M("GENERAL_UNCHANGED"); se->spotMethod = spotMethod_->get_active_text() != M("GENERAL_UNCHANGED"); se->sensiexclu = sensiexclu_->getEditedState(); @@ -1664,6 +1778,7 @@ void ControlSpotPanel::setEditedStates(SpotEdited* se) nbSpotChanged_ = false; selSpotChanged_ = false; nameChanged_ = false; + visibilityChanged_ = false; // Disable params listeners disableParamlistener(true); @@ -1673,15 +1788,18 @@ void ControlSpotPanel::setEditedStates(SpotEdited* se) treeview_.set_sensitive(false); button_add_.set_sensitive(false); button_delete_.set_sensitive(false); + button_duplicate_.set_sensitive(false); button_rename_.set_sensitive(false); + button_visibility_.set_sensitive(false); } else { treeview_.set_sensitive(true); button_add_.set_sensitive(true); button_delete_.set_sensitive(true); + button_duplicate_.set_sensitive(true); button_rename_.set_sensitive(se->name); + button_visibility_.set_sensitive(se->isvisible); } - // TODO Add isvisible if (!se->shape) { shape_->set_active_text(M("GENERAL_UNCHANGED")); } @@ -1884,10 +2002,10 @@ ControlSpotPanel::ControlSpots::ControlSpots() //----------------------------------------------------------------------------- ControlSpotPanel::RenameDialog::RenameDialog(const Glib::ustring &actualname, Gtk::Window &parent): - Gtk::Dialog("Renaming Control Spot", parent) + Gtk::Dialog(M("TP_LOCALLAB_REN_DIALOG_NAME"), parent) { Gtk::HBox *hb = Gtk::manage(new Gtk::HBox()); - hb->pack_start(*Gtk::manage(new Gtk::Label("Enter the new Control Spot name")), false, false, 4); + hb->pack_start(*Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_REN_DIALOG_LAB"))), false, false, 4); newname_.set_text(actualname); hb->pack_start(newname_); diff --git a/rtgui/controlspotpanel.h b/rtgui/controlspotpanel.h index 91470c7b5..9e250dc60 100644 --- a/rtgui/controlspotpanel.h +++ b/rtgui/controlspotpanel.h @@ -219,9 +219,9 @@ private: void on_button_add(); void on_button_delete(); + void on_button_duplicate(); void on_button_rename(); - // TODO Add visibility button - // TODO Add duplication button + void on_button_visibility(); void load_ControlSpot_param(); @@ -291,13 +291,17 @@ private: sigc::connection treeviewconn_; Glib::RefPtr treemodel_; - Gtk::ButtonBox buttonbox_; Gtk::Button button_add_; sigc::connection buttonaddconn_; Gtk::Button button_delete_; sigc::connection buttondeleteconn_; + Gtk::Button button_duplicate_; + sigc::connection buttonduplicateconn_; + Gtk::Button button_rename_; sigc::connection buttonrenameconn_; + Gtk::Button button_visibility_; + sigc::connection buttonvisibilityconn_; MyComboBoxText* const shape_; sigc::connection shapeconn_; @@ -327,7 +331,8 @@ private: bool nbSpotChanged_; bool selSpotChanged_; bool nameChanged_; - int eventType; // 0 = No event, 1 = Spot creation event, 2 = Spot deletion event, 3 = Spot selection event + bool visibilityChanged_; + int eventType; // 0 = No event, 1 = Spot creation event, 2 = Spot deletion event, 3 = Spot selection event, 4 = Spot duplication event Gtk::Frame* const excluFrame; // Treeview mutex diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 30a47532c..fd637fdd1 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -1065,7 +1065,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) spotId = expsettings->getNewId(); r = new ControlSpotPanel::SpotRow(); r->id = newSpot->id = spotId; - r->name = newSpot->name = "Control Spot #" + std::to_string(spotId); + r->name = newSpot->name = M("TP_LOCALLAB_SPOTNAME") + std::to_string(spotId); r->isvisible = newSpot->isvisible; if (newSpot->shape == "ELI") { @@ -1234,6 +1234,106 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) break; + case (4): // 4 = Spot duplication event + newSpot = nullptr; + spotId = expsettings->getSelectedSpot(); + + for (int i = 0; i < pp->locallab.nbspot && i < (int)pp->locallab.spots.size(); i++) { + if (pp->locallab.spots.at(i).id == spotId) { + newSpot = new LocallabParams::LocallabSpot(pp->locallab.spots.at(i)); + break; + } + } + + if (!newSpot) { + break; + } + + // Spot creation (initialization at currently selected spot) + spotId = expsettings->getNewId(); + r = new ControlSpotPanel::SpotRow(); + r->id = newSpot->id = spotId; + r->name = newSpot->name = newSpot->name + " - " + M("TP_LOCALLAB_DUPLSPOTNAME"); + r->isvisible = newSpot->isvisible; + + if (newSpot->shape == "ELI") { + r->shape = 0; + } else { + r->shape = 1; + } + + if (newSpot->spotMethod == "norm") { + r->spotMethod = 0; + } else { + r->spotMethod = 1; + } + + r->sensiexclu = newSpot->sensiexclu; + r->struc = newSpot->struc; + + if (newSpot->shapeMethod == "IND") { + r->shapeMethod = 0; + } else if (newSpot->shapeMethod == "SYM") { + r->shapeMethod = 1; + } else if (newSpot->shapeMethod == "INDSL") { + r->shapeMethod = 2; + } else { + r->shapeMethod = 3; + } + + r->locX = newSpot->locX; + r->locXL = newSpot->locXL; + r->locY = newSpot->locY; + r->locYT = newSpot->locYT; + r->centerX = newSpot->centerX; + r->centerY = newSpot->centerY; + r->circrad = newSpot->circrad; + + if (newSpot->qualityMethod == "std") { + r->qualityMethod = 0; + } else if (newSpot->qualityMethod == "enh") { + r->qualityMethod = 1; + } else { + r->qualityMethod = 2; + } + + r->transit = newSpot->transit; + r->thresh = newSpot->thresh; + r->iter = newSpot->iter; + expsettings->addControlSpot(r); + + // ProcParams update + pp->locallab.nbspot++; + pp->locallab.selspot = pp->locallab.nbspot - 1; + pp->locallab.spots.push_back(*newSpot); + + // New created spot selection + expsettings->setSelectedSpot(spotId); + + // Update Locallab tools GUI with new created spot + disableListener(); + + if (pe) { + pe->locallab.spots.push_back(new LocallabParamsEdited::LocallabSpotEdited(true)); + } + + updateLocallabGUI(pp, pe, pp->locallab.selspot); + + enableListener(); + + // Update default values according to selected spot + setDefaults(defparams, defpedited, spotId); + + // ParamsEdited update + if (pedited) { + pedited->locallab.nbspot = true; + pedited->locallab.selspot = true; + pedited->locallab.id = true; + pedited->locallab.spots.push_back(new LocallabParamsEdited::LocallabSpotEdited(true)); + } + + break; + default: // Spot or locallab GUI updated if (pp->locallab.nbspot > 0) { r = expsettings->getSpot(expsettings->getSelectedSpot());