Bakery::Conf::Client
sigc::trackable
Client.h
Bakery::Conf::AssociationBase::AssociationPtr typedef Bakery::Conf::AssociationBase::AssociationPtr Bakery::Conf::Client::AssociationPtr AssociationPtr
Glib::RefPtr< Gnome::Conf::Client > Glib::RefPtr<Gnome::Conf::Client> Bakery::Conf::Client::m_refClient m_refClient
Glib::ustring Glib::ustring Bakery::Conf::Client::m_directory m_directory
type_vecWidgets type_vecWidgets Bakery::Conf::Client::m_vecWidgets m_vecWidgets
std::vector< AssociationPtr > typedef std::vector<AssociationPtr> Bakery::Conf::Client::type_vecWidgets type_vecWidgets
Bakery::Conf::Client::Client
(const Glib::ustring &configuration_directory)
Client
const Glib::ustring & configuration_directory
virtual Bakery::Conf::Client::~Client
()
~Client
void virtual void Bakery::Conf::Client::load (std::auto_ptr< Glib::Error > &error) load std::auto_ptr< Glib::Error > & error
void virtual void Bakery::Conf::Client::save (std::auto_ptr< Glib::Error > &error) save std::auto_ptr< Glib::Error > & error
void virtual void Bakery::Conf::Client::add (const Glib::ustring &key, Gtk::Widget &widget) add const Glib::ustring & key Gtk::Widget & widget

e.g. conf_client.add("user_name", m_EntryUserName);

void virtual void Bakery::Conf::Client::add_instant (const Glib::ustring &key, Gtk::Widget &widget) add_instant const Glib::ustring & key Gtk::Widget & widget
void virtual void Bakery::Conf::Client::add_implementation (const Glib::ustring &key, Gtk::Widget &widget, bool instant) add_implementation const Glib::ustring & key Gtk::Widget & widget bool instant

Override this method to add recognition of additional widget types to a derived class of Client.

You must also provide an implementation for the specialization of Association<T> for the widget type(s) you are adding support for.

class T_Widget T_Widget
void void Bakery::Conf::Client::add_association (const Glib::ustring &key, T_Widget &widget, bool instant) add_association const Glib::ustring & key T_Widget & widget bool instant

Configuration Client Allows you to associate widget "values" with configuration keys, and then load() and save() them all at once.

The "value" depends on the widget: Gtk::Entry - text (gconf string). Gtk::CheckButton, Gtk::RadioButton - active (gconf bool). Gtk::Range (e.g. scales and scrollbars) - position (gconf float). Gtk::SpinButton - value (gconf float). Gtk::Combo - text (gconf string). Gtk::OptionMenu - item number (gconf int); ideally we would prefer to use a string representation, but that's not realistic.

Advantages compared to Gnome::Conf::Client:

- Avoids repetition of key names.

- Avoids repetition of the directory name.

- Avoids manual code to get and set widget values.

- Avoids 2 sets of very similar code, for load and save.

- No need for Glib::RefPtr<>

- Can do instant apply and instant update with add_instant()..

sigc::trackable
Bakery::Conf::Client
Glib::ustring
sigc::trackable
Bakery::Conf::Client
m_refClient
m_directory
Glib::RefPtr< Gnome::Conf::Client >
- Bakery::Conf::Client
  add
- Bakery::Conf::Client
  add_association
- Bakery::Conf::Client
  add_implementation
- Bakery::Conf::Client
  add_instant
- Bakery::Conf::Client
  AssociationPtr
- Bakery::Conf::Client
  Client
- Bakery::Conf::Client
  load
- Bakery::Conf::Client
  m_directory
- Bakery::Conf::Client
  m_refClient
- Bakery::Conf::Client
  m_vecWidgets
- Bakery::Conf::Client
  save
- Bakery::Conf::Client
  type_vecWidgets
- Bakery::Conf::Client
  ~Client