Fawkes API Fawkes Development Version
|
Treeview widget for displaying/editing config entries. More...
#include <tools/config_editor/config_tree_view.h>
Classes | |
class | ConfigRecord |
Column record class for the config TreeView. More... | |
Public Member Functions | |
ConfigTreeView (BaseObjectType *cobject, const Glib::RefPtr< Gnome::Glade::Xml > &ref_xml) | |
Constructor. | |
virtual | ~ConfigTreeView () |
Destructor. | |
void | set_config (fawkes::Configuration *config) |
Set the fawkes::Configuration to be displayed. | |
void | set_network_client (fawkes::FawkesNetworkClient *client) |
Set a network client that is used to open a fawkes::NetworkConfiguration. | |
void | set_config_file (const char *filename) |
Set the file to read the config from. | |
void | register_plugin (ConfigEditorPlugin *plugin) |
Register a plugin. | |
void | remove_plugin (std::string config_path) |
Remove a plugin. | |
Protected Member Functions | |
void | set_value (const char *path, const char *type, bool is_default, bool value) |
Add a config entry to the TreeModel storage object. | |
void | set_value (const char *path, const char *type, bool is_default, int value) |
Add a config entry to the TreeModel storage object. | |
void | set_value (const char *path, const char *type, bool is_default, uint value) |
Add a config entry to the TreeModel storage object. | |
void | set_value (const char *path, const char *type, bool is_default, float value) |
Add a config entry to the TreeModel storage object. | |
void | set_value (const char *path, const char *type, bool is_default, std::string value) |
Add a config entry to the TreeModel storage object. | |
virtual void | on_button_press_event_custom (GdkEventButton *event) |
Signal handler for the button press event. | |
virtual void | on_menu_edit_selected () |
Signal handler that is called when the 'edit' entry is selected from popup menu. | |
virtual void | on_menu_add_selected () |
Signal handler that is called when the 'add' entry is selected from popup menu. | |
virtual void | on_menu_remove_selected () |
Signal handler that is called when the 'remove' entry is selected from popup menu. | |
Protected Attributes | |
ConfigRecord | m_config_record |
Column record object to access the columns of the storage object. | |
Glib::RefPtr< Gtk::TreeStore > | m_config_tree |
Storage object. | |
Gtk::Menu | m_menu |
A popup menu to edit the configuration. | |
ConfigEditDialog * | m_dlg_edit |
A dialog to edit a config entry. | |
ConfigAddDialog * | m_dlg_add |
A dialog to add a config entry. | |
ConfigRemoveDialog * | m_dlg_remove |
A dialog to remove a config entry. | |
std::map< std::string, ConfigEditorPlugin * > | m_plugins |
A map of registered plugins: config-prefix => config editor plugin. | |
fawkes::Configuration * | m_config |
The fawkes::Configuration that is displayed and editted. | |
bool | m_own_config |
True if config was created by ConfigTreeView object. |
Treeview widget for displaying/editing config entries.
Definition at line 40 of file config_tree_view.h.
ConfigTreeView::ConfigTreeView | ( | BaseObjectType * | cobject, |
const Glib::RefPtr< Gnome::Glade::Xml > & | ref_xml | ||
) |
Constructor.
cobject | pointer to base object type |
ref_xml | Glade XML file |
Definition at line 93 of file config_tree_view.cpp.
References ConfigTreeView::ConfigRecord::is_default, m_config, m_config_record, m_config_tree, m_dlg_add, m_dlg_edit, m_dlg_remove, m_menu, m_own_config, ConfigTreeView::ConfigRecord::node, on_button_press_event_custom(), on_menu_add_selected(), on_menu_edit_selected(), on_menu_remove_selected(), and ConfigTreeView::ConfigRecord::value_string.
ConfigTreeView::~ConfigTreeView | ( | ) | [virtual] |
Destructor.
Definition at line 135 of file config_tree_view.cpp.
References m_config, m_own_config, and m_plugins.
void ConfigTreeView::on_button_press_event_custom | ( | GdkEventButton * | event | ) | [protected, virtual] |
Signal handler for the button press event.
event | a Gdk button event |
Definition at line 471 of file config_tree_view.cpp.
References m_config_record, m_menu, m_plugins, and ConfigTreeView::ConfigRecord::path.
Referenced by ConfigTreeView().
void ConfigTreeView::on_menu_add_selected | ( | ) | [protected, virtual] |
Signal handler that is called when the 'add' entry is selected from popup menu.
Definition at line 502 of file config_tree_view.cpp.
Referenced by ConfigTreeView().
void ConfigTreeView::on_menu_edit_selected | ( | ) | [protected, virtual] |
Signal handler that is called when the 'edit' entry is selected from popup menu.
Definition at line 493 of file config_tree_view.cpp.
Referenced by ConfigTreeView().
void ConfigTreeView::on_menu_remove_selected | ( | ) | [protected, virtual] |
Signal handler that is called when the 'remove' entry is selected from popup menu.
Definition at line 511 of file config_tree_view.cpp.
Referenced by ConfigTreeView().
void ConfigTreeView::register_plugin | ( | ConfigEditorPlugin * | plugin | ) |
Register a plugin.
This also initializes the plugin.
plugin | the new plugin to register |
Definition at line 220 of file config_tree_view.cpp.
References ConfigEditorPlugin::get_config_path(), ConfigEditorPlugin::initialize(), and m_plugins.
void ConfigTreeView::remove_plugin | ( | std::string | config_path | ) |
Remove a plugin.
config_path | the config prefix corresponding to the plugin to be removed |
Definition at line 231 of file config_tree_view.cpp.
References m_plugins.
void ConfigTreeView::set_config | ( | fawkes::Configuration * | config | ) |
Set the fawkes::Configuration to be displayed.
config | the fawkes::Configuration; set it to NULL to signal the unavailability of the config |
Definition at line 151 of file config_tree_view.cpp.
References m_config, m_config_tree, m_own_config, and m_plugins.
void ConfigTreeView::set_config_file | ( | const char * | filename | ) |
Set the file to read the config from.
filename | the filename of the database file |
Definition at line 207 of file config_tree_view.cpp.
References m_config, and m_own_config.
void ConfigTreeView::set_network_client | ( | fawkes::FawkesNetworkClient * | client | ) |
Set a network client that is used to open a fawkes::NetworkConfiguration.
client | a fawkes::NetworkClient; set it to NULL to signal the unavailability of the client |
Definition at line 179 of file config_tree_view.cpp.
References m_config, m_config_tree, m_own_config, m_plugins, and fawkes::NetworkConfiguration::set_mirror_mode().
void ConfigTreeView::set_value | ( | const char * | path, |
const char * | type, | ||
bool | is_default, | ||
bool | value | ||
) | [protected] |
Add a config entry to the TreeModel storage object.
path | config path |
type | type of config entry |
is_default | true if config entry is in the default config |
value | the value of the config entry |
Definition at line 279 of file config_tree_view.cpp.
References ConfigTreeView::ConfigRecord::is_default, m_config_record, ConfigTreeView::ConfigRecord::type, ConfigTreeView::ConfigRecord::value_bool, and ConfigTreeView::ConfigRecord::value_string.
void ConfigTreeView::set_value | ( | const char * | path, |
const char * | type, | ||
bool | is_default, | ||
std::string | value | ||
) | [protected] |
Add a config entry to the TreeModel storage object.
path | config path |
type | type of config entry |
is_default | true if config entry is in the default config |
value | the value of the config entry |
Definition at line 366 of file config_tree_view.cpp.
References ConfigTreeView::ConfigRecord::is_default, m_config_record, ConfigTreeView::ConfigRecord::type, and ConfigTreeView::ConfigRecord::value_string.
void ConfigTreeView::set_value | ( | const char * | path, |
const char * | type, | ||
bool | is_default, | ||
float | value | ||
) | [protected] |
Add a config entry to the TreeModel storage object.
path | config path |
type | type of config entry |
is_default | true if config entry is in the default config |
value | the value of the config entry |
Definition at line 343 of file config_tree_view.cpp.
References ConfigTreeView::ConfigRecord::is_default, m_config_record, ConfigTreeView::ConfigRecord::type, ConfigTreeView::ConfigRecord::value_float, and ConfigTreeView::ConfigRecord::value_string.
void ConfigTreeView::set_value | ( | const char * | path, |
const char * | type, | ||
bool | is_default, | ||
uint | value | ||
) | [protected] |
Add a config entry to the TreeModel storage object.
path | config path |
type | type of config entry |
is_default | true if config entry is in the default config |
value | the value of the config entry |
Definition at line 320 of file config_tree_view.cpp.
References ConfigTreeView::ConfigRecord::is_default, m_config_record, ConfigTreeView::ConfigRecord::type, ConfigTreeView::ConfigRecord::value_string, and ConfigTreeView::ConfigRecord::value_uint.
void ConfigTreeView::set_value | ( | const char * | path, |
const char * | type, | ||
bool | is_default, | ||
int | value | ||
) | [protected] |
Add a config entry to the TreeModel storage object.
path | config path |
type | type of config entry |
is_default | true if config entry is in the default config |
value | the value of the config entry |
Definition at line 297 of file config_tree_view.cpp.
References ConfigTreeView::ConfigRecord::is_default, m_config_record, ConfigTreeView::ConfigRecord::type, ConfigTreeView::ConfigRecord::value_int, and ConfigTreeView::ConfigRecord::value_string.
ConfigTreeView::m_config [protected] |
The fawkes::Configuration that is displayed and editted.
Definition at line 102 of file config_tree_view.h.
Referenced by ConfigTreeView(), set_config(), set_config_file(), set_network_client(), and ~ConfigTreeView().
ConfigTreeView::m_config_record [protected] |
Column record object to access the columns of the storage object.
Definition at line 92 of file config_tree_view.h.
Referenced by ConfigTreeView(), on_button_press_event_custom(), and set_value().
ConfigTreeView::m_config_tree [protected] |
Storage object.
Definition at line 93 of file config_tree_view.h.
Referenced by ConfigTreeView(), set_config(), and set_network_client().
ConfigTreeView::m_dlg_add [protected] |
A dialog to add a config entry.
Definition at line 97 of file config_tree_view.h.
Referenced by ConfigTreeView().
ConfigTreeView::m_dlg_edit [protected] |
A dialog to edit a config entry.
Definition at line 96 of file config_tree_view.h.
Referenced by ConfigTreeView().
ConfigTreeView::m_dlg_remove [protected] |
A dialog to remove a config entry.
Definition at line 98 of file config_tree_view.h.
Referenced by ConfigTreeView().
ConfigTreeView::m_menu [protected] |
A popup menu to edit the configuration.
Definition at line 95 of file config_tree_view.h.
Referenced by ConfigTreeView(), and on_button_press_event_custom().
ConfigTreeView::m_own_config [protected] |
True if config was created by ConfigTreeView object.
Definition at line 103 of file config_tree_view.h.
Referenced by ConfigTreeView(), set_config(), set_config_file(), set_network_client(), and ~ConfigTreeView().
ConfigTreeView::m_plugins [protected] |
A map of registered plugins: config-prefix => config editor plugin.
Definition at line 100 of file config_tree_view.h.
Referenced by on_button_press_event_custom(), register_plugin(), remove_plugin(), set_config(), set_network_client(), and ~ConfigTreeView().