Fix layout export dialog.

This commit is contained in:
Roman Telezhynskyi 2022-08-02 17:39:43 +03:00
parent 91a6da3c26
commit 8462a7ec1d

View File

@ -4049,13 +4049,21 @@ void VPMainWindow::on_ExportLayout()
return; return;
} }
DialogSaveManualLayout dialog(sheets.size(), false, m_layout->LayoutSettings().GetTitle(), this); const QString layoutTitle = m_layout->LayoutSettings().GetTitle();
const QString fileName = layoutTitle.isEmpty() ? QFileInfo(curFile).baseName() : layoutTitle;
DialogSaveManualLayout dialog(sheets.size(), false, fileName, this);
if (dialog.exec() == QDialog::Rejected) if (dialog.exec() == QDialog::Rejected)
{ {
return; return;
} }
if (dialog.FileName().isEmpty())
{
return;
}
VPExportData data; VPExportData data;
data.format = dialog.Format(); data.format = dialog.Format();
data.path = dialog.Path(); data.path = dialog.Path();
@ -4149,13 +4157,21 @@ void VPMainWindow::on_ExportSheet()
} }
} }
DialogSaveManualLayout dialog(1, false, sheet->GetName(), this); const QString sheetTitle = sheet->GetName();
const QString fileName = sheetTitle.isEmpty() ? QFileInfo(curFile).baseName() : sheetTitle;
DialogSaveManualLayout dialog(1, false, fileName, this);
if (dialog.exec() == QDialog::Rejected) if (dialog.exec() == QDialog::Rejected)
{ {
return; return;
} }
if (dialog.FileName().isEmpty())
{
return;
}
VPExportData data; VPExportData data;
data.format = dialog.Format(); data.format = dialog.Format();
data.path = dialog.Path(); data.path = dialog.Path();