252 : wxDialog(parent, wxID_ANY,
_(
L(
"Multiple resolved IP addresses")), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
253 ,
m_list(
new wxListView(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxSIMPLE_BORDER))
255{
256 SetBackgroundColour(*wxWHITE);
257
258 const int em = GUI::wxGetApp().em_unit();
259 m_list->SetMinSize(wxSize(40 * em, 30 * em));
260
261 wxBoxSizer* vsizer = new wxBoxSizer(wxVERTICAL);
262
263 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));
265 vsizer->Add(label, 0, wxEXPAND | wxTOP | wxLEFT | wxRIGHT, em);
266
267 m_list->SetSingleStyle(wxLC_SINGLE_SEL);
268 m_list->AppendColumn(
_(
L(
"Address")), wxLIST_FORMAT_LEFT, 40 * em);
269
270 for (size_t i = 0; i < ips.size(); i++)
271 m_list->InsertItem(i, boost::nowide::widen(ips[i].to_string()));
272
274
275 vsizer->Add(
m_list, 1, wxEXPAND | wxALL, em);
276
277 auto dlg_btns = new GUI::DialogButtons(this, {"OK", "Cancel"});
278
279 vsizer->Add(dlg_btns, 0, wxEXPAND);
280 SetSizerAndFit(vsizer);
281
282 GUI::wxGetApp().UpdateDlgDarkUI(this);
283}
#define _(s)
Definition 3mf.cpp:306
#define L(s)
Definition ExtrusionEntity.cpp:25
#define _L(s)
Definition OBJ.cpp:34
class WXDLLIMPEXP_FWD_CORE wxStaticText
Definition ProgressDialog.hpp:30
static wxFont Body_14
Definition Label.hpp:53
wxListView * m_list
Definition BonjourDialog.hpp:69
size_t & m_selected_index
Definition BonjourDialog.hpp:70
wxString format_wxstr(const char *fmt, TArgs &&... args)
Definition format.hpp:22