From: buliabyak Date: Thu, 11 Oct 2007 16:40:24 +0000 (+0000) Subject: implement no-forking option X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=515dd1f8827bd4ae40db7f2b2438bad1cf653e3f;p=inkscape.git implement no-forking option --- diff --git a/src/gradient-chemistry.cpp b/src/gradient-chemistry.cpp index 486d38167..37b50eca0 100644 --- a/src/gradient-chemistry.cpp +++ b/src/gradient-chemistry.cpp @@ -34,6 +34,7 @@ #include "svg/svg.h" #include "svg/svg-color.h" #include "svg/css-ostringstream.h" +#include "prefs-utils.h" // Terminology: @@ -234,6 +235,10 @@ sp_gradient_fork_private_if_necessary(SPGradient *gr, SPGradient *vector, SPGradient * sp_gradient_fork_vector_if_necessary (SPGradient *gr) { + // Some people actually prefer their gradient vectors to be shared... + if (prefs_get_int_attribute("options.forkgradientvectors", "value", 1) == 0) + return gr; + if (SP_OBJECT_HREFCOUNT(gr) > 1) { SPDocument *doc = SP_OBJECT_DOCUMENT(gr); Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); diff --git a/src/preferences-skeleton.h b/src/preferences-skeleton.h index 4c7616495..ca9988494 100644 --- a/src/preferences-skeleton.h +++ b/src/preferences-skeleton.h @@ -243,6 +243,7 @@ static char const preferences_skeleton[] = " clips=\"16711935\"" // 00ff00ff " masks=\"65535\"/>\n" // 0x0000ffff " \n" +" \n" " \n" "\n" " " diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 2510825d0..ccc41a0a3 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -800,6 +800,21 @@ void InkscapePreferences::initPageMisc() _page_misc.add_line( false, "", _misc_comment, "", _("When on, a comment will be added to the raw print output, marking the rendered output for an object with its label"), true); + _misc_forkvectors.init( _("Prevent sharing of gradient definitions"), "options.forkgradientvectors", "value", true); + _page_misc.add_line( false, "", _misc_forkvectors, "", + _("When on, shared gradient definitions are automatically forked on change; uncheck to allow sharing of gradient definitions so that editing one object may affect other objects using the same gradient"), true); + + _page_misc.add_line( false, _("Simplification threshold:"), _misc_simpl, "", + _("How strong is the Simplify command by default. If you invoke this command several times in quick succession, it will act more and more aggressively; invoking it again after a pause restores the default threshold."), false); + int const num_items = 5; + Glib::ustring labels[num_items] = {_("None"), _("2x2"), _("4x4"), _("8x8"), _("16x16")}; + int values[num_items] = {0, 1, 2, 3, 4}; + _misc_overs_bitmap.set_size_request(_sb_width); + _misc_overs_bitmap.init("options.bitmapoversample", "value", labels, values, num_items, 1); + _page_misc.add_line( false, _("Oversample bitmaps:"), _misc_overs_bitmap, "", "", false); + + + // consider moving this to an UI tab: _misc_small_toolbar.init( _("Make commands toolbar smaller"), "toolbox", "small", true); _page_misc.add_line( false, "", _misc_small_toolbar, "", _("Make the commands toolbar use the 'secondary' toolbar size (requires restart)"), true); @@ -812,14 +827,6 @@ void InkscapePreferences::initPageMisc() _page_misc.add_line( false, _("Max recent documents:"), _misc_recent, "", _("The maximum length of the Open Recent list in the File menu"), false); _misc_simpl.init("options.simplifythreshold", "value", 0.0001, 1.0, 0.0001, 0.0010, 0.0010, false, false); - _page_misc.add_line( false, _("Simplification threshold:"), _misc_simpl, "", - _("How strong is the Simplify command by default. If you invoke this command several times in quick succession, it will act more and more aggressively; invoking it again after a pause restores the default threshold."), false); - int const num_items = 5; - Glib::ustring labels[num_items] = {_("None"), _("2x2"), _("4x4"), _("8x8"), _("16x16")}; - int values[num_items] = {0, 1, 2, 3, 4}; - _misc_overs_bitmap.set_size_request(_sb_width); - _misc_overs_bitmap.init("options.bitmapoversample", "value", labels, values, num_items, 1); - _page_misc.add_line( false, _("Oversample bitmaps:"), _misc_overs_bitmap, "", "", false); this->AddPage(_page_misc, _("Misc"), PREFS_PAGE_MISC); } diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h index 7aadb3399..a6da63617 100644 --- a/src/ui/dialog/inkscape-preferences.h +++ b/src/ui/dialog/inkscape-preferences.h @@ -160,7 +160,7 @@ protected: PrefCheckButton _sel_layer_deselects; PrefSpinButton _importexport_export, _misc_recent, _misc_simpl; - PrefCheckButton _misc_comment, _misc_scripts; + PrefCheckButton _misc_comment, _misc_forkvectors, _misc_scripts; PrefCheckButton _misc_small_toolbar; PrefCheckButton _misc_small_tools; PrefCombo _misc_overs_bitmap;