FIX:hide publish in the Chinese region
Change-Id: I39e6d96ab6fa14f25a284a5eaf9988dd37a42b6a
This commit is contained in:
parent
b6005e957c
commit
2dbd2bcef9
7 changed files with 53 additions and 1 deletions
|
@ -254,7 +254,7 @@ void BBLTopbar::Init(wxFrame* parent)
|
||||||
m_publish_item = this->AddTool(ID_PUBLISH, "", m_publish_bitmap);
|
m_publish_item = this->AddTool(ID_PUBLISH, "", m_publish_bitmap);
|
||||||
m_publish_disable_bitmap = create_scaled_bitmap("topbar_publish_disable", nullptr, TOPBAR_ICON_SIZE);
|
m_publish_disable_bitmap = create_scaled_bitmap("topbar_publish_disable", nullptr, TOPBAR_ICON_SIZE);
|
||||||
m_publish_item->SetDisabledBitmap(m_publish_disable_bitmap);
|
m_publish_item->SetDisabledBitmap(m_publish_disable_bitmap);
|
||||||
this->EnableTool(m_publish_item->GetId(), true);
|
this->EnableTool(m_publish_item->GetId(), false);
|
||||||
this->AddSpacer(FromDIP(4));
|
this->AddSpacer(FromDIP(4));
|
||||||
|
|
||||||
/*wxBitmap model_store_bitmap = create_scaled_bitmap("topbar_store", nullptr, TOPBAR_ICON_SIZE);
|
/*wxBitmap model_store_bitmap = create_scaled_bitmap("topbar_store", nullptr, TOPBAR_ICON_SIZE);
|
||||||
|
@ -324,6 +324,12 @@ void BBLTopbar::OnOpenProject(wxAuiToolBarEvent& event)
|
||||||
plater->load_project();
|
plater->load_project();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BBLTopbar::show_publish_button(bool show)
|
||||||
|
{
|
||||||
|
this->EnableTool(m_publish_item->GetId(), show);
|
||||||
|
Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
void BBLTopbar::OnSaveProject(wxAuiToolBarEvent& event)
|
void BBLTopbar::OnSaveProject(wxAuiToolBarEvent& event)
|
||||||
{
|
{
|
||||||
MainFrame* main_frame = dynamic_cast<MainFrame*>(m_frame);
|
MainFrame* main_frame = dynamic_cast<MainFrame*>(m_frame);
|
||||||
|
|
|
@ -30,6 +30,7 @@ public:
|
||||||
void OnMouseCaptureLost(wxMouseCaptureLostEvent& event);
|
void OnMouseCaptureLost(wxMouseCaptureLostEvent& event);
|
||||||
void OnMenuClose(wxMenuEvent& event);
|
void OnMenuClose(wxMenuEvent& event);
|
||||||
void OnOpenProject(wxAuiToolBarEvent& event);
|
void OnOpenProject(wxAuiToolBarEvent& event);
|
||||||
|
void show_publish_button(bool show);
|
||||||
void OnSaveProject(wxAuiToolBarEvent& event);
|
void OnSaveProject(wxAuiToolBarEvent& event);
|
||||||
void OnUndo(wxAuiToolBarEvent& event);
|
void OnUndo(wxAuiToolBarEvent& event);
|
||||||
void OnRedo(wxAuiToolBarEvent& event);
|
void OnRedo(wxAuiToolBarEvent& event);
|
||||||
|
|
|
@ -2673,6 +2673,9 @@ bool GUI_App::on_init_inner()
|
||||||
request_model_download(m_download_file_url);
|
request_model_download(m_download_file_url);
|
||||||
m_download_file_url = "";
|
m_download_file_url = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
update_publish_status();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -2911,6 +2914,24 @@ void GUI_App::update_label_colours_from_appconfig()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GUI_App::update_publish_status()
|
||||||
|
{
|
||||||
|
if (app_config->get_country_code() == "CN") {
|
||||||
|
#ifdef __WINDOWS__
|
||||||
|
mainframe->m_topbar->show_publish_button(false);
|
||||||
|
#else
|
||||||
|
mainframe->show_publish_button(false);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
#ifdef __WINDOWS__
|
||||||
|
mainframe->m_topbar->show_publish_button(true);
|
||||||
|
#else
|
||||||
|
mainframe->show_publish_button(true);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GUI_App::update_label_colours()
|
void GUI_App::update_label_colours()
|
||||||
{
|
{
|
||||||
for (Tab* tab : tabs_list)
|
for (Tab* tab : tabs_list)
|
||||||
|
@ -3279,6 +3300,9 @@ void GUI_App::recreate_GUI(const wxString& msg_name)
|
||||||
// config_wizard_startup(true);
|
// config_wizard_startup(true);
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
update_publish_status();
|
||||||
|
|
||||||
m_is_recreating_gui = false;
|
m_is_recreating_gui = false;
|
||||||
|
|
||||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "recreate_GUI exit";
|
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "recreate_GUI exit";
|
||||||
|
|
|
@ -332,6 +332,7 @@ public:
|
||||||
const wxColour get_label_default_clr_modified();
|
const wxColour get_label_default_clr_modified();
|
||||||
void init_label_colours();
|
void init_label_colours();
|
||||||
void update_label_colours_from_appconfig();
|
void update_label_colours_from_appconfig();
|
||||||
|
void update_publish_status();
|
||||||
void update_label_colours();
|
void update_label_colours();
|
||||||
// update color mode for window
|
// update color mode for window
|
||||||
void UpdateDarkUI(wxWindow *window, bool highlited = false, bool just_font = false);
|
void UpdateDarkUI(wxWindow *window, bool highlited = false, bool just_font = false);
|
||||||
|
|
|
@ -846,6 +846,23 @@ void MainFrame::update_title()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainFrame::show_publish_button(bool show)
|
||||||
|
{
|
||||||
|
if (!m_menubar) return;
|
||||||
|
|
||||||
|
wxMenu* menu = m_menubar->GetMenu(3);
|
||||||
|
auto title = menu->GetTitle();
|
||||||
|
|
||||||
|
if (show) {
|
||||||
|
if (title != wxString::Format("&%s", _L("3D Models"))) {
|
||||||
|
m_menubar->Insert(3, publishMenu, wxString::Format("&%s", _L("3D Models")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
m_menubar->Remove(3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MainFrame::update_title_colour_after_set_title()
|
void MainFrame::update_title_colour_after_set_title()
|
||||||
{
|
{
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
|
|
@ -246,6 +246,8 @@ public:
|
||||||
void update_title();
|
void update_title();
|
||||||
void set_max_recent_count(int max);
|
void set_max_recent_count(int max);
|
||||||
|
|
||||||
|
void show_publish_button(bool show);
|
||||||
|
|
||||||
void update_title_colour_after_set_title();
|
void update_title_colour_after_set_title();
|
||||||
void show_option(bool show);
|
void show_option(bool show);
|
||||||
void init_tabpanel();
|
void init_tabpanel();
|
||||||
|
|
|
@ -280,6 +280,7 @@ wxBoxSizer *PreferencesDialog::create_item_region_combobox(wxString title, wxWin
|
||||||
config->set("region", region.ToStdString());
|
config->set("region", region.ToStdString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxGetApp().update_publish_status();
|
||||||
e.Skip();
|
e.Skip();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue