Fawkes API
Fawkes Development Version
|
#include <>>
Classes | |
class | Record |
Public Member Functions | |
virtual | ~InterfaceChooserDialog () |
Destructor. More... | |
void | get_selected_interface (Glib::ustring &type, Glib::ustring &id) |
Get selected interface type and ID. More... | |
fawkes::Interface * | run_and_open_for_reading () |
Run dialog and try to connect. More... | |
Static Public Member Functions | |
static InterfaceChooserDialog * | create (Gtk::Window &parent, BlackBoard *blackboard, const char *type_pattern, const char *id_pattern, const Glib::ustring &title=DEFAULT_TITLE) |
Factory method. More... | |
Static Public Attributes | |
static const char *const | DEFAULT_TITLE = "Select Interfaces" |
Default title of interface chooser dialogs. More... | |
Protected Member Functions | |
InterfaceChooserDialog (Gtk::Window &parent, const Glib::ustring &title) | |
Constructor for subclasses. More... | |
void | init (BlackBoard *blackboard, const char *type_pattern, const char *id_pattern) |
Initialization method. More... | |
virtual const Record & | record () const |
Returns the Record of this chooser dialog. More... | |
virtual int | init_columns () |
Initializes the columns GUI-wise. More... | |
virtual void | init_row (Gtk::TreeModel::Row &row, const InterfaceInfo &ii) |
Initializes a row with the given interface. More... | |
Protected Attributes | |
Gtk::TreeView | treeview_ |
Tree widget for interfaces. More... | |
Glib::RefPtr< Gtk::ListStore > | model_ |
Data model of the tree. More... | |
Blackboard interface chooser dialog. Allows to choose a blackboard interface from a list of interfaces matching given type and ID patterns.
Definition at line 47 of file interface_chooser_dialog.h.
|
virtual |
Destructor.
Definition at line 161 of file interface_chooser_dialog.cpp.
|
protected |
Constructor for subclasses.
After calling this constructor, the init() method needs to be called.
parent | parent window |
title | title of the dialog |
Definition at line 104 of file interface_chooser_dialog.cpp.
References model_, and record().
Referenced by fawkes::InterfaceChooserDialog::Record::Record().
|
static |
Factory method.
Why a factory method instead of a ctor? The factory method calls init(), and init() calls other virtual methods. If this was a ctor, this ctor would not be allowed to be called by subclasses, because then the virtual methods in init() don't dispatch the right way during construction (see Effective C++ #9).
parent | parent window |
blackboard | blackboard instance to query interfaces from |
type_pattern | pattern with shell like globs (* for any number of characters, ? for exactly one character) to match the interface type. |
id_pattern | pattern with shell like globs (* for any number of characters, ? for exactly one character) to match the interface ID. |
title | title of the dialog |
Definition at line 86 of file interface_chooser_dialog.cpp.
void fawkes::InterfaceChooserDialog::get_selected_interface | ( | Glib::ustring & | type, |
Glib::ustring & | id | ||
) |
Get selected interface type and ID.
If an interface has been selected use this method to get the type and ID. Only applicable if get_multi() == false.
type | upon return contains the type of the interface |
id | upon return contains the ID of the interface |
Exception | thrown if no interface has been selected |
Definition at line 225 of file interface_chooser_dialog.cpp.
|
protected |
Initialization method.
Subclasses should use the protected constructor and should then call the init() method. This ensures that init()'s calls to virtual methods dispatch to the right ones.
blackboard | blackboard instance to query interfaces from |
type_pattern | pattern with shell like globs (* for any number of characters, ? for exactly one character) to match the interface type. |
id_pattern | pattern with shell like globs (* for any number of characters, ? for exactly one character) to match the interface ID. |
Definition at line 124 of file interface_chooser_dialog.cpp.
Referenced by fawkes::MultiInterfaceChooserDialog::create().
|
protectedvirtual |
Initializes the columns GUI-wise.
Called in the ctor. Subclasses of InterfaceChooserDialog might want to override this method, but should probably still call their super-class's implementation (i.e., this one).
Reimplemented in fawkes::MultiInterfaceChooserDialog.
Definition at line 190 of file interface_chooser_dialog.cpp.
|
protectedvirtual |
Initializes a row with the given interface.
Called in the ctor. Subclasses of InterfaceChooserDialog might want to override this method, but should probably still call their super-class's implementation (i.e., this one).
row | The row whose content is to be set. |
ii | The interface info that should populate the row. |
Reimplemented in fawkes::MultiInterfaceChooserDialog.
Definition at line 208 of file interface_chooser_dialog.cpp.
References record(), treeview_, and fawkes::InterfaceChooserDialog::Record::type.
|
protectedvirtual |
Returns the Record of this chooser dialog.
Subclasses of InterfaceChooserDialog might want to override this method.
Reimplemented in fawkes::MultiInterfaceChooserDialog.
Definition at line 173 of file interface_chooser_dialog.cpp.
Referenced by init_row(), and InterfaceChooserDialog().
fawkes::Interface * fawkes::InterfaceChooserDialog::run_and_open_for_reading | ( | ) |
Run dialog and try to connect.
This runs the service chooser dialog and connects to the given service with the attached FawkesNetworkClient. If the connection couldn't be established an error dialog is shown. You should not rely on the connection to be active after calling this method, rather you should use a ConnectionDispatcher to get the "connected" signal.
Definition at line 249 of file interface_chooser_dialog.cpp.
|
static |
Default title of interface chooser dialogs.
Definition at line 50 of file interface_chooser_dialog.h.
|
protected |
Data model of the tree.
Definition at line 85 of file interface_chooser_dialog.h.
Referenced by fawkes::MultiInterfaceChooserDialog::init_row(), InterfaceChooserDialog(), and fawkes::MultiInterfaceChooserDialog::~MultiInterfaceChooserDialog().
|
protected |
Tree widget for interfaces.
Definition at line 84 of file interface_chooser_dialog.h.
Referenced by init_row().