]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blobdiff - Constructor/src/cisternptywnd.cpp
Se agrega el doc del cliente REVISAR Y CORREGIR A GUSTO!
[z.facultad/75.42/plaqui.git] / Constructor / src / cisternptywnd.cpp
index 495b0ef94a94bbaa577e53e6a604726cd340fe0d..c63c57f377863073748551b9c48ecefc716a7351 100644 (file)
@@ -8,11 +8,19 @@ CisternPtyWnd::CisternPtyWnd(BaseObjectType* cobject, const Glib::RefPtr<Gnome::
        refGlade->get_widget("txt_cistern_name", txt_cistern_name);
        refGlade->get_widget("btn_select_color", btn_select_color);             
        refGlade->get_widget("color_preview",color_preview);
        refGlade->get_widget("txt_cistern_name", txt_cistern_name);
        refGlade->get_widget("btn_select_color", btn_select_color);             
        refGlade->get_widget("color_preview",color_preview);
+       refGlade->get_widget("spin_flot_inf", spin_flot_inf);
+       refGlade->get_widget("spin_flot_sup", spin_flot_sup);
        
        Glib::RefPtr<Gnome::Glade::Xml> ref = Gnome::Glade::Xml::create(PACKAGE_DATA_DIR"/plaqui-constructor/dialogs/constructor.glade", "color_select_dlg");
        ref->get_widget("color_select_dlg",color_select_dlg);
        ref->get_widget("dlg_select_color_cancel",dlg_select_color_cancel);
        ref->get_widget("dlg_select_color_ok",dlg_select_color_ok);
        
        Glib::RefPtr<Gnome::Glade::Xml> ref = Gnome::Glade::Xml::create(PACKAGE_DATA_DIR"/plaqui-constructor/dialogs/constructor.glade", "color_select_dlg");
        ref->get_widget("color_select_dlg",color_select_dlg);
        ref->get_widget("dlg_select_color_cancel",dlg_select_color_cancel);
        ref->get_widget("dlg_select_color_ok",dlg_select_color_ok);
+
+       Glib::RefPtr<Gnome::Glade::Xml> ref2 = Gnome::Glade::Xml::create(PACKAGE_DATA_DIR"/plaqui-constructor/dialogs/constructor.glade", "dlg_flot");
+       ref2->get_widget("dlg_flot",dlg_flot);
+       ref2->get_widget("btn_dlg_flot_ok",btn_dlg_flot_ok);
+       
+       btn_dlg_flot_ok->signal_clicked().connect(SigC::slot(*this,&CisternPtyWnd::on_btn_dlg_flot_ok_clicked));
        
        btn_select_color->signal_clicked().connect(SigC::slot(*this,&CisternPtyWnd::on_btn_select_color_clicked));
        dlg_select_color_cancel->signal_clicked().connect(SigC::slot(*this,&CisternPtyWnd::on_dlg_select_color_cancel_clicked));
        
        btn_select_color->signal_clicked().connect(SigC::slot(*this,&CisternPtyWnd::on_btn_select_color_clicked));
        dlg_select_color_cancel->signal_clicked().connect(SigC::slot(*this,&CisternPtyWnd::on_dlg_select_color_cancel_clicked));
@@ -35,7 +43,7 @@ CisternPtyWnd::~CisternPtyWnd()
 void CisternPtyWnd::on_btn_accept_clicked()
 {
        CisternPtyWnd::on_btn_apply_clicked();
 void CisternPtyWnd::on_btn_accept_clicked()
 {
        CisternPtyWnd::on_btn_apply_clicked();
-       if ( !cistern->workplace->chek_name(txt_cistern_name->get_text(), cistern->get_id()) 
+       if ( !cistern->workplace->chek_name(txt_cistern_name->get_text(), cistern->get_id()) && ( spin_flot_inf->get_value() < spin_flot_sup->get_value() )     )
        hide();
 }
 
        hide();
 }
 
@@ -49,6 +57,12 @@ void CisternPtyWnd::on_btn_apply_clicked()
                dlg_name->show();
        else 
                cistern->set_name( txt_cistern_name->get_text() );
                dlg_name->show();
        else 
                cistern->set_name( txt_cistern_name->get_text() );
+       if ( spin_flot_inf->get_value() >= spin_flot_sup->get_value() ) 
+               dlg_flot->show();
+       else {
+               cistern->set_flotante_inf(spin_flot_inf->get_value() );
+               cistern->set_flotante_sup(spin_flot_sup->get_value() );
+       }               
 }
 
 void CisternPtyWnd::on_btn_select_color_clicked()
 }
 
 void CisternPtyWnd::on_btn_select_color_clicked()
@@ -68,3 +82,8 @@ void CisternPtyWnd::on_dlg_select_color_ok_clicked()
        color_preview->modify_bg( Gtk::STATE_NORMAL , cistern->get_liquid_color() );
        color_select_dlg->hide();
 }
        color_preview->modify_bg( Gtk::STATE_NORMAL , cistern->get_liquid_color() );
        color_select_dlg->hide();
 }
+
+void CisternPtyWnd::on_btn_dlg_flot_ok_clicked()
+{
+       dlg_flot->hide();
+}