OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::PrintErrorDialog Class Reference

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

Inheritance diagram for Slic3r::GUI::PrintErrorDialog:
Collaboration diagram for Slic3r::GUI::PrintErrorDialog:

Public Types

enum  PrintErrorButton : int {
  RESUME_PRINTING = 2 , RESUME_PRINTING_DEFECTS = 3 , RESUME_PRINTING_PROBELM_SOLVED = 4 , STOP_PRINTING = 5 ,
  CHECK_ASSISTANT = 6 , FILAMENT_EXTRUDED = 7 , RETRY_FILAMENT_EXTRUDED = 8 , CONTINUE = 9 ,
  LOAD_VIRTUAL_TRAY = 10 , OK_BUTTON = 11 , FILAMENT_LOAD_RESUME = 12 , JUMP_TO_LIVEVIEW ,
  NO_REMINDER_NEXT_TIME = 23 , IGNORE_NO_REMINDER_NEXT_TIME = 25 , IGNORE_RESUME = 27 , PROBLEM_SOLVED_RESUME = 28 ,
  TURN_OFF_FIRE_ALARM = 29 , RETRY_PROBLEM_SOLVED = 34 , STOP_DRYING = 35 , REMOVE_CLOSE_BTN = 39 ,
  ERROR_BUTTON_COUNT
}

Public Member Functions

 PrintErrorDialog (wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=wxEmptyString, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxCLOSE_BOX|wxCAPTION)
void update_text_image (const wxString &text, const wxString &error_code, const wxString &image_url)
void on_show ()
void on_hide ()
void update_title_style (wxString title, std::vector< int > style, wxWindow *parent=nullptr)
void post_event (wxCommandEvent &event)
void post_event (wxCommandEvent &&event)
void rescale ()
 ~PrintErrorDialog ()
void on_dpi_changed (const wxRect &suggested_rect)
void msw_rescale ()
void init_button (PrintErrorButton style, wxString buton_text)
void init_button_list ()
void on_webrequest_state (wxWebRequestEvent &evt)
float scale_factor () const
float prev_scale_factor () const
void set_scale_factor (float v)
void set_prev_scale_factor (float v)
void set_em_unit (int v)
bool force_rescale () const
int em_unit () const
const wxFont & normal_font () const
void enable_force_rescale ()
int ShowModal ()

Public Attributes

wxWebRequest web_request
wxStaticBitmap * m_error_prompt_pic_static
Label * m_staticText_release_note { nullptr }
Label * m_staticText_error_code { nullptr }
wxBoxSizer * m_sizer_main
wxBoxSizer * m_sizer_button
wxScrolledWindow * m_vebview_release_note { nullptr }
std::map< int, Button * > m_button_list
std::vector< int > m_used_button

Protected Member Functions

virtual void on_sys_color_changed ()

Private Member Functions

void update_em_unit ()
bool is_new_scale_factor () const

Private Attributes

wxWindow * event_parent { nullptr }
float m_scale_factor
int m_em_unit
wxFont m_normal_font
float m_prev_scale_factor
bool m_can_rescale
bool m_force_rescale
int m_new_font_point_size

Detailed Description

Member Enumeration Documentation

◆ PrintErrorButton

