Lines 81-88
PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, PrintHostPostUplo
Link Here
|
81 |
if (size_t extension_start = recent_path.find_last_of('.'); extension_start != std::string::npos) |
81 |
if (size_t extension_start = recent_path.find_last_of('.'); extension_start != std::string::npos) |
82 |
m_valid_suffix = recent_path.substr(extension_start); |
82 |
m_valid_suffix = recent_path.substr(extension_start); |
83 |
// .gcode suffix control |
83 |
// .gcode suffix control |
84 |
auto validate_path = [this](const wxString &path) -> bool { |
84 |
auto validate_path = [this](const std::wstring &path) -> bool { |
85 |
if (! path.Lower().EndsWith(m_valid_suffix.Lower())) { |
85 |
if (! wxString(path).Lower().EndsWith(m_valid_suffix.Lower())) { |
86 |
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); |
86 |
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); |
87 |
if (msg_wingow.ShowModal() == wxID_NO) |
87 |
if (msg_wingow.ShowModal() == wxID_NO) |
88 |
return false; |
88 |
return false; |
Lines 92-98
PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, PrintHostPostUplo
Link Here
|
92 |
|
92 |
|
93 |
auto* btn_ok = add_button(wxID_OK, true, _L("Upload")); |
93 |
auto* btn_ok = add_button(wxID_OK, true, _L("Upload")); |
94 |
btn_ok->Bind(wxEVT_BUTTON, [this, validate_path](wxCommandEvent&) { |
94 |
btn_ok->Bind(wxEVT_BUTTON, [this, validate_path](wxCommandEvent&) { |
95 |
if (validate_path(txt_filename->GetValue())) { |
95 |
if (validate_path(txt_filename->GetValue().ToStdWstring())) { |
96 |
post_upload_action = PrintHostPostUploadAction::None; |
96 |
post_upload_action = PrintHostPostUploadAction::None; |
97 |
EndDialog(wxID_OK); |
97 |
EndDialog(wxID_OK); |
98 |
} |
98 |
} |
Lines 102-108
PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, PrintHostPostUplo
Link Here
|
102 |
if (post_actions.has(PrintHostPostUploadAction::StartPrint)) { |
102 |
if (post_actions.has(PrintHostPostUploadAction::StartPrint)) { |
103 |
auto* btn_print = add_button(wxID_YES, false, _L("Upload and Print")); |
103 |
auto* btn_print = add_button(wxID_YES, false, _L("Upload and Print")); |
104 |
btn_print->Bind(wxEVT_BUTTON, [this, validate_path](wxCommandEvent&) { |
104 |
btn_print->Bind(wxEVT_BUTTON, [this, validate_path](wxCommandEvent&) { |
105 |
if (validate_path(txt_filename->GetValue())) { |
105 |
if (validate_path(txt_filename->GetValue().ToStdWstring())) { |
106 |
post_upload_action = PrintHostPostUploadAction::StartPrint; |
106 |
post_upload_action = PrintHostPostUploadAction::StartPrint; |
107 |
EndDialog(wxID_OK); |
107 |
EndDialog(wxID_OK); |
108 |
} |
108 |
} |
Lines 113-119
PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, PrintHostPostUplo
Link Here
|
113 |
// Using wxID_MORE as a button identifier to be different from the other buttons, wxID_MORE has no other meaning here. |
113 |
// Using wxID_MORE as a button identifier to be different from the other buttons, wxID_MORE has no other meaning here. |
114 |
auto* btn_simulate = add_button(wxID_MORE, false, _L("Upload and Simulate")); |
114 |
auto* btn_simulate = add_button(wxID_MORE, false, _L("Upload and Simulate")); |
115 |
btn_simulate->Bind(wxEVT_BUTTON, [this, validate_path](wxCommandEvent&) { |
115 |
btn_simulate->Bind(wxEVT_BUTTON, [this, validate_path](wxCommandEvent&) { |
116 |
if (validate_path(txt_filename->GetValue())) { |
116 |
if (validate_path(txt_filename->GetValue().ToStdWstring())) { |
117 |
post_upload_action = PrintHostPostUploadAction::StartSimulation; |
117 |
post_upload_action = PrintHostPostUploadAction::StartSimulation; |
118 |
EndDialog(wxID_OK); |
118 |
EndDialog(wxID_OK); |
119 |
} |
119 |
} |