mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 23:17:35 -06:00
ENH:displays the publish button based on user permissions
Change-Id: I853506fa61f1f8cf14dfeb4601c8bb5f1a0c5914
This commit is contained in:
parent
d1021e6861
commit
72b4827f85
10 changed files with 93 additions and 20 deletions
|
@ -3200,6 +3200,12 @@ void GUI_App::request_user_logout()
|
|||
GUI::wxGetApp().sidebar().load_ams_list({});
|
||||
GUI::wxGetApp().remove_user_presets();
|
||||
GUI::wxGetApp().stop_sync_user_preset();
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
wxGetApp().mainframe->topbar()->show_publish_button(false);
|
||||
#else
|
||||
wxGetApp().mainframe->show_publish_button(false);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3529,6 +3535,21 @@ void GUI_App::on_user_login(wxCommandEvent &evt)
|
|||
GUI::wxGetApp().preset_bundle->update_user_presets_directory(user_id);
|
||||
if (online_login)
|
||||
GUI::wxGetApp().mainframe->show_sync_dialog();
|
||||
|
||||
//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
|
||||
}
|
||||
}
|
||||
|
||||
bool GUI_App::is_studio_active()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue