00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "plugin_gui.h"
00025 #include <gui_utils/plugin_tree_view.h>
00026 #include <gui_utils/service_selector_cbe.h>
00027
00028 #include <string>
00029
00030 using namespace fawkes;
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 PluginGuiGtkWindow::PluginGuiGtkWindow(BaseObjectType* cobject,
00044 const Glib::RefPtr<Gnome::Glade::Xml> ref_xml)
00045 : Gtk::Window(cobject)
00046 {
00047 ref_xml->get_widget("stbStatus", m_stb_status);
00048 ref_xml->get_widget_derived("trvPlugins", m_trv_plugins);
00049
00050 #ifdef HAVE_GCONFMM
00051 m_trv_plugins->set_gconf_prefix(GCONF_PREFIX);
00052 #endif
00053
00054 m_service_selector = new ServiceSelectorCBE(ref_xml, "cbeHosts", "btnConnect", "wndMain");
00055 m_trv_plugins->set_network_client( m_service_selector->get_network_client() );
00056
00057 m_service_selector->signal_connected().connect(sigc::mem_fun(*this, &PluginGuiGtkWindow::on_connect));
00058 m_service_selector->signal_disconnected().connect(sigc::mem_fun(*this, &PluginGuiGtkWindow::on_disconnect));
00059
00060 m_stb_status->push("Started");
00061 }
00062
00063
00064 PluginGuiGtkWindow::~PluginGuiGtkWindow()
00065 {
00066 m_stb_status->push("Exiting");
00067 }
00068
00069
00070 void
00071 PluginGuiGtkWindow::on_connect()
00072 {
00073 this->set_title(std::string("Fawkes Plugin Tool @ ") + m_service_selector->get_name());
00074 }
00075
00076
00077 void
00078 PluginGuiGtkWindow::on_disconnect()
00079 {
00080 this->set_title("Fawkes Plugin Tool");
00081 }