X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/a0d48c665de2a880c7587063ea7d9bc8959430d0..cc77948bedbd851e009ad3b8a421dea93c3ceeff:/Client/src/principal.cpp diff --git a/Client/src/principal.cpp b/Client/src/principal.cpp index 96093c1..f9cb07f 100644 --- a/Client/src/principal.cpp +++ b/Client/src/principal.cpp @@ -80,7 +80,7 @@ Principal::~Principal() } // Espera a que termine realmente. while (conexion) { - Glib::usleep(10000); // 10 milisegundos + Glib::usleep(100000); // 0,1 segundo } } @@ -155,6 +155,7 @@ void Principal::on_dlg_connect_ok() // Conecto las seƱales conexion->signal_ok_received().connect( SigC::slot(*this, &Principal::on_conexion_ok) ); + conexion->signal_error().connect( SigC::slot(*this, &Principal::on_conexion_fatal_error) ); conexion->signal_error_received().connect( SigC::slot(*this, &Principal::on_conexion_error) ); conexion->signal_finished().connect( SigC::slot(*this, &Principal::on_conexion_finished) ); conexion->signal_frame_received().connect(SigC::slot(*this, &Principal::on_conexion_frame)); @@ -321,14 +322,29 @@ void Principal::on_conexion_ok(const std::string &body) } } -void Principal::on_conexion_error(unsigned code) +void Principal::on_conexion_fatal_error(const PlaQui::Server::ControlClient::Error& code, const std::string& desc) { std::stringstream a; std::string s; a << code; a >> s; - txt_view->get_buffer()->insert_at_cursor("El server dice que hay error : "); + txt_view->get_buffer()->insert_at_cursor("Error de red nro. "); txt_view->get_buffer()->insert_at_cursor(s); + txt_view->get_buffer()->insert_at_cursor(": "); + txt_view->get_buffer()->insert_at_cursor(desc); + txt_view->get_buffer()->insert_at_cursor("\n"); +} + +void Principal::on_conexion_error(unsigned code, const std::string& desc) +{ + std::stringstream a; + std::string s; + a << code; + a >> s; + txt_view->get_buffer()->insert_at_cursor("El server dice que hay error nro. "); + txt_view->get_buffer()->insert_at_cursor(s); + txt_view->get_buffer()->insert_at_cursor(": "); + txt_view->get_buffer()->insert_at_cursor(desc); txt_view->get_buffer()->insert_at_cursor("\n"); } @@ -830,6 +846,7 @@ bool Principal::get_bool_from_xml(xmlNodePtr nodo) } nodo = nodo->next; } + std::cout << "AAACCCCAA : " << tmp << std::endl; return tmp == "true"; }