Classes | Public Member Functions | Protected Member Functions | Protected Attributes

ConfigTreeView Class Reference

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

#include <tools/config_editor/config_tree_view.h>

List of all members.

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.
ConfigEditDialogm_dlg_edit
 A dialog to edit a config entry.
ConfigAddDialogm_dlg_add
 A dialog to add a config entry.
ConfigRemoveDialogm_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::Configurationm_config
 The fawkes::Configuration that is displayed and editted.
bool m_own_config
 True if config was created by ConfigTreeView object.

Detailed Description

Treeview widget for displaying/editing config entries.

Author:
Daniel Beck

Definition at line 40 of file config_tree_view.h.


Constructor & Destructor Documentation

ConfigTreeView::ConfigTreeView ( BaseObjectType *  cobject,
const Glib::RefPtr< Gnome::Glade::Xml > &  ref_xml 
)
ConfigTreeView::~ConfigTreeView (  )  [virtual]

Destructor.

Definition at line 135 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  )  [protected, virtual]

Signal handler for the button press event.

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

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.

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

Referenced by FawkesConfigEditor::FawkesConfigEditor().

void ConfigTreeView::remove_plugin ( std::string  config_path  ) 

Remove a plugin.

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

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

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

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

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

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

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

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

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


Member Data Documentation

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

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

Storage object.

Definition at line 93 of file config_tree_view.h.

Referenced by ConfigTreeView(), set_config(), and set_network_client().

A dialog to add a config entry.

Definition at line 97 of file config_tree_view.h.

Referenced by ConfigTreeView().

A dialog to edit a config entry.

Definition at line 96 of file config_tree_view.h.

Referenced by ConfigTreeView().

A dialog to remove a config entry.

Definition at line 98 of file config_tree_view.h.

Referenced by ConfigTreeView().

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

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

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: