add build dialog
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
#include "controller_install.h"
|
||||
|
||||
controller_install::controller_install(view_install *vis, session_manager *sesi)
|
||||
#include "container_window.h"
|
||||
#include <thread>
|
||||
#include <gtkmm/messagedialog.h>
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -13,5 +16,24 @@ void controller_install::add_controlers(){
|
||||
}
|
||||
|
||||
void controller_install::on_button_clicked(){
|
||||
this->sesi->install_command(vis->entry.get_text());
|
||||
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();
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user