Enumerator
RESUME_PRINTING 
RESUME_PRINTING_DEFECTS 
RESUME_PRINTING_PROBELM_SOLVED 
STOP_PRINTING 
CHECK_ASSISTANT 
FILAMENT_EXTRUDED 
RETRY_FILAMENT_EXTRUDED 
CONTINUE 
LOAD_VIRTUAL_TRAY 
OK_BUTTON 
FILAMENT_LOAD_RESUME 
JUMP_TO_LIVEVIEW 
NO_REMINDER_NEXT_TIME 
IGNORE_NO_REMINDER_NEXT_TIME 
IGNORE_RESUME 
PROBLEM_SOLVED_RESUME 
TURN_OFF_FIRE_ALARM 
RETRY_PROBLEM_SOLVED 
STOP_DRYING 
REMOVE_CLOSE_BTN 
ERROR_BUTTON_COUNT 
180 : int {
181 RESUME_PRINTING = 2,
184 STOP_PRINTING = 5,
185 CHECK_ASSISTANT = 6,
188 CONTINUE = 9,
190 OK_BUTTON = 11,
193
196 //LOAD_FILAMENT = 26*/
197 IGNORE_RESUME = 27,
200
202 STOP_DRYING = 35,
203 REMOVE_CLOSE_BTN = 39, // special case, do not show close button
204
206 };
@ IGNORE_RESUME
Definition ReleaseNote.hpp:197
@ PROBLEM_SOLVED_RESUME
Definition ReleaseNote.hpp:198
@ FILAMENT_EXTRUDED
Definition ReleaseNote.hpp:186
@ REMOVE_CLOSE_BTN
Definition ReleaseNote.hpp:203
@ RESUME_PRINTING
Definition ReleaseNote.hpp:181
@ RESUME_PRINTING_PROBELM_SOLVED
Definition ReleaseNote.hpp:183
@ CHECK_ASSISTANT
Definition ReleaseNote.hpp:185
@ ERROR_BUTTON_COUNT
Definition ReleaseNote.hpp:205
@ RETRY_PROBLEM_SOLVED
Definition ReleaseNote.hpp:201
@ CONTINUE
Definition ReleaseNote.hpp:188
@ JUMP_TO_LIVEVIEW
Definition ReleaseNote.hpp:192
@ STOP_PRINTING
Definition ReleaseNote.hpp:184
@ TURN_OFF_FIRE_ALARM
Definition ReleaseNote.hpp:199
@ FILAMENT_LOAD_RESUME
Definition ReleaseNote.hpp:191
@ LOAD_VIRTUAL_TRAY
Definition ReleaseNote.hpp:189
@ RETRY_FILAMENT_EXTRUDED
Definition ReleaseNote.hpp:187
@ IGNORE_NO_REMINDER_NEXT_TIME
Definition ReleaseNote.hpp:195
@ RESUME_PRINTING_DEFECTS
Definition ReleaseNote.hpp:182
@ OK_BUTTON
Definition ReleaseNote.hpp:190
@ STOP_DRYING
Definition ReleaseNote.hpp:202
@ NO_REMINDER_NEXT_TIME
Definition ReleaseNote.hpp:194

Constructor & Destructor Documentation

◆ PrintErrorDialog()

