<widget class="GtkFrame" id="frame2">
<property name="visible">True</property>
<property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
+ <property name="label_yalign">0</property>
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
<child>
- <widget class="GtkHBox" id="hbox1">
+ <widget class="GtkTable" id="table2">
<property name="visible">True</property>
+ <property name="n_rows">3</property>
+ <property name="n_columns">3</property>
<property name="homogeneous">False</property>
- <property name="spacing">0</property>
+ <property name="row_spacing">0</property>
+ <property name="column_spacing">0</property>
<child>
- <widget class="GtkLabel" id="label12">
+ <widget class="GtkLabel" id="label14">
<property name="visible">True</property>
- <property name="label" translatable="yes">URI : </property>
+ <property name="label" translatable="yes">Target : </property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
- <property name="xalign">0.5</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label15">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Command :</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label16">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Arguments :</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkEntry" id="txt_uri">
+ <widget class="GtkEntry" id="txt_target">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="activates_default">False</property>
</widget>
<packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkEntry" id="txt_command">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">True</property>
+ <property name="visibility">True</property>
+ <property name="max_length">0</property>
+ <property name="text" translatable="yes"></property>
+ <property name="has_frame">True</property>
+ <property name="invisible_char" translatable="yes">*</property>
+ <property name="activates_default">False</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkEntry" id="txt_args">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">True</property>
+ <property name="visibility">True</property>
+ <property name="max_length">0</property>
+ <property name="text" translatable="yes"></property>
+ <property name="has_frame">True</property>
+ <property name="invisible_char" translatable="yes">*</property>
+ <property name="activates_default">False</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options"></property>
</packing>
</child>
<widget class="GtkButton" id="btn_get">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">GET</property>
+ <property name="label" translatable="yes">Enviar</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
</widget>
<packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">fill</property>
+ <property name="y_options">fill</property>
</packing>
</child>
</widget>
</widget>
<packing>
<property name="shrink">True</property>
- <property name="resize">True</property>
+ <property name="resize">False</property>
</packing>
</child>
</widget>
Principal::Principal(BaseObjectType *co, const Glib::RefPtr<Gnome::Glade::Xml> &rg):Gtk::Window(co),refXml(rg)
{
Gtk::MenuItem *conect=0, *exit=0, *about=0;
- Gtk::Button *btn_get=0;
+ Gtk::Button *btn_get=0, *bar_connect=0;
txt_view = 0;
- txt_get = 0;
+ txt_target = txt_command = txt_args = 0;
rg->get_widget("mnu_file_connect", conect);
rg->get_widget("mnu_file_exit", exit);
rg->get_widget_derived("dlgConectar", dlg_conectar);
rg->get_widget("btn_get", btn_get);
rg->get_widget("txt_view", txt_view);
- rg->get_widget("txt_uri", txt_get);
+ rg->get_widget("txt_target", txt_target);
+ rg->get_widget("txt_command", txt_command);
+ rg->get_widget("txt_args", txt_args);
+ rg->get_widget("bar_connect", bar_connect);
dlg_conectar->get_ok_button()->signal_clicked().connect( SigC::slot(*this, &Principal::on_dlg_connect_ok) );
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));
about->signal_activate().connect( SigC::slot(*this, &Principal::on_mnu_help_about));
btn_get->signal_clicked().connect( SigC::slot(*this, &Principal::on_get_clicked) );
if (conexion == NULL) {
std::cout << "Conectando ..." << std::endl;
// Creo la conexion
- conexion = new PlaQui::Server::ControlClient(dlg_conectar->get_server_name(), dlg_conectar->get_server_port());
+ try {
+ conexion = new PlaQui::Server::ControlClient(dlg_conectar->get_server_name(), dlg_conectar->get_server_port());
+ }
+ catch (...) {
+ txt_view->get_buffer()->insert_at_cursor("NO SE PUDO CREAR OBJETO\n");
+ return;
+ }
+
// Conecto las señales
conexion->signal_ok_received().connect( SigC::slot(*this, &Principal::on_conexion_ok) );
conexion->signal_error_received().connect( SigC::slot(*this, &Principal::on_conexion_error) );
// Lanzo la conexion!
- conexion->run();
+ //
+ try {
+ conexion->run();
+ }
+ catch (...) {
+ txt_view->get_buffer()->insert_at_cursor("no se puede correr ->run()!!!\n");
+ }
} else {
std::cout << "Ya estas conectado" << std::endl;
}
dlg_conectar->hide();
-
- // mando algo para ver que me dice
- PlaQui::Server::Command command("/", "status");
- conexion->send(command);
}
void Principal::on_mnu_file_exit()
txt_view->get_buffer()->insert_at_cursor("SIN CONEXION\n");
}
- txt_view->get_buffer()->insert_at_cursor("Enviada URI : ");
- txt_view->get_buffer()->insert_at_cursor(txt_get->get_text());
- txt_view->get_buffer()->insert_at_cursor("\n");
- PlaQui::Server::Command command(txt_get->get_text(), "");
- conexion->send(command);
+ PlaQui::Server::Command command(txt_target->get_text(), txt_command->get_text());
+ command.add_arg( txt_args->get_text() );
+ txt_view->get_buffer()->insert_at_cursor("Enviando comando\n");
+ try {
+ conexion->send(command);
+ }
+ catch (...) {
+ txt_view->get_buffer()->insert_at_cursor("EXCEPTION EN conexion->send !!\n");
+ }
}