diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-11-23 18:23:36 +0200 |
---|---|---|
committer | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-11-24 22:27:30 +0200 |
commit | 712697e0c24e53d32ef6087c7f2b4e24fdf8a57c (patch) | |
tree | 3c28c2b546478096f5a69287e952e436ecbc8c6b | |
parent | ba7f2a399b6c0df6805d25b37bcab266d2020acc (diff) | |
download | subsurface-712697e0c24e53d32ef6087c7f2b4e24fdf8a57c.tar.gz |
printing: detect a 'statistics' template when editing
Prefix the path for 'statistics' templates when
detecting if a template is read-only.
Import / Export for statistic templates is not supported.
So the user has to manually copy and chown a '/statistics'
templates.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
-rw-r--r-- | desktop-widgets/printoptions.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/desktop-widgets/printoptions.cpp b/desktop-widgets/printoptions.cpp index 6e45bc5e1..cebb073a3 100644 --- a/desktop-widgets/printoptions.cpp +++ b/desktop-widgets/printoptions.cpp @@ -124,7 +124,8 @@ void PrintOptions::on_printTemplate_currentIndexChanged(int index) void PrintOptions::on_editButton_clicked() { QString templateName = getSelectedTemplate(); - QFile f(getPrintingTemplatePathUser() + QDir::separator() + templateName); + QString prefix = (printOptions->type == print_options::STATISTICS) ? "statistics/" : ""; + QFile f(getPrintingTemplatePathUser() + QDir::separator() + prefix + templateName); if (!f.open(QFile::ReadWrite | QFile::Text)) { QMessageBox msgBox(this); msgBox.setWindowTitle(tr("Read-only template!")); |