]> git.tdb.fi Git - r2c2.git/blobdiff - source/remote/remote.cpp
Remove the GTK-based remote control program
[r2c2.git] / source / remote / remote.cpp
diff --git a/source/remote/remote.cpp b/source/remote/remote.cpp
deleted file mode 100644 (file)
index dbcb7e4..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#include <gtkmm/scrolledwindow.h>
-#include <gtkmm/separator.h>
-#include <msp/core/getopt.h>
-#include <msp/net/resolve.h>
-#include <msp/time/units.h>
-#include "mainpanel.h"
-#include "remote.h"
-#include "trainpanel.h"
-
-using namespace std;
-using namespace Msp;
-
-Remote::Remote(int argc, char **argv):
-       client(catalogue),
-       gtk(argc, argv)
-{
-       if(argc<2)
-               throw usage_error("No address given");
-
-       DataFile::load(catalogue, "locos.dat");
-
-       client.use_event_dispatcher(event_disp);
-       client.signal_train_added.connect(sigc::mem_fun(this, &Remote::train_added));
-       string addr_str = argv[1];
-       if(addr_str.find(':')==string::npos)
-               addr_str += ":8315";
-       Net::SockAddr *addr = Net::resolve(addr_str);
-       client.connect(*addr);
-       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);
-
-       Gtk::ScrolledWindow *scroll = new Gtk::ScrolledWindow;
-       window.add(*manage(scroll));
-       scroll->set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
-
-       panel_box = new Gtk::VBox(false, 5);
-       scroll->add(*manage(panel_box));
-
-       main_panel = new MainPanel(*this, client);
-       panel_box->pack_start(*manage(main_panel), false, true);
-
-       window.show_all();
-}
-
-void Remote::tick()
-{
-       event_disp.tick(Time::zero);
-       gtk.iteration(false);
-}
-
-void Remote::train_added(R2C2::NetTrain &t)
-{
-       Gtk::HSeparator *sep = new Gtk::HSeparator;
-       panel_box->pack_start(*manage(sep), false, true);
-       sep->show();
-
-       TrainPanel *panel = new TrainPanel(*this, client, t);
-       panel_box->pack_start(*manage(panel), false, true);
-       train_panels.push_back(panel);
-}