Refactor specification handling in DocumentSettingsDialog and PDFController. Introduced primary application field for document types, updated export messages for consistency, and improved page number handling in specifications. Cleaned up unnecessary code in preview widgets.

This commit is contained in:
2025-12-23 14:12:50 +03:00
parent 129922e392
commit 80e407e6be
12 changed files with 349 additions and 105 deletions
+23
View File
@@ -1339,6 +1339,29 @@ void DocumentEditWidget::onRemoveRow()
return;
}
// Проверяем, является ли процессор SpecificationProcessor
SpecificationProcessor *specProcessor = qobject_cast<SpecificationProcessor*>(m_processor);
if (specProcessor) {
// Проверяем, можно ли удалить эту строку
if (m_controller && m_controller->specificationTableModel()) {
if (!m_controller->specificationTableModel()->canEditRow(row)) {
qDebug() << "DocumentEditWidget::onRemoveRow: Строка" << row << "не может быть удалена (заголовок или автоматически сгенерированная)";
return;
}
}
qDebug() << "DocumentEditWidget::onRemoveRow: Удаляем строку" << row;
// Получаем контроллер и удаляем строку
if (m_controller && m_controller->specificationController()) {
m_controller->specificationController()->removeRow(row);
qDebug() << "DocumentEditWidget::onRemoveRow: Строка удалена через SpecificationController";
} else {
qDebug() << "DocumentEditWidget::onRemoveRow: SpecificationController недоступен";
}
return;
}
// Проверяем, является ли процессор VedomostProcessor
VedomostProcessor *vedomostProcessor = qobject_cast<VedomostProcessor*>(m_processor);
if (vedomostProcessor) {