25 #include <gui_utils/connection_dispatcher.h>
26 #include <gui_utils/service_model.h>
27 #include <gui_utils/service_selector_cbe.h>
28 #include <netcomm/fawkes/client.h>
73 #if GTK_VERSION_GE(3, 0)
84 m_cbe_services = services;
85 m_btn_connect = connect;
86 m_tbtn_connect = NULL;
98 #if GTK_VERSION_GE(3, 0)
103 Gtk::ToolButton *connect,
104 Gtk::Window * parent,
105 const char * service)
109 m_cbe_services = services;
110 m_btn_connect = NULL;
111 m_tbtn_connect = connect;
125 const char * cbe_name,
126 const char * btn_name,
127 const char * wnd_name,
128 const char * service)
132 builder->get_widget(wnd_name,
m_parent);
143 #if GTK_VERSION_GE(3, 0)
145 throw Exception(
"Service combo box does not have an entry, fix UI file?");
149 #if GTK_VERSION_GE(3, 0)
158 Gtk::Entry *ent =
static_cast<Gtk::Entry *
>(
m_cbe_services->get_child());
160 char *fawkes_ip = getenv(
"FAWKES_IP");
162 ent->set_text(fawkes_ip);
164 ent->set_text(
"localhost");
271 hostname_ = entry->get_text();
273 Glib::ustring::size_type pos;
274 if ((pos = hostname_.find(
':')) != Glib::ustring::npos) {
275 Glib::ustring host =
"";
276 unsigned int port = 1234567;
277 std::istringstream is(hostname_.replace(pos, 1,
" "));
281 if (port != 1234567 && host.size()) {
287 servicename_ = hostname_;
296 client->
connect(hostname_.c_str(), port_);
298 Glib::ustring message = *(e.
begin());
305 md.set_title(
"Connection failed");
333 client->
connect(hostname_.c_str(), port_);
335 Glib::ustring message = *(e.
begin());
342 md.set_title(
"Connection failed");