diff options
| author | Patrick Storz <eduard.braun2@gmx.de> | 2019-09-01 19:49:18 +0000 |
|---|---|---|
| committer | Patrick Storz <eduard.braun2@gmx.de> | 2019-09-01 19:50:16 +0000 |
| commit | 5e8e0a6bdd15427faa16d6432b9fbd7bbe0d6335 (patch) | |
| tree | 37dfb161397255903dd32fe27302fb308e5b9d4a /src/extension/input.cpp | |
| parent | Add 'vector-effect' to CSS and attribute lists. (diff) | |
| parent | Update internal extensions for latest .inx format changes (diff) | |
| download | inkscape-5e8e0a6bdd15427faa16d6432b9fbd7bbe0d6335.tar.gz inkscape-5e8e0a6bdd15427faa16d6432b9fbd7bbe0d6335.zip | |
Extension updates for 1.0 (!808)
Diffstat (limited to 'src/extension/input.cpp')
| -rw-r--r-- | src/extension/input.cpp | 47 |
1 files changed, 32 insertions, 15 deletions
diff --git a/src/extension/input.cpp b/src/extension/input.cpp index 708324de2..ef3a9a5b5 100644 --- a/src/extension/input.cpp +++ b/src/extension/input.cpp @@ -8,13 +8,16 @@ * Released under GNU GPL v2+, read the file 'COPYING' for more information. */ -#ifdef HAVE_CONFIG_H -#endif +#include "input.h" -#include "prefdialog.h" -#include "implementation/implementation.h" #include "timer.h" -#include "input.h" + +#include "implementation/implementation.h" + +#include "prefdialog/prefdialog.h" + +#include "xml/repr.h" + /* Inkscape::Extension::Input */ @@ -37,7 +40,8 @@ namespace Extension { Overall, there are many levels of indentation, just to handle the levels of indentation in the XML file. */ -Input::Input (Inkscape::XML::Node * in_repr, Implementation::Implementation * in_imp) : Extension(in_repr, in_imp) +Input::Input (Inkscape::XML::Node *in_repr, Implementation::Implementation *in_imp, std::string *base_directory) + : Extension(in_repr, in_imp, base_directory) { mimetype = nullptr; extension = nullptr; @@ -182,23 +186,35 @@ Input::get_extension() \return The name of the filetype supported \brief Get the name of the filetype supported */ -gchar * -Input::get_filetypename() +const char * +Input::get_filetypename(bool translated) { - if (filetypename != nullptr) - return filetypename; + const char *name; + + if (filetypename) + name = filetypename; else - return get_name(); + name = get_name(); + + if (name && translated) { + return get_translation(name); + } else { + return name; + } } /** \return Tooltip giving more information on the filetype \brief Get the tooltip for more information on the filetype */ -gchar * -Input::get_filetypetooltip() +const char * +Input::get_filetypetooltip(bool translated) { - return filetypetooltip; + if (filetypetooltip && translated) { + return get_translation(filetypetooltip); + } else { + return filetypetooltip; + } } /** @@ -224,7 +240,8 @@ Input::prefs (const gchar *uri) return true; } - PrefDialog * dialog = new PrefDialog(this->get_name(), this->get_help(), controls); + Glib::ustring name = get_translation(this->get_name()); + PrefDialog *dialog = new PrefDialog(name, controls); int response = dialog->run(); dialog->hide(); |
