#include "controller_info.h" controller_info::controller_info(view_info *view, session_manager *sesion) { this->view=view; this->sesion=sesion; this->load_info(); this->add_controlers(); } void controller_info::load_info(){ this->view->restart_table(); std::list list=this->sesion->get_packages_info(); for(std::string data:list){ Gtk::TreeModel::Row row = *(this->view->m_refTreeModel->append()); row[this->view->m_Columns.r_name]=get_first(data); row[this->view->m_Columns.r_date]=get_first(data); row[this->view->m_Columns.r_config]=(get_first(data)=="t"); row[this->view->m_Columns.r_user]=get_first(data); } } std::string controller_info::get_first(std::string &info){ int pos = info.find(":"); std::string ret = info.substr(0, pos); info=info.substr(pos+1, info.size()+1); return ret; } void controller_info::add_controlers(){ this->view->b_remove.signal_clicked().connect(sigc::mem_fun(this, &controller_info::on_button_clicked)); } void controller_info::on_button_clicked(){ Gtk::TreeModel::Row row = *this->view->tree.get_selection()->get_selected(); std::string name=row.get_value(this->view->m_Columns.r_name); if(name.find("Gtk-CRITICAL **:")==std::string::npos){ this->sesion->remove_command(name); } this->load_info(); }