ENH: refine model uploading logics
1. change the url of product env to makerworld 2. always show the uploading button without checking permission Signed-off-by: yifan.wu <yifan.wu@bambulab.com> Change-Id: I666042a216d1a4aca69e2a50d430532f722d9b00 (cherry picked from commit 94daddc0aa593778fbf4a9d44d92a68883292a7f)
This commit is contained in:
parent
693af0c98f
commit
bd2df4801a
|
@ -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(), false);
|
this->EnableTool(m_publish_item->GetId(), true);
|
||||||
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);
|
||||||
|
@ -317,12 +317,6 @@ BBLTopbar::~BBLTopbar()
|
||||||
m_file_menu = nullptr;
|
m_file_menu = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BBLTopbar::show_publish_button(bool show)
|
|
||||||
{
|
|
||||||
this->EnableTool(m_publish_item->GetId(), show);
|
|
||||||
Refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
void BBLTopbar::OnOpenProject(wxAuiToolBarEvent& event)
|
void BBLTopbar::OnOpenProject(wxAuiToolBarEvent& event)
|
||||||
{
|
{
|
||||||
MainFrame* main_frame = dynamic_cast<MainFrame*>(m_frame);
|
MainFrame* main_frame = dynamic_cast<MainFrame*>(m_frame);
|
||||||
|
|
|
@ -16,7 +16,6 @@ public:
|
||||||
BBLTopbar(wxFrame* parent);
|
BBLTopbar(wxFrame* parent);
|
||||||
void Init(wxFrame *parent);
|
void Init(wxFrame *parent);
|
||||||
~BBLTopbar();
|
~BBLTopbar();
|
||||||
void show_publish_button(bool show);
|
|
||||||
void UpdateToolbarWidth(int width);
|
void UpdateToolbarWidth(int width);
|
||||||
void Rescale();
|
void Rescale();
|
||||||
void OnIconize(wxAuiToolBarEvent& event);
|
void OnIconize(wxAuiToolBarEvent& event);
|
||||||
|
|
|
@ -1383,10 +1383,10 @@ std::string GUI_App::get_model_http_url(std::string country_code)
|
||||||
{
|
{
|
||||||
std::string url;
|
std::string url;
|
||||||
if (country_code == "US") {
|
if (country_code == "US") {
|
||||||
url = "https://makerhub.bambu-lab.com/";
|
url = "https://makerworld.com/";
|
||||||
}
|
}
|
||||||
else if (country_code == "CN") {
|
else if (country_code == "CN") {
|
||||||
url = "https://makerhub.bambu-lab.com/zh/";
|
url = "https://makerworld.com/";
|
||||||
}
|
}
|
||||||
else if (country_code == "ENV_CN_DEV") {
|
else if (country_code == "ENV_CN_DEV") {
|
||||||
url = "https://makerhub-dev.bambu-lab.com/";
|
url = "https://makerhub-dev.bambu-lab.com/";
|
||||||
|
@ -3279,21 +3279,6 @@ void GUI_App::recreate_GUI(const wxString& msg_name)
|
||||||
// config_wizard_startup(true);
|
// config_wizard_startup(true);
|
||||||
// });
|
// });
|
||||||
|
|
||||||
//show publish button
|
|
||||||
if (m_agent && m_agent->is_user_login() && mainframe) {
|
|
||||||
int identifier;
|
|
||||||
int result = m_agent->get_user_info(&identifier);
|
|
||||||
auto publish_identifier = identifier & 1;
|
|
||||||
|
|
||||||
#ifdef __WINDOWS__
|
|
||||||
if (result == 0 && publish_identifier >= 0) {
|
|
||||||
mainframe->m_topbar->show_publish_button(publish_identifier == 0 ? false : true);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
mainframe->show_publish_button(publish_identifier == 0 ? false : true);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
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";
|
||||||
|
@ -3621,12 +3606,6 @@ void GUI_App::request_user_logout()
|
||||||
m_device_manager->clean_user_info();
|
m_device_manager->clean_user_info();
|
||||||
GUI::wxGetApp().sidebar().load_ams_list({}, {});
|
GUI::wxGetApp().sidebar().load_ams_list({}, {});
|
||||||
GUI::wxGetApp().stop_sync_user_preset();
|
GUI::wxGetApp().stop_sync_user_preset();
|
||||||
|
|
||||||
#ifdef __WINDOWS__
|
|
||||||
wxGetApp().mainframe->topbar()->show_publish_button(false);
|
|
||||||
#else
|
|
||||||
wxGetApp().mainframe->show_publish_button(false);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3971,20 +3950,6 @@ void GUI_App::on_user_login_handle(wxCommandEvent &evt)
|
||||||
} else {
|
} else {
|
||||||
enable_user_preset_folder(false);
|
enable_user_preset_folder(false);
|
||||||
}
|
}
|
||||||
//show publish button
|
|
||||||
if (m_agent->is_user_login() && mainframe) {
|
|
||||||
int identifier;
|
|
||||||
int result = m_agent->get_user_info(&identifier);
|
|
||||||
auto publish_identifier = identifier & 1;
|
|
||||||
|
|
||||||
#ifdef __WINDOWS__
|
|
||||||
if (result == 0 && publish_identifier >= 0) {
|
|
||||||
mainframe->m_topbar->show_publish_button(publish_identifier == 0 ? false : true);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
mainframe->show_publish_button(publish_identifier == 0 ? false : true);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GUI_App::check_track_enable()
|
void GUI_App::check_track_enable()
|
||||||
|
@ -5729,6 +5694,7 @@ void GUI_App::open_publish_page_dialog()
|
||||||
wxString language_code = this->current_language_code().BeforeFirst('_');
|
wxString language_code = this->current_language_code().BeforeFirst('_');
|
||||||
model_url += (language_code.ToStdString() + "/my/models/publish");
|
model_url += (language_code.ToStdString() + "/my/models/publish");
|
||||||
|
|
||||||
|
#if 0
|
||||||
if (getAgent() && mainframe) {
|
if (getAgent() && mainframe) {
|
||||||
|
|
||||||
//login already
|
//login already
|
||||||
|
@ -5741,6 +5707,7 @@ void GUI_App::open_publish_page_dialog()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
link_url = host_url + model_url;
|
link_url = host_url + model_url;
|
||||||
|
|
|
@ -2573,18 +2573,6 @@ void MainFrame::init_menubar_as_editor()
|
||||||
#endif // __APPLE__
|
#endif // __APPLE__
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainFrame::show_publish_button(bool show)
|
|
||||||
{
|
|
||||||
if (!m_menubar) return;
|
|
||||||
|
|
||||||
if (show){
|
|
||||||
m_menubar->Insert(4, publishMenu, wxString::Format("&%s", _L("3D Models")));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
m_menubar->Remove(4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainFrame::set_max_recent_count(int max)
|
void MainFrame::set_max_recent_count(int max)
|
||||||
{
|
{
|
||||||
max = max < 0 ? 0 : max > 10000 ? 10000 : max;
|
max = max < 0 ? 0 : max > 10000 ? 10000 : max;
|
||||||
|
|
|
@ -244,7 +244,6 @@ public:
|
||||||
BBLTopbar* topbar() { return m_topbar; }
|
BBLTopbar* topbar() { return m_topbar; }
|
||||||
|
|
||||||
void update_title();
|
void update_title();
|
||||||
void show_publish_button(bool show);
|
|
||||||
void set_max_recent_count(int max);
|
void set_max_recent_count(int max);
|
||||||
|
|
||||||
void update_title_colour_after_set_title();
|
void update_title_colour_after_set_title();
|
||||||
|
|
Loading…
Reference in New Issue