]> git.tdb.fi Git - r2c2.git/commitdiff
Reflect the current state of functions in a newly opened train dialog
authorMikko Rasa <tdb@tdb.fi>
Sat, 4 Apr 2015 16:05:05 +0000 (19:05 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 4 Apr 2015 16:05:05 +0000 (19:05 +0300)
source/engineer/controlpanel.cpp

index c2938cd12f92c1adb4e1679f2546ce7bedc8049b..cc2fa079fbebc03bd984ee8d74e4b44380f20a9e 100644 (file)
@@ -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;