mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
printing: update the coping of bundled templates
This update includes: - Instead of copyPath() use a new specialized function: copy_bundled_templates() - The new function supports overwriting of templates in the user path, but only if a template file is read-only - If the file is RW create a backup of the file in the form of: <file-name>-User.html - Collect backup files and store them in a QStringList which is then shown in a QMessageBox from MainWindow to notifying the user about the backup This change allows moving the maintenance of the bundled templates back to the application developers and contributors as currently the only one who can edit the templates in the user path was the user. Suggested-by: Dirk Hohndel <dirk@hohndel.org> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
fc48cde77c
commit
65f0600679
3 changed files with 48 additions and 2 deletions
|
|
@ -2,6 +2,7 @@
|
|||
#ifndef TEMPLATELAYOUT_H
|
||||
#define TEMPLATELAYOUT_H
|
||||
|
||||
#include <QStringList>
|
||||
#include <grantlee_templates.h>
|
||||
#include "mainwindow.h"
|
||||
#include "printoptions.h"
|
||||
|
|
@ -13,6 +14,7 @@
|
|||
int getTotalWork(print_options *printOptions);
|
||||
void find_all_templates();
|
||||
void set_bundled_templates_as_read_only();
|
||||
void copy_bundled_templates(QString src, QString dst, QStringList *templateBackupList);
|
||||
|
||||
extern QList<QString> grantlee_templates, grantlee_statistics_templates;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue