OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::IPListDialog Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/BonjourDialog.hpp>

Inheritance diagram for Slic3r::IPListDialog:
Collaboration diagram for Slic3r::IPListDialog:

Public Member Functions

 IPListDialog (wxWindow *parent, const wxString &hostname, const std::vector< boost::asio::ip::address > &ips, size_t &selected_index)
 IPListDialog (IPListDialog &&)=delete
 IPListDialog (const IPListDialog &)=delete
IPListDialog & operator= (IPListDialog &&)=delete
IPListDialog & operator= (const IPListDialog &)=delete
 ~IPListDialog ()
virtual void EndModal (int retCode) wxOVERRIDE

Private Attributes

wxListView * m_list
size_t & m_selected_index

Detailed Description

Constructor & Destructor Documentation

◆ IPListDialog() [1/3]

Slic3r::IPListDialog::IPListDialog ( wxWindow * parent,
const wxString & hostname,
const std::vector< boost::asio::ip::address > & ips,
size_t & selected_index )
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))
254 , m_selected_index (selected_index)
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));
264 label->SetFont(Label::Body_14);
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
273 m_list->Select(0);
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

References _, _L, Label::Body_14, Slic3r::GUI::format_wxstr(), L, m_list, m_selected_index, and wxStaticText.

Referenced by IPListDialog(), IPListDialog(), operator=(), and operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IPListDialog() [2/3]

Slic3r::IPListDialog::IPListDialog ( IPListDialog && )
delete

References IPListDialog().

Here is the call graph for this function:

◆ IPListDialog() [3/3]

Slic3r::IPListDialog::IPListDialog ( const IPListDialog & )
delete

References IPListDialog().

Here is the call graph for this function:

◆ ~IPListDialog()

Slic3r::IPListDialog::~IPListDialog ( )
286{
287}

Member Function Documentation

◆ EndModal()

void Slic3r::IPListDialog::EndModal ( int retCode)
virtual
290{
291 if (retCode == wxID_OK) {
292 m_selected_index = (size_t)m_list->GetFirstSelected();
293 }
294 wxDialog::EndModal(retCode);
295}

References m_list, and m_selected_index.

◆ operator=() [1/2]

IPListDialog & Slic3r::IPListDialog::operator= ( const IPListDialog & )
delete

References IPListDialog().

Here is the call graph for this function:

◆ operator=() [2/2]

IPListDialog & Slic3r::IPListDialog::operator= ( IPListDialog && )
delete

References IPListDialog().

Here is the call graph for this function:

Member Data Documentation

◆ m_list

wxListView* Slic3r::IPListDialog::m_list
private

Referenced by IPListDialog(), and EndModal().

◆ m_selected_index

size_t& Slic3r::IPListDialog::m_selected_index
private

Referenced by IPListDialog(), and EndModal().


The documentation for this class was generated from the following files: