]> git.tdb.fi Git - r2c2.git/blobdiff - source/engineer/mainpanel.cpp
Convert designer to use mspgltk for UI
[r2c2.git] / source / engineer / mainpanel.cpp
index 7866a1cf1d1348340f7ccfc7e578a28a10653752..dd4d3f9e70e2512208de4a2c006e8353f83fedba 100644 (file)
@@ -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 <msp/gltk/button.h>
 #include "engineer.h"
 #include "mainpanel.h"
@@ -48,6 +55,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)
@@ -78,3 +87,9 @@ void MainPanel::quit()
 {
        engineer.quit();
 }
+
+void MainPanel::power_event(bool p)
+{
+       ind_on->set_active(p);
+       ind_off->set_active(!p);
+}