主界面小对话框中添加 计数器重置按钮

This commit is contained in:
2026-09-12 08:34:25 +08:00
parent 7d411deab0
commit 96c5fab758
15 changed files with 1039 additions and 856 deletions
+8 -3
View File
@@ -2982,6 +2982,9 @@ void InkJetPrinter::restartPrintWhenSwitchedWorkFile(bool isPrinting)
bool InkJetPrinter::loadWorkFileAndPreparePrint(const QString &filename)
{
QElapsedTimer runtimer;
runtimer.start();
auto u8Filename = filename.toUtf8();
if(u8Filename.size() > int(ARRAY_SIZE(sysPara->para.lastOpenedFileName) - 1)) {
LogInfo::setRunStatusText(QString("File name is too long: %1").arg(filename));
@@ -2997,6 +3000,8 @@ bool InkJetPrinter::loadWorkFileAndPreparePrint(const QString &filename)
return false;
}
qDebug() << "Time taken to read work file: " << runtimer.elapsed() << "ms";
bool rePrint = false;
if(sysPara->status.isPrinting && sysPara->status.selfCheckDone) {
// connect(this, &InkJetPrinter::printStatusChanged,
@@ -3006,15 +3011,15 @@ bool InkJetPrinter::loadWorkFileAndPreparePrint(const QString &filename)
rePrint = true;
}
PrintSettingModel::applyToSysPara(model, sysPara);
ret = m_MainWidget->generatePrintContent(scene);
ret = m_MainWidget->generatePrintContent(scene, model);
if(!ret) {
LogInfo::setRunStatusText(QString("Failed to generate print content from work file: %1").arg(filename));
delete scene;
return false;
}
qDebug() << "Time taken to generate work file: " << runtimer.elapsed() << "ms";
LogInfo::setRunStatusText(QString("Work file loaded: %1").arg(filename));
ui.label_currWorkFile->setText(QFileInfo(filename).baseName());