Fawkes API  Fawkes Development Version
ConfigTreeView Class Reference

Treeview widget for displaying/editing config entries. More...

#include <tools/config_editor/config_tree_view.h>

Inheritance diagram for ConfigTreeView:

Classes

class  ConfigRecord
 Column record class for the config TreeView. More...
 

Public Member Functions

 ConfigTreeView (BaseObjectType *cobject, const Glib::RefPtr< Gtk::Builder > &builder)
 Constructor. More...
 
virtual ~ConfigTreeView ()
 Destructor. More...
 
void set_config (fawkes::Configuration *config)
 Set the fawkes::Configuration to be displayed. More...
 
void set_network_client (fawkes::FawkesNetworkClient *client)
 Set a network client that is used to open a fawkes::NetworkConfiguration. More...
 
void set_config_file (const char *filename)
 Set the file to read the config from. More...
 
void register_plugin (ConfigEditorPlugin *plugin)
 Register a plugin. More...
 
void remove_plugin (std::string config_path)
 Remove a plugin. More...
 

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. More...
 
void set_value (const char *path, const char *type, bool is_default, int value)
 Add a config entry to the TreeModel storage object. More...
 
void set_value (const char *path, const char *type, bool is_default, uint value)
 Add a config entry to the TreeModel storage object. More...
 
void set_value (const char *path, const char *type, bool is_default, float value)
 Add a config entry to the TreeModel storage object. More...
 
void set_value (const char *path, const char *type, bool is_default, std::string value)
 Add a config entry to the TreeModel storage object. More...
 
virtual void on_button_press_event_custom (GdkEventButton *event)
 Signal handler for the button press event. More...
 
virtual void on_menu_edit_selected ()
 Signal handler that is called when the 'edit' entry is selected from popup menu. More...
 
virtual void on_menu_add_selected ()
 Signal handler that is called when the 'add' entry is selected from popup menu. More...
 
virtual void on_menu_remove_selected ()
 Signal handler that is called when the 'remove' entry is selected from popup menu. More...
 

Protected Attributes

ConfigRecord m_config_record
 Column record object to access the columns of the storage object. More...
 
Glib::RefPtr< Gtk::TreeStore > m_config_tree
 Storage object. More...
 
Gtk::Menu m_menu
 A popup menu to edit the configuration. More...
 
ConfigEditDialogm_dlg_edit
 A dialog to edit a config entry. More...
 
ConfigAddDialogm_dlg_add
 A dialog to add a config entry. More...
 
ConfigRemoveDialogm_dlg_remove
 A dialog to remove a config entry. More...
 
std::map< std::string, ConfigEditorPlugin * > m_plugins
 A map of registered plugins: config-prefix => config editor plugin. More...
 
fawkes::Configurationm_config
 The fawkes::Configuration that is displayed and editted. More...
 
bool m_own_config
 True if config was created by ConfigTreeView object. More...
 

Detailed Description

Treeview widget for displaying/editing config entries.

Author
Daniel Beck

Definition at line 39 of file config_tree_view.h.

Constructor & Destructor Documentation

ConfigTreeView::ConfigTreeView ( BaseObjectType *  cobject,
const Glib::RefPtr< Gtk::Builder > &  builder 
)
ConfigTreeView::~ConfigTreeView ( )
virtual

Destructor.

Definition at line 142 of file config_tree_view.cpp.

References m_config, m_own_config, and m_plugins.

Member Function Documentation

void ConfigTreeView::on_button_press_event_custom ( GdkEventButton *  event)
protectedvirtual

Signal handler for the button press event.

Parameters
eventa Gdk button event
Returns
true if signal has been handled, false otherwise

Definition at line 478 of file config_tree_view.cpp.

References m_config_record, m_plugins, and ConfigTreeView::ConfigRecord::path.

Referenced by ConfigTreeView().

void ConfigTreeView::on_menu_add_selected ( )
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.

void ConfigTreeView::on_menu_edit_selected ( )
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.

void ConfigTreeView::on_menu_remove_selected ( )
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.

Parameters
pluginthe 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.

Parameters
config_paththe 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.

Parameters
configthe 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.

Parameters
filenamethe 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.

Parameters
clienta 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().

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.

Parameters
pathconfig path
typetype of config entry
is_defaulttrue if config entry is in the default config
valuethe 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.

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.

Parameters
pathconfig path
typetype of config entry
is_defaulttrue if config entry is in the default config
valuethe 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.

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.

Parameters
pathconfig path
typetype of config entry
is_defaulttrue if config entry is in the default config
valuethe 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.

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.

Parameters
pathconfig path
typetype of config entry
is_defaulttrue if config entry is in the default config
valuethe 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.

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.

Parameters
pathconfig path
typetype of config entry
is_defaulttrue if config entry is in the default config
valuethe 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.

Member Data Documentation

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.

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().


The documentation for this class was generated from the following files: