mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-09-28 19:53:14 +08:00
FIX: something
1. split translate filament_extruder_variant 2. printer sync icon dark mode 3. translate Extruder 1/2 to Left/Right Extruder 4. parse error code from get_camera_url 5. smaller printer bed image Jira: STUDIO-8542, STUDIO-9056, STUDIO-7681, STUDIO-9487 Change-Id: I8a10fbe4e6d17e7a3e35e8846e3d964084d07f50 (cherry picked from commit 626256beb6fb8a90a99578b5208cb588ead5dd80)
This commit is contained in:
parent
268090da5c
commit
9c81c2cf5e
@ -525,7 +525,13 @@ void MediaFilePanel::fetchUrl(boost::weak_ptr<PrinterFileSystem> wfs)
|
||||
fs->SetUrl(url);
|
||||
} else {
|
||||
m_image_grid->SetStatus(m_bmp_failed, _L("Connection Failed. Please check the network and try again"));
|
||||
fs->SetUrl("3");
|
||||
std::string res = "3";
|
||||
if (boost::ends_with(url, "]")) {
|
||||
size_t n = url.find_last_of('[');
|
||||
if (n != std::string::npos)
|
||||
res = url.substr(n + 1, url.length() - n - 2);
|
||||
}
|
||||
fs->SetUrl(res);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -373,6 +373,11 @@ void MediaPlayCtrl::Play()
|
||||
if (m_last_state == MEDIASTATE_INITIALIZING) {
|
||||
if (url.empty() || !boost::algorithm::starts_with(url, "bambu:///")) {
|
||||
m_failed_code = 3;
|
||||
if (boost::ends_with(url, "]")) {
|
||||
size_t n = url.find_last_of('[');
|
||||
if (n != std::string::npos)
|
||||
m_failed_code = std::atoi(url.substr(n + 1, url.length() - n - 2).c_str());
|
||||
}
|
||||
Stop(_L("Connection Failed. Please check the network and try again"), from_u8(url));
|
||||
} else {
|
||||
m_url = url;
|
||||
|
@ -1323,6 +1323,7 @@ void Sidebar::priv::update_sync_status(const MachineObject *obj)
|
||||
}
|
||||
|
||||
#define PRINTER_THUMBNAIL_SIZE (wxSize(FromDIP(48), FromDIP(48)))
|
||||
#define PRINTER_THUMBNAIL_SIZE_SMALL (wxSize(FromDIP(32), FromDIP(32)))
|
||||
#define PRINTER_PANEL_SIZE_SMALL (wxSize(FromDIP(98), FromDIP(68)))
|
||||
#define PRINTER_PANEL_SIZE (wxSize(FromDIP(98), FromDIP(98)))
|
||||
|
||||
@ -1480,8 +1481,8 @@ Sidebar::Sidebar(Plater *parent)
|
||||
wxLaunchDefaultBrowser("https://wiki.bambulab.com/en/x1/manual/compatibility-and-parameter-settings-of-filaments");
|
||||
});
|
||||
|
||||
ScalableBitmap bitmap_bed(p->panel_printer_bed, "printer_placeholder", 48);
|
||||
p->image_printer_bed = new wxStaticBitmap(p->panel_printer_bed, wxID_ANY, bitmap_bed.bmp(), wxDefaultPosition, PRINTER_THUMBNAIL_SIZE, 0);
|
||||
ScalableBitmap bitmap_bed(p->panel_printer_bed, "printer_placeholder", 32);
|
||||
p->image_printer_bed = new wxStaticBitmap(p->panel_printer_bed, wxID_ANY, bitmap_bed.bmp(), wxDefaultPosition, PRINTER_THUMBNAIL_SIZE_SMALL, 0);
|
||||
|
||||
p->combo_printer_bed = new ComboBox(p->panel_printer_bed, wxID_ANY, wxString(""), wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY | wxALIGN_CENTER_HORIZONTAL);
|
||||
p->combo_printer_bed->SetBorderWidth(0);
|
||||
@ -1495,7 +1496,7 @@ Sidebar::Sidebar(Plater *parent)
|
||||
|
||||
p->combo_printer_bed->Bind(wxEVT_COMBOBOX, [this](auto &e) {
|
||||
int selection = p->combo_printer_bed->GetSelection();
|
||||
p->image_printer_bed->SetBitmap(create_scaled_bitmap(bed_type_thumbnails[BedType(selection + 1)], this, 48));
|
||||
p->image_printer_bed->SetBitmap(create_scaled_bitmap(bed_type_thumbnails[BedType(selection + 1)], this, 32));
|
||||
e.Skip();//fix bug:Event spreads to sidebar
|
||||
});
|
||||
|
||||
@ -1516,8 +1517,8 @@ Sidebar::Sidebar(Plater *parent)
|
||||
bed_type_hsizer->Add(bed_type_hsizer2, 1);
|
||||
bed_type_hsizer->Add(p->image_printer_bed, 0);
|
||||
bed_type_hsizer->AddStretchSpacer(1);
|
||||
bed_type_sizer->Add(bed_type_hsizer, 0, wxALIGN_CENTER | wxLEFT | wxTOP | wxRIGHT, FromDIP(4));
|
||||
bed_type_sizer->Add(p->combo_printer_bed, 0, wxEXPAND | wxALL, FromDIP(4));
|
||||
bed_type_sizer->Add(bed_type_hsizer, 0, wxALIGN_CENTER | wxLEFT | wxTOP | wxRIGHT, FromDIP(2));
|
||||
bed_type_sizer->Add(p->combo_printer_bed, 0, wxEXPAND | wxALL, FromDIP(2));
|
||||
bed_type_sizer->AddStretchSpacer(1);
|
||||
p->panel_printer_bed->SetSizer(bed_type_sizer);
|
||||
|
||||
@ -2288,6 +2289,8 @@ void Sidebar::msw_rescale()
|
||||
->SetMinSize(-1, 3 * wxGetApp().em_unit());
|
||||
p->m_printer_icon->msw_rescale();
|
||||
p->m_printer_setting->msw_rescale();
|
||||
p->image_printer->SetSize(PRINTER_THUMBNAIL_SIZE);
|
||||
p->image_printer_bed->SetSize(PRINTER_THUMBNAIL_SIZE_SMALL);
|
||||
p->m_filament_icon->msw_rescale();
|
||||
p->m_bpButton_add_filament->msw_rescale();
|
||||
p->m_bpButton_del_filament->msw_rescale();
|
||||
@ -2360,7 +2363,8 @@ void Sidebar::sys_color_changed()
|
||||
for (wxWindow* win : std::vector<wxWindow*>{ p->scrolled, p->presets_panel })
|
||||
wxGetApp().UpdateAllStaticTextDarkUI(win);
|
||||
#endif
|
||||
//for (wxWindow* btn : std::vector<wxWindow*>{ p->btn_reslice, p->btn_export_gcode })
|
||||
p->btn_sync_printer->SetIcon("ams_nozzle_sync");
|
||||
// for (wxWindow* btn : std::vector<wxWindow*>{ p->btn_reslice, p->btn_export_gcode })
|
||||
// wxGetApp().UpdateDarkUI(btn, true);
|
||||
p->m_printer_icon->msw_rescale();
|
||||
p->m_printer_setting->msw_rescale();
|
||||
|
@ -642,6 +642,8 @@ Slic3r::GUI::PageShp Tab::add_options_page(const wxString& title, const std::str
|
||||
wxString Tab::translate_category(const wxString& title, Preset::Type preset_type)
|
||||
{
|
||||
if (preset_type == Preset::TYPE_PRINTER && title.Contains("Extruder ")) {
|
||||
if (title == "Extruder 1") return _("Left Extruder");
|
||||
if (title == "Extruder 2") return _("Right Extruder");
|
||||
return _("Extruder") + title.SubString(8, title.Last());
|
||||
}
|
||||
return _(title);
|
||||
@ -6009,9 +6011,15 @@ void Tab::update_extruder_variants(int extruder_id, bool reload)
|
||||
auto variants = m_config->option<ConfigOptionStrings>("filament_extruder_variant");
|
||||
int n = m_variant_combo->GetSelection();
|
||||
m_variant_combo->Clear();
|
||||
for (auto & v : variants->values)
|
||||
m_variant_combo->Append(_L(v));
|
||||
m_variant_combo->SetSelection(n < 0 || n >= m_variant_combo->GetCount() ? 0 : n);
|
||||
for (auto &v : variants->values) {
|
||||
int n = v.find("Drive ");
|
||||
if (n != std::string::npos)
|
||||
m_variant_combo->Append(_L(v.substr(0, n + 5)) + " " + _L(v.substr(n + 6)));
|
||||
else
|
||||
m_variant_combo->Append(_L(v));
|
||||
}
|
||||
m_variant_combo->SetSelection(n < 0 || (unsigned int)n >= m_variant_combo->GetCount() ? 0 : n);
|
||||
m_variant_combo->Enable(m_variant_combo->GetCount() > 1);
|
||||
}
|
||||
switch_excluder(extruder_id, reload);
|
||||
if (m_variant_sizer) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user