mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 00:37:51 -06:00
parent
c3726d95c7
commit
b85b514bd9
3 changed files with 32 additions and 6 deletions
|
@ -3059,12 +3059,15 @@ void GLCanvas3D::on_char(wxKeyEvent& evt)
|
||||||
case WXK_BACK: { post_event(SimpleEvent(EVT_GLTOOLBAR_DELETE)); break; }
|
case WXK_BACK: { post_event(SimpleEvent(EVT_GLTOOLBAR_DELETE)); break; }
|
||||||
#endif
|
#endif
|
||||||
case WXK_ESCAPE: { deselect_all(); break; }
|
case WXK_ESCAPE: { deselect_all(); break; }
|
||||||
//case WXK_F5: {
|
case WXK_F5: {
|
||||||
// if ((wxGetApp().is_editor() && !wxGetApp().plater()->model().objects.empty()) ||
|
if (wxGetApp().mainframe->is_printer_view())
|
||||||
// (wxGetApp().is_gcode_viewer() && !wxGetApp().plater()->get_last_loaded_gcode().empty()))
|
wxGetApp().mainframe->load_printer_url();
|
||||||
// post_event(SimpleEvent(EVT_GLCANVAS_RELOAD_FROM_DISK));
|
|
||||||
// break;
|
//if ((wxGetApp().is_editor() && !wxGetApp().plater()->model().objects.empty()) ||
|
||||||
//}
|
// (wxGetApp().is_gcode_viewer() && !wxGetApp().plater()->get_last_loaded_gcode().empty()))
|
||||||
|
// post_event(SimpleEvent(EVT_GLCANVAS_RELOAD_FROM_DISK));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// BBS: use keypad to change extruder
|
// BBS: use keypad to change extruder
|
||||||
case '1':
|
case '1':
|
||||||
|
|
|
@ -3240,6 +3240,27 @@ void MainFrame::load_printer_url(wxString url)
|
||||||
evt->SetString(url);
|
evt->SetString(url);
|
||||||
wxQueueEvent(this, evt);
|
wxQueueEvent(this, evt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainFrame::load_printer_url()
|
||||||
|
{
|
||||||
|
PresetBundle &preset_bundle = *wxGetApp().preset_bundle;
|
||||||
|
if (preset_bundle.printers.get_edited_preset().is_bbl_vendor_preset(&preset_bundle))
|
||||||
|
return;
|
||||||
|
|
||||||
|
auto cfg = preset_bundle.printers.get_edited_preset().config;
|
||||||
|
wxString url =
|
||||||
|
cfg.opt_string("print_host_webui").empty() ? cfg.opt_string("print_host") : cfg.opt_string("print_host_webui");
|
||||||
|
if (!url.empty()) {
|
||||||
|
if (!url.Lower().starts_with("http"))
|
||||||
|
url = wxString::Format("http://%s", url);
|
||||||
|
|
||||||
|
load_printer_url(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MainFrame::is_printer_view() const { return m_tabpanel->GetSelection() == TabPosition::tpMonitor; }
|
||||||
|
|
||||||
|
|
||||||
void MainFrame::refresh_plugin_tips()
|
void MainFrame::refresh_plugin_tips()
|
||||||
{
|
{
|
||||||
if (m_webview != nullptr)
|
if (m_webview != nullptr)
|
||||||
|
|
|
@ -325,6 +325,8 @@ public:
|
||||||
//BBS
|
//BBS
|
||||||
void load_url(wxString url);
|
void load_url(wxString url);
|
||||||
void load_printer_url(wxString url);
|
void load_printer_url(wxString url);
|
||||||
|
void load_printer_url();
|
||||||
|
bool is_printer_view() const;
|
||||||
void refresh_plugin_tips();
|
void refresh_plugin_tips();
|
||||||
void RunScript(wxString js);
|
void RunScript(wxString js);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue