From 43762b687409942c663ed1ab327247f37ec226bc Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Mon, 18 Nov 2013 12:59:40 +0100 Subject: i18n. Fix for Bug #1252229 (As for the verb name XXX (No preferences), XXX are not localized.). Fixed bugs: - https://launchpad.net/bugs/1252229 (bzr r12820) --- src/extension/effect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/extension') diff --git a/src/extension/effect.cpp b/src/extension/effect.cpp index 1575c2b10..3c8ee5844 100644 --- a/src/extension/effect.cpp +++ b/src/extension/effect.cpp @@ -38,7 +38,7 @@ Inkscape::XML::Node * Effect::_filters_list = NULL; Effect::Effect (Inkscape::XML::Node * in_repr, Implementation::Implementation * in_imp) : Extension(in_repr, in_imp), _id_noprefs(Glib::ustring(get_id()) + ".noprefs"), - _name_noprefs(Glib::ustring(get_name()) + _(" (No preferences)")), + _name_noprefs(Glib::ustring(_(get_name())) + _(" (No preferences)")), _verb(get_id(), get_name(), NULL, NULL, this, true), _verb_nopref(_id_noprefs.c_str(), _name_noprefs.c_str(), NULL, NULL, this, false), _menu_node(NULL), _workingDialog(true), -- cgit v1.2.3 From 9318c9c232cf73aa806c366381f144dc6df4d218 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Tue, 19 Nov 2013 13:10:04 +0100 Subject: Add GUI for 'image-rendering'. Completes fix for blocker bug #1163449. Removed two unused preference options for bitmaps. (bzr r12823) --- src/extension/internal/gdkpixbuf-input.cpp | 56 ++++++++++++++++++++++-------- src/extension/system.cpp | 4 +-- 2 files changed, 43 insertions(+), 17 deletions(-) (limited to 'src/extension') diff --git a/src/extension/internal/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp index 6d159d265..d7d692091 100644 --- a/src/extension/internal/gdkpixbuf-input.cpp +++ b/src/extension/internal/gdkpixbuf-input.cpp @@ -26,23 +26,34 @@ namespace Internal { SPDocument * GdkpixbufInput::open(Inkscape::Extension::Input *mod, char const *uri) { - // determine whether the image should be embedded - // TODO: this logic seems very wrong - bool embed = false; + // Determine whether the image should be embedded Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - Glib::ustring attr = prefs->getString("/dialogs/import/link"); - if (strcmp(attr.c_str(), "embed") == 0) { - embed = true; - } else if (strcmp(attr.c_str(), "link") == 0) { - embed = false; - } else { - embed = (strcmp(mod->get_param_optiongroup("link"), "embed") == 0); - if (mod->get_param_bool("ask")) { - prefs->setString("/dialogs/import/link", mod->get_param_optiongroup("link")); - mod->set_param_bool("ask", false); + bool ask = prefs->getBool("/dialogs/import/ask"); + Glib::ustring link = prefs->getString("/dialogs/import/link"); + Glib::ustring scale = prefs->getString("/dialogs/import/scale"); + // std::cout << "GkdpixbufInput::open: " + // << " ask: " << ask + // << ", link: " << link + // << ", scale: " << scale << std::endl; + // std::cout << " in preferences: " + // << " ask: " << !mod->get_param_bool("do_not_ask") + // << ", link: " << mod->get_param_optiongroup("link") + // << ", scale: " << mod->get_param_optiongroup("scale") << std::endl; + if( ask ) { + Glib::ustring mod_link = mod->get_param_optiongroup("link"); + Glib::ustring mod_scale = mod->get_param_optiongroup("scale"); + if( link.compare( mod_link ) != 0 ) { + link = mod_link; + } + prefs->setString("/dialogs/import/link", link ); + if( scale.compare( mod_scale ) != 0 ) { + scale = mod_scale; } + prefs->setString("/dialogs/import/scale", scale ); + prefs->setBool("/dialogs/import/ask", !mod->get_param_bool("do_not_ask") ); } - + bool embed = ( link.compare( "embed" ) == 0 ); + SPDocument *doc = NULL; boost::scoped_ptr pb(Inkscape::Pixbuf::create_from_file(uri)); @@ -84,6 +95,12 @@ GdkpixbufInput::open(Inkscape::Extension::Input *mod, char const *uri) Inkscape::XML::Node *image_node = xml_doc->createElement("svg:image"); sp_repr_set_svg_double(image_node, "width", width); sp_repr_set_svg_double(image_node, "height", height); + if( scale.compare( "auto" ) != 0 ) { + SPCSSAttr *css = sp_repr_css_attr_new(); + sp_repr_css_set_property(css, "image-rendering", scale.c_str()); + sp_repr_css_set(image_node, css, "style"); + sp_repr_css_attr_unref( css ); + } if (embed) { sp_embed_image(image_node, pb.get()); @@ -155,12 +172,21 @@ GdkpixbufInput::init(void) "\n" "%s\n" "org.inkscape.input.gdkpixbuf.%s\n" + "\n" "<_option value='embed' >" N_("Embed") "\n" "<_option value='link' >" N_("Link") "\n" "\n" "<_param name='help' type='description'>" N_("Embed results in stand-alone, larger SVG files. Link references a file outside this SVG document and all files must be moved together.") "\n" - "false\n" + + "\n" + "<_option value='auto' >" N_("None (auto)") "\n" + "<_option value='optimizeQuality' >" N_("Smooth (optimizeQuality)") "\n" + "<_option value='optimizeSpeed' >" N_("Blocky (optimizeSpeed)") "\n" + "\n" + "<_param name='help' type='description'>" N_("When an image is upscaled, apply smoothing or keep blocky (pixelated). (Will not work in all browsers.)") "\n" + + "false\n" "\n" ".%s\n" "%s\n" diff --git a/src/extension/system.cpp b/src/extension/system.cpp index c0211032c..7a50826ca 100644 --- a/src/extension/system.cpp +++ b/src/extension/system.cpp @@ -97,9 +97,9 @@ SPDocument *open(Extension *key, gchar const *filename) bool show = true; if (strlen(imod->get_id()) > 27) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - Glib::ustring attr = prefs->getString("/dialogs/import/link"); + bool ask = prefs->getBool("/dialogs/import/ask"); Glib::ustring id = Glib::ustring(imod->get_id(), 28); - if (strcmp(attr.c_str(), "ask") != 0 and strcmp(id.c_str(), "org.inkscape.input.gdkpixbuf") == 0) { + if (!ask and id.compare( "org.inkscape.input.gdkpixbuf") == 0) { show = false; imod->set_gui(false); } -- cgit v1.2.3