summaryrefslogtreecommitdiffstats
path: root/src/splivarot.cpp
diff options
context:
space:
mode:
authorJohn Bintz <me@johnbintz.com>2006-08-13 18:48:37 +0000
committerjohncoswell <johncoswell@users.sourceforge.net>2006-08-13 18:48:37 +0000
commit5405cd71cf8c0aa7a202506fb11444d51747c368 (patch)
treee64e2b4c4801546392e088475ad3a7f65d29a18d /src/splivarot.cpp
parentadd interface for disabling interaction during long-running operations (diff)
downloadinkscape-5405cd71cf8c0aa7a202506fb11444d51747c368.tar.gz
inkscape-5405cd71cf8c0aa7a202506fb11444d51747c368.zip
inform user of progress during long-running simplify operations
(bzr r1597)
Diffstat (limited to 'src/splivarot.cpp')
-rw-r--r--src/splivarot.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/splivarot.cpp b/src/splivarot.cpp
index 87ad24800..2fd01cb69 100644
--- a/src/splivarot.cpp
+++ b/src/splivarot.cpp
@@ -1482,6 +1482,13 @@ sp_selected_path_simplify_items(SPDesktop *desktop,
bool simplifyIndividualPaths =
(bool) prefs_get_int_attribute("options.simplifyindividualpaths", "value", 0);
+ gchar *simplificationType;
+ if (simplifyIndividualPaths) {
+ simplificationType = "individual paths";
+ } else {
+ simplificationType = "as a group";
+ }
+
bool didSomething = false;
NR::Rect selectionBbox = selection->bounds();
@@ -1489,6 +1496,11 @@ sp_selected_path_simplify_items(SPDesktop *desktop,
gdouble simplifySize = selectionSize;
+ int pathsSimplified = 0;
+ int totalPathCount = g_slist_length(items);
+
+ desktop->disableInteraction();
+
for (; items != NULL; items = items->next) {
SPItem *item = (SPItem *) items->data;
@@ -1500,10 +1512,25 @@ sp_selected_path_simplify_items(SPDesktop *desktop,
simplifySize = L2(itemBbox.dimensions());
}
+
+ pathsSimplified++;
+
+ if (pathsSimplified % 20 == 0) {
+ gchar *message = g_strdup_printf(_("Simplifying %s - <b>%d</b> of <b>%d</b> paths simplified..."), simplificationType, pathsSimplified, totalPathCount);
+ desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, message);
+ desktop->updateCanvasNow();
+ }
+
didSomething |= sp_selected_path_simplify_item(desktop, selection, item,
threshold, justCoalesce, angleLimit, breakableAngles, simplifySize, modifySelection);
}
+ desktop->enableInteraction();
+
+ if (pathsSimplified > 20) {
+ desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, g_strdup_printf(_("Done - <b>%d</b> paths simplified."), pathsSimplified));
+ }
+
return didSomething;
}