Add improved copy/paste or save/load for Locallab spots

Preliminary work: "nbspot" and "id" spot parameters have been removed to
simplify Locallab spots management.
This commit is contained in:
Pandagrapher
2020-02-20 20:35:29 +01:00
parent f51f2f44ec
commit 209eccba8a
17 changed files with 499 additions and 564 deletions

View File

@@ -1070,6 +1070,8 @@ void FileBrowser::partPasteProfile ()
auto toplevel = static_cast<Gtk::Window*> (get_toplevel ());
PartialPasteDlg partialPasteDlg (M("PARTIALPASTE_DIALOGLABEL"), toplevel);
partialPasteDlg.updateSpotWidget(clipboard.getPartialProfile().pparams);
int i = partialPasteDlg.run ();
if (i == Gtk::RESPONSE_OK) {
@@ -1396,6 +1398,8 @@ void FileBrowser::applyPartialMenuItemActivated (ProfileStoreLabel *label)
auto toplevel = static_cast<Gtk::Window*> (get_toplevel ());
PartialPasteDlg partialPasteDlg (M("PARTIALPASTE_DIALOGLABEL"), toplevel);
partialPasteDlg.updateSpotWidget(srcProfiles->pparams);
if (partialPasteDlg.run() == Gtk::RESPONSE_OK) {
MYREADERLOCK(l, entryRW);
@@ -1410,7 +1414,7 @@ void FileBrowser::applyPartialMenuItemActivated (ProfileStoreLabel *label)
rtengine::procparams::PartialProfile dstProfile(true);
*dstProfile.pparams = (static_cast<FileBrowserEntry*>(selected[i]))->thumbnail->getProcParams ();
dstProfile.set(true);
dstProfile.pedited->locallab.spots.resize(dstProfile.pparams->locallab.nbspot, new LocallabParamsEdited::LocallabSpotEdited(true));
dstProfile.pedited->locallab.spots.resize(dstProfile.pparams->locallab.spots.size(), new LocallabParamsEdited::LocallabSpotEdited(true));
partialPasteDlg.applyPaste (dstProfile.pparams, dstProfile.pedited, srcProfiles->pparams, srcProfiles->pedited);
(static_cast<FileBrowserEntry*>(selected[i]))->thumbnail->setProcParams (*dstProfile.pparams, dstProfile.pedited, FILEBROWSER);
dstProfile.deleteInstance();