Slic3r::GUI::PrintErrorDialog::PrintErrorDialog ( wxWindow * parent,
wxWindowID id = wxID_ANY,
const wxString & title = wxEmptyString,
const wxPoint & pos = wxDefaultPosition,
const wxSize & size = wxDefaultSize,
long style = wxCLOSE_BOX | wxCAPTION )
860 :DPIFrame(parent, id, title, pos, size, style)
861{
862 SetBackgroundColour(*wxWHITE);
863
864 m_sizer_main = new wxBoxSizer(wxVERTICAL);
865 auto m_line_top = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(FromDIP(350), 1));
866 m_line_top->SetBackgroundColour(wxColour(166, 169, 170));
867 m_sizer_main->Add(m_line_top, 0, wxEXPAND, 0);
868 m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(5));
869
870 wxBoxSizer* m_sizer_right = new wxBoxSizer(wxVERTICAL);
871
872 m_sizer_right->Add(0, 0, 1, wxTOP, FromDIP(5));
873
874 m_vebview_release_note = new wxScrolledWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL);
875 m_vebview_release_note->SetScrollRate(0, FromDIP(20));
876 m_vebview_release_note->SetBackgroundColour(*wxWHITE);
877 m_vebview_release_note->SetMinSize(wxSize(FromDIP(320), FromDIP(250)));
878 m_sizer_right->Add(m_vebview_release_note, 0, wxEXPAND | wxRIGHT | wxLEFT, FromDIP(15));
879
880 m_error_prompt_pic_static = new wxStaticBitmap(m_vebview_release_note, wxID_ANY, wxBitmap(), wxDefaultPosition, wxSize(FromDIP(300), FromDIP(180)));
881
882 auto bottom_sizer = new wxBoxSizer(wxVERTICAL);
883 m_sizer_button = new wxBoxSizer(wxVERTICAL);
884
885 bottom_sizer->Add(m_sizer_button, 0, wxEXPAND | wxRIGHT | wxLEFT, 0);
886
887 m_sizer_right->Add(bottom_sizer, 0, wxEXPAND | wxRIGHT | wxLEFT, FromDIP(20));
888 m_sizer_right->Add(0, 0, 0, wxTOP, FromDIP(10));
889
890 m_sizer_main->Add(m_sizer_right, 0, wxBOTTOM | wxEXPAND, FromDIP(5));
891
892 Bind(wxEVT_CLOSE_WINDOW, [this](auto& e) {this->on_hide(); });
893 // Fix for #9874: Remove RequestUserAttention on deactivation to prevent focus stealing
894 // This was causing random window activation when multiple instances were running
895 // Bind(wxEVT_ACTIVATE, [this](auto& e) { if (!e.GetActive()) this->RequestUserAttention(wxUSER_ATTENTION_ERROR); });
896 Bind(wxEVT_WEBREQUEST_STATE, &PrintErrorDialog::on_webrequest_state, this);
897
898
899 SetSizer(m_sizer_main);
900 Layout();
901 m_sizer_main->Fit(this);
902
904
905 CenterOnParent();
906 wxGetApp().UpdateFrameDarkUI(this);
907}
#define style
Definition WipeTowerDialog.cpp:101
wxBoxSizer * m_sizer_main
Definition ReleaseNote.hpp:233
wxStaticBitmap * m_error_prompt_pic_static
Definition ReleaseNote.hpp:230
wxBoxSizer * m_sizer_button
Definition ReleaseNote.hpp:234
void on_hide()
Definition ReleaseNote.cpp:1040
wxScrolledWindow * m_vebview_release_note
Definition ReleaseNote.hpp:235
void on_webrequest_state(wxWebRequestEvent &evt)
Definition ReleaseNote.cpp:929
void init_button_list()
Definition ReleaseNote.cpp:1112
DPIAware< wxFrame > DPIFrame
Definition GUI_Utils.hpp:298

References init_button_list(), m_error_prompt_pic_static, m_sizer_button, m_sizer_main, m_vebview_release_note, on_hide(), on_webrequest_state(), and style.

Here is the call graph for this function:

◆ ~PrintErrorDialog()

Slic3r::GUI::PrintErrorDialog::~PrintErrorDialog ( )
1136{
1137
1138}

Member Function Documentation

◆ em_unit()

int Slic3r::GUI::DPIAware< wxFrame >::em_unit ( ) const
inlineinherited
203{ return m_em_unit; }
Definition GUI_Utils.hpp:107

References m_em_unit.

Referenced by Slic3r::GUI::MainFrame::create_side_tools(), and Slic3r::GUI::MainFrame::update_side_button_style().

Here is the caller graph for this function:

◆ enable_force_rescale()

void Slic3r::GUI::DPIAware< wxFrame >::enable_force_rescale ( )
inlineinherited
206{ m_force_rescale = true; }

References m_force_rescale.

◆ force_rescale()

bool Slic3r::GUI::DPIAware< wxFrame >::force_rescale ( ) const
inlineinherited
201{ return m_force_rescale; }

References m_force_rescale.

◆ init_button()

