#include "controller_install.h" #include "container_window.h" #include #include controller_install::controller_install(view_install *vis, session_manager *sesi, controller_info* con) { this->vis=vis; this->sesi=sesi; this->con=con; this->add_controlers(); } void controller_install::add_controlers(){ vis->m_button.signal_clicked().connect(sigc::mem_fun(this, &controller_install::on_button_clicked)); } void controller_install::on_button_clicked(){ std::string n_package = this->vis->entry.get_text(); std::string mesage="Compile the package "; mesage.append(n_package); mesage.append("?"); Gtk::MessageDialog mes=Gtk::MessageDialog(mesage,false,Gtk::MessageType::MESSAGE_INFO, Gtk::ButtonsType::BUTTONS_OK_CANCEL); int result=mes.run(); if(result==-5){ int res=this->sesi->install_command(n_package); mes.close(); con->load_info(); if(res>0){ con->load_info(); Gtk::MessageDialog mesf=Gtk::MessageDialog("Compile end satisfactorily",false,Gtk::MessageType::MESSAGE_INFO, Gtk::ButtonsType::BUTTONS_OK); mesf.run(); }else{ Gtk::MessageDialog mesf=Gtk::MessageDialog("Compile fail",false,Gtk::MessageType::MESSAGE_ERROR, Gtk::ButtonsType::BUTTONS_OK); mesf.run(); } } }