Fawkes API
Fawkes Development Version
|
This widget consists of a Gtk::ComboBox and a Gtk::Button. More...
#include <gui_utils/service_selector_cbe.h>
Public Member Functions | |
ServiceSelectorCBE (Gtk::ComboBoxEntry *services, Gtk::Button *connect, Gtk::Window *parent, const char *service="_fawkes._tcp") | |
Construtor. More... | |
ServiceSelectorCBE (Gtk::ComboBoxEntry *services, Gtk::ToolButton *connect, Gtk::Window *parent, const char *service="_fawkes._tcp") | |
Construtor. More... | |
ServiceSelectorCBE (Glib::RefPtr< Gtk::Builder > builder, const char *cbe_name="cbeServices", const char *btn_name="btnConnect", const char *wnd_name="wndMain", const char *service="_fawkes._tcp") | |
Constructor. More... | |
virtual | ~ServiceSelectorCBE () |
Destructor. More... | |
FawkesNetworkClient * | get_network_client () |
Access the current network client. More... | |
Glib::ustring | get_hostname () |
Returns the currently selected hostname (after connect) More... | |
Glib::ustring | get_name () |
Returns the currently selected service name (after connect) More... | |
unsigned int | get_port () |
Returns the currently used port (after connect) More... | |
sigc::signal< void > | signal_connected () |
This signal is emitted whenever a network connection is established. More... | |
sigc::signal< void > | signal_disconnected () |
This signal is emitted whenever a network connection is terminated. More... | |
Protected Member Functions | |
void | initialize () |
Initializer method. More... | |
void | on_btn_connect_clicked () |
Signal handler that is called whenever the connect button is clicked or an entry in the combo box is selected. More... | |
void | on_service_selected () |
Signal handler that is called whenever an entry is selected from the combo box. More... | |
void | on_connected () |
Signal handler for the connection established signal. More... | |
void | on_disconnected () |
Signal handler for the connection terminated signal. More... | |
Protected Attributes | |
Gtk::ComboBoxEntry * | m_cbe_services |
A Gtk::ComboBox that lists all available services. More... | |
Gtk::Button * | m_btn_connect |
A Gtk::Button that triggers the connection. More... | |
Gtk::ToolButton * | m_tbtn_connect |
A Gtk::ToolButton that triggers the connection. More... | |
Gtk::Window * | m_parent |
The parent Gtk::Window. More... | |
ConnectionDispatcher * | m_dispatcher |
A ConnectionDispatcher which dispatches connection signals. More... | |
ServiceModel * | m_service_model |
A liststore which contains information about detected services. More... | |
This widget consists of a Gtk::ComboBox and a Gtk::Button.
The combo box contains all detected services of a given type; upon click the button opens a network connection to the selected service.
Definition at line 44 of file service_selector_cbe.h.
ServiceSelectorCBE::ServiceSelectorCBE | ( | Gtk::ComboBoxEntry * | services, |
Gtk::Button * | connect, | ||
Gtk::Window * | parent, | ||
const char * | service = "_fawkes._tcp" |
||
) |
Construtor.
services | the combo box to hold the list of services |
connect | the button to trigger the network connection |
parent | the parent window. Used for error dialogs. |
service | a service identifier |
Definition at line 76 of file service_selector_cbe.cpp.
ServiceSelectorCBE::ServiceSelectorCBE | ( | Gtk::ComboBoxEntry * | services, |
Gtk::ToolButton * | connect, | ||
Gtk::Window * | parent, | ||
const char * | service = "_fawkes._tcp" |
||
) |
Construtor.
services | the combo box to hold the list of services |
connect | the button to trigger the network connection |
parent | the parent window. Used for error dialogs. |
service | a service identifier |
Definition at line 101 of file service_selector_cbe.cpp.
ServiceSelectorCBE::ServiceSelectorCBE | ( | Glib::RefPtr< Gtk::Builder > | builder, |
const char * | cbe_name = "cbeServices" , |
||
const char * | btn_name = "btnConnect" , |
||
const char * | wnd_name = "wndMain" , |
||
const char * | service = "_fawkes._tcp" |
||
) |
Constructor.
builder | Gtk builder |
cbe_name | name of the combo box |
btn_name | name of the button |
wnd_name | name of the parent window |
service | service identifier |
Definition at line 124 of file service_selector_cbe.cpp.
References initialize(), m_btn_connect, m_cbe_services, m_parent, and m_service_model.
|
virtual |
Destructor.
Definition at line 188 of file service_selector_cbe.cpp.
References m_dispatcher, and m_service_model.
Glib::ustring ServiceSelectorCBE::get_hostname | ( | ) |
Returns the currently selected hostname (after connect)
Definition at line 208 of file service_selector_cbe.cpp.
Glib::ustring ServiceSelectorCBE::get_name | ( | void | ) |
Returns the currently selected service name (after connect)
Definition at line 218 of file service_selector_cbe.cpp.
Referenced by PluginGuiGtkWindow::~PluginGuiGtkWindow().
FawkesNetworkClient * ServiceSelectorCBE::get_network_client | ( | ) |
Access the current network client.
Definition at line 198 of file service_selector_cbe.cpp.
References fawkes::ConnectionDispatcher::get_client(), and m_dispatcher.
Referenced by PluginGuiGtkWindow::PluginGuiGtkWindow().
unsigned int ServiceSelectorCBE::get_port | ( | ) |
Returns the currently used port (after connect)
Definition at line 228 of file service_selector_cbe.cpp.
|
protected |
Initializer method.
Definition at line 141 of file service_selector_cbe.cpp.
References fawkes::ServiceModel::get_column_record(), fawkes::ServiceModel::get_list_store(), m_btn_connect, m_cbe_services, m_dispatcher, m_service_model, m_tbtn_connect, fawkes::ServiceModel::ServiceRecord::name, on_btn_connect_clicked(), on_connected(), on_disconnected(), on_service_selected(), fawkes::ConnectionDispatcher::signal_connected(), and fawkes::ConnectionDispatcher::signal_disconnected().
Referenced by ServiceSelectorCBE().
|
protected |
Signal handler that is called whenever the connect button is clicked or an entry in the combo box is selected.
Definition at line 255 of file service_selector_cbe.cpp.
References fawkes::Exception::begin(), fawkes::FawkesNetworkClient::connect(), fawkes::FawkesNetworkClient::connected(), fawkes::FawkesNetworkClient::disconnect(), fawkes::ConnectionDispatcher::get_client(), fawkes::ServiceModel::get_column_record(), fawkes::ServiceModel::ServiceRecord::hostname, m_btn_connect, m_cbe_services, m_dispatcher, m_parent, m_service_model, m_tbtn_connect, fawkes::ServiceModel::ServiceRecord::name, and fawkes::ServiceModel::ServiceRecord::port.
Referenced by initialize().
|
protected |
Signal handler for the connection established signal.
Definition at line 354 of file service_selector_cbe.cpp.
References m_btn_connect, and m_tbtn_connect.
Referenced by initialize().
|
protected |
Signal handler for the connection terminated signal.
Definition at line 364 of file service_selector_cbe.cpp.
References m_btn_connect, and m_tbtn_connect.
Referenced by initialize().
|
protected |
Signal handler that is called whenever an entry is selected from the combo box.
Definition at line 320 of file service_selector_cbe.cpp.
References fawkes::Exception::begin(), fawkes::FawkesNetworkClient::connect(), fawkes::FawkesNetworkClient::connected(), fawkes::FawkesNetworkClient::disconnect(), fawkes::ConnectionDispatcher::get_client(), fawkes::ServiceModel::get_column_record(), fawkes::ServiceModel::ServiceRecord::hostname, m_cbe_services, m_dispatcher, m_parent, m_service_model, fawkes::ServiceModel::ServiceRecord::name, and fawkes::ServiceModel::ServiceRecord::port.
Referenced by initialize().
sigc::signal< void > ServiceSelectorCBE::signal_connected | ( | ) |
This signal is emitted whenever a network connection is established.
Definition at line 237 of file service_selector_cbe.cpp.
References m_dispatcher, and fawkes::ConnectionDispatcher::signal_connected().
Referenced by PluginGuiGtkWindow::PluginGuiGtkWindow().
sigc::signal< void > ServiceSelectorCBE::signal_disconnected | ( | ) |
This signal is emitted whenever a network connection is terminated.
Definition at line 246 of file service_selector_cbe.cpp.
References m_dispatcher, and fawkes::ConnectionDispatcher::signal_disconnected().
Referenced by PluginGuiGtkWindow::PluginGuiGtkWindow().
|
protected |
A Gtk::Button that triggers the connection.
Definition at line 94 of file service_selector_cbe.h.
Referenced by initialize(), on_btn_connect_clicked(), on_connected(), on_disconnected(), and ServiceSelectorCBE().
|
protected |
A Gtk::ComboBox that lists all available services.
Definition at line 92 of file service_selector_cbe.h.
Referenced by initialize(), on_btn_connect_clicked(), on_service_selected(), and ServiceSelectorCBE().
|
protected |
A ConnectionDispatcher which dispatches connection signals.
Definition at line 98 of file service_selector_cbe.h.
Referenced by get_network_client(), initialize(), on_btn_connect_clicked(), on_service_selected(), signal_connected(), signal_disconnected(), and ~ServiceSelectorCBE().
|
protected |
The parent Gtk::Window.
Definition at line 96 of file service_selector_cbe.h.
Referenced by on_btn_connect_clicked(), on_service_selected(), and ServiceSelectorCBE().
|
protected |
A liststore which contains information about detected services.
Definition at line 99 of file service_selector_cbe.h.
Referenced by initialize(), on_btn_connect_clicked(), on_service_selected(), ServiceSelectorCBE(), and ~ServiceSelectorCBE().
|
protected |
A Gtk::ToolButton that triggers the connection.
Definition at line 95 of file service_selector_cbe.h.
Referenced by initialize(), on_btn_connect_clicked(), on_connected(), and on_disconnected().