void Slic3r::GUI::PrintErrorDialog::init_button ( PrintErrorButton style,
wxString buton_text )
1095{
1096 Button* print_error_button = new Button(this, buton_text);
1097 print_error_button->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
1098 print_error_button->SetSize(wxSize(FromDIP(300), FromDIP(30)));
1099 print_error_button->SetMinSize(wxSize(FromDIP(300), FromDIP(30)));
1100 print_error_button->SetMaxSize(wxSize(-1, FromDIP(30)));
1101 print_error_button->Hide();
1102 m_button_list[style] = print_error_button;
1103 m_button_list[style]->Bind(wxEVT_LEFT_DOWN, [this, style](wxMouseEvent& e)
1104 {
1105 wxCommandEvent evt(EVT_ERROR_DIALOG_BTN_CLICKED);
1106 evt.SetInt(style);
1107 post_event(evt);
1108 e.Skip();
1109 });
1110}
@ Regular
Definition Button.hpp:24
@ Choice
Definition Button.hpp:33
void SetMinSize(const wxSize &size) override
Definition Button.cpp:112
void SetStyle(const ButtonStyle style, const ButtonType type)
Definition Button.cpp:200
void SetMaxSize(const wxSize &size) override
Definition Button.cpp:118
void post_event(wxCommandEvent &event)
Definition ReleaseNote.cpp:909
std::map< int, Button * > m_button_list
Definition ReleaseNote.hpp:236
wxMouseEvent
Definition CameraPopup.cpp:47

References Choice, m_button_list, post_event(), Regular, Button::SetMaxSize(), Button::SetMinSize(), Button::SetStyle(), style, and Slic3r::GUI::wxMouseEvent.

Referenced by init_button_list().

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

◆ init_button_list()

void Slic3r::GUI::PrintErrorDialog::init_button_list ( )
1113{
1114 init_button(RESUME_PRINTING, _L("Resume Printing"));
1115 init_button(RESUME_PRINTING_DEFECTS, _L("Resume (defects acceptable)"));
1116 init_button(RESUME_PRINTING_PROBELM_SOLVED, _L("Resume (problem solved)"));
1117 init_button(STOP_PRINTING, _L("Stop Printing"));// pop up recheck dialog?
1118 init_button(CHECK_ASSISTANT, _L("Check Assistant"));
1119 init_button(FILAMENT_EXTRUDED, _L("Filament Extruded, Continue"));
1120 init_button(RETRY_FILAMENT_EXTRUDED, _L("Not Extruded Yet, Retry"));
1121 init_button(CONTINUE, _L("Finished, Continue"));
1123 init_button(OK_BUTTON, _L("OK"));
1124 init_button(FILAMENT_LOAD_RESUME, _L("Filament Loaded, Resume"));
1125 init_button(JUMP_TO_LIVEVIEW, _L("View Liveview"));
1126 init_button(NO_REMINDER_NEXT_TIME, _L("No Reminder Next Time"));
1127 init_button(IGNORE_NO_REMINDER_NEXT_TIME, _L("Ignore. Don't Remind Next Time"));
1128 init_button(IGNORE_RESUME, _L("Ignore this and Resume"));
1129 init_button(PROBLEM_SOLVED_RESUME, _L("Problem Solved and Resume"));
1130 init_button(TURN_OFF_FIRE_ALARM, _L("Got it, Turn off the Fire Alarm."));
1131 init_button(RETRY_PROBLEM_SOLVED, _L("Retry (problem solved)"));
1132 init_button(STOP_DRYING, _L("Stop Drying"));
1133}
#define _L(s)
Definition OBJ.cpp:34
void init_button(PrintErrorButton style, wxString buton_text)
Definition ReleaseNote.cpp:1094

References _L, CHECK_ASSISTANT, CONTINUE, FILAMENT_EXTRUDED, FILAMENT_LOAD_RESUME, IGNORE_NO_REMINDER_NEXT_TIME, IGNORE_RESUME, init_button(), JUMP_TO_LIVEVIEW, LOAD_VIRTUAL_TRAY, NO_REMINDER_NEXT_TIME, OK_BUTTON, PROBLEM_SOLVED_RESUME, RESUME_PRINTING, RESUME_PRINTING_DEFECTS, RESUME_PRINTING_PROBELM_SOLVED, RETRY_FILAMENT_EXTRUDED, RETRY_PROBLEM_SOLVED, STOP_DRYING, STOP_PRINTING, and TURN_OFF_FIRE_ALARM.

