Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
actions-tutorial.cpp
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
14#include "actions-tutorial.h"
15
16#include <glibmm/i18n.h>
17#include <sigc++/adaptors/bind.h>
18
21#include "ui/interface.h"
22#include "ui/dialog/about.h"
23#include "io/resource.h"
24
25class SPDocument;
26
28
29
34
35void help_open_tutorial(Glib::ustring const &name)
36{
37 Glib::ustring filename = name + ".svg";
38
40 if (!filename.empty()) {
42 SPDocument* doc = app->document_new(filename);
43 app->desktopOpen(doc);
44 } else {
45 // TRANSLATORS: Please don't translate link unless the page exists in your language. Add your language code to
46 // the link this way: https://inkscape.org/[lang]/learn/tutorials/
47 sp_ui_error_dialog(_("The tutorial files are not installed.\nFor Linux, you may need to install "
48 "'inkscape-tutorials'; for Windows, please re-run the setup and select 'Tutorials'.\nThe "
49 "tutorials can also be found online at https://inkscape.org/en/learn/tutorials/"));
50 }
51}
52
53const Glib::ustring SECTION = NC_("Action Section", "Tutorial");
54
55std::vector<std::vector<Glib::ustring>> raw_data_tutorial =
56{
57 // clang-format off
58 { "app.tutorial-basic", N_("Inkscape: Basic"), SECTION, N_("Getting started with Inkscape")},
59 { "app.tutorial-shapes", N_("Inkscape: Shapes"), SECTION, N_("Using shape tools to create and edit shapes")},
60 { "app.tutorial-advanced", N_("Inkscape: Advanced"), SECTION, N_("Advanced Inkscape topics")},
61 { "app.tutorial-tracing", N_("Inkscape: Tracing"), SECTION, N_("Using bitmap tracing"),},
62 { "app.tutorial-tracing-pixelart", N_("Inkscape: Tracing Pixel Art"), SECTION, N_("Using Trace Pixel Art dialog")},
63 { "app.tutorial-calligraphy", N_("Inkscape: Calligraphy"), SECTION, N_("Using the Calligraphy pen tool")},
64 { "app.tutorial-interpolate", N_("Inkscape: Interpolate"), SECTION, N_("Using the interpolate extension")},
65 { "app.tutorial-design", N_("Elements of Design"), SECTION, N_("Principles of design in the tutorial form")},
66 { "app.tutorial-tips", N_("Tips and Tricks"), SECTION, N_("Miscellaneous tips and tricks")},
67 { "app.about", N_("About Inkscape"), SECTION, N_("Inkscape version, authors, license")}
68 // clang-format on
69};
70
71void
73{
74 if (!app->gtk_app()) {
75 return;
76 }
77
78 auto *gapp = app->gio_app();
79
80 // clang-format off
81 gapp->add_action( "tutorial-basic", sigc::bind(&help_open_tutorial, "tutorial-basic"));
82 gapp->add_action( "tutorial-shapes", sigc::bind(&help_open_tutorial, "tutorial-shapes"));
83 gapp->add_action( "tutorial-advanced", sigc::bind(&help_open_tutorial, "tutorial-advanced"));
84 gapp->add_action( "tutorial-tracing", sigc::bind(&help_open_tutorial, "tutorial-tracing"));
85 gapp->add_action( "tutorial-tracing-pixelart", sigc::bind(&help_open_tutorial, "tutorial-tracing-pixelart"));
86 gapp->add_action( "tutorial-calligraphy", sigc::bind(&help_open_tutorial, "tutorial-calligraphy"));
87 gapp->add_action( "tutorial-interpolate", sigc::bind(&help_open_tutorial, "tutorial-interpolate"));
88 gapp->add_action( "tutorial-design", sigc::bind(&help_open_tutorial, "tutorial-elements"));
89 gapp->add_action( "tutorial-tips", sigc::bind(&help_open_tutorial, "tutorial-tips"));
90 gapp->add_action( "about", &help_about);
91 // clang-format on
92
94}
95
96/*
97 Local Variables:
98 mode:c++
99 c-file-style:"stroustrup"
100 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
101 indent-tabs-mode:nil
102 fill-column:99
103 End:
104*/
105// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
A dialog for the about screen.
void help_about()
const Glib::ustring SECTION
void help_open_tutorial(Glib::ustring const &name)
std::vector< std::vector< Glib::ustring > > raw_data_tutorial
void add_actions_tutorial(InkscapeApplication *app)
Authors: Sushant A A sushant.co19@gmail.com
void add_data(std::vector< std::vector< Glib::ustring > > const &raw_data)
InkActionExtraData & get_action_extra_data()
Gio::Application * gio_app()
The Gio application instance, never NULL.
static InkscapeApplication * instance()
Singleton instance.
Gtk::Application * gtk_app()
The Gtk application instance, or NULL if running headless without display.
Typed SVG document implementation.
Definition document.h:101
void sp_ui_error_dialog(char const *message)
Definition interface.cpp:56
std::string get_filename(Type type, char const *filename, bool localized, bool silent)
Definition resource.cpp:170
Inkscape::IO::Resource - simple resource API.
Glib::ustring name
Definition toolbars.cpp:55