Lines 79-86
PrintHostSendDialog::PrintHostSendDialog
Link Here
|
79 |
if (size_t extension_start = recent_path.find_last_of('.'); extension_start != std::string::npos) |
79 |
if (size_t extension_start = recent_path.find_last_of('.'); extension_start != std::string::npos) |
80 |
m_valid_suffix = recent_path.substr(extension_start); |
80 |
m_valid_suffix = recent_path.substr(extension_start); |
81 |
// .gcode suffix control |
81 |
// .gcode suffix control |
82 |
auto validate_path = [this](const wxString &path) -> bool { |
82 |
auto validate_path = [this](const std::wstring &path) -> bool { |
83 |
if (! path.Lower().EndsWith(m_valid_suffix.Lower())) { |
83 |
if (! wxString(path).Lower().EndsWith(m_valid_suffix.Lower())) { |
84 |
MessageDialog msg_wingow(this, wxString::Format(_L("Upload filename doesn't end with \"%s\". Do you wish to continue?"), m_valid_suffix), wxString(SLIC3R_APP_NAME), wxYES | wxNO); |
84 |
MessageDialog msg_wingow(this, wxString::Format(_L("Upload filename doesn't end with \"%s\". Do you wish to continue?"), m_valid_suffix), wxString(SLIC3R_APP_NAME), wxYES | wxNO); |
85 |
if (msg_wingow.ShowModal() == wxID_NO) |
85 |
if (msg_wingow.ShowModal() == wxID_NO) |
86 |
return false; |
86 |
return false; |
Lines 90-96
PrintHostSendDialog::PrintHostSendDialog
Link Here
|
90 |
|
90 |
|
91 |
auto* btn_ok = add_button(wxID_OK, true, _L("Upload")); |
91 |
auto* btn_ok = add_button(wxID_OK, true, _L("Upload")); |
92 |
btn_ok->Bind(wxEVT_BUTTON, [this, validate_path](wxCommandEvent&) { |
92 |
btn_ok->Bind(wxEVT_BUTTON, [this, validate_path](wxCommandEvent&) { |
93 |
if (validate_path(txt_filename->GetValue())) { |
93 |
if (validate_path(txt_filename->GetValue().ToStdWstring())) { |
94 |
post_upload_action = PrintHostPostUploadAction::None; |
94 |
post_upload_action = PrintHostPostUploadAction::None; |
95 |
EndDialog(wxID_OK); |
95 |
EndDialog(wxID_OK); |
96 |
} |
96 |
} |
Lines 100-106
PrintHostSendDialog::PrintHostSendDialog
Link Here
|
100 |
if (post_actions.has(PrintHostPostUploadAction::StartPrint)) { |
100 |
if (post_actions.has(PrintHostPostUploadAction::StartPrint)) { |
101 |
auto* btn_print = add_button(wxID_YES, false, _L("Upload and Print")); |
101 |
auto* btn_print = add_button(wxID_YES, false, _L("Upload and Print")); |
102 |
btn_print->Bind(wxEVT_BUTTON, [this, validate_path](wxCommandEvent&) { |
102 |
btn_print->Bind(wxEVT_BUTTON, [this, validate_path](wxCommandEvent&) { |
103 |
if (validate_path(txt_filename->GetValue())) { |
103 |
if (validate_path(txt_filename->GetValue().ToStdWstring())) { |
104 |
post_upload_action = PrintHostPostUploadAction::StartPrint; |
104 |
post_upload_action = PrintHostPostUploadAction::StartPrint; |
105 |
EndDialog(wxID_OK); |
105 |
EndDialog(wxID_OK); |
106 |
} |
106 |
} |
Lines 111-117
PrintHostSendDialog::PrintHostSendDialog
Link Here
|
111 |
// Using wxID_MORE as a button identifier to be different from the other buttons, wxID_MORE has no other meaning here. |
111 |
// Using wxID_MORE as a button identifier to be different from the other buttons, wxID_MORE has no other meaning here. |
112 |
auto* btn_simulate = add_button(wxID_MORE, false, _L("Upload and Simulate")); |
112 |
auto* btn_simulate = add_button(wxID_MORE, false, _L("Upload and Simulate")); |
113 |
btn_simulate->Bind(wxEVT_BUTTON, [this, validate_path](wxCommandEvent&) { |
113 |
btn_simulate->Bind(wxEVT_BUTTON, [this, validate_path](wxCommandEvent&) { |
114 |
if (validate_path(txt_filename->GetValue())) { |
114 |
if (validate_path(txt_filename->GetValue().ToStdWstring())) { |
115 |
post_upload_action = PrintHostPostUploadAction::StartSimulation; |
115 |
post_upload_action = PrintHostPostUploadAction::StartSimulation; |
116 |
EndDialog(wxID_OK); |
116 |
EndDialog(wxID_OK); |
117 |
} |
117 |
} |