mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
printing: minor improvements to import / export
1) Always open the user path on Import / Export 2) Update the list after Export, as the user might have exported to the user path Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
9209382c18
commit
c6c9b3bd8b
1 changed files with 8 additions and 4 deletions
|
@ -128,12 +128,13 @@ void PrintOptions::on_editButton_clicked()
|
||||||
|
|
||||||
void PrintOptions::on_importButton_clicked()
|
void PrintOptions::on_importButton_clicked()
|
||||||
{
|
{
|
||||||
QString filename = QFileDialog::getOpenFileName(this, tr("Import template file"), "",
|
QString pathUser = getPrintingTemplatePathUser();
|
||||||
|
QString filename = QFileDialog::getOpenFileName(this, tr("Import template file"), pathUser,
|
||||||
tr("HTML files") + " (*.html)");
|
tr("HTML files") + " (*.html)");
|
||||||
if (filename.isEmpty())
|
if (filename.isEmpty())
|
||||||
return;
|
return;
|
||||||
QFileInfo fileInfo(filename);
|
QFileInfo fileInfo(filename);
|
||||||
QFile::copy(filename, getPrintingTemplatePathUser() + QDir::separator() + fileInfo.fileName());
|
QFile::copy(filename, pathUser + QDir::separator() + fileInfo.fileName());
|
||||||
printOptions->p_template = fileInfo.fileName();
|
printOptions->p_template = fileInfo.fileName();
|
||||||
find_all_templates();
|
find_all_templates();
|
||||||
setup();
|
setup();
|
||||||
|
@ -141,11 +142,14 @@ void PrintOptions::on_importButton_clicked()
|
||||||
|
|
||||||
void PrintOptions::on_exportButton_clicked()
|
void PrintOptions::on_exportButton_clicked()
|
||||||
{
|
{
|
||||||
QString filename = QFileDialog::getSaveFileName(this, tr("Export template files as"), "",
|
QString pathUser = getPrintingTemplatePathUser();
|
||||||
|
QString filename = QFileDialog::getSaveFileName(this, tr("Export template files as"), pathUser,
|
||||||
tr("HTML files") + " (*.html)");
|
tr("HTML files") + " (*.html)");
|
||||||
if (filename.isEmpty())
|
if (filename.isEmpty())
|
||||||
return;
|
return;
|
||||||
QFile::copy(getPrintingTemplatePathUser() + QDir::separator() + getSelectedTemplate(), filename);
|
QFile::copy(pathUser + QDir::separator() + getSelectedTemplate(), filename);
|
||||||
|
find_all_templates();
|
||||||
|
setup();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintOptions::on_deleteButton_clicked()
|
void PrintOptions::on_deleteButton_clicked()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue