save provisory work GUI
This commit is contained in:
@@ -71,6 +71,7 @@ ControlSpotPanel::ControlSpotPanel():
|
||||
|
||||
avoid_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_AVOID")))),
|
||||
laplac_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_LAPLACC")))),
|
||||
deltae_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_DELTAEC")))),
|
||||
|
||||
lastObject_(-1),
|
||||
nbSpotChanged_(false),
|
||||
@@ -275,6 +276,9 @@ ControlSpotPanel::ControlSpotPanel():
|
||||
laplacConn_ = laplac_->signal_toggled().connect(
|
||||
sigc::mem_fun(*this, &ControlSpotPanel::laplacChanged));
|
||||
pack_start(*laplac_);
|
||||
deltaeConn_ = deltae_->signal_toggled().connect(
|
||||
sigc::mem_fun(*this, &ControlSpotPanel::deltaeChanged));
|
||||
// pack_start(*deltae_);
|
||||
|
||||
show_all();
|
||||
|
||||
@@ -580,6 +584,7 @@ void ControlSpotPanel::load_ControlSpot_param()
|
||||
transitgrad_->setValue((double)row[spots_.transitgrad]);
|
||||
avoid_->set_active(row[spots_.avoid]);
|
||||
laplac_->set_active(row[spots_.laplac]);
|
||||
deltae_->set_active(row[spots_.deltae]);
|
||||
}
|
||||
|
||||
void ControlSpotPanel::controlspotChanged()
|
||||
@@ -1080,6 +1085,42 @@ void ControlSpotPanel::laplacChanged()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ControlSpotPanel::deltaeChanged()
|
||||
{
|
||||
// printf("laplacChanged\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;
|
||||
|
||||
if (multiImage) {
|
||||
if (deltae_->get_inconsistent()) {
|
||||
deltae_->set_inconsistent(false);
|
||||
deltaeConn_.block(true);
|
||||
deltae_->set_active(false);
|
||||
deltaeConn_.block(false);
|
||||
}
|
||||
}
|
||||
|
||||
row[spots_.deltae] = deltae_->get_active();
|
||||
|
||||
// Raise event
|
||||
if (listener) {
|
||||
if (deltae_->get_active()) {
|
||||
listener->panelChanged(Evlocallabdeltae, M("GENERAL_ENABLED"));
|
||||
} else {
|
||||
listener->panelChanged(Evlocallabdeltae, M("GENERAL_DISABLED"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ControlSpotPanel::disableParamlistener(bool cond)
|
||||
{
|
||||
// printf("disableParamlistener: %d\n", cond);
|
||||
@@ -1112,6 +1153,7 @@ void ControlSpotPanel::disableParamlistener(bool cond)
|
||||
transitgrad_->block(cond);
|
||||
avoidConn_.block(cond);
|
||||
laplacConn_.block(cond);
|
||||
deltaeConn_.block(cond);
|
||||
}
|
||||
|
||||
void ControlSpotPanel::setParamEditable(bool cond)
|
||||
@@ -1140,6 +1182,7 @@ void ControlSpotPanel::setParamEditable(bool cond)
|
||||
transitgrad_->set_sensitive(cond);
|
||||
avoid_->set_sensitive(cond);
|
||||
laplac_->set_sensitive(cond);
|
||||
deltae_->set_sensitive(cond);
|
||||
}
|
||||
|
||||
void ControlSpotPanel::addControlSpotCurve(Gtk::TreeModel::Row& row)
|
||||
@@ -1774,6 +1817,7 @@ ControlSpotPanel::SpotRow* ControlSpotPanel::getSpot(const int id)
|
||||
r->transitgrad = row[spots_.transitgrad];
|
||||
r->avoid = row[spots_.avoid];
|
||||
r->laplac = row[spots_.laplac];
|
||||
r->deltae = row[spots_.deltae];
|
||||
|
||||
return r;
|
||||
}
|
||||
@@ -1901,6 +1945,7 @@ void ControlSpotPanel::addControlSpot(SpotRow* newSpot)
|
||||
row[spots_.transitgrad] = newSpot->transitgrad;
|
||||
row[spots_.avoid] = newSpot->avoid;
|
||||
row[spots_.laplac] = newSpot->laplac;
|
||||
row[spots_.deltae] = newSpot->deltae;
|
||||
updateParamVisibility();
|
||||
disableParamlistener(false);
|
||||
|
||||
@@ -1947,6 +1992,7 @@ int ControlSpotPanel::updateControlSpot(SpotRow* spot)
|
||||
row[spots_.transitgrad] = spot->transitgrad;
|
||||
row[spots_.avoid] = spot->avoid;
|
||||
row[spots_.laplac] = spot->laplac;
|
||||
row[spots_.deltae] = spot->deltae;
|
||||
|
||||
updateControlSpotCurve(row);
|
||||
updateParamVisibility();
|
||||
@@ -2039,6 +2085,7 @@ ControlSpotPanel::SpotEdited* ControlSpotPanel::getEditedStates()
|
||||
se->transitgrad = transitgrad_->getEditedState();
|
||||
se->avoid = !avoid_->get_inconsistent();
|
||||
se->laplac = !laplac_->get_inconsistent();
|
||||
se->deltae = !deltae_->get_inconsistent();
|
||||
|
||||
return se;
|
||||
}
|
||||
@@ -2109,6 +2156,7 @@ void ControlSpotPanel::setEditedStates(SpotEdited* se)
|
||||
transitgrad_->setEditedState(se->transitgrad ? Edited : UnEdited);
|
||||
avoid_->set_inconsistent(multiImage && !se->avoid);
|
||||
laplac_->set_inconsistent(multiImage && !se->laplac);
|
||||
deltae_->set_inconsistent(multiImage && !se->deltae);
|
||||
|
||||
// Update Control Spot GUI according to widgets edited states
|
||||
updateParamVisibility();
|
||||
@@ -2260,6 +2308,7 @@ ControlSpotPanel::ControlSpots::ControlSpots()
|
||||
add(transitgrad);
|
||||
add(avoid);
|
||||
add(laplac);
|
||||
add(deltae);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user