plugin_gui.cpp

00001 
00002 /***************************************************************************
00003  *  plugin_gui.cpp -  Plugin Tool Gui
00004  *
00005  *  Created: Thu Nov 09 20:16:23 2007
00006  *  Copyright  2007       Daniel Beck
00007  *             2008-2009  Tim Niemueller [www.niemueller.de]
00008  *
00009  ****************************************************************************/
00010 
00011 /*  This program is free software; you can redistribute it and/or modify
00012  *  it under the terms of the GNU General Public License as published by
00013  *  the Free Software Foundation; either version 2 of the License, or
00014  *  (at your option) any later version.
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL file in the doc directory.
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 /** @class PluginGuiGtkWindow "plugin_gui.h"
00033  * Graphical plugin management tool.
00034  *
00035  * @author Daniel Beck
00036  * @author Tim Niemueller
00037  */
00038 
00039 /** Constructor.
00040  * @param cobject C base object
00041  * @param ref_xml Glade XML
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 /** Destructor. */
00064 PluginGuiGtkWindow::~PluginGuiGtkWindow()
00065 {
00066   m_stb_status->push("Exiting");
00067 }
00068 
00069 /** Connected handler. */
00070 void
00071 PluginGuiGtkWindow::on_connect()
00072 {
00073   this->set_title(std::string("Fawkes Plugin Tool @ ") + m_service_selector->get_name());
00074 }
00075 
00076 /** Disconnected handler. */
00077 void
00078 PluginGuiGtkWindow::on_disconnect()
00079 {
00080   this->set_title("Fawkes Plugin Tool");
00081 }

Generated on Tue Feb 22 13:32:32 2011 for Fawkes API by  doxygen 1.4.7