X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/667418327423ba116d24751926a95a2f1235849c..a5853e30ca27518a7a3a33e4f97588f7b1e9ffe3:/Constructor/src/pumpptywnd.cpp?ds=inline diff --git a/Constructor/src/pumpptywnd.cpp b/Constructor/src/pumpptywnd.cpp index 0889599..f9ecc08 100644 --- a/Constructor/src/pumpptywnd.cpp +++ b/Constructor/src/pumpptywnd.cpp @@ -16,23 +16,36 @@ PumpPtyWnd::PumpPtyWnd(BaseObjectType* cobject, const Glib::RefPtrsignal_clicked().connect(SigC::slot(*this,&PumpPtyWnd::on_btn_select_color_clicked)); dlg_select_color_cancel->signal_clicked().connect(SigC::slot(*this,&PumpPtyWnd::on_dlg_select_color_cancel_clicked)); dlg_select_color_ok->signal_clicked().connect(SigC::slot(*this,&PumpPtyWnd::on_dlg_select_color_ok_clicked)); + pump = NULL; } PumpPtyWnd::~PumpPtyWnd() { } +void PumpPtyWnd::show() +{ + if (pump != NULL) { + color_preview->modify_bg( Gtk::STATE_NORMAL , pump->get_liquid_color() ); + } + PropertyWnd::show(); +} + void PumpPtyWnd::on_btn_accept_clicked() { PumpPtyWnd::on_btn_apply_clicked(); + if ( !pump->workplace->chek_name(txt_pump_name->get_text(), pump->get_id()) ) hide(); } void PumpPtyWnd::on_btn_apply_clicked() { pump->set_entrega( spin_fluid->get_value() ); - pump->set_name( txt_pump_name->get_text() ); color_select_dlg->get_colorsel()->set_current_color(pump->get_liquid_color()); + if ( pump->workplace->chek_name(txt_pump_name->get_text(), pump->get_id()) ) + dlg_name->show(); + else + pump->set_name( txt_pump_name->get_text() ); } void PumpPtyWnd::on_btn_select_color_clicked()