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 45 of file interface_chooser_dialog.h.
|
virtual |
Destructor.
Definition at line 159 of file interface_chooser_dialog.cpp.
|
protected |
|
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 84 of file interface_chooser_dialog.cpp.
References init(), and InterfaceChooserDialog().
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 223 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 122 of file interface_chooser_dialog.cpp.
Referenced by create(), and 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 188 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 206 of file interface_chooser_dialog.cpp.
|
protectedvirtual |
Returns the Record of this chooser dialog.
Subclasses of InterfaceChooserDialog might want to override this method.
Reimplemented in fawkes::MultiInterfaceChooserDialog.
Definition at line 171 of file interface_chooser_dialog.cpp.
Referenced by 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 247 of file interface_chooser_dialog.cpp.
References fawkes::Exception::begin(), and fawkes::BlackBoard::open_for_reading().
|
static |
Default title of interface chooser dialogs.
Definition at line 48 of file interface_chooser_dialog.h.
|
protected |
Data model of the tree.
Definition at line 83 of file interface_chooser_dialog.h.
Referenced by InterfaceChooserDialog().
|
protected |
Tree widget for interfaces.
Definition at line 82 of file interface_chooser_dialog.h.
Referenced by fawkes::MultiInterfaceChooserDialog::MultiInterfaceChooserDialog().