#include "cisternptywnd.h"
+#include "cistern.h"
CisternPtyWnd::CisternPtyWnd(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade):PropertyWnd(cobject, refGlade)
{
- refGlade = Gnome::Glade::Xml::create("constructor.glade", "cistern_pty_wnd");
refGlade->get_widget("spin_capacidad", spin_capacidad);
refGlade->get_widget("spin_inicial", spin_inicial);
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);
+
+ Glib::RefPtr<Gnome::Glade::Xml> ref = Gnome::Glade::Xml::create("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);
+
+ 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));
+ dlg_select_color_ok->signal_clicked().connect(SigC::slot(*this,&CisternPtyWnd::on_dlg_select_color_ok_clicked));
}
CisternPtyWnd::~CisternPtyWnd()
void CisternPtyWnd::on_btn_accept_clicked()
{
- cistern->set_capacidad( spin_capacidad->get_value() );
- cistern->set_contenido_inicial( spin_inicial->get_value() );
- cistern->set_name( txt_cistern_name->get_text() );
+ CisternPtyWnd::on_btn_apply_clicked();
hide();
}
cistern->set_capacidad( spin_capacidad->get_value() );
cistern->set_contenido_inicial( spin_inicial->get_value() );
cistern->set_name( txt_cistern_name->get_text() );
+ color_select_dlg->get_colorsel()->set_current_color(cistern->get_liquid_color());
+}
+
+void CisternPtyWnd::on_btn_select_color_clicked()
+{
+ color_select_dlg->get_colorsel()->set_current_color(cistern->get_liquid_color());
+ color_select_dlg->show();
+}
+
+void CisternPtyWnd::on_dlg_select_color_cancel_clicked()
+{
+ color_select_dlg->hide();
+}
+
+void CisternPtyWnd::on_dlg_select_color_ok_clicked()
+{
+ cistern->set_liquid_color( color_select_dlg->get_colorsel()->get_current_color() );
+ color_preview->modify_bg( Gtk::STATE_NORMAL , cistern->get_liquid_color() );
+ color_select_dlg->hide();
}