From 42a8b1309df6a629a72bb886f1ff3dcc25b31a68 Mon Sep 17 00:00:00 2001 From: Max Gaukler Date: Sun, 10 Feb 2019 15:47:44 +0100 Subject: [PATCH] Show helpful message if tutorials are not installed Fixes https://bugs.launchpad.net/ubuntu/+source/inkscape/+bug/1803021 (for 1.0-alpha) --- po/POTFILES.in | 2 ++ src/help.cpp | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/po/POTFILES.in b/po/POTFILES.in index 90f74bc720..9f84d91975 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -107,8 +107,10 @@ src/file.cpp src/filter-enums.cpp src/gradient-chemistry.cpp src/gradient-drag.cpp +src/help.cpp src/helper/gettext.cpp src/helper/gettext.h +src/helper/verb-action.cpp src/inkscape-application.cpp src/inkscape.cpp src/inkview-application.cpp diff --git a/src/help.cpp b/src/help.cpp index a9f1fe9aac..3c76797c0f 100644 --- a/src/help.cpp +++ b/src/help.cpp @@ -13,11 +13,14 @@ */ #include +#include #include "file.h" #include "help.h" +#include "io/sys.h" #include "path-prefix.h" #include "ui/dialog/aboutbox.h" +#include "ui/interface.h" void sp_help_about() { @@ -28,7 +31,13 @@ void sp_help_open_tutorial(GtkMenuItem *, void* data) { gchar const *name = static_cast(data); gchar *c = g_build_filename(INKSCAPE_TUTORIALSDIR, name, NULL); - sp_file_open(c, nullptr, false, false); + if (Inkscape::IO::file_test(c, G_FILE_TEST_EXISTS)) { + sp_file_open(c, nullptr, false, false); + } else { + sp_ui_error_dialog(_("The tutorial files are not installed.\nFor Linux, you may need to install " + "'inkscape-tutorials'; for Windows, please re-run the setup and select 'Tutorials'.\nThe " + "tutorials can also be found online at https://inkscape.org/learn/tutorials/")); + } g_free(c); } -- GitLab