Skip to content

Commit

Permalink
misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SoftFever committed Aug 27, 2023
1 parent c3d9ace commit 012f113
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 15 deletions.
5 changes: 4 additions & 1 deletion src/libslic3r/PresetBundle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,10 @@ VendorType PresetBundle::get_current_vendor_type()
}
}
if (!vendor_name.empty())
t = vendor_name.compare("BBL") == 0 ? VendorType::Unknown : VendorType::Marlin_BBL;
{
if(vendor_name.compare("BBL") == 0)
t = VendorType::Marlin_BBL;
}
return t;
}

Expand Down
25 changes: 15 additions & 10 deletions src/slic3r/GUI/MainFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1080,27 +1080,32 @@ void MainFrame::init_tabpanel() {
}
}

// SoftFever
// SoftFever
void MainFrame::show_device(bool bBBLPrinter) {
if (m_tabpanel->GetPage(3) != m_monitor &&
m_tabpanel->GetPage(3) != m_printer_view) {
if (m_tabpanel->GetPage(tpMonitor) != m_monitor &&
m_tabpanel->GetPage(tpMonitor) != m_printer_view) {
BOOST_LOG_TRIVIAL(error) << "Failed to find device tab";
return;
}
if (bBBLPrinter) {
if (m_tabpanel->GetPage(3) != m_monitor) {
m_tabpanel->RemovePage(3);
m_tabpanel->InsertPage(3, m_monitor, _L("Device"),
if (m_tabpanel->GetPage(tpMonitor) != m_monitor) {
m_printer_view->Hide();
m_monitor->Show(true);
m_tabpanel->RemovePage(tpMonitor);
m_tabpanel->InsertPage(tpMonitor, m_monitor, _L("Device"),
std::string("tab_monitor_active"),
std::string("tab_monitor_active"));
m_tabpanel->SetSelection(tp3DEditor);
}
} else {
if (m_tabpanel->GetPage(3) != m_printer_view) {
m_tabpanel->RemovePage(3);
m_tabpanel->InsertPage(3, m_printer_view, _L("Device"),
if (m_tabpanel->GetPage(tpMonitor) != m_printer_view) {
m_printer_view->Show();
m_monitor->Show(false);
m_tabpanel->RemovePage(tpMonitor);
m_tabpanel->InsertPage(tpMonitor, m_printer_view, _L("Device"),
std::string("tab_monitor_active"),
std::string("tab_monitor_active"));
m_printer_view->Show();
m_tabpanel->SetSelection(tp3DEditor);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/PlateSettingsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ PlateSettingsDialog::PlateSettingsDialog(wxWindow* parent, wxWindowID id, const
m_bed_type_choice->Append(to_bed_type_name(i));
}

if (wxGetApp().preset_bundle->is_bbl_vendor())
if (!wxGetApp().preset_bundle->is_bbl_vendor())
m_bed_type_choice->Disable();

wxStaticText* m_bed_type_txt = new wxStaticText(this, wxID_ANY, _L("Bed type"));
Expand Down
9 changes: 6 additions & 3 deletions src/slic3r/GUI/Plater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1028,12 +1028,13 @@ void Sidebar::update_all_preset_comboboxes()
PresetBundle &preset_bundle = *wxGetApp().preset_bundle;
const auto print_tech = preset_bundle.printers.get_edited_preset().printer_technology();

bool is_bbl_preset = preset_bundle.is_bbl_vendor();
bool is_bbl_vendor = preset_bundle.is_bbl_vendor();

// Orca:: show device tab based on vendor type
auto p_mainframe = wxGetApp().mainframe;
p_mainframe->show_device(is_bbl_vendor);

p_mainframe->show_device(is_bbl_preset);
if (is_bbl_preset) {
if (is_bbl_vendor) {
//only show connection button for not-BBL printer
connection_btn->Hide();
//only show sync-ams button for BBL printer
Expand Down Expand Up @@ -1087,6 +1088,8 @@ void Sidebar::update_all_preset_comboboxes()

if (p->combo_printer)
p->combo_printer->update();

p_mainframe->m_tabpanel->SetSelection(p_mainframe->m_tabpanel->GetSelection());
}

void Sidebar::update_presets(Preset::Type preset_type)
Expand Down

0 comments on commit 012f113

Please sign in to comment.