]> git.llucax.com Git - z.facultad/75.42/plaqui.git/commitdiff
* La animacion es mas linda ahora
authorRicardo Markiewicz <gazer.arg@gmail.com>
Mon, 1 Dec 2003 06:15:22 +0000 (06:15 +0000)
committerRicardo Markiewicz <gazer.arg@gmail.com>
Mon, 1 Dec 2003 06:15:22 +0000 (06:15 +0000)
 * Se implementa el menu comandos

12 files changed:
Client/dialogs/client.glade
Client/include/principal.h
Client/pixmaps/Makefile.am
Client/pixmaps/anim_0.png
Client/pixmaps/anim_1.png
Client/pixmaps/anim_2.png
Client/pixmaps/anim_3.png
Client/pixmaps/anim_4.png
Client/pixmaps/anim_5.png [new file with mode: 0644]
Client/pixmaps/anim_6.png [new file with mode: 0644]
Client/pixmaps/anim_7.png [new file with mode: 0644]
Client/src/principal.cpp

index bac40c9140d732df339c506bf5b82c0381777ad5..15a75383e134b74b08b61fcad5a52e7fd8f04db8 100644 (file)
                <widget class="GtkMenu" id="mnu_comandos_menu">
 
                  <child>
-                   <widget class="GtkImageMenuItem" id="mnu_detener_servidor">
+                   <widget class="GtkImageMenuItem" id="mnu_server_stop">
                      <property name="visible">True</property>
                      <property name="label" translatable="yes">Detener Servidor</property>
                      <property name="use_underline">True</property>
index 818d0165f9d89a7f17616a38a1fc8795e0dfc3fb..f93cb78d1d2b1347fae2934073bcecffea961b2f 100644 (file)
@@ -51,7 +51,7 @@ protected:
 
        // Archivo XML del Padre
        Glib::RefPtr<Gnome::Glade::Xml> refXml;
-       Glib::RefPtr<Gdk::Pixbuf> anim_frames[5];
+       Glib::RefPtr<Gdk::Pixbuf> anim_frames[8];
        int current_frame;
        Gtk::Image *anim;
        bool paused;
@@ -87,6 +87,7 @@ protected:
        virtual bool on_item_clicked(GdkEventButton *, ViewItem *);
        virtual bool on_workplace_expose_event(GdkEventExpose *);
        virtual bool on_delete_event(GdkEventAny *);
+       virtual void on_mnu_server_stop_activate();
        
        // Callbacks para las conexiones
        void on_conexion_finished();
index 05a00dbc00c76485176924d9f93691c84d2054d9..f7489ce54b7262e5a22d2fbbeced034dd6ecc484 100644 (file)
@@ -40,7 +40,10 @@ anim_0.png \
 anim_1.png \
 anim_2.png \
 anim_3.png \
-anim_4.png
+anim_4.png \
+anim_5.png \
+anim_6.png \
+anim_7.png
 
 EXTRA_DIST = $(plaqui_DATA) 
 
index 097654acf9e58bb3c57bc9fde0996afd68c8a0b8..eb849e44f43d5fdb5871c4352570662b27a8d492 100644 (file)
Binary files a/Client/pixmaps/anim_0.png and b/Client/pixmaps/anim_0.png differ
index 37edd58d215e0a1e479eac7a1aec44bcd8ad55a0..25f07b917e37c546d59ea06e4abc6e1bbea441aa 100644 (file)
Binary files a/Client/pixmaps/anim_1.png and b/Client/pixmaps/anim_1.png differ
index 4cbe59c32d553d4f783f6ec6d4929b3b7769d839..3a62b5d9f27986957a84e1d378ddaf3b90e8e35c 100644 (file)
Binary files a/Client/pixmaps/anim_2.png and b/Client/pixmaps/anim_2.png differ
index 5092e1a06d42590f9f4696d33564ff0bba3db57e..92dbbe899eca0c3d7323f4c92fff6f9dd180eb26 100644 (file)
Binary files a/Client/pixmaps/anim_3.png and b/Client/pixmaps/anim_3.png differ
index a89a499c9f300eeedf1c90761cfa383329a624be..ea3107b8e3d18fc1c520ce18bf6b947d5960ee89 100644 (file)
Binary files a/Client/pixmaps/anim_4.png and b/Client/pixmaps/anim_4.png differ
diff --git a/Client/pixmaps/anim_5.png b/Client/pixmaps/anim_5.png
new file mode 100644 (file)
index 0000000..9cea633
Binary files /dev/null and b/Client/pixmaps/anim_5.png differ
diff --git a/Client/pixmaps/anim_6.png b/Client/pixmaps/anim_6.png
new file mode 100644 (file)
index 0000000..ee207da
Binary files /dev/null and b/Client/pixmaps/anim_6.png differ
diff --git a/Client/pixmaps/anim_7.png b/Client/pixmaps/anim_7.png
new file mode 100644 (file)
index 0000000..25d7927
Binary files /dev/null and b/Client/pixmaps/anim_7.png differ
index 3775a8f7c3bf99df336ea0e2b0dd5799edf2721b..8b47e56ddcc563695f934eddcb38996572cc6e20 100644 (file)
@@ -20,7 +20,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, *mnu_disconnect=0;
+       Gtk::MenuItem *conect=0, *exit=0, *about=0, *mnu_prop=0, *mnu_disconnect=0, *server_stop=0;
        Gtk::Button *bar_connect=0;
        txt_view = 0;
        work_place = 0;
