summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRaphael Rosch <launchpad@insaner.com>2013-05-13 06:27:27 +0000
committerinsaner <launchpad@insaner.com>2013-05-13 06:27:27 +0000
commit809b1fa562f45269681ef26a0350c9b15f394ba8 (patch)
tree6b9eb54ca16f985032c79b616362209ed444f23c /src
parentMoved icc selector members to internal helper. (diff)
downloadinkscape-809b1fa562f45269681ef26a0350c9b15f394ba8.tar.gz
inkscape-809b1fa562f45269681ef26a0350c9b15f394ba8.zip
cleanup document option to clean up unused swatches
Fixed bugs: - https://launchpad.net/bugs/1177888 (bzr r12333)
Diffstat (limited to 'src')
-rw-r--r--src/sp-object.cpp4
-rw-r--r--src/ui/dialog/inkscape-preferences.cpp7
-rw-r--r--src/ui/dialog/inkscape-preferences.h4
3 files changed, 14 insertions, 1 deletions
diff --git a/src/sp-object.cpp b/src/sp-object.cpp
index 4d2a5a709..b5c93e792 100644
--- a/src/sp-object.cpp
+++ b/src/sp-object.cpp
@@ -455,13 +455,15 @@ void SPObject::setLabel(gchar const *label)
void SPObject::requestOrphanCollection() {
g_return_if_fail(document != NULL);
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
// do not remove style or script elements (Bug #276244)
if (SP_IS_STYLE_ELEM(this)) {
// leave it
} else if (SP_IS_SCRIPT(this)) {
// leave it
- } else if (SP_IS_PAINT_SERVER(this) && static_cast<SPPaintServer*>(this)->isSwatch() ) {
+
+ } else if ((! prefs->getBool("/options/cleanupswatches/value", false)) && SP_IS_PAINT_SERVER(this) && static_cast<SPPaintServer*>(this)->isSwatch() ) {
// leave it
} else if (IS_COLORPROFILE(this)) {
// leave it
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp
index 6a696045d..bc648002d 100644
--- a/src/ui/dialog/inkscape-preferences.cpp
+++ b/src/ui/dialog/inkscape-preferences.cpp
@@ -1341,6 +1341,13 @@ void InkscapePreferences::initPageBehavior()
_("Update marker color when object color changes"));
this->AddPage(_page_markers, _("Markers"), iter_behavior, PREFS_PAGE_BEHAVIOR_MARKERS);
+
+
+ _page_cleanup.add_group_header( _("Document cleanup"));
+ _cleanup_swatches.init ( _("Remove unused swatches when doing a document cleanup"), "/options/cleanupswatches/value", false); // text label
+ _page_cleanup.add_line( true, "", _cleanup_swatches, "",
+ _("Remove unused swatches when doing a document cleanup")); // tooltip
+ this->AddPage(_page_cleanup, _("Cleanup"), iter_behavior, PREFS_PAGE_BEHAVIOR_CLEANUP);
}
void InkscapePreferences::initPageRendering()
diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h
index 82df26d54..37c05df05 100644
--- a/src/ui/dialog/inkscape-preferences.h
+++ b/src/ui/dialog/inkscape-preferences.h
@@ -74,6 +74,7 @@ enum {
PREFS_PAGE_BEHAVIOR_CLONES,
PREFS_PAGE_BEHAVIOR_MASKS,
PREFS_PAGE_BEHAVIOR_MARKERS,
+ PREFS_PAGE_BEHAVIOR_CLEANUP,
PREFS_PAGE_IO,
PREFS_PAGE_IO_MOUSE,
PREFS_PAGE_IO_SVGOUTPUT,
@@ -167,6 +168,7 @@ protected:
UI::Widget::DialogPage _page_clones;
UI::Widget::DialogPage _page_mask;
UI::Widget::DialogPage _page_markers;
+ UI::Widget::DialogPage _page_cleanup;
UI::Widget::DialogPage _page_io;
UI::Widget::DialogPage _page_mouse;
@@ -311,6 +313,8 @@ protected:
UI::Widget::PrefCheckButton _markers_color_stock;
UI::Widget::PrefCheckButton _markers_color_custom;
UI::Widget::PrefCheckButton _markers_color_update;
+
+ UI::Widget::PrefCheckButton _cleanup_swatches;
UI::Widget::PrefSpinButton _importexport_export_res;
UI::Widget::PrefSpinButton _importexport_import_res;