15 #define GETTEXT_DOMAIN "wesnoth-lib"
23 #ifdef GUI2_EXPERIMENTAL_LISTBOX
61 class tmp_server_list :
public tdialog
80 void pre_show(twindow& window);
83 void post_show(twindow& window);
88 void tmp_server_list::pre_show(twindow& window)
92 tlistbox& list = find_widget<tlistbox>(&window,
"server_list",
false);
94 window.keyboard_capture(&list);
96 const std::vector<game_config::server_info>& pref_servers
99 for(
const auto & server : pref_servers)
102 std::map<std::string, string_map>
data;
105 item[
"label"] = server.name;
106 data.insert(std::make_pair(
"name", item));
108 item[
"label"] = server.address;
109 data.insert(std::make_pair(
"address", item));
115 void tmp_server_list::post_show(twindow& window)
120 = find_widget<const tlistbox>(&window,
"server_list",
false);
122 const tgrid*
row = list.get_row_grid(list.get_selected_row());
125 host_name_ = find_widget<const tcontrol>(
row,
"address",
false).label();
161 host_name->set_widget_value(window, dlg.host_name());
180 if(
tbutton* button = find_widget<tbutton>(&window,
"list",
false,
false)) {
192 return new tmp_server_list();
void pre_show(twindow &window)
Inherited from tdialog.
GLvoid **typedef void(GLAPIENTRY *PFNGLGETVERTEXATTRIBDVPROC)(GLuint
tfield_text * host_name_
The host name of the selected servef.
std::string network_host()
REGISTER_DIALOG(label_settings)
int get_retval(const std::string &retval_id, const int retval, const std::string &id)
Returns the return value for a widget.
void connect_signal_mouse_left_click(tdispatcher &dispatcher, const tsignal_function &signal)
Connects a signal handler for a left mouse button click.
void set_network_host(const std::string &host)
Implements some helper classes to ease adding fields to a dialog and hide the synchronization needed...
GLint GLenum GLsizei GLint GLsizei const GLvoid * data
base class of top level items, the only item which needs to store the final canvases to draw on ...
A class inherited from ttext_box that displays its input as stars.
Dialog is closed with ok button.
Abstract base class for all dialogs.
void set_restore(const bool restore)
const std::vector< game_config::server_info > & server_list()
Modify, read and display user preferences.
std::map< std::string, t_string > string_map
static tdialog * mp_server_list_for_unit_test()
The unit test needs to be able to test the tmp_connect dialog.
GLenum GLenum GLvoid * row
GLsizei const GLcharARB ** string
Specialized field class for text.
static void show_server_list(CVideo &video, twindow &window, tfield_text *host_name)