X-Git-Url: http://git.tdb.fi/?p=r2c2.git;a=blobdiff_plain;f=source%2Fremote%2Fmainpanel.cpp;fp=source%2Fremote%2Fmainpanel.cpp;h=0000000000000000000000000000000000000000;hp=705c402bdf809c293355708e9a66b26d4fa9dfca;hb=a9bbf8d37a2f94a720897fe4f0ab06a016779c69;hpb=df88ff837468c32986c73740b4fc8279bc152e47 diff --git a/source/remote/mainpanel.cpp b/source/remote/mainpanel.cpp deleted file mode 100644 index 705c402..0000000 --- a/source/remote/mainpanel.cpp +++ /dev/null @@ -1,53 +0,0 @@ -#include "mainpanel.h" - -using namespace std; -using namespace R2C2; - -MainPanel::MainPanel(Remote &r, R2C2::Client &c): - remote(r), - client(c) -{ - client.signal_power_changed.connect(sigc::mem_fun(this, &MainPanel::power_changed)); - client.signal_halt_changed.connect(sigc::mem_fun(this, &MainPanel::halt_changed)); - client.signal_emergency.connect(sigc::mem_fun(this, &MainPanel::emergency)); - - Gtk::HBox *hbox = new Gtk::HBox(false, 5); - pack_start(*manage(hbox), false, true); - - hbox->pack_start(*manage(chk_power = new Gtk::CheckButton("Power")), false, true); - chk_power->signal_toggled().connect(sigc::mem_fun(this, &MainPanel::ui_power_changed)); - - hbox->pack_start(*manage(chk_halt = new Gtk::CheckButton("Halt")), false, true); - chk_halt->signal_toggled().connect(sigc::mem_fun(this, &MainPanel::ui_halt_changed)); - - pack_start(*manage(lbl_status = new Gtk::Label), false, true); - - show_all(); -} - -void MainPanel::power_changed(bool p) -{ - chk_power->set_active(p); -} - -void MainPanel::halt_changed(bool h) -{ - chk_halt->set_active(h); - if(!h) - lbl_status->set_text(string()); -} - -void MainPanel::emergency(const string &msg) -{ - lbl_status->set_text(msg); -} - -void MainPanel::ui_power_changed() -{ - client.set_power(chk_power->get_active()); -} - -void MainPanel::ui_halt_changed() -{ - client.set_halt(chk_halt->get_active()); -}