X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/f61a5ebd00d4620af70c3780ba821f5af68def1c..24ac99bd21e4562a6ae028e0a84d8c09da07058b:/Client/src/principal.cpp?ds=sidebyside diff --git a/Client/src/principal.cpp b/Client/src/principal.cpp index 1ccf645..0b59c0b 100644 --- a/Client/src/principal.cpp +++ b/Client/src/principal.cpp @@ -22,6 +22,7 @@ Principal::Principal(BaseObjectType *co, const Glib::RefPtr & work_place = 0; lbl_cap_flujo = lbl_cap_extra = lbl_extra = lbl_nombre = lbl_color = lbl_flujo = 0; + rg->get_widget("btn_activar", btn_activar); rg->get_widget("color_preview", color_preview); rg->get_widget("lbl_nombre", lbl_nombre); rg->get_widget("lbl_extra", lbl_extra); @@ -50,6 +51,7 @@ Principal::Principal(BaseObjectType *co, const Glib::RefPtr & exit->signal_activate().connect( SigC::slot(*this, &Principal::on_mnu_file_exit)); about->signal_activate().connect( SigC::slot(*this, &Principal::on_mnu_help_about)); btn_get->signal_clicked().connect( SigC::slot(*this, &Principal::on_get_clicked) ); + btn_activar->signal_clicked().connect( SigC::slot(*this, &Principal::on_btn_activar_clicked) ); conexion = NULL; is_xml_loaded = false; @@ -97,6 +99,23 @@ void Principal::on_mnu_file_exit() Gtk::Main::quit(); } +void Principal::on_btn_activar_clicked() +{ + if ((conexion == NULL) || (last_selected == NULL)) return; + + PlaQui::Server::Command c("plant", "set"); + c.add_arg("default"); + c.add_arg(last_selected->get_name()); + c.add_arg("open"); + + if (last_selected->get_open()) + c.add_arg("false"); + else + c.add_arg("true"); + + conexion->send(c); +} + void Principal::on_mnu_file_disconnect() { if (conexion == NULL) return; @@ -168,8 +187,6 @@ void Principal::update_items_prop() color_preview->modify_bg(Gtk::STATE_NORMAL, last_selected->get_color()); color_preview->queue_draw(); - - std::cout << last_selected->get_name() << " " << last_selected->get_color().get_red() << std::endl; } void Principal::on_conexion_connected()