]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blobdiff - Constructor/constructor.cpp
(no commit message)
[z.facultad/75.42/plaqui.git] / Constructor / constructor.cpp
index 98fbb786ffc7f754ad4df8b81172109cc9f8732c..aa27c5361b28980dbb5af3de4b721c9b4cdd74aa 100644 (file)
@@ -24,6 +24,7 @@ Constructor::Constructor(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad
        refGlade->get_widget("btn_check",btn_check);
        refGlade->get_widget("dlg_connect", dlg_connect);
        refGlade->get_widget("btn_dlg_close", btn_dlg_close);
+       refGlade->get_widget("dlg_label", dlg_label);
        
        refGlade->get_widget_derived("workplace", workplace);  //fixed
        
@@ -270,12 +271,19 @@ void Constructor::on_item_drop_drag_received(const Glib::RefPtr<Gdk::DragContext
 void Constructor::on_btn_check_clicked()
 {
        std::list<CItem *>::iterator i = listaItems.begin();
-       while ( i != listaItems.end() ) {
-               CItem *temp = *i;
-               if ( !temp->check_connection() ) {
-                       dlg_connect->show();
-                       break;
+       if ( !listaItems.empty() ) {
+               while ( i != listaItems.end() ) {
+                       CItem *temp = *i;
+                       if ( !temp->check_connection() ) {
+                               dlg_connect->set_title("Error");
+                               dlg_label->set_text("Los elementos no estan conectados\n\t\tcorrectamente");
+                               dlg_connect->show();
+                               return;
+                       }       
+               i++;
                }
-       i++;
+               dlg_connect->set_title("Conexion");
+               dlg_label->set_text("Los elementos estan conectados\n\t\tcorrectamente");
+               dlg_connect->show();    
        }
 }