mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-01-30 23:48:44 +03:00
fix some bug
This commit is contained in:
@@ -261,6 +261,10 @@ void AppConfig::set_defaults()
|
||||
if (get("old_settings_layout_mode").empty())
|
||||
set("old_settings_layout_mode", "1");
|
||||
|
||||
//y16
|
||||
if(get("switch to device tab after upload").empty())
|
||||
set("switch to device tab after upload", "0");
|
||||
|
||||
// Remove legacy window positions/sizes
|
||||
erase("", "main_frame_maximized");
|
||||
erase("", "main_frame_pos");
|
||||
|
||||
@@ -2065,7 +2065,7 @@ void PrintConfigDef::init_fff_params()
|
||||
def = this->add("ironing_pattern", coEnum);
|
||||
def->label = L("Ironing Pattern");
|
||||
def->category = L("Ironing");
|
||||
def->tooltip = L("Ironing Type");
|
||||
def->tooltip = L("Ironing Pattern");
|
||||
def->set_enum<InfillPattern>({
|
||||
{ "rectilinear", L("Rectilinear") },
|
||||
{ "concentric", L("Concentric") }
|
||||
|
||||
@@ -149,5 +149,10 @@
|
||||
<key>ASAN_OPTIONS</key>
|
||||
<string>detect_container_overflow=0</string>
|
||||
</dict>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -560,7 +560,7 @@ bool GLGizmoEmboss::init_create(ModelVolumeType volume_type)
|
||||
m_text_lines.reset(); // remove not current text lines
|
||||
|
||||
// set default text
|
||||
m_text = _u8L("Embossed text");
|
||||
m_text = "Embossed text";
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -601,7 +601,8 @@ void MainFrame::update_title()
|
||||
|
||||
title += wxString(build_id);
|
||||
if (wxGetApp().is_editor())
|
||||
title += (" " + _L("based on Slic3r"));
|
||||
//B8
|
||||
title += (" ");
|
||||
|
||||
SetTitle(title);
|
||||
}
|
||||
@@ -720,12 +721,24 @@ void MainFrame::init_tabpanel()
|
||||
tab->OnActivate();
|
||||
m_last_selected_tab = m_tabpanel->GetSelection();
|
||||
select_tab(tab);
|
||||
//} else if (m_tabpanel->GetSelection() != 0) {
|
||||
// m_last_selected_tab = m_tabpanel->GetSelection();
|
||||
}
|
||||
//y17
|
||||
else if (m_tabpanel->GetSelection() != 0) {
|
||||
m_last_selected_tab = m_tabpanel->GetSelection();
|
||||
}
|
||||
}
|
||||
else if (current_selected_tab == 4 || current_selected_tab == 5)
|
||||
else if (m_layout == ESettingsLayout::Dlg) {
|
||||
current_selected_tab += 1;
|
||||
select_tab(current_selected_tab);
|
||||
m_last_selected_tab = current_selected_tab - 1;
|
||||
}
|
||||
else if (current_selected_tab == 4 || current_selected_tab == 5)
|
||||
{
|
||||
select_tab(current_selected_tab);
|
||||
m_last_selected_tab = current_selected_tab;
|
||||
}
|
||||
//y17
|
||||
|
||||
else
|
||||
select_tab(size_t(0)); // select Plater
|
||||
});
|
||||
@@ -858,7 +871,8 @@ void MainFrame::create_preset_tabs()
|
||||
// new created tabs have to be hidden by default
|
||||
m_connect_webview->Hide();
|
||||
m_printer_webview->Hide();
|
||||
|
||||
//y17
|
||||
select_tab(size_t(0));
|
||||
}
|
||||
|
||||
void MainFrame::add_connect_webview_tab()
|
||||
@@ -1617,6 +1631,7 @@ void MainFrame::init_menubar_as_editor()
|
||||
[this/*, tab_offset*/](wxCommandEvent&) { select_tab(3); }, "printer", nullptr,
|
||||
[]() {return true; }, this);
|
||||
m_changeable_menu_items.push_back(item_printer_tab);
|
||||
//y
|
||||
wxMenuItem* item_device_tab = append_menu_item(windowMenu, wxID_HIGHEST + 5, _L("Device Page") + "\tCtrl+5", _L("Show the Device page"),
|
||||
[this/*, tab_offset*/](wxCommandEvent&) { select_tab(4); }, "tab_monitor_active", nullptr,
|
||||
[]() {return true; }, this);
|
||||
@@ -1625,8 +1640,10 @@ void MainFrame::init_menubar_as_editor()
|
||||
[this/*, tab_offset*/](wxCommandEvent&) { select_tab(5); }, "userguide", nullptr,
|
||||
[]() {return true; }, this);
|
||||
m_changeable_menu_items.push_back(item_guide_tab);
|
||||
|
||||
if (m_plater) {
|
||||
windowMenu->AppendSeparator();
|
||||
//y
|
||||
append_menu_item(windowMenu, wxID_HIGHEST + 7, _L("3&D") + "\tCtrl+7", _L("Show the 3D editing view"),
|
||||
[this](wxCommandEvent&) { m_plater->select_view_3D("3D"); }, "editor_menu", nullptr,
|
||||
[this](){return can_change_view(); }, this);
|
||||
|
||||
@@ -1164,7 +1164,7 @@ wxString OptionsGroup::get_url(const std::string& path_end)
|
||||
wxString language = wxGetApp().current_language_code_safe();
|
||||
wxString lang_marker = language.IsEmpty() ? "en" : language.BeforeFirst('_');
|
||||
|
||||
return wxString("https://wiki.qidi3d.com/") + lang_marker + wxString("/article/" + path_end);
|
||||
return wxString("https://wiki.qidi3d.com/") + lang_marker + wxString("/software/qidi-slicer/" + path_end);
|
||||
}
|
||||
|
||||
bool OptionsGroup::launch_browser(const std::string& path_end)
|
||||
|
||||
@@ -3712,13 +3712,17 @@ void Plater::priv::show_action_buttons(const bool ready_to_slice_) const
|
||||
const auto print_host_opt = selected_printer_config ? selected_printer_config->option<ConfigOptionString>("print_host") : nullptr;
|
||||
const bool send_gcode_shown = print_host_opt != nullptr && !print_host_opt->value.empty();
|
||||
const bool connect_gcode_shown = print_host_opt == nullptr && can_show_upload_to_connect();
|
||||
|
||||
//y18
|
||||
const bool local_has_devices = main_frame->m_printer_view->Local_has_device();
|
||||
|
||||
//y
|
||||
#if QDT_RELEASE_TO_PUBLIC
|
||||
auto m_devices = wxGetApp().get_devices();
|
||||
const bool link_has_machine = m_devices.size() > 0;
|
||||
#else
|
||||
const bool link_has_machine = false;
|
||||
#endif
|
||||
# endif
|
||||
|
||||
// when a background processing is ON, export_btn and/or send_btn are showing
|
||||
if (get_config_bool("background_processing"))
|
||||
@@ -3726,7 +3730,8 @@ void Plater::priv::show_action_buttons(const bool ready_to_slice_) const
|
||||
RemovableDriveManager::RemovableDrivesStatus removable_media_status = wxGetApp().removable_drive_manager()->status();
|
||||
if (sidebar->show_reslice(false) |
|
||||
sidebar->show_export(true) |
|
||||
sidebar->show_send(send_gcode_shown | link_has_machine) |
|
||||
//y18
|
||||
sidebar->show_send(send_gcode_shown | link_has_machine | local_has_devices) |
|
||||
//y15
|
||||
// sidebar->show_connect(connect_gcode_shown) |
|
||||
sidebar->show_export_removable(removable_media_status.has_removable_drives))
|
||||
@@ -3739,7 +3744,8 @@ void Plater::priv::show_action_buttons(const bool ready_to_slice_) const
|
||||
removable_media_status = wxGetApp().removable_drive_manager()->status();
|
||||
if (sidebar->show_reslice(ready_to_slice) |
|
||||
sidebar->show_export(!ready_to_slice) |
|
||||
sidebar->show_send((send_gcode_shown | link_has_machine) && !ready_to_slice) |
|
||||
//y18
|
||||
sidebar->show_send((send_gcode_shown | link_has_machine | local_has_devices) && !ready_to_slice) |
|
||||
//y15
|
||||
// sidebar->show_connect(connect_gcode_shown && !ready_to_slice) |
|
||||
sidebar->show_export_removable(!ready_to_slice && removable_media_status.has_removable_drives))
|
||||
@@ -4312,7 +4318,8 @@ void Plater::calib_pa_line(const double StartPA, double EndPA, double PAStep)
|
||||
gcode << "\n;WIDTH:" << pa_line_width;
|
||||
gcode << set_pa_acceleration(external_perimeter_acceleration);
|
||||
gcode << move_to(Vec2d(start_x + 80, start_y), pa_travel_speed, retract_length, retract_speed);
|
||||
gcode << move_to(pa_layer_height);
|
||||
//w44
|
||||
gcode << move_to(pa_layer_height + printer_config->get_abs_value("z_offset"));
|
||||
gcode << move_to(Vec2d(start_x + 80, start_y + count * step_spacing), 3000, count * step_spacing * e_per_mm);
|
||||
|
||||
for (int i = 0; i <= count; i++) {
|
||||
@@ -4447,7 +4454,8 @@ void Plater::calib_pa_pattern(const double StartPA, double EndPA, double PAStep)
|
||||
gcode << set_pa_acceleration(external_perimeter_acceleration);
|
||||
|
||||
gcode << move_to(Vec2d(start_x + 2 * line_spacing, start_y - 2 * line_spacing), pa_travel_speed, retract_length, retract_speed);
|
||||
gcode << move_to(pa_layer_height);
|
||||
//w44
|
||||
gcode << move_to(pa_layer_height + printer_config->get_abs_value("z_offset"));
|
||||
|
||||
// Draw Box
|
||||
for (int i = 0; i < 3; i++) {
|
||||
@@ -4464,7 +4472,8 @@ void Plater::calib_pa_pattern(const double StartPA, double EndPA, double PAStep)
|
||||
for (int n = 1; n <= count + 1; n++) {
|
||||
gcode << set_pressure_advance(StartPA + (n - 1) * PAStep);
|
||||
for (int i = 0; i < 3; i++) {
|
||||
gcode << move_to(Vec2d(start_x + 3 * line_spacing, start_y - n * step_spacing - i * line_spacing_xy), pa_travel_speed, retract_length, retract_speed, pa_layer_height, retract_lift);
|
||||
//w44
|
||||
gcode << move_to(Vec2d(start_x + 3 * line_spacing, start_y - n * step_spacing - i * line_spacing_xy), pa_travel_speed, retract_length, retract_speed, pa_layer_height + printer_config->get_abs_value("z_offset"), retract_lift);
|
||||
gcode << move_to(Vec2d(start_x + pa_wall_length / 2, start_y - n * step_spacing - i * line_spacing_xy - pa_wall_length / 2 + 3 * line_spacing),
|
||||
speed_first_layer, (pa_wall_length - 6 * line_spacing) / 1.4142 * e_per_mm);
|
||||
gcode << move_to(Vec2d(start_x + pa_wall_length - 3 * line_spacing, start_y - n * step_spacing - i * line_spacing_xy),
|
||||
@@ -4491,11 +4500,13 @@ void Plater::calib_pa_pattern(const double StartPA, double EndPA, double PAStep)
|
||||
gcode << "\nM106 P3 S" << volume_fan_speed;
|
||||
|
||||
for (int m = 2; m <= 4; m++) {
|
||||
gcode << move_to(pa_layer_height * m);
|
||||
//w44
|
||||
gcode << move_to(pa_layer_height * m + printer_config->get_abs_value("z_offset"));
|
||||
for (int n = 1; n <= count + 1; n++) {
|
||||
gcode << set_pressure_advance(StartPA + (n - 1) * PAStep);
|
||||
for (int i = 0; i < 3; i++) {
|
||||
gcode << move_to(Vec2d(start_x , start_y - n * step_spacing - i * line_spacing_xy + 3 * line_spacing), pa_travel_speed, retract_length, retract_speed, pa_layer_height * m, retract_lift);
|
||||
//w44
|
||||
gcode << move_to(Vec2d(start_x , start_y - n * step_spacing - i * line_spacing_xy + 3 * line_spacing), pa_travel_speed, retract_length, retract_speed, pa_layer_height * m + printer_config->get_abs_value("z_offset"), retract_lift);
|
||||
gcode << move_to(Vec2d(start_x + pa_wall_length / 2, start_y - n * step_spacing - pa_wall_length / 2 + 3 * line_spacing - i * line_spacing_xy),
|
||||
speed_fast, pa_wall_length / 1.4142 * e_per_mm);
|
||||
gcode << move_to(Vec2d(start_x + pa_wall_length, start_y - n * step_spacing - i * line_spacing_xy + 3 * line_spacing),
|
||||
@@ -6710,6 +6721,10 @@ void Plater::send_gcode()
|
||||
{
|
||||
// if physical_printer is selected, send gcode for this printer
|
||||
DynamicPrintConfig* physical_printer_config = wxGetApp().preset_bundle->physical_printers.get_selected_printer_config();
|
||||
|
||||
//y18
|
||||
const bool local_has_machine = wxGetApp().mainframe->m_printer_view->Local_has_device();
|
||||
|
||||
#if QDT_RELEASE_TO_PUBLIC
|
||||
auto m_devices = wxGetApp().get_devices();
|
||||
const bool link_has_machine = m_devices.size() > 0;
|
||||
@@ -6717,7 +6732,8 @@ void Plater::send_gcode()
|
||||
const bool link_has_machine = false;
|
||||
#endif
|
||||
|
||||
if ((!physical_printer_config && !link_has_machine) || p->model.objects.empty())
|
||||
//y18
|
||||
if ((!physical_printer_config && !link_has_machine && !local_has_machine) || p->model.objects.empty())
|
||||
return;
|
||||
|
||||
// Obtain default output path
|
||||
@@ -6767,6 +6783,9 @@ void Plater::send_gcode()
|
||||
PrintHostSendDialog dlg(default_output_file, PrintHostPostUploadAction::StartPrint, groups, storage_paths, storage_names, this,
|
||||
(this->fff_print().print_statistics()), only_link);
|
||||
if (dlg.ShowModal() == wxID_OK) {
|
||||
//y16
|
||||
bool is_jump = false;
|
||||
|
||||
if (printer_technology() == ptFFF) {
|
||||
const std::string ext = boost::algorithm::to_lower_copy(dlg.filename().extension().string());
|
||||
const bool binary_output = wxGetApp().preset_bundle->printers.get_edited_preset().config.opt_bool("binary_gcode") &&
|
||||
@@ -6832,6 +6851,16 @@ void Plater::send_gcode()
|
||||
p->export_gcode(fs::path(), false, std::move(upload_job));
|
||||
|
||||
UploadCount++;
|
||||
|
||||
//y16
|
||||
if(!is_jump){
|
||||
is_jump = true;
|
||||
std::string send_host = into_u8(preset_data.host);
|
||||
wxGetApp().mainframe->m_printer_view->FormatUrl(send_host);
|
||||
wxGetApp().mainframe->m_printer_view->SetToggleBar(false);
|
||||
wxGetApp().app_config->set("machine_list_net", "0");
|
||||
wxGetApp().mainframe->m_printer_view->ShowLocalPrinterButton();
|
||||
}
|
||||
}
|
||||
}
|
||||
#if QDT_RELEASE_TO_PUBLIC
|
||||
@@ -6840,32 +6869,45 @@ void Plater::send_gcode()
|
||||
if (checkbox_net_status[i]) {
|
||||
auto device = m_devices[i];
|
||||
PrintHostJob upload_job(device.url,device.local_ip);
|
||||
if (upload_job.empty())
|
||||
return;
|
||||
upload_job.upload_data.upload_path = dlg.filename();
|
||||
upload_job.upload_data.post_action = dlg.post_action();
|
||||
upload_job.upload_data.group = dlg.group();
|
||||
upload_job.upload_data.storage = dlg.storage();
|
||||
upload_job.create_time = std::chrono::system_clock::now();
|
||||
if (upload_job.empty())
|
||||
return;
|
||||
upload_job.upload_data.upload_path = dlg.filename();
|
||||
upload_job.upload_data.post_action = dlg.post_action();
|
||||
upload_job.upload_data.group = dlg.group();
|
||||
upload_job.upload_data.storage = dlg.storage();
|
||||
upload_job.create_time = std::chrono::system_clock::now();
|
||||
|
||||
if (UploadCount != 0 && UploadCount % std::stoi(wxGetApp().app_config->get("max_send")) == 0) {
|
||||
m_sending_interval += std::stoi(wxGetApp().app_config->get("sending_interval")) * 60;
|
||||
}
|
||||
upload_job.sendinginterval = m_sending_interval;
|
||||
// Show "Is printer clean" dialog for QIDIConnect - Upload and print.
|
||||
if (std::string(upload_job.printhost->get_name()) == "QIDIConnect" &&
|
||||
upload_job.upload_data.post_action == PrintHostPostUploadAction::StartPrint) {
|
||||
GUI::MessageDialog dlg(nullptr, _L("Is the printer ready? Is the print sheet in place, empty and clean?"),
|
||||
_L("Upload and Print"), wxOK | wxCANCEL);
|
||||
if (dlg.ShowModal() != wxID_OK)
|
||||
return;
|
||||
}
|
||||
// Show "Is printer clean" dialog for QIDIConnect - Upload and print.
|
||||
if (std::string(upload_job.printhost->get_name()) == "QIDIConnect" &&
|
||||
upload_job.upload_data.post_action == PrintHostPostUploadAction::StartPrint) {
|
||||
GUI::MessageDialog dlg(nullptr, _L("Is the printer ready? Is the print sheet in place, empty and clean?"),
|
||||
_L("Upload and Print"), wxOK | wxCANCEL);
|
||||
if (dlg.ShowModal() != wxID_OK)
|
||||
return;
|
||||
}
|
||||
|
||||
p->export_gcode(fs::path(), false, std::move(upload_job));
|
||||
UploadCount++;
|
||||
}
|
||||
}
|
||||
p->export_gcode(fs::path(), false, std::move(upload_job));
|
||||
UploadCount++;
|
||||
|
||||
//y16
|
||||
if(!is_jump){
|
||||
is_jump = true;
|
||||
wxGetApp().mainframe->m_printer_view->FormatNetUrl(device.link_url, device.local_ip, device.isSpecialMachine);
|
||||
wxGetApp().mainframe->m_printer_view->SetToggleBar(true);
|
||||
wxGetApp().app_config->set("machine_list_net", "1");
|
||||
wxGetApp().mainframe->m_printer_view->ShowNetPrinterButton();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
//y16
|
||||
bool is_switch_to_device = wxGetApp().app_config->get("switch to device tab after upload") == "1" ? true : false;
|
||||
if (is_switch_to_device)
|
||||
wxGetApp().mainframe->select_tab(size_t(4));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
#include "ExtraRenderers.hpp"
|
||||
#include "format.hpp"
|
||||
|
||||
#include <wx/tooltip.h>
|
||||
|
||||
namespace fs = boost::filesystem;
|
||||
|
||||
namespace Slic3r {
|
||||
@@ -122,6 +124,17 @@ PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, PrintHostPostUplo
|
||||
auto *label_input_sending_interval = new wxStaticText(this, wxID_ANY, _L("(It depends on how long it takes to complete the heating.)"));
|
||||
label_input_sending_interval->Wrap(CONTENT_WIDTH * wxGetApp().em_unit());
|
||||
|
||||
//y16
|
||||
m_switch_to_device = new wxCheckBox(this, wxID_ANY, _L("Switch to Device tab"), wxDefaultPosition);
|
||||
m_switch_to_device->SetValue((wxGetApp().app_config->get("switch to device tab after upload") == "1") ? true : false);
|
||||
wxToolTip* switch_tips = new wxToolTip(_L("Switch to Device tab after upload."));
|
||||
m_switch_to_device->SetToolTip(switch_tips);
|
||||
m_switch_to_device->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, [this](wxCommandEvent &event){
|
||||
if(event.GetInt() == 1)
|
||||
wxGetApp().app_config->set("switch to device tab after upload", "1");
|
||||
else
|
||||
wxGetApp().app_config->set("switch to device tab after upload", "0");
|
||||
});
|
||||
|
||||
wxBoxSizer *max_printer_send =
|
||||
create_item_input(_L("Send"),
|
||||
@@ -140,6 +153,10 @@ PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, PrintHostPostUplo
|
||||
vbox2->Add(delay_time);
|
||||
vbox2->Add(label_input_sending_interval);
|
||||
|
||||
//y16
|
||||
vbox2->Add(0, 0, 0, wxEXPAND | wxTOP, 15);
|
||||
vbox2->Add(m_switch_to_device);
|
||||
|
||||
hbox1->Add(vbox1);
|
||||
hbox1->Add(0, 0, 0, wxEXPAND | wxLEFT, 23);
|
||||
hbox1->Add(vbox2);
|
||||
@@ -397,6 +414,17 @@ PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, PrintHostPostUplo
|
||||
MessageDialog msg_wingow(this, wxString::Format(_L("Upload filename doesn't end with \"%s\". Do you wish to continue?"), m_valid_suffix), wxString(SLIC3R_APP_NAME), wxYES | wxNO);
|
||||
return msg_wingow.ShowModal() == wxID_YES;
|
||||
}
|
||||
|
||||
//y19
|
||||
std::string unusable_symbols = "<>[]:/\\|?*\"";
|
||||
for(auto c : path){
|
||||
if(unusable_symbols.find(c) != std::string::npos){
|
||||
ErrorDialog msg(this, format_wxstr("%1%\n%2% %3%", _L("The provided name is not valid;"),
|
||||
_L("the following characters are not allowed:"), unusable_symbols), wxOK);
|
||||
msg.ShowModal();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -425,6 +453,7 @@ PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, PrintHostPostUplo
|
||||
post_upload_action = PrintHostPostUploadAction::None;
|
||||
EndDialog(wxID_OK);
|
||||
}
|
||||
txt_filename->SetFocus();
|
||||
});
|
||||
txt_filename->SetFocus();
|
||||
|
||||
@@ -483,6 +512,7 @@ PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, PrintHostPostUplo
|
||||
post_upload_action = PrintHostPostUploadAction::StartPrint;
|
||||
EndDialog(wxID_OK);
|
||||
}
|
||||
txt_filename->SetFocus();
|
||||
});
|
||||
//B53 //B64
|
||||
Bind(wxEVT_CHECKBOX, [btn_ok, btn_print, sizer_machine_list, sizer_machine_list2, this](wxCommandEvent &event) {
|
||||
|
||||
@@ -100,6 +100,9 @@ private:
|
||||
//y4
|
||||
std::vector<SendCheckBox*> unSelectedBoxes;
|
||||
std::vector<SendCheckBox*> SelectedBoxes;
|
||||
|
||||
//y16
|
||||
wxCheckBox* m_switch_to_device{ nullptr };
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -510,24 +510,18 @@ void PrinterWebView::AddButton(const wxString & device_name,
|
||||
machine_button->SetBorderColor(wxColour(67, 67, 71));
|
||||
machine_button->SetCanFocus(false);
|
||||
machine_button->SetIsSimpleMode(m_isSimpleMode);
|
||||
wxString formattedHost = ip;
|
||||
if (!formattedHost.Lower().starts_with("http"))
|
||||
formattedHost = wxString::Format("http://%s", formattedHost);
|
||||
if (isQIDI) {
|
||||
if (!formattedHost.Lower().ends_with("10088"))
|
||||
formattedHost = wxString::Format("%s:10088", formattedHost);
|
||||
}
|
||||
|
||||
machine_button->Bind(wxEVT_BUTTON, [this, formattedHost](wxCommandEvent &event) {
|
||||
wxString url = formattedHost;
|
||||
load_url(url);
|
||||
machine_button->Bind(wxEVT_BUTTON, [this, ip](wxCommandEvent &event) {
|
||||
//y16
|
||||
FormatUrl(into_u8(ip));
|
||||
});
|
||||
devicesizer->Add(machine_button, wxSizerFlags().Border(wxALL, 1).Expand());
|
||||
devicesizer->Layout();
|
||||
m_buttons.push_back(machine_button);
|
||||
|
||||
if(isSelected)
|
||||
load_url(formattedHost);
|
||||
//y16
|
||||
FormatUrl(into_u8(ip));
|
||||
}
|
||||
|
||||
//y3
|
||||
@@ -601,35 +595,8 @@ void PrinterWebView::AddNetButton(const Device device)
|
||||
machine_button->SetIsSimpleMode(m_isSimpleMode);
|
||||
|
||||
machine_button->Bind(wxEVT_BUTTON, [this, device](wxCommandEvent &event) {
|
||||
//y5
|
||||
std::string formattedHost;
|
||||
|
||||
if (device.isSpecialMachine)
|
||||
{
|
||||
if (wxGetApp().app_config->get("dark_color_mode") == "1")
|
||||
formattedHost = device.link_url + "&theme=dark";
|
||||
else
|
||||
formattedHost = device.link_url + "&theme=light";
|
||||
|
||||
std::string formattedHost1 = "http://fluidd_" + formattedHost;
|
||||
std::string formattedHost2 = "http://fluidd2_" + formattedHost;
|
||||
if (formattedHost1 == m_web || formattedHost2 == m_web)
|
||||
return;
|
||||
|
||||
if (m_isfluidd_1) {
|
||||
formattedHost = "http://fluidd_" + formattedHost;
|
||||
m_isfluidd_1 = false;
|
||||
} else {
|
||||
formattedHost = "http://fluidd2_" + formattedHost;
|
||||
m_isfluidd_1 = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
formattedHost = "http://" + device.link_url;
|
||||
}
|
||||
|
||||
load_net_url(formattedHost, device.local_ip);
|
||||
//y16
|
||||
FormatNetUrl(device.link_url, device.local_ip, device.isSpecialMachine);
|
||||
});
|
||||
|
||||
|
||||
@@ -939,15 +906,8 @@ void PrinterWebView::OnEditButtonClick(wxCommandEvent &event)
|
||||
m_handlerl(event);
|
||||
}
|
||||
m_ip = dlg.get_host();
|
||||
wxString url;
|
||||
if (!m_ip.Lower().starts_with("http"))
|
||||
url = wxString::Format("http://%s", m_ip);
|
||||
|
||||
if (!url.Lower().ends_with("10088"))
|
||||
url = wxString::Format("%s:10088", url);
|
||||
|
||||
load_url(url);
|
||||
|
||||
//y16
|
||||
FormatUrl(into_u8(m_ip));
|
||||
SetPresetChanged(true);
|
||||
}
|
||||
break;
|
||||
@@ -1152,5 +1112,63 @@ void PrinterWebView::RunScript(const wxString &javascript)
|
||||
|
||||
WebView::RunScript(m_browser, javascript);
|
||||
}
|
||||
|
||||
//y16
|
||||
void PrinterWebView::FormatNetUrl(std::string link_url, std::string local_ip, bool isSpecialMachine)
|
||||
{
|
||||
std::string formattedHost;
|
||||
if (isSpecialMachine)
|
||||
{
|
||||
if (wxGetApp().app_config->get("dark_color_mode") == "1")
|
||||
formattedHost = link_url + "&theme=dark";
|
||||
else
|
||||
formattedHost = link_url + "&theme=light";
|
||||
|
||||
std::string formattedHost1 = "http://fluidd_" + formattedHost;
|
||||
std::string formattedHost2 = "http://fluidd2_" + formattedHost;
|
||||
if (formattedHost1 == m_web || formattedHost2 == m_web)
|
||||
return;
|
||||
|
||||
if (m_isfluidd_1)
|
||||
{
|
||||
formattedHost = "http://fluidd_" + formattedHost;
|
||||
m_isfluidd_1 = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
formattedHost = "http://fluidd2_" + formattedHost;
|
||||
m_isfluidd_1 = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
formattedHost = "http://" + link_url;
|
||||
}
|
||||
load_net_url(formattedHost, local_ip);
|
||||
}
|
||||
|
||||
//y16
|
||||
void PrinterWebView::FormatUrl(std::string link_url)
|
||||
{
|
||||
wxString m_link_url = from_u8(link_url);
|
||||
wxString url;
|
||||
if (!m_link_url.Lower().starts_with("http"))
|
||||
url = wxString::Format("http://%s", m_link_url);
|
||||
|
||||
if (!url.Lower().ends_with("10088"))
|
||||
url = wxString::Format("%s:10088", url);
|
||||
|
||||
load_url(url);
|
||||
}
|
||||
|
||||
//y16
|
||||
void PrinterWebView::SetToggleBar(bool is_net_mode)
|
||||
{
|
||||
toggleBar->SetValue(is_net_mode);
|
||||
m_isNetMode = is_net_mode;
|
||||
UpdateState();
|
||||
}
|
||||
|
||||
|
||||
} // GUI
|
||||
} // Slic3r
|
||||
|
||||
@@ -129,6 +129,14 @@ public:
|
||||
void load_disconnect_url(wxString& url);
|
||||
std::set<std::string> GetExitHost() { return m_exit_host; };
|
||||
|
||||
//y16
|
||||
void FormatNetUrl(std::string link_url, std::string local_ip, bool isSpecialMachine);
|
||||
void FormatUrl(std::string link_url);
|
||||
void SetToggleBar(bool is_net_mode);
|
||||
|
||||
//y18
|
||||
bool Local_has_device() { return m_buttons.size() > 0; };
|
||||
|
||||
private:
|
||||
wxBoxSizer *leftallsizer;
|
||||
|
||||
|
||||
@@ -486,6 +486,10 @@ Sidebar::Sidebar(Plater *parent)
|
||||
|
||||
auto* complect_btns_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
complect_btns_sizer->Add(m_btn_export_gcode, 1, wxEXPAND);
|
||||
|
||||
//B
|
||||
m_btn_connect_gcode->Hide();
|
||||
|
||||
//y15
|
||||
// complect_btns_sizer->Add(m_btn_connect_gcode, 1, wxEXPAND | wxLEFT, margin_5);
|
||||
complect_btns_sizer->Add(m_btn_send_gcode, 0, wxLEFT, margin_5);
|
||||
|
||||
@@ -1410,7 +1410,7 @@ void TabPrint::build()
|
||||
load_initial_data();
|
||||
|
||||
auto page = add_options_page(L("Layers and perimeters"), "layers");
|
||||
std::string category_path = "layers-and-perimeters_1748#";
|
||||
std::string category_path = "print-settings/layer-perimeters#";
|
||||
auto optgroup = page->new_optgroup(L("Layer height"));
|
||||
optgroup->append_single_option_line("layer_height", category_path + "layer-height");
|
||||
optgroup->append_single_option_line("first_layer_height", category_path + "first-layer-height");
|
||||
@@ -1429,7 +1429,7 @@ void TabPrint::build()
|
||||
|
||||
optgroup = page->new_optgroup(L("Horizontal shells"));
|
||||
line = { L("Solid layers"), "" };
|
||||
line.label_path = category_path + "solid-layers-top-bottom";
|
||||
line.label_path = category_path + "solid-layers";
|
||||
line.append_option(optgroup->get_option("top_solid_layers"));
|
||||
line.append_option(optgroup->get_option("bottom_solid_layers"));
|
||||
optgroup->append_line(line);
|
||||
@@ -1465,17 +1465,18 @@ void TabPrint::build()
|
||||
optgroup->append_single_option_line("perimeter_generator");
|
||||
|
||||
optgroup = page->new_optgroup(L("Fuzzy skin (experimental)"));
|
||||
category_path = "fuzzy-skin_246186/#";
|
||||
category_path = "print-settings/fuzzy-skin#";
|
||||
optgroup->append_single_option_line("fuzzy_skin", category_path + "fuzzy-skin-type");
|
||||
optgroup->append_single_option_line("fuzzy_skin_thickness", category_path + "fuzzy-skin-thickness");
|
||||
optgroup->append_single_option_line("fuzzy_skin_point_dist", category_path + "fuzzy-skin-point-distance");
|
||||
|
||||
category_path = "print-settings/layer-perimeters#";
|
||||
optgroup = page->new_optgroup(L("Only one perimeter"));
|
||||
optgroup->append_single_option_line("top_one_perimeter_type", category_path + "top-one-perimeter-type");
|
||||
optgroup->append_single_option_line("only_one_perimeter_first_layer", category_path + "only-one-perimeter-first-layer");
|
||||
optgroup->append_single_option_line("top_one_perimeter_type", category_path + "only-one-perimeter");
|
||||
optgroup->append_single_option_line("only_one_perimeter_first_layer", category_path + "only-one-perimeter");
|
||||
|
||||
page = add_options_page(L("Infill"), "infill");
|
||||
category_path = "infill_42#";
|
||||
category_path = "print-settings/infill#";
|
||||
optgroup = page->new_optgroup(L("Infill"));
|
||||
optgroup->append_single_option_line("fill_density", category_path + "fill-density");
|
||||
optgroup->append_single_option_line("fill_pattern", category_path + "fill-pattern");
|
||||
@@ -1485,7 +1486,7 @@ void TabPrint::build()
|
||||
optgroup->append_single_option_line("bottom_fill_pattern", category_path + "bottom-fill-pattern");
|
||||
|
||||
optgroup = page->new_optgroup(L("Ironing"));
|
||||
category_path = "ironing_177488#";
|
||||
category_path = "print-settings/ironing#";
|
||||
optgroup->append_single_option_line("ironing", category_path);
|
||||
//w33
|
||||
optgroup->append_single_option_line("ironing_type", category_path + "ironing-type");
|
||||
@@ -1494,12 +1495,12 @@ void TabPrint::build()
|
||||
optgroup->append_single_option_line("ironing_spacing", category_path + "spacing-between-ironing-passes");
|
||||
|
||||
optgroup = page->new_optgroup(L("Reducing printing time"));
|
||||
category_path = "infill_42#";
|
||||
optgroup->append_single_option_line("infill_every_layers", category_path + "combine-infill-every-x-layers");
|
||||
category_path = "print-settings/infill#";
|
||||
optgroup->append_single_option_line("infill_every_layers", category_path + "combine-infill-every");
|
||||
// optgroup->append_single_option_line("infill_only_where_needed", category_path + "only-infill-where-needed");
|
||||
|
||||
optgroup = page->new_optgroup(L("Advanced"));
|
||||
optgroup->append_single_option_line("solid_infill_every_layers", category_path + "solid-infill-every-x-layers");
|
||||
optgroup->append_single_option_line("solid_infill_every_layers", category_path + "solid-infill-every");
|
||||
optgroup->append_single_option_line("fill_angle", category_path + "fill-angle");
|
||||
optgroup->append_single_option_line("solid_infill_below_area", category_path + "solid-infill-threshold-area");
|
||||
optgroup->append_single_option_line("bridge_angle");
|
||||
@@ -1511,7 +1512,7 @@ void TabPrint::build()
|
||||
optgroup->append_single_option_line("filter_top_gap_infill");
|
||||
|
||||
page = add_options_page(L("Skirt and brim"), "skirt+brim");
|
||||
category_path = "skirt-and-brim_133969#";
|
||||
category_path = "print-settings/skirt-and-brim#";
|
||||
optgroup = page->new_optgroup(L("Skirt"));
|
||||
optgroup->append_single_option_line("skirts", category_path + "skirt");
|
||||
optgroup->append_single_option_line("skirt_distance", category_path + "skirt");
|
||||
@@ -1525,14 +1526,14 @@ void TabPrint::build()
|
||||
optgroup->append_single_option_line("brim_separation", category_path + "brim");
|
||||
|
||||
page = add_options_page(L("Support material"), "support");
|
||||
category_path = "support-material_1698#";
|
||||
category_path = "print-settings/support_material#";
|
||||
optgroup = page->new_optgroup(L("Support material"));
|
||||
optgroup->append_single_option_line("support_material", category_path + "generate-support-material");
|
||||
optgroup->append_single_option_line("support_material_auto", category_path + "auto-generated-supports");
|
||||
optgroup->append_single_option_line("support_material_threshold", category_path + "overhang-threshold");
|
||||
optgroup->append_single_option_line("support_material_enforce_layers", category_path + "enforce-support-for-the-first");
|
||||
optgroup->append_single_option_line("raft_first_layer_density", category_path + "raft-first-layer-density");
|
||||
optgroup->append_single_option_line("raft_first_layer_expansion", category_path + "raft-first-layer-expansion");
|
||||
optgroup->append_single_option_line("raft_first_layer_density");
|
||||
optgroup->append_single_option_line("raft_first_layer_expansion");
|
||||
|
||||
optgroup = page->new_optgroup(L("Raft"));
|
||||
optgroup->append_single_option_line("raft_layers", category_path + "raft-layers");
|
||||
@@ -1541,16 +1542,16 @@ void TabPrint::build()
|
||||
|
||||
optgroup = page->new_optgroup(L("Options for support material and raft"));
|
||||
optgroup->append_single_option_line("support_material_style", category_path + "style");
|
||||
optgroup->append_single_option_line("support_material_contact_distance", category_path + "contact-z-distance");
|
||||
optgroup->append_single_option_line("support_material_bottom_contact_distance", category_path + "contact-z-distance");
|
||||
optgroup->append_single_option_line("support_material_contact_distance", category_path + "top-contact-Z-distance");
|
||||
optgroup->append_single_option_line("support_material_bottom_contact_distance", category_path + "bottom-contact-Z-distance");
|
||||
optgroup->append_single_option_line("support_material_pattern", category_path + "pattern");
|
||||
optgroup->append_single_option_line("support_material_with_sheath", category_path + "with-sheath-around-the-support");
|
||||
optgroup->append_single_option_line("support_material_spacing", category_path + "pattern-spacing-0-inf");
|
||||
optgroup->append_single_option_line("support_material_spacing", category_path + "pattern-spacing");
|
||||
optgroup->append_single_option_line("support_material_angle", category_path + "pattern-angle");
|
||||
optgroup->append_single_option_line("support_material_closing_radius", category_path + "pattern-angle");
|
||||
optgroup->append_single_option_line("support_material_interface_layers", category_path + "interface-layers");
|
||||
optgroup->append_single_option_line("support_material_bottom_interface_layers", category_path + "interface-layers");
|
||||
optgroup->append_single_option_line("support_material_interface_pattern", category_path + "interface-pattern");
|
||||
optgroup->append_single_option_line("support_material_closing_radius", category_path + "closing-radius");
|
||||
optgroup->append_single_option_line("support_material_interface_layers", category_path + "top-interface-layers");
|
||||
optgroup->append_single_option_line("support_material_bottom_interface_layers", category_path + "bottom-interface-layers");
|
||||
optgroup->append_single_option_line("support_material_interface_pattern");
|
||||
optgroup->append_single_option_line("support_material_interface_spacing", category_path + "interface-pattern-spacing");
|
||||
optgroup->append_single_option_line("support_material_interface_contact_loops", category_path + "interface-loops");
|
||||
optgroup->append_single_option_line("support_material_buildplate_only", category_path + "support-on-build-plate-only");
|
||||
@@ -1558,10 +1559,10 @@ void TabPrint::build()
|
||||
optgroup->append_single_option_line("dont_support_bridges", category_path + "dont-support-bridges");
|
||||
optgroup->append_single_option_line("support_material_synchronize_layers", category_path + "synchronize-with-object-layers");
|
||||
//w28
|
||||
optgroup->append_single_option_line("max_bridge_length", category_path + "max_bridge_length");
|
||||
optgroup->append_single_option_line("max_bridge_length");
|
||||
|
||||
optgroup = page->new_optgroup(L("Organic supports"));
|
||||
const std::string path = "organic-supports_480131#organic-supports-settings";
|
||||
const std::string path = "print-settings/origanic-supports";
|
||||
optgroup->append_single_option_line("support_tree_angle", path);
|
||||
optgroup->append_single_option_line("support_tree_angle_slow", path);
|
||||
optgroup->append_single_option_line("support_tree_branch_diameter", path);
|
||||
@@ -1715,7 +1716,7 @@ void TabPrint::build()
|
||||
|
||||
page = add_options_page(L("Output options"), "output+page_white");
|
||||
optgroup = page->new_optgroup(L("Sequential printing"));
|
||||
optgroup->append_single_option_line("complete_objects", "sequential-printing_124589");
|
||||
optgroup->append_single_option_line("complete_objects", "print-settings/sequential-printing");
|
||||
line = { L("Extruder clearance"), "" };
|
||||
line.append_option(optgroup->get_option("extruder_clearance_radius"));
|
||||
line.append_option(optgroup->get_option("extruder_clearance_height"));
|
||||
@@ -1730,7 +1731,7 @@ void TabPrint::build()
|
||||
|
||||
optgroup = page->new_optgroup(L("Other"));
|
||||
|
||||
create_line_with_widget(optgroup.get(), "gcode_substitutions", "g-code-substitutions_301694", [this](wxWindow* parent) {
|
||||
create_line_with_widget(optgroup.get(), "gcode_substitutions", "print-settings/gcode-substitutions", [this](wxWindow* parent) {
|
||||
return create_manage_substitution_widget(parent);
|
||||
});
|
||||
line = { "", "" };
|
||||
@@ -2232,7 +2233,7 @@ void TabFilament::build()
|
||||
optgroup->append_line(line);
|
||||
|
||||
page = add_options_page(L("Cooling"), "cooling");
|
||||
std::string category_path = "cooling_127569#";
|
||||
std::string category_path = "filament-settings/cooling#";
|
||||
optgroup = page->new_optgroup(L("Enable"));
|
||||
optgroup->append_single_option_line("fan_always_on");
|
||||
optgroup->append_single_option_line("cooling");
|
||||
@@ -2288,7 +2289,7 @@ void TabFilament::build()
|
||||
optgroup->append_single_option_line("filament_abrasive");
|
||||
|
||||
optgroup = page->new_optgroup(L("Print speed override"));
|
||||
optgroup->append_single_option_line("filament_max_volumetric_speed", "max-volumetric-speed_127176");
|
||||
optgroup->append_single_option_line("filament_max_volumetric_speed", "print-settings/max-volumetric-speed");
|
||||
|
||||
line = { "", "" };
|
||||
line.full_width = 1;
|
||||
@@ -2297,8 +2298,8 @@ void TabFilament::build()
|
||||
};
|
||||
optgroup->append_line(line);
|
||||
|
||||
optgroup->append_single_option_line("filament_infill_max_speed", "max-simple-infill-speed");
|
||||
optgroup->append_single_option_line("filament_infill_max_crossing_speed", "max-crossing-infill-speed");
|
||||
optgroup->append_single_option_line("filament_infill_max_speed");
|
||||
optgroup->append_single_option_line("filament_infill_max_crossing_speed");
|
||||
|
||||
optgroup = page->new_optgroup(L("Shrinkage compensation"));
|
||||
optgroup->append_single_option_line("filament_shrinkage_compensation_xy");
|
||||
@@ -2709,7 +2710,7 @@ void TabPrinter::build_fff()
|
||||
auto page = add_options_page(L("General"), "printer");
|
||||
auto optgroup = page->new_optgroup(L("Size and coordinates"));
|
||||
|
||||
create_line_with_widget(optgroup.get(), "bed_shape", "custom-svg-and-png-bed-textures_124612", [this](wxWindow* parent) {
|
||||
create_line_with_widget(optgroup.get(), "bed_shape", "", [this](wxWindow* parent) {
|
||||
return create_bed_shape_widget(parent);
|
||||
});
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ FRF_Calibration_Dlg::FRF_Calibration_Dlg(wxWindow* parent, wxWindowID id, Plater
|
||||
SetSizer(v_sizer);
|
||||
|
||||
// desc
|
||||
std::string setting_desc_message = _u8L("Please input the best value from the coarse calibration to further determine a more accurate extrusion multiplier.");
|
||||
wxString setting_desc_message = _L("Please input the best value from the coarse calibration to further determine a more accurate extrusion multiplier.");
|
||||
auto setting_desc = new wxStaticText(this, wxID_ANY, setting_desc_message, wxDefaultPosition, wxSize(340, -1), wxALIGN_LEFT);
|
||||
setting_desc->Wrap(setting_desc->GetClientSize().x);
|
||||
v_sizer->Add(setting_desc, 0, wxTOP | wxRIGHT | wxLEFT | wxALIGN_CENTER_VERTICAL, 15);
|
||||
@@ -147,7 +147,7 @@ PA_Calibration_Dlg::PA_Calibration_Dlg(wxWindow* parent, wxWindowID id, Plater*
|
||||
|
||||
// Note
|
||||
auto note_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
std::string note_message = _u8L("Note: PA calibration is not applicable to PETG, please modify the PA value according to the actual printing of the model.");
|
||||
wxString note_message = _L("Note: PA calibration is not applicable to PETG, please modify the PA value according to the actual printing of the model.");
|
||||
auto note_text = new wxStaticText(this, wxID_ANY, note_message, wxDefaultPosition, wxSize(240, -1), wxALIGN_LEFT);
|
||||
note_text->Wrap(note_text->GetClientSize().x);
|
||||
note_sizer->Add(note_text, 0, wxALL | wxALIGN_CENTER_VERTICAL, 2);
|
||||
|
||||
@@ -9,6 +9,10 @@ namespace GUI {
|
||||
#if __APPLE__
|
||||
extern bool mac_dark_mode();
|
||||
extern double mac_max_scaling_factor();
|
||||
// old webview
|
||||
//y18
|
||||
void WKWebView_evaluateJavaScript(void * web, wxString const & script, void (*callback)(wxString const &));
|
||||
void WKWebView_setTransparentBackground(void * web);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -46,7 +46,17 @@ void WKWebView_evaluateJavaScript(void * web, wxString const & script, void (*ca
|
||||
}];
|
||||
}
|
||||
|
||||
// old webview
|
||||
//y18
|
||||
void WKWebView_setTransparentBackground(void * web)
|
||||
{
|
||||
WKWebView * webView = (WKWebView*)web;
|
||||
[webView layer].backgroundColor = [NSColor clearColor].CGColor;
|
||||
}
|
||||
|
||||
// old webview
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@end
|
||||
@@ -197,6 +197,9 @@ struct PresetUpdater::priv
|
||||
// checks existence and downloads resource to vendor or copy from cache to vendor
|
||||
void get_or_copy_missing_resource(const GUI::ArchiveRepository* archive, const std::string& vendor, const std::string& filename, const std::string& repository_id_from_ini) const;
|
||||
void update_index_db();
|
||||
|
||||
//w45
|
||||
bool force_update_config();
|
||||
};
|
||||
|
||||
PresetUpdater::priv::priv()
|
||||
@@ -1268,7 +1271,20 @@ PresetUpdater::UpdateResult PresetUpdater::config_update(const Semver& old_slic3
|
||||
break;
|
||||
}
|
||||
}
|
||||
GUI::wxGetApp().plater()->get_notification_manager()->push_notification(new_printer? GUI::NotificationType::PresetUpdateAvailableNewPrinter : GUI::NotificationType::PresetUpdateAvailable);
|
||||
//w45
|
||||
if(new_printer == true)
|
||||
GUI::wxGetApp().plater()->get_notification_manager()->push_notification(GUI::NotificationType::PresetUpdateAvailableNewPrinter);
|
||||
else{
|
||||
if(p->force_update_config()){
|
||||
if (p->perform_updates(std::move(p->waiting_updates), repositories) &&
|
||||
reload_configs_update_gui()) {
|
||||
p->has_waiting_updates = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
GUI::wxGetApp().plater()->get_notification_manager()->push_notification( GUI::NotificationType::PresetUpdateAvailable);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
BOOST_LOG_TRIVIAL(info) << format("Update of %1% bundles available. Asking for confirmation ...", p->waiting_updates.updates.size());
|
||||
@@ -1417,6 +1433,56 @@ bool PresetUpdater::install_bundles_rsrc_or_cache_vendor(std::vector<std::string
|
||||
return p->perform_updates(std::move(updates), repositories, snapshot);
|
||||
}
|
||||
|
||||
//w45
|
||||
bool PresetUpdater::priv::force_update_config()
|
||||
{
|
||||
fs::path rsrc_ini = rsrc_path / "QIDITechnology.ini";
|
||||
|
||||
if (!fs::exists(rsrc_ini)) {
|
||||
BOOST_LOG_TRIVIAL(error) << "INI file does not exist: " << rsrc_ini.string();
|
||||
return false;
|
||||
}
|
||||
|
||||
std::ifstream file(rsrc_ini.string());
|
||||
if (!file.is_open()) {
|
||||
BOOST_LOG_TRIVIAL(error) << "Failed to open INI file: " << rsrc_ini.string();
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string line;
|
||||
std::string force_update_value;
|
||||
|
||||
while (std::getline(file, line)) {
|
||||
line.erase(0, line.find_first_not_of(" \t"));
|
||||
line.erase(line.find_last_not_of(" \t") + 1);
|
||||
|
||||
if (line.find("force_update") == 0) {
|
||||
auto pos = line.find('=');
|
||||
if (pos != std::string::npos) {
|
||||
force_update_value = line.substr(pos + 1);
|
||||
force_update_value.erase(0, force_update_value.find_first_not_of(" \t"));
|
||||
force_update_value.erase(force_update_value.find_last_not_of(" \t") + 1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
file.close();
|
||||
|
||||
if (force_update_value.empty()) {
|
||||
BOOST_LOG_TRIVIAL(warning) << "force_update not found in INI file.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (force_update_value == "1") {
|
||||
BOOST_LOG_TRIVIAL(info) << "Force update is enabled in the INI file.";
|
||||
return true;
|
||||
} else {
|
||||
BOOST_LOG_TRIVIAL(info) << "Force update is disabled or invalid in the INI file.";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void PresetUpdater::on_update_notification_confirm(const SharedArchiveRepositoryVector& repositories)
|
||||
{
|
||||
if (!p->has_waiting_updates)
|
||||
|
||||
Reference in New Issue
Block a user