Referenced by PrintErrorDialog().

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

◆ is_new_scale_factor()

bool Slic3r::GUI::DPIAware< wxFrame >::is_new_scale_factor ( ) const
inlineprivateinherited
262{ return fabs(m_scale_factor - m_prev_scale_factor) > 0.001; }

References m_prev_scale_factor, and m_scale_factor.

◆ msw_rescale()

void Slic3r::GUI::PrintErrorDialog::msw_rescale ( )
1145 {
1146 wxGetApp().UpdateFrameDarkUI(this);
1147 Refresh();
1148}

◆ normal_font()

const wxFont & Slic3r::GUI::DPIAware< wxFrame >::normal_font ( ) const
inlineinherited
205{ return m_normal_font; }

References m_normal_font.

Referenced by Slic3r::GUI::MainFrame::init_tabpanel(), and Slic3r::GUI::MainFrame::on_dpi_changed().

Here is the caller graph for this function:

◆ on_dpi_changed()

void Slic3r::GUI::PrintErrorDialog::on_dpi_changed ( const wxRect & suggested_rect)
virtual

Implements Slic3r::GUI::DPIAware< wxFrame >.

1141{
1142 rescale();
1143}
void rescale()
Definition ReleaseNote.cpp:1150

References rescale().

Here is the call graph for this function:

◆ on_hide()

void Slic3r::GUI::PrintErrorDialog::on_hide ( )
1041{
1042 //m_sizer_button->Clear();
1043 //m_sizer_button->Layout();
1044 //m_used_button.clear();
1045 this->Hide();
1046 if (web_request.IsOk() && web_request.GetState() == wxWebRequest::State_Active) {
1047 BOOST_LOG_TRIVIAL(info) << "web_request: cancelled";
1048 web_request.Cancel();
1049 }
1050 m_error_prompt_pic_static->SetBitmap(wxBitmap());
1051
1052 if (wxGetApp().mainframe != nullptr) {
1053 wxGetApp().mainframe->Show();
1054 wxGetApp().mainframe->Raise();
1055 }
1056}
wxWebRequest web_request
Definition ReleaseNote.hpp:229

References m_error_prompt_pic_static, and web_request.

Referenced by PrintErrorDialog().

Here is the caller graph for this function:

◆ on_show()

void Slic3r::GUI::PrintErrorDialog::on_show ( )
1033{
1034 wxGetApp().UpdateFrameDarkUI(this);
1035
1036 this->Show();
1037 this->Raise();
1038}

◆ on_sys_color_changed()

virtual void Slic3r::GUI::DPIAware< wxFrame >::on_sys_color_changed ( )
inlineprotectedvirtualinherited

Reimplemented in Slic3r::GUI::MainFrame.

226{};

◆ on_webrequest_state()

void Slic3r::GUI::PrintErrorDialog::on_webrequest_state ( wxWebRequestEvent & evt)
930{
931 BOOST_LOG_TRIVIAL(trace) << "monitor: monitor_panel web request state = " << evt.GetState();
932 switch (evt.GetState()) {
933 case wxWebRequest::State_Completed: {
934 wxImage img(*evt.GetResponse().GetStream());
935 wxImage resize_img = img.Scale(FromDIP(320), FromDIP(180), wxIMAGE_QUALITY_HIGH);
936 wxBitmap error_prompt_pic = resize_img;
937 m_error_prompt_pic_static->SetBitmap(error_prompt_pic);
938 Layout();
939 Fit();
940
941 break;
942 }
943 case wxWebRequest::State_Failed:
944 case wxWebRequest::State_Cancelled:
945 case wxWebRequest::State_Unauthorized: {
946 m_error_prompt_pic_static->SetBitmap(wxBitmap());
947 break;
948 }
949 case wxWebRequest::State_Active:
950 case wxWebRequest::State_Idle: break;
951 default: break;
952 }
953}
void trace(unsigned int level, const char *message)
Definition utils.cpp:247

