diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2017-11-25 08:30:24 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-11-25 08:30:24 -0800 |
commit | 357dea0bcb374d02b3a3219f4f78752b1703ea27 (patch) | |
tree | d8abca0c6c597fd8c23a36a4eb65ee953fe1f06e /desktop-widgets/mainwindow.cpp | |
parent | dd2466f51899aae406dc8c13904787710f30ec1c (diff) | |
parent | 4a870ff6b3478725629116ddf48df345619b3d64 (diff) | |
download | subsurface-357dea0bcb374d02b3a3219f4f78752b1703ea27.tar.gz |
Merge branch 'print' of https://github.com/neolit123/subsurface
Diffstat (limited to 'desktop-widgets/mainwindow.cpp')
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 20 |
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 |