FIX:fixed some models with special names cannot be downloaded
Change-Id: Id5a3dff960d6e9868dfa87aef96093de2dc215e6
This commit is contained in:
parent
301d06dab4
commit
c8df45c11f
|
@ -3573,7 +3573,7 @@ void GUI_App::request_model_download(std::string url, std::string filename)
|
|||
if (!check_login()) return;
|
||||
|
||||
if (plater_) {
|
||||
plater_->request_model_download(url, filename);
|
||||
plater_->request_model_download();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -482,13 +482,21 @@ public:
|
|||
Model& model();
|
||||
NotificationManager * notification_manager();
|
||||
|
||||
|
||||
std::string m_mall_model_download_url;
|
||||
std::string m_mall_model_download_name;
|
||||
ModelMallDialog* m_mall_home_dialog{ nullptr };
|
||||
ModelMallDialog* m_mall_publish_dialog{ nullptr };
|
||||
|
||||
void set_download_model_url(std::string url) {m_mall_model_download_url = url;}
|
||||
void set_download_model_name(std::string name) {m_mall_model_download_name = name;}
|
||||
std::string get_download_model_url() {return m_mall_model_download_url;}
|
||||
std::string get_download_model_name() {return m_mall_model_download_name;}
|
||||
|
||||
void load_url(wxString url);
|
||||
void open_mall_page_dialog();
|
||||
void open_publish_page_dialog();
|
||||
void remove_mall_system_dialog();
|
||||
void remove_mall_system_dialog();
|
||||
void run_script(wxString js);
|
||||
bool is_adding_script_handler() { return m_adding_script_handler; }
|
||||
void set_adding_script_handler(bool status) { m_adding_script_handler = status; }
|
||||
|
|
|
@ -147,7 +147,10 @@ namespace GUI {
|
|||
filename = j["data"]["filename"].get<std::string>();
|
||||
|
||||
if (download_url.empty()) return;
|
||||
wxGetApp().plater()->request_model_download(download_url, filename);
|
||||
|
||||
wxGetApp().set_download_model_url(download_url);
|
||||
wxGetApp().set_download_model_name(filename);
|
||||
wxGetApp().plater()->request_model_download();
|
||||
}
|
||||
else if(strCmd == "request_close_publish_window") {
|
||||
this->Hide();
|
||||
|
|
|
@ -7597,15 +7597,15 @@ int Plater::save_project(bool saveAs)
|
|||
//BBS import model by model id
|
||||
void Plater::import_model_id(const std::string& download_info)
|
||||
{
|
||||
std::string download_url = "";
|
||||
std::string filename = "";
|
||||
std::string download_url = wxGetApp().get_download_model_url();
|
||||
std::string filename = wxGetApp().get_download_model_name();
|
||||
|
||||
auto selection_data_arr = wxSplit(download_info, '|');
|
||||
/* auto selection_data_arr = wxSplit(download_info, '|');
|
||||
|
||||
if (selection_data_arr.size() == 2) {
|
||||
download_url = selection_data_arr[0].ToStdString();
|
||||
filename = selection_data_arr[1].ToStdString();
|
||||
}
|
||||
if (selection_data_arr.size() == 2) {
|
||||
download_url = selection_data_arr[0].ToStdString();
|
||||
filename = selection_data_arr[1].ToStdString();
|
||||
}*/
|
||||
|
||||
|
||||
bool download_ok = false;
|
||||
|
@ -7782,10 +7782,9 @@ void Plater::download_project(const wxString& project_id)
|
|||
return;
|
||||
}
|
||||
|
||||
void Plater::request_model_download(std::string url, std::string filename)
|
||||
void Plater::request_model_download()
|
||||
{
|
||||
wxCommandEvent* event = new wxCommandEvent(EVT_IMPORT_MODEL_ID);
|
||||
event->SetString(wxString::Format("%s|%s", wxString(url), wxString(filename)));
|
||||
wxQueueEvent(this, event);
|
||||
}
|
||||
|
||||
|
|
|
@ -211,7 +211,7 @@ public:
|
|||
//BBS download project by project id
|
||||
void import_model_id(const std::string& download_info);
|
||||
void download_project(const wxString& project_id);
|
||||
void request_model_download(std::string url, std::string filename);
|
||||
void request_model_download();
|
||||
void request_download_project(std::string project_id);
|
||||
// BBS: check snapshot
|
||||
bool up_to_date(bool saved, bool backup);
|
||||
|
|
Loading…
Reference in New Issue