240 : wxDialog(parent, wxID_ANY,
_(
L(
"Multiple resolved IP addresses")), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
241 ,
m_list(
new wxListView(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxSIMPLE_BORDER))
243{
244 const int em = GUI::wxGetApp().em_unit();
245 m_list->SetMinSize(wxSize(40 * em, 30 * em));
246
247 wxBoxSizer* vsizer = new wxBoxSizer(wxVERTICAL);
248
249 auto* label =
new wxStaticText(
this, wxID_ANY,
GUI::format_wxstr(
_L(
"There are several IP addresses resolving to hostname %1%.\nPlease select one that should be used."), hostname));
250 vsizer->Add(label, 0, wxEXPAND | wxTOP | wxLEFT | wxRIGHT, em);
251
252 m_list->SetSingleStyle(wxLC_SINGLE_SEL);
253 m_list->AppendColumn(
_(
L(
"Address")), wxLIST_FORMAT_LEFT, 40 * em);
254
255 for (size_t i = 0; i < ips.size(); i++)
257
259
260 vsizer->Add(
m_list, 1, wxEXPAND | wxALL, em);
261
262 wxBoxSizer* button_sizer = new wxBoxSizer(wxHORIZONTAL);
263 button_sizer->Add(new wxButton(this, wxID_OK, "OK"), 0, wxALL, em);
264 button_sizer->Add(new wxButton(this, wxID_CANCEL, "Cancel"), 0, wxALL, em);
265
266 vsizer->Add(button_sizer, 0, wxALIGN_CENTER);
267 SetSizerAndFit(vsizer);
268
269 GUI::wxGetApp().UpdateDlgDarkUI(this);
270}
wxListView * m_list
Definition BonjourDialog.hpp:65
size_t & m_selected_index
Definition BonjourDialog.hpp:66
#define _(msgid)
Definition getopt.c:87
wxString format_wxstr(const char *fmt, TArgs &&... args)
Definition format.hpp:42
wchar_t * widen(wchar_t *output, size_t output_size, char const *source)
Convert NULL terminated UTF source string to NULL terminated output string of size at most output_siz...
Definition convert.hpp:95
#define L(s)
Definition I18N.hpp:18
#define _L(s)
Definition I18N.hpp:3