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; }
|
||||
#endif
|
||||
case WXK_ESCAPE: { deselect_all(); break; }
|
||||
//case WXK_F5: {
|
||||
// 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;
|
||||
//}
|
||||
case WXK_F5: {
|
||||
if (wxGetApp().mainframe->is_printer_view())
|
||||
wxGetApp().mainframe->load_printer_url();
|
||||
|
||||
//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
|
||||
case '1':
|
||||
|
|
|
@ -3240,6 +3240,27 @@ void MainFrame::load_printer_url(wxString url)
|
|||
evt->SetString(url);
|
||||
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()
|
||||
{
|
||||
if (m_webview != nullptr)
|
||||
|
|
|
@ -325,6 +325,8 @@ public:
|
|||
//BBS
|
||||
void load_url(wxString url);
|
||||
void load_printer_url(wxString url);
|
||||
void load_printer_url();
|
||||
bool is_printer_view() const;
|
||||
void refresh_plugin_tips();
|
||||
void RunScript(wxString js);
|
||||
|
||||
|
|
Loading…
Reference in a new issue