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< Gtk::Builder > &builder) | |
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 39 of file config_tree_view.h.
ConfigTreeView::ConfigTreeView | ( | BaseObjectType * | cobject, |
const Glib::RefPtr< Gtk::Builder > & | builder | ||
) |
Constructor.
cobject | pointer to base object type |
builder | Gtk builder |
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_own_config, ConfigTreeView::ConfigRecord::node, on_button_press_event_custom(), and ConfigTreeView::ConfigRecord::value_string.
|
virtual |
Destructor.
Definition at line 142 of file config_tree_view.cpp.
References m_config, m_own_config, and m_plugins.
|
protectedvirtual |
Signal handler for the button press event.
event | a Gdk button event |
Definition at line 478 of file config_tree_view.cpp.
References m_config_record, m_plugins, and ConfigTreeView::ConfigRecord::path.
Referenced by ConfigTreeView().
|
protectedvirtual |
Signal handler that is called when the 'add' entry is selected from popup menu.
Definition at line 509 of file config_tree_view.cpp.
|
protectedvirtual |
Signal handler that is called when the 'edit' entry is selected from popup menu.
Definition at line 500 of file config_tree_view.cpp.
|
protectedvirtual |
Signal handler that is called when the 'remove' entry is selected from popup menu.
Definition at line 518 of file config_tree_view.cpp.
void ConfigTreeView::register_plugin | ( | ConfigEditorPlugin * | plugin | ) |
Register a plugin.
This also initializes the plugin.
plugin | the new plugin to register |
Definition at line 227 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 238 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 158 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 214 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 186 of file config_tree_view.cpp.
References m_config, m_config_tree, m_own_config, m_plugins, and fawkes::NetworkConfiguration::set_mirror_mode().
|
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 286 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.
|
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 304 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.
|
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 327 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.
|
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 350 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.
|
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 373 of file config_tree_view.cpp.
References ConfigTreeView::ConfigRecord::is_default, m_config_record, ConfigTreeView::ConfigRecord::type, and ConfigTreeView::ConfigRecord::value_string.
|
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().
|
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().
|
protected |
Storage object.
Definition at line 93 of file config_tree_view.h.
Referenced by ConfigTreeView(), set_config(), and set_network_client().
|
protected |
A dialog to add a config entry.
Definition at line 97 of file config_tree_view.h.
Referenced by ConfigTreeView().
|
protected |
A dialog to edit a config entry.
Definition at line 96 of file config_tree_view.h.
Referenced by ConfigTreeView().
|
protected |
A dialog to remove a config entry.
Definition at line 98 of file config_tree_view.h.
Referenced by ConfigTreeView().
|
protected |
A popup menu to edit the configuration.
Definition at line 95 of file config_tree_view.h.
|
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().
|
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().