mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 13:25:56 +08:00
Store avatar png in temp folder
This commit is contained in:
parent
e9706f4032
commit
af97422ea9
@ -951,7 +951,8 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
|
||||
}
|
||||
});
|
||||
this->q->Bind(EVT_UA_AVATAR_SUCCESS, [this](UserAccountSuccessEvent& evt) {
|
||||
boost::filesystem::path png_path = boost::filesystem::path(Slic3r::data_dir()) / "cache" / "avatar.png";
|
||||
const std::string filename = "prusaslicer-avatar-" + wxGetApp().get_instance_hash_string() + ".png";
|
||||
const boost::filesystem::path png_path = boost::filesystem::path(wxStandardPaths::Get().GetTempDir().utf8_str().data()) / filename;
|
||||
FILE* file;
|
||||
file = fopen(png_path.string().c_str(), "wb");
|
||||
fwrite(evt.data.c_str(), 1, evt.data.size(), file);
|
||||
|
@ -202,7 +202,8 @@ void TopBarItemsCtrl::UpdateAccountMenu(bool avatar/* = false*/)
|
||||
m_account_btn->SetLabel(user_name);
|
||||
if (avatar) {
|
||||
if (user_account->is_logged()) {
|
||||
boost::filesystem::path path = boost::filesystem::path(boost::filesystem::path(Slic3r::data_dir()) / "cache" / "avatar.png");
|
||||
const std::string filename = "prusaslicer-avatar-" + wxGetApp().get_instance_hash_string() + ".png";
|
||||
boost::filesystem::path path = boost::filesystem::path(wxStandardPaths::Get().GetTempDir().utf8_str().data()) / filename;
|
||||
ScalableBitmap new_logo(this, path, m_account_btn->GetBitmapSize());
|
||||
if (new_logo.IsOk())
|
||||
m_account_btn->SetBitmap_(new_logo);
|
||||
|
Loading…
x
Reference in New Issue
Block a user