add build dialog
This commit is contained in:
parent
44bfd7e606
commit
adf1bc70ce
@ -5,7 +5,7 @@ CONFIG -= qt
|
||||
CONFIG += link_pkgconfig
|
||||
#PKGCONFIG += gtk+-3.0
|
||||
PKGCONFIG += gtkmm-3.0
|
||||
LIBS += -lcrypto -lssl
|
||||
LIBS += -lcrypto -lssl -pthread
|
||||
SOURCES += \
|
||||
main.cpp \
|
||||
conexion.cpp \
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 4.8.2, 2020-06-02T15:21:19. -->
|
||||
<!-- Written by QtCreator 4.8.2, 2020-06-03T15:11:45. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
|
@ -6,8 +6,8 @@ container_window::container_window(conexion *con, Glib::RefPtr< Gtk::Application
|
||||
this->app=app;
|
||||
this->app->run(loggin);
|
||||
if(this->loggin.login){
|
||||
this->cont_inst=new controller_install(&install, sesion.get());
|
||||
this->cont_info=new controller_info(&info, sesion.get());
|
||||
this->cont_inst=new controller_install(&install, sesion.get(), this->cont_info);
|
||||
this->app.reset();
|
||||
this->app=Gtk::Application::create( "org.gtkmm.examples.base");
|
||||
this->add(this->book);
|
||||
|
@ -23,6 +23,7 @@ public:
|
||||
* @param app App that contains the gtk loop
|
||||
*/
|
||||
container_window(conexion *con, Glib::RefPtr< Gtk::Application > app);
|
||||
controller_info *cont_info;
|
||||
private:
|
||||
Glib::RefPtr< Gtk::Application > app;
|
||||
std::unique_ptr<session_manager> sesion;
|
||||
@ -31,7 +32,6 @@ private:
|
||||
view_info info;
|
||||
view_user_info uinfo;
|
||||
controller_install *cont_inst;
|
||||
controller_info *cont_info;
|
||||
controller_user_info *con_uinfo;
|
||||
Gtk::Notebook book;
|
||||
};
|
||||
|
@ -14,14 +14,14 @@ public:
|
||||
* @param sesion Model to have the funcionality
|
||||
*/
|
||||
controller_info(view_info *view, session_manager *sesion);
|
||||
private:
|
||||
view_info *view;
|
||||
session_manager *sesion;
|
||||
/**
|
||||
* @brief load_info
|
||||
* Load the info in the table
|
||||
*/
|
||||
void load_info();
|
||||
private:
|
||||
view_info *view;
|
||||
session_manager *sesion;
|
||||
/**
|
||||
* @brief get_first
|
||||
* Get the firs string until the special character ":"
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,8 @@
|
||||
#include "view_install.h"
|
||||
#include "conexion.h"
|
||||
#include "session_manager.h"
|
||||
#include "controller_info.h"
|
||||
|
||||
class controller_install
|
||||
{
|
||||
public:
|
||||
@ -11,11 +13,13 @@ public:
|
||||
* View controler that send a name package to build
|
||||
* @param view View to controle
|
||||
* @param sesion Model to have the funcionality
|
||||
* @param cont Window that contains these view
|
||||
*/
|
||||
controller_install(view_install* view, session_manager* sesion);
|
||||
controller_install(view_install* view, session_manager* sesion, controller_info* con);
|
||||
private:
|
||||
view_install *vis;
|
||||
session_manager *sesi;
|
||||
controller_info *con;
|
||||
/**
|
||||
* @brief add_controlers
|
||||
* Add controlers to the bottons
|
||||
|
@ -8,7 +8,6 @@ view_install::view_install():m_button("build"),m_VBox(Gtk::ORIENTATION_VERTICAL)
|
||||
add(m_VBox);
|
||||
|
||||
m_VBox.pack_start(this->entry);
|
||||
|
||||
m_VBox.pack_start(m_ButtonBox, Gtk::PACK_SHRINK);
|
||||
m_ButtonBox.pack_start(m_button, Gtk::PACK_SHRINK);
|
||||
m_ButtonBox.set_border_width(5);
|
||||
|
Loading…
Reference in New Issue
Block a user