From: Mikko Rasa Date: Sat, 4 Apr 2015 16:05:05 +0000 (+0300) Subject: Reflect the current state of functions in a newly opened train dialog X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=15e67d19ed780cc7ebc0e7adb76feb218eb1ab8c;p=r2c2.git Reflect the current state of functions in a newly opened train dialog --- diff --git a/source/engineer/controlpanel.cpp b/source/engineer/controlpanel.cpp index c2938cd..cc2fa07 100644 --- a/source/engineer/controlpanel.cpp +++ b/source/engineer/controlpanel.cpp @@ -36,6 +36,7 @@ ControlPanel::ControlPanel(Engineer &e, Train &t): for(VehicleType::FunctionMap::const_iterator i=funcs.begin(); i!=funcs.end(); ++i) { GLtk::Toggle *tgl = new GLtk::Toggle(i->second); + tgl->set_value(train.get_function(i->first)); tgl->signal_toggled.connect(sigc::bind(sigc::mem_fun(this, &ControlPanel::ui_function_toggled), i->first)); pnl_functions->add(*tgl); tgl_funcs[i->first] = tgl;