X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fengineer%2Fmainpanel.cpp;h=08348d713a91982902c9122067f6d6b017732801;hb=dcbe77ccf560aae2d10d645a02f6256fc0caf6f3;hp=c89060a4416b77145337de2f2bffd743493cb6e3;hpb=aead7f2da831199fbb8f6950b067656b2965c2fa;p=r2c2.git diff --git a/source/engineer/mainpanel.cpp b/source/engineer/mainpanel.cpp index c89060a..08348d7 100644 --- a/source/engineer/mainpanel.cpp +++ b/source/engineer/mainpanel.cpp @@ -1,3 +1,10 @@ +/* $Id$ + +This file is part of the MSP Märklin suite +Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa +Distributed under the GPL +*/ + #include #include "engineer.h" #include "mainpanel.h" @@ -6,6 +13,7 @@ using namespace std; using namespace Msp; MainPanel::MainPanel(Engineer &e, GLtk::Resources &r): + Widget(r), Panel(r), engineer(e) { @@ -48,6 +56,8 @@ MainPanel::MainPanel(Engineer &e, GLtk::Resources &r): ind_on->set_active(true); else ind_off->set_active(true); + + engineer.get_control().signal_power_event.connect(sigc::mem_fun(this, &MainPanel::power_event)); } void MainPanel::set_status_text(const string &txt) @@ -71,10 +81,16 @@ void MainPanel::power_off() void MainPanel::new_loc() { - engineer.add_train(0); + engineer.add_train(); } void MainPanel::quit() { engineer.quit(); } + +void MainPanel::power_event(bool p) +{ + ind_on->set_active(p); + ind_off->set_active(!p); +}