mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 08:56:02 +08:00
Fix of showing Physical printer webview tab at startup
This commit is contained in:
parent
0c7e6cb063
commit
93d47dd121
@ -1410,6 +1410,8 @@ bool GUI_App::on_init_inner()
|
|||||||
|
|
||||||
update_mode(); // update view mode after fix of the object_list size
|
update_mode(); // update view mode after fix of the object_list size
|
||||||
|
|
||||||
|
show_printer_webview_tab();
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
other_instance_message_handler()->bring_instance_forward();
|
other_instance_message_handler()->bring_instance_forward();
|
||||||
#endif //__APPLE__
|
#endif //__APPLE__
|
||||||
@ -3707,25 +3709,27 @@ void GUI_App::handle_connect_request_printer_pick(std::string msg)
|
|||||||
this->plater()->get_notification_manager()->push_notification(NotificationType::UserAccountID, NotificationManager::NotificationLevel::ImportantNotificationLevel, out);
|
this->plater()->get_notification_manager()->push_notification(NotificationType::UserAccountID, NotificationManager::NotificationLevel::ImportantNotificationLevel, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GUI_App::show_printer_webview_tab(bool show, const DynamicPrintConfig& dpc/* = {}*/)
|
void GUI_App::show_printer_webview_tab()
|
||||||
{
|
{
|
||||||
if (!show) {
|
//bool show, const DynamicPrintConfig& dpc
|
||||||
|
|
||||||
|
if (DynamicPrintConfig* dpc = preset_bundle->physical_printers.get_selected_printer_config(); dpc == nullptr) {
|
||||||
this->mainframe->select_tab(size_t(0));
|
this->mainframe->select_tab(size_t(0));
|
||||||
mainframe->remove_printer_webview_tab();
|
mainframe->remove_printer_webview_tab();
|
||||||
} else {
|
} else {
|
||||||
std::string url = dpc.opt_string("print_host");
|
std::string url = dpc->opt_string("print_host");
|
||||||
|
|
||||||
if (url.find("http://") != 0 && url.find("https://") != 0) {
|
if (url.find("http://") != 0 && url.find("https://") != 0) {
|
||||||
url = "http://" + url;
|
url = "http://" + url;
|
||||||
}
|
}
|
||||||
|
|
||||||
// set password / api key
|
// set password / api key
|
||||||
if (dynamic_cast<const ConfigOptionEnum<AuthorizationType>*>(dpc.option("printhost_authorization_type"))->value == AuthorizationType::atKeyPassword) {
|
if (dynamic_cast<const ConfigOptionEnum<AuthorizationType>*>(dpc->option("printhost_authorization_type"))->value == AuthorizationType::atKeyPassword) {
|
||||||
mainframe->set_printer_webview_api_key(dpc.opt_string("printhost_apikey"));
|
mainframe->set_printer_webview_api_key(dpc->opt_string("printhost_apikey"));
|
||||||
}
|
}
|
||||||
#if 0 // The user password authentication is not working in prusa link as of now.
|
#if 0 // The user password authentication is not working in prusa link as of now.
|
||||||
else {
|
else {
|
||||||
mainframe->set_printer_webview_credentials(dpc.opt_string("printhost_user"), dpc.opt_string("printhost_password"));
|
mainframe->set_printer_webview_credentials(dpc->opt_string("printhost_user"), dpc->opt_string("printhost_password"));
|
||||||
}
|
}
|
||||||
#endif // 0
|
#endif // 0
|
||||||
// add printer or change url
|
// add printer or change url
|
||||||
|
@ -412,7 +412,7 @@ public:
|
|||||||
void request_user_logout() {}
|
void request_user_logout() {}
|
||||||
int request_user_unbind(std::string dev_id) { return 0; }
|
int request_user_unbind(std::string dev_id) { return 0; }
|
||||||
void handle_connect_request_printer_pick(std::string cmd);
|
void handle_connect_request_printer_pick(std::string cmd);
|
||||||
void show_printer_webview_tab(bool show, const DynamicPrintConfig& dpc = {});
|
void show_printer_webview_tab();
|
||||||
// return true if preset vas invisible and we have to installed it to make it selectable
|
// return true if preset vas invisible and we have to installed it to make it selectable
|
||||||
bool select_printer_from_connect(const Preset* printer_preset);
|
bool select_printer_from_connect(const Preset* printer_preset);
|
||||||
void handle_script_message(std::string msg) {}
|
void handle_script_message(std::string msg) {}
|
||||||
|
@ -718,11 +718,7 @@ void Sidebar::on_select_preset(wxCommandEvent& evt)
|
|||||||
*/
|
*/
|
||||||
m_object_list->update_object_list_by_printer_technology();
|
m_object_list->update_object_list_by_printer_technology();
|
||||||
|
|
||||||
if (combo->is_selected_physical_printer()) {
|
wxGetApp().show_printer_webview_tab();
|
||||||
wxGetApp().show_printer_webview_tab(true, wxGetApp().preset_bundle->physical_printers.get_selected_printer().config);
|
|
||||||
} else {
|
|
||||||
wxGetApp().show_printer_webview_tab(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
|
Loading…
x
Reference in New Issue
Block a user