Merge pull request #3608 from Beep6581/dcp-batch-editing

Fix issue #3590
This commit is contained in:
Jean-Christophe
2017-01-15 18:42:39 +01:00
committed by GitHub
2 changed files with 30 additions and 70 deletions

View File

@@ -97,7 +97,6 @@ ICMPanel::ICMPanel () : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iunch
dcpIll->show (); dcpIll->show ();
dcpTemperatures[0] = 0; dcpTemperatures[0] = 0;
dcpTemperatures[1] = 0; dcpTemperatures[1] = 0;
ignoreDcpSignal = true;
dcpIllHBox->pack_start(*dcpIllLabel, Gtk::PACK_SHRINK, 4); dcpIllHBox->pack_start(*dcpIllLabel, Gtk::PACK_SHRINK, 4);
dcpIllHBox->pack_start(*dcpIll); dcpIllHBox->pack_start(*dcpIll);
@@ -295,11 +294,11 @@ ICMPanel::ICMPanel () : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iunch
oldip = ""; oldip = "";
wnames->signal_changed().connect( sigc::mem_fun(*this, &ICMPanel::wpChanged) ); wnamesconn = wnames->signal_changed().connect( sigc::mem_fun(*this, &ICMPanel::wpChanged) );
onames->signal_changed().connect( sigc::mem_fun(*this, &ICMPanel::opChanged) ); onamesconn = onames->signal_changed().connect( sigc::mem_fun(*this, &ICMPanel::opChanged) );
ointent->signal_changed().connect( sigc::mem_fun(*this, &ICMPanel::oiChanged) ); ointentconn = ointent->signal_changed().connect( sigc::mem_fun(*this, &ICMPanel::oiChanged) );
wgamma->signal_changed().connect( sigc::mem_fun(*this, &ICMPanel::gpChanged) ); wgammaconn = wgamma->signal_changed().connect( sigc::mem_fun(*this, &ICMPanel::gpChanged) );
dcpIll->signal_changed().connect( sigc::mem_fun(*this, &ICMPanel::dcpIlluminantChanged) ); dcpillconn = dcpIll->signal_changed().connect( sigc::mem_fun(*this, &ICMPanel::dcpIlluminantChanged) );
obpcconn = obpc->signal_toggled().connect( sigc::mem_fun(*this, &ICMPanel::oBPCChanged) ); obpcconn = obpc->signal_toggled().connect( sigc::mem_fun(*this, &ICMPanel::oBPCChanged) );
gamcsconn = freegamma->signal_toggled().connect ( sigc::mem_fun(*this, &ICMPanel::GamChanged)); gamcsconn = freegamma->signal_toggled().connect ( sigc::mem_fun(*this, &ICMPanel::GamChanged));
@@ -347,6 +346,7 @@ void ICMPanel::updateRenderingIntent (const Glib::ustring &profile) {
void ICMPanel::updateDCP (int dcpIlluminant, Glib::ustring dcp_name) void ICMPanel::updateDCP (int dcpIlluminant, Glib::ustring dcp_name)
{ {
ConnectionBlocker dcpillconn_(dcpillconn);
if (isBatchMode) { if (isBatchMode) {
dcpFrame->set_sensitive(true); dcpFrame->set_sensitive(true);
@@ -359,7 +359,6 @@ void ICMPanel::updateDCP (int dcpIlluminant, Glib::ustring dcp_name)
if (dcpTemperatures[0] != 0 || dcpTemperatures[1] != 0) { if (dcpTemperatures[0] != 0 || dcpTemperatures[1] != 0) {
int curr_active = dcpIll->get_active_row_number(); int curr_active = dcpIll->get_active_row_number();
ignoreDcpSignal = true;
dcpIll->clear_items (); dcpIll->clear_items ();
dcpIll->append_text (M("TP_ICM_DCPILLUMINANT_INTERPOLATED")); dcpIll->append_text (M("TP_ICM_DCPILLUMINANT_INTERPOLATED"));
dcpIll->append_text (M("TP_ICM_DCPILLUMINANT") + " 1"); dcpIll->append_text (M("TP_ICM_DCPILLUMINANT") + " 1");
@@ -368,7 +367,6 @@ void ICMPanel::updateDCP (int dcpIlluminant, Glib::ustring dcp_name)
dcpTemperatures[0] = 0; dcpTemperatures[0] = 0;
dcpTemperatures[1] = 0; dcpTemperatures[1] = 0;
dcpIll->set_active (curr_active); dcpIll->set_active (curr_active);
ignoreDcpSignal = false;
} }
if (dcpIll->get_active_row_number() == -1 && dcpIlluminant == -1) { if (dcpIll->get_active_row_number() == -1 && dcpIlluminant == -1) {
@@ -425,7 +423,6 @@ void ICMPanel::updateDCP (int dcpIlluminant, Glib::ustring dcp_name)
sprintf(tempstr1, "%.0fK", illuminants.temperature_1); sprintf(tempstr1, "%.0fK", illuminants.temperature_1);
sprintf(tempstr2, "%.0fK", illuminants.temperature_2); sprintf(tempstr2, "%.0fK", illuminants.temperature_2);
int curr_active = dcpIll->get_active_row_number(); int curr_active = dcpIll->get_active_row_number();
ignoreDcpSignal = true;
dcpIll->clear_items (); dcpIll->clear_items ();
dcpIll->append_text (M("TP_ICM_DCPILLUMINANT_INTERPOLATED")); dcpIll->append_text (M("TP_ICM_DCPILLUMINANT_INTERPOLATED"));
dcpIll->append_text (tempstr1); dcpIll->append_text (tempstr1);
@@ -433,7 +430,6 @@ void ICMPanel::updateDCP (int dcpIlluminant, Glib::ustring dcp_name)
dcpTemperatures[0] = illuminants.temperature_1; dcpTemperatures[0] = illuminants.temperature_1;
dcpTemperatures[1] = illuminants.temperature_2; dcpTemperatures[1] = illuminants.temperature_2;
dcpIll->set_active (curr_active); dcpIll->set_active (curr_active);
ignoreDcpSignal = false;
} }
if (dcpIlluminant > 2) { if (dcpIlluminant > 2) {
@@ -441,22 +437,16 @@ void ICMPanel::updateDCP (int dcpIlluminant, Glib::ustring dcp_name)
} }
if (dcpIll->get_active_row_number() == -1 && dcpIlluminant == -1) { if (dcpIll->get_active_row_number() == -1 && dcpIlluminant == -1) {
ignoreDcpSignal = true;
dcpIll->set_active(0); dcpIll->set_active(0);
ignoreDcpSignal = false;
} else if (dcpIlluminant >= 0 && dcpIlluminant != dcpIll->get_active_row_number()) { } else if (dcpIlluminant >= 0 && dcpIlluminant != dcpIll->get_active_row_number()) {
ignoreDcpSignal = true;
dcpIll->set_active(dcpIlluminant); dcpIll->set_active(dcpIlluminant);
ignoreDcpSignal = false;
} }
dcpIll->set_sensitive (true); dcpIll->set_sensitive (true);
dcpIllLabel->set_sensitive (true); dcpIllLabel->set_sensitive (true);
} else { } else {
if (dcpIll->get_active_row_number() != -1) { if (dcpIll->get_active_row_number() != -1) {
ignoreDcpSignal = true;
dcpIll->set_active(-1); dcpIll->set_active(-1);
ignoreDcpSignal = false;
} }
} }
} }
@@ -464,7 +454,6 @@ void ICMPanel::updateDCP (int dcpIlluminant, Glib::ustring dcp_name)
if (!dcpIllLabel->get_sensitive() && dcpIll->get_active_row_number() != 0) { if (!dcpIllLabel->get_sensitive() && dcpIll->get_active_row_number() != 0) {
if (dcpTemperatures[0] != 0 || dcpTemperatures[1] != 0) { if (dcpTemperatures[0] != 0 || dcpTemperatures[1] != 0) {
int curr_active = dcpIll->get_active_row_number(); int curr_active = dcpIll->get_active_row_number();
ignoreDcpSignal = true;
dcpIll->clear_items (); dcpIll->clear_items ();
dcpIll->append_text (M("TP_ICM_DCPILLUMINANT_INTERPOLATED")); dcpIll->append_text (M("TP_ICM_DCPILLUMINANT_INTERPOLATED"));
dcpIll->append_text (M("TP_ICM_DCPILLUMINANT") + " 1"); dcpIll->append_text (M("TP_ICM_DCPILLUMINANT") + " 1");
@@ -477,7 +466,6 @@ void ICMPanel::updateDCP (int dcpIlluminant, Glib::ustring dcp_name)
dcpTemperatures[0] = 0; dcpTemperatures[0] = 0;
dcpTemperatures[1] = 0; dcpTemperatures[1] = 0;
dcpIll->set_active (curr_active); dcpIll->set_active (curr_active);
ignoreDcpSignal = false;
} }
} }
} }
@@ -487,14 +475,19 @@ void ICMPanel::read (const ProcParams* pp, const ParamsEdited* pedited)
disableListener (); disableListener ();
obpcconn.block (true); ConnectionBlocker obpcconn_(obpcconn);
ipc.block (true); ConnectionBlocker ipc_(ipc);
gamcsconn.block (true); ConnectionBlocker gamcsconn_(gamcsconn);
tcurveconn.block(true); ConnectionBlocker tcurveconn_(tcurveconn);
ltableconn.block(true); ConnectionBlocker ltableconn_(ltableconn);
beoconn.block(true); ConnectionBlocker beoconn_(beoconn);
hsmconn.block(true); ConnectionBlocker hsmconn_(hsmconn);
blendcmsconn.block(true); ConnectionBlocker blendcmsconn_(blendcmsconn);
ConnectionBlocker wnamesconn_(wnamesconn);
ConnectionBlocker onamesconn_(onamesconn);
ConnectionBlocker ointentconn_(ointentconn);
ConnectionBlocker wgammaconn_(wgammaconn);
ConnectionBlocker dcpillconn_(dcpillconn);
if(pp->icm.input.substr(0, 5) != "file:" && !ipDialog->get_filename().empty()) { if(pp->icm.input.substr(0, 5) != "file:" && !ipDialog->get_filename().empty()) {
ipDialog->set_filename(pp->icm.input); ipDialog->set_filename(pp->icm.input);
@@ -626,15 +619,6 @@ void ICMPanel::read (const ProcParams* pp, const ParamsEdited* pedited)
} }
blendcmsconn.block(false);
tcurveconn.block(false);
ltableconn.block(false);
beoconn.block(false);
hsmconn.block(false);
gamcsconn.block (false);
ipc.block (false);
obpcconn.block (false);
enableListener (); enableListener ();
} }
@@ -661,11 +645,7 @@ void ICMPanel::write (ProcParams* pp, ParamsEdited* pedited)
pp->icm.working = wnames->get_active_text (); pp->icm.working = wnames->get_active_text ();
pp->icm.gamma = wgamma->get_active_text (); pp->icm.gamma = wgamma->get_active_text ();
pp->icm.dcpIlluminant = dcpIll->get_active_row_number(); pp->icm.dcpIlluminant = rtengine::max<int>(dcpIll->get_active_row_number(), 0);
if (pp->icm.dcpIlluminant < 0) {
pp->icm.dcpIlluminant = 0;
}
if (onames->get_active_text() == M("TP_ICM_NOICM")) { if (onames->get_active_text() == M("TP_ICM_NOICM")) {
pp->icm.output = ColorManagementParams::NoICMString; pp->icm.output = ColorManagementParams::NoICMString;
@@ -681,33 +661,10 @@ void ICMPanel::write (ProcParams* pp, ParamsEdited* pedited)
} }
pp->icm.freegamma = freegamma->get_active(); pp->icm.freegamma = freegamma->get_active();
pp->icm.toneCurve = ckbToneCurve->get_active ();
DCPProfile* dcp = nullptr; pp->icm.applyLookTable = ckbApplyLookTable->get_active ();
pp->icm.applyBaselineExposureOffset = ckbApplyBaselineExposureOffset->get_active ();
if (ifromfile->get_active() && pp->icm.input.substr(0, 5) == "file:" && DCPStore::getInstance()->isValidDCPFileName(pp->icm.input.substr(5))) { pp->icm.applyHueSatMap = ckbApplyHueSatMap->get_active ();
dcp = DCPStore::getInstance()->getProfile(pp->icm.input.substr(5));
} else if(icameraICC->get_active()) {
dcp = DCPStore::getInstance()->getStdProfile(camName);
}
if (dcp) {
if (dcp->getHasToneCurve()) {
pp->icm.toneCurve = ckbToneCurve->get_active ();
}
if (dcp->getHasLookTable()) {
pp->icm.applyLookTable = ckbApplyLookTable->get_active ();
}
if (dcp->getHasBaselineExposureOffset()) {
pp->icm.applyBaselineExposureOffset = ckbApplyBaselineExposureOffset->get_active ();
}
if (dcp->getHasHueSatMap()) {
pp->icm.applyHueSatMap = ckbApplyHueSatMap->get_active ();
}
}
pp->icm.blendCMSMatrix = ckbBlendCMSMatrix->get_active (); pp->icm.blendCMSMatrix = ckbBlendCMSMatrix->get_active ();
pp->icm.gampos = (double) gampos->getValue(); pp->icm.gampos = (double) gampos->getValue();
pp->icm.slpos = (double) slpos->getValue(); pp->icm.slpos = (double) slpos->getValue();
@@ -786,7 +743,7 @@ void ICMPanel::gpChanged ()
void ICMPanel::dcpIlluminantChanged() void ICMPanel::dcpIlluminantChanged()
{ {
if (listener && !ignoreDcpSignal) { if (listener) {
listener->panelChanged (EvDCPIlluminant, dcpIll->get_active_text ()); listener->panelChanged (EvDCPIlluminant, dcpIll->get_active_text ());
} }
} }
@@ -1145,7 +1102,6 @@ void ICMPanel::setBatchMode (bool batchMode)
{ {
isBatchMode = true; isBatchMode = true;
ignoreDcpSignal = false;
ToolPanel::setBatchMode (batchMode); ToolPanel::setBatchMode (batchMode);
iunchanged = Gtk::manage (new Gtk::RadioButton (M("GENERAL_UNCHANGED"))); iunchanged = Gtk::manage (new Gtk::RadioButton (M("GENERAL_UNCHANGED")));
iunchanged->set_group (opts); iunchanged->set_group (opts);

View File

@@ -73,16 +73,21 @@ private:
Gtk::RadioButton* ifromfile; Gtk::RadioButton* ifromfile;
Gtk::Label* dcpIllLabel; Gtk::Label* dcpIllLabel;
MyComboBoxText* dcpIll; MyComboBoxText* dcpIll;
sigc::connection dcpillconn;
Gtk::CheckButton* ckbToneCurve; Gtk::CheckButton* ckbToneCurve;
Gtk::CheckButton* ckbApplyLookTable; Gtk::CheckButton* ckbApplyLookTable;
Gtk::CheckButton* ckbApplyBaselineExposureOffset; Gtk::CheckButton* ckbApplyBaselineExposureOffset;
Gtk::CheckButton* ckbApplyHueSatMap; Gtk::CheckButton* ckbApplyHueSatMap;
Gtk::CheckButton* ckbBlendCMSMatrix; Gtk::CheckButton* ckbBlendCMSMatrix;
MyComboBoxText* wnames; MyComboBoxText* wnames;
sigc::connection wnamesconn;
MyComboBoxText* wgamma; MyComboBoxText* wgamma;
sigc::connection wgammaconn;
MyComboBoxText* onames; MyComboBoxText* onames;
sigc::connection onamesconn;
PopUpButton* ointent; PopUpButton* ointent;
sigc::connection ointentconn;
Gtk::RadioButton* ofromdir; Gtk::RadioButton* ofromdir;
Gtk::RadioButton* ofromfile; Gtk::RadioButton* ofromfile;
Gtk::RadioButton* iunchanged; Gtk::RadioButton* iunchanged;
@@ -93,7 +98,6 @@ private:
Glib::ustring oldip; Glib::ustring oldip;
ICMPanelListener* icmplistener; ICMPanelListener* icmplistener;
bool ignoreDcpSignal;
double dcpTemperatures[2]; double dcpTemperatures[2];
bool enableLastICCWorkDirChange; bool enableLastICCWorkDirChange;
Glib::ustring lastRefFilename; Glib::ustring lastRefFilename;