ENH:dynamically check the installation of the farm software.
jira:[none] Change-Id: I2c0d52498c067b9494ffc2b75b0f4390e2851e0c (cherry picked from commit 56f2c39acb3cdab5481c557c2e981f72284d9a62)
This commit is contained in:
parent
baabcdd654
commit
86dd85f90f
|
@ -1907,19 +1907,6 @@ wxBoxSizer* MainFrame::create_side_tools()
|
|||
p->Dismiss();
|
||||
});
|
||||
|
||||
#if !BBL_RELEASE_TO_PUBLIC
|
||||
SideButton *send_to_multi_app_btn = new SideButton(p, _L("Send to Bambu Farm Manager Client"), "");
|
||||
send_to_multi_app_btn->SetCornerRadius(0);
|
||||
send_to_multi_app_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent &) {
|
||||
m_print_btn->SetLabel(_L("Send to BFMC"));
|
||||
m_print_select = eSendMultiApp;
|
||||
m_print_enable = get_enable_print_status();
|
||||
m_print_btn->Enable(m_print_enable);
|
||||
this->Layout();
|
||||
p->Dismiss();
|
||||
});
|
||||
#endif
|
||||
|
||||
p->append_button(print_plate_btn);
|
||||
p->append_button(print_all_btn);
|
||||
p->append_button(send_to_printer_btn);
|
||||
|
@ -1927,9 +1914,23 @@ wxBoxSizer* MainFrame::create_side_tools()
|
|||
p->append_button(export_sliced_file_btn);
|
||||
p->append_button(export_all_sliced_file_btn);
|
||||
|
||||
#if !BBL_RELEASE_TO_PUBLIC
|
||||
p->append_button(send_to_multi_app_btn);
|
||||
#endif
|
||||
|
||||
if (check_bbl_farm_client_installed()) {
|
||||
SideButton *send_to_multi_app_btn = new SideButton(p, _L("Send to Bambu Farm Manager Client"), "");
|
||||
send_to_multi_app_btn->SetCornerRadius(0);
|
||||
p->append_button(send_to_multi_app_btn);
|
||||
|
||||
send_to_multi_app_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent &) {
|
||||
m_print_btn->SetLabel(_L("Send to BFMC"));
|
||||
m_print_select = eSendMultiApp;
|
||||
m_print_enable = get_enable_print_status();
|
||||
m_print_btn->Enable(m_print_enable);
|
||||
this->Layout();
|
||||
p->Dismiss();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (enable_multi_machine) {
|
||||
SideButton* print_multi_machine_btn = new SideButton(p, _L("Send to Multi-device"), "");
|
||||
print_multi_machine_btn->SetCornerRadius(0);
|
||||
|
@ -3997,6 +3998,27 @@ void MainFrame::show_sync_dialog()
|
|||
wxQueueEvent(this, evt);
|
||||
}
|
||||
|
||||
bool MainFrame::check_bbl_farm_client_installed()
|
||||
{
|
||||
#ifdef WIN32
|
||||
HKEY hKey;
|
||||
LONG result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Bambulab\\Bambu Farm Manager Client"), 0, KEY_READ, &hKey);
|
||||
LONG result_backup = RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("HKEY_CLASSES_ROOT\\bambu-farm-client\\shell\\open\\command"), 0, KEY_READ, &hKey);
|
||||
|
||||
if (result == ERROR_SUCCESS || result_backup == ERROR_SUCCESS) {
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "Bambu Farm Manager Client found.";
|
||||
RegCloseKey(hKey);
|
||||
return true;
|
||||
} else {
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "Bambu Farm Manager Client Not found.";
|
||||
return false;
|
||||
}
|
||||
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void MainFrame::update_side_preset_ui()
|
||||
{
|
||||
// select last preset
|
||||
|
|
|
@ -279,6 +279,7 @@ public:
|
|||
// Called from wxEVT_ACTIVATE, as wxEVT_CREATE was not reliable (bug in wxWidgets?).
|
||||
void register_win32_callbacks();
|
||||
void init_menubar_as_editor();
|
||||
bool check_bbl_farm_client_installed();
|
||||
void init_menubar_as_gcodeviewer();
|
||||
void update_menubar();
|
||||
// Open item in menu by menu and item name (in actual language)
|
||||
|
|
Loading…
Reference in New Issue