References m_error_prompt_pic_static, and Slic3r::trace().

Referenced by PrintErrorDialog().

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

◆ post_event() [1/2]

void Slic3r::GUI::PrintErrorDialog::post_event ( wxCommandEvent && event)
920{
921 if (event_parent) {
922 event.SetString("");
923 event.SetEventObject(event_parent);
924 wxPostEvent(event_parent, event);
925 event.Skip();
926 }
927}
wxWindow * event_parent
Definition ReleaseNote.hpp:178

References event_parent.

◆ post_event() [2/2]

void Slic3r::GUI::PrintErrorDialog::post_event ( wxCommandEvent & event)
910{
911 if (event_parent) {
912 event.SetString("");
913 event.SetEventObject(event_parent);
914 wxPostEvent(event_parent, event);
915 event.Skip();
916 }
917}

References event_parent.

Referenced by init_button().

Here is the caller graph for this function:

◆ prev_scale_factor()

float Slic3r::GUI::DPIAware< wxFrame >::prev_scale_factor ( ) const
inlineinherited
196{ return m_prev_scale_factor; }

References m_prev_scale_factor.

◆ rescale()

void Slic3r::GUI::PrintErrorDialog::rescale ( )
1151{
1152 for (auto used_button : m_used_button) {
1153 if (m_button_list.find(used_button) != m_button_list.end()) {
1154 m_button_list[used_button]->Rescale();
1155 }
1156 }
1157}
std::vector< int > m_used_button
Definition ReleaseNote.hpp:237

References m_button_list, and m_used_button.

Referenced by on_dpi_changed().

Here is the caller graph for this function:

◆ scale_factor()

float Slic3r::GUI::DPIAware< wxFrame >::scale_factor ( ) const
inlineinherited
195{ return m_scale_factor; }

References m_scale_factor.

◆ set_em_unit()

void Slic3r::GUI::DPIAware< wxFrame >::set_em_unit ( int v)
inlineinherited
200{ m_em_unit = v; }

References m_em_unit.

◆ set_prev_scale_factor()

void Slic3r::GUI::DPIAware< wxFrame >::set_prev_scale_factor ( float v)
inlineinherited

References m_prev_scale_factor.

◆ set_scale_factor()

void Slic3r::GUI::DPIAware< wxFrame >::set_scale_factor ( float v)
inlineinherited
198{ m_scale_factor = v; }

References m_scale_factor.

◆ ShowModal()

int Slic3r::GUI::DPIAware< wxFrame >::ShowModal ( )
inlineinherited
217 {
218 dialogStack.push_front(this);
219 int r = wxDialog::ShowModal();
220 dialogStack.pop_front();
221 return r;
222 }

References Slic3r::GUI::dialogStack.

◆ update_em_unit()

void Slic3r::GUI::DPIAware< wxFrame >::update_em_unit ( )
inlineprivateinherited
250 {
251 // Linux specific issue : get_dpi_for_window(this) still doesn't responce to the Display's scale in new wxWidgets(3.1.3).
252 // So, calculate the m_em_unit value from the font size, as before
253#if !defined(__WXGTK__)
255#else
256 // initialize default width_unit according to the width of the one symbol ("m") of the currently active font of this window.
257 m_em_unit = std::max<size_t>(10, this->GetTextExtent("m").x - 1);
258#endif // __WXGTK__
259 }

References m_em_unit, and m_scale_factor.

◆ update_text_image()