@@ -32,6 +32,9 @@ Principal::Principal(BaseObjectType *co, const Glib::RefPtr<Gnome::Glade::Xml> &
        anim_frames[2] = Gdk::Pixbuf::create_from_file(PACKAGE_DATA_DIR"/plaqui-client/pixmaps/anim_2.png");
        anim_frames[3] = Gdk::Pixbuf::create_from_file(PACKAGE_DATA_DIR"/plaqui-client/pixmaps/anim_3.png");
        anim_frames[4] = Gdk::Pixbuf::create_from_file(PACKAGE_DATA_DIR"/plaqui-client/pixmaps/anim_4.png");
+       anim_frames[5] = Gdk::Pixbuf::create_from_file(PACKAGE_DATA_DIR"/plaqui-client/pixmaps/anim_5.png");
+       anim_frames[6] = Gdk::Pixbuf::create_from_file(PACKAGE_DATA_DIR"/plaqui-client/pixmaps/anim_6.png");
+       anim_frames[7] = Gdk::Pixbuf::create_from_file(PACKAGE_DATA_DIR"/plaqui-client/pixmaps/anim_7.png");
        current_frame = 0;
 
        anim = 0;
@@ -51,6 +54,7 @@ Principal::Principal(BaseObjectType *co, const Glib::RefPtr<Gnome::Glade::Xml> &
        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_server_stop", server_stop);
        rg->get_widget("mnu_prop", mnu_prop);
        rg->get_widget_derived("dlg_property", dlg_property);
        rg->get_widget_derived("dlgConectar", dlg_conectar);
@@ -64,6 +68,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_property));
        mnu_disconnect->signal_activate().connect( SigC::slot(*this, &Principal::on_mnu_file_disconnect));
+       server_stop->signal_activate().connect( SigC::slot(*this, &Principal::on_mnu_server_stop_activate));
        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));
@@ -87,13 +92,6 @@ Principal::Principal(BaseObjectType *co, const Glib::RefPtr<Gnome::Glade::Xml> &
 
 Principal::~Principal()
 {
-       if (conexion) {
-               conexion->finish();
-       }
-       // Espera a que termine realmente.
-       while (conexion) {
-               Glib::usleep(100000); // 0,1 segundo
-       }
 }
 
 void Principal::on_realize()
@@ -197,6 +195,13 @@ void Principal::on_dlg_connect_ok()
 void Principal::on_mnu_file_exit()
 {
        on_mnu_file_disconnect();
+       if (conexion) {
+               conexion->finish();
+       }
+       // Espera a que termine realmente.
+       while (conexion) {
+               Glib::usleep(100000); // 0,1 segundo
+       }
        Gtk::Main::quit();
 }
 
@@ -206,6 +211,14 @@ bool Principal::on_delete_event(GdkEventAny *e)
        return false;
 }
 
+void Principal::on_mnu_server_stop_activate()
+{
+       if (conexion == NULL) return;
+
+       PlaQui::Server::Command c("server", "stop");
+       conexion->send(c);
+}
+
 void Principal::on_btn_activar_clicked()
 {
        if ((conexion == NULL) || (last_selected == NULL)) return;
@@ -235,7 +248,6 @@ void Principal::on_mnu_file_disconnect()
        c2.add_arg(conexion->get_host());
        c2.add_arg(conexion->get_port());
        conexion->send(c2);
-
 }
 
 void Principal::on_mnu_file_connect()
@@ -302,7 +314,7 @@ void Principal::update_items_prop()
 
        if (!paused) {
                current_frame++;
-               if (current_frame > 4) {
+               if (current_frame > 7) {
                        current_frame = 0;
                }
                anim->set(anim_frames[current_frame]);
@@ -334,6 +346,7 @@ void Principal::on_conexion_finished()
                delete i->second;
        }
        mapItems.clear();
+       is_xml_loaded = false;
 }
 
 void Principal::on_conexion_ok(const std::string &body)