fix some bug

This commit is contained in:
QIDI TECH
2024-11-30 14:00:32 +08:00
parent 1244542711
commit dd004ebffd
11 changed files with 51 additions and 10 deletions

View File

@@ -182,6 +182,13 @@ PrinterTechnology BackgroundSlicingProcess::current_printer_technology() const
//return m_print->technology();
}
//y49
std::string BackgroundSlicingProcess::output_filename_for_project()
{
std::string filename = m_print->output_filename("");
return filename;
}
std::string BackgroundSlicingProcess::output_filepath_for_project(const boost::filesystem::path &project_path)
{
assert(m_print != nullptr);

View File

@@ -125,6 +125,8 @@ public:
// Take the project path (if provided), extract the name of the project, run it through the macro processor and save it next to the project file.
// If the project_path is empty, just run output_filepath().
std::string output_filepath_for_project(const boost::filesystem::path &project_path);
//y49
std::string output_filename_for_project();
// Start the background processing. Returns false if the background processing was already running.
bool start();

View File

@@ -718,6 +718,8 @@ void TextCtrl::BUILD() {
temp->SetLabel(_L(m_opt.sidetext));
auto text_ctrl = m_opt.multiline ? (wxTextCtrl *)temp : ((TextInput *) temp)->GetTextCtrl();
text_ctrl->SetLabel(text_value);
//y49
temp->SetMinSize(size);
temp->SetSize(size);
m_combine_side_text = !m_opt.multiline;
if (parent_is_custom_ctrl && m_opt.height < 0)

View File

@@ -251,18 +251,18 @@ void PhysicalPrinterDialog::build_printhost_settings(ConfigOptionsGroup* m_optgr
// Set a wider width for a better alignment
Option option = m_optgroup->get_option("print_host");
// option.opt.width = Field::def_width_wider();
// 47
option.opt.width = 20;
//y49
option.opt.width = Field::def_width_wider() * 2;
Line host_line = m_optgroup->create_single_option_line(option);
host_line.append_widget(printhost_browse);
host_line.append_widget(print_host_test);
m_optgroup->append_line(host_line);
//y47
//y49
option = m_optgroup->get_option("printhost_apikey");
option.opt.width = 20;
option.opt.width = Field::def_width_wider() * 2;
option.opt.full_width = 1;
m_optgroup->append_single_option_line(option);
m_optgroup->activate();

View File

@@ -14076,6 +14076,12 @@ wxString Plater::get_project_filename(const wxString& extension) const
return p->get_project_filename(extension);
}
//y49
wxString Plater::get_output_filename()
{
return from_u8((p->background_process.output_filename_for_project()));
}
wxString Plater::get_export_gcode_filename(const wxString & extension, bool only_filename, bool export_all) const
{
return p->get_export_gcode_filename(extension, only_filename, export_all);

View File

@@ -469,6 +469,9 @@ public:
// QDS
//void show_action_buttons(const bool is_ready_to_slice) const;
//y49
wxString get_output_filename();
wxString get_project_filename(const wxString& extension = wxEmptyString) const;
wxString get_export_gcode_filename(const wxString& extension = wxEmptyString, bool only_filename = false, bool export_all = false) const;
void set_project_filename(const wxString& filename);

View File

@@ -4055,7 +4055,9 @@ void SelectMachineDialog::set_default()
//project name
m_rename_switch_panel->SetSelection(0);
wxString filename = m_plater->get_export_gcode_filename("", true, m_print_plate_idx == PLATE_ALL_IDX ? true : false);
//y49
wxString filename = m_plater->get_output_filename();
if (m_print_plate_idx == PLATE_ALL_IDX && filename.empty()) {
filename = _L("Untitled");
}

View File

@@ -1470,7 +1470,8 @@ void SendMultiMachinePage::set_default_normal(const ThumbnailData& data)
void SendMultiMachinePage::set_default()
{
wxString filename = m_plater->get_export_gcode_filename("", true, m_print_plate_idx == PLATE_ALL_IDX ? true : false);
//y49
wxString filename = m_plater->get_output_filename();
if (m_print_plate_idx == PLATE_ALL_IDX && filename.empty()) {
filename = _L("Untitled");
}