Fawkes API
Fawkes Development Version
|
Base class for plugins for the Fawkes config editor. More...
#include <tools/config_editor/config_editor_plugin.h>
Public Member Functions | |
ConfigEditorPlugin (std::string config_path, std::string ui_file) | |
Constructor. More... | |
virtual | ~ConfigEditorPlugin () |
Destructor. More... | |
void | initialize () |
Initialize the plugin. More... | |
void | run () |
Run the plugin. More... | |
std::string | get_config_path () const |
Get the config prefix specified for this config editor plugin. More... | |
void | set_config (fawkes::Configuration *config) |
Set the configuration for the plugin to work on. More... | |
Protected Member Functions | |
virtual void | pre_run ()=0 |
Config editor plugins need to implement this function. More... | |
virtual void | post_run (int response)=0 |
This method is called after the dialog is closed. More... | |
virtual Gtk::Dialog * | load_dialog ()=0 |
In this function the (custom) dialog of the plugin needs to be initialized. More... | |
Protected Attributes | |
Gtk::Dialog * | m_dialog |
The (main-) dialog of the plugin. More... | |
Glib::RefPtr< Gtk::Builder > | m_builder |
Gtk Builder created from the UI file of the plugin. More... | |
std::string | m_config_path |
The config prefix the plugin is attached to. More... | |
fawkes::Configuration * | m_config |
The fawkes::Configuration. More... | |
Base class for plugins for the Fawkes config editor.
A plugin allows to manipulate a certain part of the configuration, most often this is intended to be the config options for a Fawkes plugin.
Definition at line 34 of file config_editor_plugin.h.
ConfigEditorPlugin::ConfigEditorPlugin | ( | std::string | config_path, |
std::string | ui_file | ||
) |
Constructor.
config_path | the prefix of the part that can be configured with this plugin |
ui_file | a Gtk Builder file which contains the definition the plugin's GUI components |
Definition at line 78 of file config_editor_plugin.cpp.
|
virtual |
Destructor.
Definition at line 85 of file config_editor_plugin.cpp.
std::string ConfigEditorPlugin::get_config_path | ( | ) | const |
Get the config prefix specified for this config editor plugin.
Definition at line 93 of file config_editor_plugin.cpp.
Referenced by ConfigTreeView::register_plugin().
void ConfigEditorPlugin::initialize | ( | ) |
Initialize the plugin.
This method needs to be called before the plugin can be used.
Definition at line 111 of file config_editor_plugin.cpp.
Referenced by ConfigTreeView::register_plugin().
|
protectedpure virtual |
In this function the (custom) dialog of the plugin needs to be initialized.
Implemented in NaoStiffnessConfigPlugin, and RetrieverConfigPlugin.
|
protectedpure virtual |
This method is called after the dialog is closed.
Here, the input the user has made needs to be handled.
response | the response obtained from the run() method of the dialog (Gtk::RESPONSE_OK or Gtk::RESPONSE_CANCEL) |
Implemented in NaoStiffnessConfigPlugin, and RetrieverConfigPlugin.
|
protectedpure virtual |
Config editor plugins need to implement this function.
It is called before the actual dialog is opened. Ususally, plugins want to parse the configuration, here, and initialize the GUI elements of the dialog.
Implemented in NaoStiffnessConfigPlugin, and RetrieverConfigPlugin.
void ConfigEditorPlugin::run | ( | ) |
Run the plugin.
Usually, this means opening a dialog where config values can be manipulated and on closing these are written to the config.
Definition at line 121 of file config_editor_plugin.cpp.
void ConfigEditorPlugin::set_config | ( | fawkes::Configuration * | config | ) |
Set the configuration for the plugin to work on.
config | the configuration |
Definition at line 102 of file config_editor_plugin.cpp.
|
protected |
Gtk Builder created from the UI file of the plugin.
Definition at line 54 of file config_editor_plugin.h.
Referenced by RetrieverConfigPlugin::load_dialog(), and NaoStiffnessConfigPlugin::load_dialog().
|
protected |
Definition at line 57 of file config_editor_plugin.h.
Referenced by RetrieverConfigPlugin::post_run(), RetrieverConfigPlugin::pre_run(), and NaoStiffnessConfigPlugin::~NaoStiffnessConfigPlugin().
|
protected |
The config prefix the plugin is attached to.
Definition at line 56 of file config_editor_plugin.h.
Referenced by RetrieverConfigPlugin::post_run(), and RetrieverConfigPlugin::pre_run().
|
protected |
The (main-) dialog of the plugin.
Definition at line 53 of file config_editor_plugin.h.
Referenced by RetrieverConfigPlugin::post_run(), RetrieverConfigPlugin::pre_run(), and NaoStiffnessConfigPlugin::~NaoStiffnessConfigPlugin().