diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-11-23 02:24:29 +0200 |
---|---|---|
committer | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-11-24 21:50:16 +0200 |
commit | c6c9b3bd8ba41290d4484b168401976571166d70 (patch) | |
tree | ae341abc1dd922c7c0b5aac2fc599d5d0529bfe1 | |
parent | 9209382c1868045baf49da42c5700da43556a49f (diff) | |
download | subsurface-c6c9b3bd8ba41290d4484b168401976571166d70.tar.gz |
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>
-rw-r--r-- | desktop-widgets/printoptions.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/desktop-widgets/printoptions.cpp b/desktop-widgets/printoptions.cpp index eaeb6954b..34aac318f 100644 --- a/desktop-widgets/printoptions.cpp +++ b/desktop-widgets/printoptions.cpp @@ -128,12 +128,13 @@ void PrintOptions::on_editButton_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)"); if (filename.isEmpty()) return; QFileInfo fileInfo(filename); - QFile::copy(filename, getPrintingTemplatePathUser() + QDir::separator() + fileInfo.fileName()); + QFile::copy(filename, pathUser + QDir::separator() + fileInfo.fileName()); printOptions->p_template = fileInfo.fileName(); find_all_templates(); setup(); @@ -141,11 +142,14 @@ void PrintOptions::on_importButton_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)"); if (filename.isEmpty()) return; - QFile::copy(getPrintingTemplatePathUser() + QDir::separator() + getSelectedTemplate(), filename); + QFile::copy(pathUser + QDir::separator() + getSelectedTemplate(), filename); + find_all_templates(); + setup(); } void PrintOptions::on_deleteButton_clicked() |