]> git.llucax.com Git - z.facultad/75.42/plaqui.git/commitdiff
Se agrega el menu desconectar, que en algun lado falla (command::add_arg tal
authorRicardo Markiewicz <gazer.arg@gmail.com>
Mon, 17 Nov 2003 04:42:09 +0000 (04:42 +0000)
committerRicardo Markiewicz <gazer.arg@gmail.com>
Mon, 17 Nov 2003 04:42:09 +0000 (04:42 +0000)
 vez)

Client/include/principal.h
Client/src/client.glade
Client/src/principal.cpp

index f93adbe1f42c4690296f2cd10036cb27b0008c9b..c3212435b04bdcf409dd627e2185f625c215b611 100644 (file)
@@ -46,6 +46,7 @@ protected:
        // Callbacks del menu y la barra
        virtual void on_mnu_file_exit();
        virtual void on_mnu_file_connect();
+       virtual void on_mnu_file_disconnect();
        virtual void on_mnu_help_about();
        virtual void on_dlg_connect_ok();
        virtual void on_get_clicked();
index 7896363d3bea17f42e4f3e137470cdff9c676c04..0fdcecc0adfd073f00a9fda0504d274a44fa3893 100644 (file)
 <widget class="GtkDialog" id="dlgConectar">
   <property name="title" translatable="yes">Conectar</property>
   <property name="type">GTK_WINDOW_TOPLEVEL</property>
-  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="window_position">GTK_WIN_POS_CENTER</property>
   <property name="modal">False</property>
   <property name="resizable">True</property>
   <property name="destroy_with_parent">False</property>
index 45d4a445a061b4c55e7993bdf6f11c8aff6a43e1..27ebd524019b94749868b1fcbc05d47d677361b0 100644 (file)
@@ -5,6 +5,7 @@
 #include <iostream>
 #include <sstream>
 #include <string>
+#include "plaqui/server/string.h"
 #include "item_codo.h"
 #include "item_conduct.h"
 #include "item_exclusa.h"
@@ -15,7 +16,7 @@
 
 Principal::Principal(BaseObjectType *co, const Glib::RefPtr<Gnome::Glade::Xml> &rg):Gtk::Window(co),refXml(rg)
 {
-       Gtk::MenuItem *conect=0, *exit=0, *about=0, *mnu_prop=0;
+       Gtk::MenuItem *conect=0, *exit=0, *about=0, *mnu_prop=0, *mnu_disconnect;
        Gtk::Button *btn_get=0, *bar_connect=0;
        txt_view = 0;
        txt_target = txt_command = txt_args = 0;
@@ -24,6 +25,7 @@ Principal::Principal(BaseObjectType *co, const Glib::RefPtr<Gnome::Glade::Xml> &
 
        rg->get_widget("lbl_nombre", lbl_nombre);
        rg->get_widget("mnu_file_connect", conect);
+       rg->get_widget("mnu_file_disconnect", mnu_disconnect);
        rg->get_widget("mnu_file_exit", exit);
        rg->get_widget("mnu_help_about", about);
        rg->get_widget("mnu_prop", mnu_prop);
@@ -39,6 +41,7 @@ Principal::Principal(BaseObjectType *co, const Glib::RefPtr<Gnome::Glade::Xml> &
 
        dlg_conectar->get_ok_button()->signal_clicked().connect( SigC::slot(*this, &Principal::on_dlg_connect_ok) );
        mnu_prop->signal_activate().connect( SigC::slot(*this, &Principal::on_mnu_prop));
+       mnu_disconnect->signal_activate().connect( SigC::slot(*this, &Principal::on_mnu_file_disconnect));
        conect->signal_activate().connect( SigC::slot(*this, &Principal::on_mnu_file_connect));
        bar_connect->signal_clicked().connect( SigC::slot(*this, &Principal::on_mnu_file_connect));
        exit->signal_activate().connect( SigC::slot(*this, &Principal::on_mnu_file_exit));
@@ -90,6 +93,16 @@ void Principal::on_mnu_file_exit()
        Gtk::Main::quit();
 }
 
+void Principal::on_mnu_file_disconnect()
+{
+       if (conexion == NULL) return;
+
+       PlaQui::Server::Command c("connection", "stop");
+       c.add_arg(conexion->get_host());
+       c.add_arg(conexion->get_port());
+       conexion->send(c);
+}
+
 void Principal::on_mnu_file_connect()
 {
        dlg_conectar->show();