00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef __GUI_UTILS_PLUGIN_TREE_VIEW_H_
00026 #define __GUI_UTILS_PLUGIN_TREE_VIEW_H_
00027
00028 #include <netcomm/fawkes/client_handler.h>
00029 #include <core/utils/lock_queue.h>
00030 #include <gui_utils/connection_dispatcher.h>
00031
00032 #include <gtkmm.h>
00033 #ifdef HAVE_GLADEMM
00034 # include <libglademm/xml.h>
00035 #endif
00036 #ifdef HAVE_GCONFMM
00037 # include <gconfmm.h>
00038 #endif
00039
00040 namespace fawkes {
00041 #if 0
00042 }
00043 #endif
00044
00045 class FawkesNetworkClient;
00046 class FawkesNetworkMessage;
00047
00048 class PluginTreeView
00049 : public Gtk::TreeView
00050 {
00051 public:
00052 PluginTreeView();
00053 #ifdef HAVE_GLADEMM
00054 PluginTreeView(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml> ref_xml);
00055 #endif
00056 virtual ~PluginTreeView();
00057
00058 void set_network_client(fawkes::FawkesNetworkClient* client);
00059 void set_gconf_prefix(Glib::ustring gconf_prefix);
00060
00061 private:
00062 class PluginRecord : public Gtk::TreeModelColumnRecord
00063 {
00064 public:
00065 PluginRecord()
00066 {
00067 add(index);
00068 add(name);
00069 add(description);
00070 add(loaded);
00071 }
00072
00073 Gtk::TreeModelColumn<int> index;
00074 Gtk::TreeModelColumn<Glib::ustring> name;
00075 Gtk::TreeModelColumn<Glib::ustring> description;
00076 Gtk::TreeModelColumn<bool> loaded;
00077 };
00078
00079 void ctor();
00080 void on_status_toggled(const Glib::ustring& path);
00081 void on_connected();
00082 void on_disconnected();
00083 void on_message_received(fawkes::FawkesNetworkMessage *msg);
00084 void on_id_clicked();
00085 void on_status_clicked();
00086 void on_name_clicked();
00087 void on_config_changed();
00088
00089 void append_plugin_column();
00090
00091 private:
00092 Glib::RefPtr<Gtk::ListStore> m_plugin_list;
00093 #ifdef HAVE_GCONFMM
00094 Glib::RefPtr<Gnome::Conf::Client> __gconf;
00095 #endif
00096 PluginRecord m_plugin_record;
00097
00098 sigc::connection __gconf_connection;
00099 Glib::ustring __gconf_prefix;
00100
00101 fawkes::ConnectionDispatcher m_dispatcher;
00102 };
00103
00104 }
00105
00106 #endif