]> git.tdb.fi Git - r2c2.git/blobdiff - source/remote/remote.cpp
Rename the project to R²C²
[r2c2.git] / source / remote / remote.cpp
index 57080c1fd0897ea86ea0527cf974a42f8b836d5d..830a06d05a2f3fc07eb624718629c45772a1f5aa 100644 (file)
@@ -1,10 +1,11 @@
 /* $Id$
 
-This file is part of the MSP Märklin suite
-Copyright © 2009  Mikkosoft Productions, Mikko Rasa
+This file is part of R²C²
+Copyright © 2009-2010  Mikkosoft Productions, Mikko Rasa
 Distributed under the GPL
 */
 
+#include <gtkmm/separator.h>
 #include <msp/net/resolve.h>
 #include <msp/time/units.h>
 #include "remote.h"
@@ -34,9 +35,12 @@ Remote::Remote(int argc, char **argv):
        delete addr;
 
        window.signal_hide().connect(sigc::bind(sigc::mem_fun(this, &Remote::exit), 0));
+       window.set_default_size(300, 200);
        window.set_border_width(5);
+
        train_box = new Gtk::VBox(false, 5);
        window.add(*manage(train_box));
+
        window.show_all();
 }
 
@@ -46,8 +50,15 @@ void Remote::tick()
        gtk.iteration(false);
 }
 
-void Remote::train_added(Marklin::NetTrain &t)
+void Remote::train_added(R2C2::NetTrain &t)
 {
-       TrainPanel *panel = new TrainPanel(t);
-       train_box->add(*manage(panel));
+       TrainPanel *panel = new TrainPanel(*this, client, t);
+       if(!train_panels.empty())
+       {
+               Gtk::HSeparator *sep = new Gtk::HSeparator;
+               train_box->pack_start(*manage(sep), false, true);
+               sep->show();
+       }
+       train_box->pack_start(*manage(panel), false, true);
+       train_panels.push_back(panel);
 }