Added checkbutton in settings forced change in BW

This commit is contained in:
Desmis
2020-05-02 11:13:48 +02:00
parent 0196b31bf5
commit 778e9af9b7
11 changed files with 69 additions and 2 deletions

View File

@@ -78,6 +78,7 @@ ControlSpotPanel::ControlSpotPanel():
lumask_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LUMASK"), 0, 30, 1, 10))),
avoid_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_AVOID")))),
blwh_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_BLWH")))),
recurs_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_RECURS")))),
laplac_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_LAPLACC")))),
deltae_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_DELTAEC")))),
@@ -357,6 +358,10 @@ ControlSpotPanel::ControlSpotPanel():
sigc::mem_fun(*this, &ControlSpotPanel::avoidChanged));
pack_start(*avoid_);
blwhConn_ = blwh_->signal_toggled().connect(
sigc::mem_fun(*this, &ControlSpotPanel::blwhChanged));
pack_start(*blwh_);
recursConn_ = recurs_->signal_toggled().connect(
sigc::mem_fun(*this, &ControlSpotPanel::recursChanged));
@@ -757,6 +762,7 @@ void ControlSpotPanel::load_ControlSpot_param()
balanh_->setValue((double)row[spots_.balanh]);
colorde_->setValue((double)row[spots_.colorde]);
avoid_->set_active(row[spots_.avoid]);
blwh_->set_active(row[spots_.blwh]);
recurs_->set_active(row[spots_.recurs]);
laplac_->set_active(row[spots_.laplac]);
deltae_->set_active(row[spots_.deltae]);
@@ -1307,6 +1313,31 @@ void ControlSpotPanel::avoidChanged()
}
}
void ControlSpotPanel::blwhChanged()
{
// printf("blwhChanged\n");
// Get selected control spot
const auto s = treeview_->get_selection();
if (!s->count_selected_rows()) {
return;
}
const auto iter = s->get_selected();
Gtk::TreeModel::Row row = *iter;
row[spots_.blwh] = blwh_->get_active();
// Raise event
if (listener) {
if (blwh_->get_active()) {
listener->panelChanged(Evlocallabblwh, M("GENERAL_ENABLED"));
} else {
listener->panelChanged(Evlocallabblwh, M("GENERAL_DISABLED"));
}
}
}
void ControlSpotPanel::recursChanged()
{
// printf("recursChanged\n");
@@ -1467,6 +1498,7 @@ void ControlSpotPanel::disableParamlistener(bool cond)
balanh_->block(cond);
colorde_->block(cond);
avoidConn_.block(cond);
blwhConn_.block(cond);
recursConn_.block(cond);
laplacConn_.block(cond);
deltaeConn_.block(cond);
@@ -1506,6 +1538,7 @@ void ControlSpotPanel::setParamEditable(bool cond)
balanh_->set_sensitive(cond);
colorde_->set_sensitive(cond);
avoid_->set_sensitive(cond);
blwh_->set_sensitive(cond);
recurs_->set_sensitive(cond);
laplac_->set_sensitive(cond);
deltae_->set_sensitive(cond);
@@ -2156,6 +2189,7 @@ ControlSpotPanel::SpotRow* ControlSpotPanel::getSpot(const int index)
r->scopemask = row[spots_.scopemask];
r->lumask = row[spots_.lumask];
r->avoid = row[spots_.avoid];
r->blwh = row[spots_.blwh];
r->recurs = row[spots_.recurs];
r->laplac = row[spots_.laplac];
r->deltae = row[spots_.deltae];
@@ -2270,6 +2304,7 @@ void ControlSpotPanel::addControlSpot(SpotRow* newSpot)
row[spots_.balanh] = newSpot->balanh;
row[spots_.colorde] = newSpot->colorde;
row[spots_.avoid] = newSpot->avoid;
row[spots_.blwh] = newSpot->blwh;
row[spots_.recurs] = newSpot->recurs;
row[spots_.laplac] = newSpot->laplac;
row[spots_.deltae] = newSpot->deltae;
@@ -2379,6 +2414,7 @@ ControlSpotPanel::ControlSpots::ControlSpots()
add(balanh);
add(colorde);
add(avoid);
add(blwh);
add(recurs);
add(laplac);
add(deltae);