summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/mainwindow.cpp')
-rw-r--r--desktop-widgets/mainwindow.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index b0817b9f1..330ea7d05 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -256,8 +256,24 @@ MainWindow::MainWindow() : QMainWindow(),
connect(geoLookup, SIGNAL(started()),information(), SLOT(disableGeoLookupEdition()));
connect(geoLookup, SIGNAL(finished()), information(), SLOT(enableGeoLookupEdition()));
#ifndef NO_PRINTING
- // copy the bundled print templates to the user path; no overwriting occurs!
- copyPath(getPrintingTemplatePathBundle(), getPrintingTemplatePathUser());
+ // copy the bundled print templates to the user path
+ QStringList templateBackupList;
+ QString templatePathUser(getPrintingTemplatePathUser());
+ copy_bundled_templates(getPrintingTemplatePathBundle(), templatePathUser, &templateBackupList);
+ if (templateBackupList.length()) {
+ QMessageBox msgBox(this);
+ templatePathUser.replace("\\", "/");
+ templateBackupList.replaceInStrings(templatePathUser + "/", "");
+ msgBox.setWindowTitle(tr("Template backup created"));
+ msgBox.setText(tr("The following backup printing templates were created:\n\n%1\n\n"
+ "Location:\n%2\n\n"
+ "Please note that as of this version of Subsurface the default templates\n"
+ "are read-only and should not be edited directly, since the application\n"
+ "can overwrite them on startup.").arg(templateBackupList.join("\n")).arg(templatePathUser));
+ msgBox.setStandardButtons(QMessageBox::Ok);
+ msgBox.exec();
+ }
+ set_bundled_templates_as_read_only();
find_all_templates();
#endif