void Slic3r::GUI::PrintErrorDialog::update_text_image ( const wxString & text,
const wxString & error_code,
const wxString & image_url )
956{
957 //if (!m_sizer_text_release_note) {
958 // m_sizer_text_release_note = new wxBoxSizer(wxVERTICAL);
959 //}
960 wxBoxSizer* sizer_text_release_note = new wxBoxSizer(wxVERTICAL);
961
962 wxString error_code_msg = error_code;
963 if (!error_code.IsEmpty()) {
964 wxDateTime now = wxDateTime::Now();
965 wxString show_time = now.Format("%H%M%d");
966 error_code_msg = wxString::Format("[%S %S]", error_code, show_time);
967 }
968
971 sizer_text_release_note->Add(m_error_prompt_pic_static, 0, wxALIGN_CENTER, FromDIP(5));
972 sizer_text_release_note->AddSpacer(10);
973 sizer_text_release_note->Add(m_staticText_release_note, 0, wxALIGN_CENTER , FromDIP(5));
974 }
976 m_staticText_error_code = new Label(m_vebview_release_note, error_code_msg, LB_AUTO_WRAP);
977 sizer_text_release_note->AddSpacer(5);
978 sizer_text_release_note->Add(m_staticText_error_code, 0, wxALIGN_CENTER, FromDIP(5));
979 }
980
981 m_vebview_release_note->SetSizer(sizer_text_release_note);
982
983 if (!image_url.empty()) {
984 const wxImage& img = wxGetApp().get_hms_query()->query_image_from_local(image_url);
985 if (!img.IsOk() && image_url.Contains("http"))
986 {
987 web_request = wxWebSession::GetDefault().CreateRequest(this, image_url);
988 BOOST_LOG_TRIVIAL(trace) << "monitor: create new webrequest, state = " << web_request.GetState() << ", url = " << image_url;
989 if (web_request.GetState() == wxWebRequest::State_Idle) web_request.Start();
990 BOOST_LOG_TRIVIAL(trace) << "monitor: start new webrequest, state = " << web_request.GetState() << ", url = " << image_url;
991 }
992 else
993 {
994 const wxImage& resize_img = img.Scale(FromDIP(320), FromDIP(180), wxIMAGE_QUALITY_HIGH);
995 m_error_prompt_pic_static->SetBitmap(wxBitmap(resize_img));
996
997 Layout();
998 Fit();
999 }
1000
1002
1003 }
1004 else {
1006 }
1007 sizer_text_release_note->Layout();
1008 m_staticText_release_note->SetMaxSize(wxSize(FromDIP(300), -1));
1009 m_staticText_release_note->SetMinSize(wxSize(FromDIP(300), -1));
1010 m_staticText_release_note->SetLabelText(text);
1011 m_staticText_error_code->SetMaxSize(wxSize(FromDIP(300), -1));
1012 m_staticText_error_code->SetMinSize(wxSize(FromDIP(300), -1));
1013 m_staticText_error_code->SetLabelText(error_code_msg);
1014 m_vebview_release_note->Layout();
1015
1016 auto text_size = m_staticText_release_note->GetBestSize();
1017 if (text_size.y < FromDIP(360))
1018 if (!image_url.empty()) {
1019 m_vebview_release_note->SetMinSize(wxSize(FromDIP(320), text_size.y + FromDIP(220)));
1020 }
1021 else {
1022 m_vebview_release_note->SetMinSize(wxSize(FromDIP(320), text_size.y + FromDIP(50)));
1023 }
1024 else {
1025 m_vebview_release_note->SetMinSize(wxSize(FromDIP(320), FromDIP(340)));
1026 }
1027
1028 Layout();
1029 Fit();
1030}
#define LB_AUTO_WRAP
Definition Label.hpp:12
Label * m_staticText_error_code
Definition ReleaseNote.hpp:232
Label * m_staticText_release_note
Definition ReleaseNote.hpp:231

References LB_AUTO_WRAP, m_error_prompt_pic_static, m_staticText_error_code, m_staticText_release_note, m_vebview_release_note, Slic3r::trace(), and web_request.

Here is the call graph for this function:

◆ update_title_style()

