FIX: [STUDIO-3308] check has_model_mall

Change-Id: I9b7477af12a5d59855f7ef176aac24731665c343
This commit is contained in:
chunmao.guo 2023-06-21 10:58:08 +08:00 committed by Lane.Wei
parent a20229f222
commit 82cd618c14
3 changed files with 24 additions and 8 deletions

View File

@ -1771,7 +1771,7 @@ void GUI_App::restart_networking()
start_sync_user_preset();
}
if (mainframe && this->app_config->get("staff_pick_switch") == "true") {
if (mainframe->m_webview) { mainframe->m_webview->SendDesignStaffpick(true); }
if (mainframe->m_webview) { mainframe->m_webview->SendDesignStaffpick(has_model_mall()); }
}
}
BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< boost::format(" exit, m_agent=%1%")%m_agent;
@ -2993,14 +2993,19 @@ void GUI_App::update_label_colours_from_appconfig()
void GUI_App::update_publish_status()
{
if (app_config->get_country_code() == "CN") {
mainframe->show_publish_button(false);
}
else {
mainframe->show_publish_button(true);
mainframe->show_publish_button(has_model_mall());
if (app_config->get("staff_pick_switch") == "true") {
mainframe->m_webview->SendDesignStaffpick(has_model_mall());
}
}
bool GUI_App::has_model_mall()
{
if (app_config->get_country_code() == "CN")
return false;
return true;
}
void GUI_App::update_label_colours()
{
for (Tab* tab : tabs_list)

View File

@ -338,6 +338,7 @@ public:
void init_label_colours();
void update_label_colours_from_appconfig();
void update_publish_status();
bool has_model_mall();
void update_label_colours();
// update color mode for window
void UpdateDarkUI(wxWindow *window, bool highlited = false, bool just_font = false);

View File

@ -1020,8 +1020,18 @@ wxWindow* PreferencesDialog::create_general_page()
sizer_page->Add(item_associate_stl, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_associate_step, 0, wxTOP, FromDIP(3));
#endif // _WIN32
sizer_page->Add(title_modelmall, 0, wxTOP | wxEXPAND, FromDIP(20));
sizer_page->Add(item_modelmall, 0, wxTOP, FromDIP(3));
auto item_title_modelmall = sizer_page->Add(title_modelmall, 0, wxTOP | wxEXPAND, FromDIP(20));
auto item_item_modelmall = sizer_page->Add(item_modelmall, 0, wxTOP, FromDIP(3));
auto update_modelmall = [this, item_title_modelmall, item_item_modelmall] (wxEvent & e) {
bool has_model_mall = wxGetApp().has_model_mall();
item_title_modelmall->Show(has_model_mall);
item_item_modelmall->Show(has_model_mall);
Layout();
Fit();
};
wxCommandEvent eee(wxEVT_COMBOBOX);
update_modelmall(eee);
item_region->GetItem(size_t(2))->GetWindow()->Bind(wxEVT_COMBOBOX, update_modelmall);
sizer_page->Add(title_project, 0, wxTOP| wxEXPAND, FromDIP(20));
sizer_page->Add(item_max_recent_count, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_save_choise, 0, wxTOP, FromDIP(3));