mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-18 10:05:57 +08:00
New request naming
This commit is contained in:
parent
7c63c2dbfb
commit
5e5f2c493d
@ -471,8 +471,10 @@ ConnectRequestHandler::ConnectRequestHandler()
|
||||
{
|
||||
m_actions["REQUEST_ACCESS_TOKEN"] = std::bind(&ConnectRequestHandler::on_request_access_token, this);
|
||||
m_actions["REQUEST_CONFIG"] = std::bind(&ConnectRequestHandler::on_request_config, this);
|
||||
m_actions["UPDATE_SELECTED_PRINTER"] = std::bind(&ConnectRequestHandler::on_request_update_selected_printer_action, this);
|
||||
m_actions["WEBAPP_READY"] = std::bind(&ConnectRequestHandler::request_compatible_printers, this);
|
||||
m_actions["SELECT_PRINTER"] = std::bind(&ConnectRequestHandler::on_request_select_printer, this);
|
||||
m_actions["PRINT"] = std::bind(&ConnectRequestHandler::on_request_print, this);
|
||||
m_actions["REQUEST_SELECTED_PRINTER"] = std::bind(&ConnectRequestHandler::on_request_print, this);
|
||||
}
|
||||
ConnectRequestHandler::~ConnectRequestHandler()
|
||||
{
|
||||
@ -567,12 +569,16 @@ void ConnectWebViewPanel::sys_color_changed()
|
||||
resend_config();
|
||||
}
|
||||
|
||||
void ConnectWebViewPanel::on_request_update_selected_printer_action()
|
||||
void ConnectWebViewPanel::on_request_select_printer()
|
||||
{
|
||||
assert(!m_message_data.empty());
|
||||
wxGetApp().handle_connect_request_printer_select(m_message_data);
|
||||
}
|
||||
|
||||
void ConnectWebViewPanel::on_request_print()
|
||||
{
|
||||
// PRINT request is not defined for ConnectWebViewPanel
|
||||
assert(true);
|
||||
}
|
||||
|
||||
PrinterWebViewPanel::PrinterWebViewPanel(wxWindow* parent, const wxString& default_url)
|
||||
: WebViewPanel(parent, default_url)
|
||||
@ -1060,7 +1066,12 @@ void PrinterPickWebViewDialog::on_script_message(wxWebViewEvent& evt)
|
||||
handle_message(into_u8(evt.GetString()));
|
||||
}
|
||||
|
||||
void PrinterPickWebViewDialog::on_request_update_selected_printer_action()
|
||||
void PrinterPickWebViewDialog::on_request_select_printer()
|
||||
{
|
||||
// SELECT_PRINTER request is not defined for PrinterPickWebViewDialog
|
||||
assert(true);
|
||||
}
|
||||
void PrinterPickWebViewDialog::on_request_print()
|
||||
{
|
||||
m_ret_val = m_message_data;
|
||||
m_browser->RemoveScriptMessageHandler("_prusaSlicer");
|
||||
|
@ -166,7 +166,8 @@ protected:
|
||||
// action callbacs stored in m_actions
|
||||
virtual void on_request_access_token();
|
||||
virtual void on_request_config();
|
||||
virtual void on_request_update_selected_printer_action() = 0;
|
||||
virtual void on_request_select_printer() = 0;
|
||||
virtual void on_request_print() = 0;
|
||||
virtual void run_script_bridge(const wxString& script) = 0;
|
||||
virtual void request_compatible_printers() = 0;
|
||||
|
||||
@ -183,7 +184,8 @@ public:
|
||||
void logout();
|
||||
void sys_color_changed() override;
|
||||
protected:
|
||||
void on_request_update_selected_printer_action() override;
|
||||
void on_request_select_printer() override;
|
||||
void on_request_print() override;
|
||||
void request_compatible_printers() override {}
|
||||
void run_script_bridge(const wxString& script) override {run_script(script); }
|
||||
};
|
||||
@ -232,7 +234,8 @@ public:
|
||||
void on_show(wxShowEvent& evt) override;
|
||||
void on_script_message(wxWebViewEvent& evt) override;
|
||||
protected:
|
||||
void on_request_update_selected_printer_action() override;
|
||||
void on_request_select_printer() override;
|
||||
void on_request_print() override;
|
||||
void request_compatible_printers() override;
|
||||
void request_compatible_printers_FFF();
|
||||
void request_compatible_printers_SLA();
|
||||
|
Loading…
x
Reference in New Issue
Block a user