fix flatpak build

This commit is contained in:
SoftFever 2024-07-23 18:18:27 +08:00
parent b0bd16e908
commit f490d2ca9f
2 changed files with 14 additions and 15 deletions

View file

@ -4943,14 +4943,14 @@ void GCodeProcessor::run_post_process()
// found an invalid value, clamp it to a valid one
tool_number = std::clamp<int>(0, m_extruder_temps_config.size() - 1, tool_number);
// emit warning
std::string warning = _u8L("GCode Post-Processor encountered an invalid toolchange, maybe from a custom gcode:");
std::string warning = "GCode Post-Processor encountered an invalid toolchange, maybe from a custom gcode:";
warning += "\n> ";
warning += gcode_line;
warning += _u8L("Generated M104 lines may be incorrect.");
warning += "Generated M104 lines may be incorrect.";
BOOST_LOG_TRIVIAL(error) << warning;
// Orca todo
// if (m_print != nullptr)
// m_print->active_step_add_warning(PrintStateBase::WarningLevel::CRITICAL, warning);
if (m_print != nullptr)
m_print->active_step_add_warning(PrintStateBase::WarningLevel::CRITICAL, warning);
}
}
export_lines.insert_lines(

View file

@ -583,7 +583,16 @@ public:
bool is_step_done(PrintStepEnum step) const { return m_state.is_done(step, this->state_mutex()); }
PrintStateBase::StateWithTimeStamp step_state_with_timestamp(PrintStepEnum step) const { return m_state.state_with_timestamp(step, this->state_mutex()); }
PrintStateBase::StateWithWarnings step_state_with_warnings(PrintStepEnum step) const { return m_state.state_with_warnings(step, this->state_mutex()); }
// Add a slicing warning to the active Print step and send a status notification.
// This method could be called multiple times between this->set_started() and this->set_done().
void active_step_add_warning(PrintStateBase::WarningLevel warning_level, const std::string &message,
PrintStateBase::SlicingNotificationType message_id = PrintStateBase::SlicingDefaultNotification)
{
std::pair<PrintStepEnum, bool> active_step = m_state.active_step_add_warning(warning_level, message, (int)message_id, this->state_mutex());
if (active_step.second)
// Update UI.
this->status_update_warnings(static_cast<int>(active_step.first), warning_level, message, nullptr, message_id);
}
protected:
bool set_started(PrintStepEnum step) { return m_state.set_started(step, this->state_mutex(), [this](){ this->throw_if_canceled(); }); }
PrintStateBase::TimeStamp set_done(PrintStepEnum step) {
@ -605,16 +614,6 @@ protected:
bool is_step_started_unguarded(PrintStepEnum step) const { return m_state.is_started_unguarded(step); }
bool is_step_done_unguarded(PrintStepEnum step) const { return m_state.is_done_unguarded(step); }
// Add a slicing warning to the active Print step and send a status notification.
// This method could be called multiple times between this->set_started() and this->set_done().
void active_step_add_warning(PrintStateBase::WarningLevel warning_level, const std::string &message,
PrintStateBase::SlicingNotificationType message_id = PrintStateBase::SlicingDefaultNotification)
{
std::pair<PrintStepEnum, bool> active_step = m_state.active_step_add_warning(warning_level, message, (int)message_id, this->state_mutex());
if (active_step.second)
// Update UI.
this->status_update_warnings(static_cast<int>(active_step.first), warning_level, message, nullptr, message_id);
}
private:
PrintState<PrintStepEnum, COUNT> m_state;