#include "conexion_ssl.h" #include "vista.h" #include "controlador.h" #include "view_loggin.h" #include #include "read_uses.h" #define FILE_CONFIG "config" using namespace std; int main(int argc, char *argv[]) { auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example"); config_reader conf = config_reader(FILE_CONFIG); conexion* con; string option; if(conf.get_param("security", option)){ if(option=="yes"){ con = new conexion_ssl(conf); }else if(option=="no"){ con = new conexion(conf); }else{ perror("invalid option in security"); } }else{ perror("no securty option found in config"); } /*if(con->check_pass("test","ok")){ con->write_string("algo"); string salida; con->read_string(salida,10); cout << salida << endl; }else{ cout << "contrasenia incorrecta" << endl; }*/ view_loggin login(con); //Shows the window and returns when it is closed. //app->add_window(vis); app->run(login); if(login.login){ vista vis; controlador cont(&vis, con); app.reset(); app = Gtk::Application::create(argc, argv, "org.gtkmm.example"); app->run(vis); } return 0; }