void Slic3r::GUI::PrintErrorDialog::update_title_style ( wxString title,
std::vector< int > style,
wxWindow * parent = nullptr )
1059{
1060 SetTitle(title);
1061 event_parent = parent;
1062 for (int used_button_id : m_used_button) {
1063 if (m_button_list.find(used_button_id) != m_button_list.end()) {
1064 m_button_list[used_button_id]->Hide();
1065 }
1066 }
1067
1068 m_sizer_button->Clear();
1069 m_used_button = button_style;
1070 bool need_remove_close_btn = false;
1071 for (int button_id : button_style) {
1072 if (m_button_list.find(button_id) != m_button_list.end()) {
1073 m_sizer_button->Add(m_button_list[button_id], 0, wxALL, FromDIP(5));
1074 m_button_list[button_id]->Show();
1075 }
1076
1077 need_remove_close_btn |= (button_id == REMOVE_CLOSE_BTN); // special case, do not show close button
1078 }
1079
1080 // Special case, do not show close button
1081 if (need_remove_close_btn)
1082 {
1083 SetWindowStyle(GetWindowStyle() & ~wxCLOSE_BOX);
1084 }
1085 else
1086 {
1087 SetWindowStyle(GetWindowStyle() | wxCLOSE_BOX);
1088 }
1089
1090 Layout();
1091 Fit();
1092}

References event_parent, m_button_list, m_sizer_button, m_used_button, and REMOVE_CLOSE_BTN.

Member Data Documentation

◆ event_parent

wxWindow* Slic3r::GUI::PrintErrorDialog::event_parent { nullptr }
private
178{ nullptr };

Referenced by post_event(), post_event(), and update_title_style().

◆ m_button_list

std::map<int, Button*> Slic3r::GUI::PrintErrorDialog::m_button_list

◆ m_can_rescale

bool Slic3r::GUI::DPIAware< wxFrame >::m_can_rescale
privateinherited
235{ true };

Referenced by DPIAware().

◆ m_em_unit

int Slic3r::GUI::DPIAware< wxFrame >::m_em_unit
privateinherited

◆ m_error_prompt_pic_static

wxStaticBitmap* Slic3r::GUI::PrintErrorDialog::m_error_prompt_pic_static

◆ m_force_rescale

bool Slic3r::GUI::DPIAware< wxFrame >::m_force_rescale
privateinherited
236{ false };

Referenced by DPIAware(), enable_force_rescale(), force_rescale(), and rescale().

◆ m_new_font_point_size

int Slic3r::GUI::DPIAware< wxFrame >::m_new_font_point_size
privateinherited

Referenced by DPIAware().

◆ m_normal_font

wxFont Slic3r::GUI::DPIAware< wxFrame >::m_normal_font
privateinherited

Referenced by DPIAware(), normal_font(), and rescale().

◆ m_prev_scale_factor

float Slic3r::GUI::DPIAware< wxFrame >::m_prev_scale_factor
privateinherited

◆ m_scale_factor

float Slic3r::GUI::DPIAware< wxFrame >::m_scale_factor
privateinherited

◆ m_sizer_button

wxBoxSizer* Slic3r::GUI::PrintErrorDialog::m_sizer_button

◆ m_sizer_main

wxBoxSizer* Slic3r::GUI::PrintErrorDialog::m_sizer_main

Referenced by PrintErrorDialog().

◆ m_staticText_error_code

Label* Slic3r::GUI::PrintErrorDialog::m_staticText_error_code { nullptr }
232{ nullptr };

Referenced by update_text_image().

◆ m_staticText_release_note

Label* Slic3r::GUI::PrintErrorDialog::m_staticText_release_note { nullptr }
231{ nullptr };

Referenced by update_text_image().

◆ m_used_button

std::vector<int> Slic3r::GUI::PrintErrorDialog::m_used_button

Referenced by rescale(), and update_title_style().

◆ m_vebview_release_note

wxScrolledWindow* Slic3r::GUI::PrintErrorDialog::m_vebview_release_note { nullptr }
235{ nullptr };

Referenced by PrintErrorDialog(), and update_text_image().

◆ web_request

wxWebRequest Slic3r::GUI::PrintErrorDialog::web_request

Referenced by on_hide(), and update_text_image().


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