From 8a2e93a39e369953e0fc16168d5a11c26a20f309 Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Fri, 30 Dec 2011 12:01:48 +0100 Subject: Item properties dialog: fix wasting resources when moving objects (bzr r10806) --- src/dialogs/item-properties.cpp | 15 ++++++++++++--- src/dialogs/item-properties.h | 4 +++- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'src/dialogs') diff --git a/src/dialogs/item-properties.cpp b/src/dialogs/item-properties.cpp index 8d468705c..55c292900 100644 --- a/src/dialogs/item-properties.cpp +++ b/src/dialogs/item-properties.cpp @@ -108,7 +108,8 @@ SPItemDialog::SPItemDialog (void) : CBLock(_("L_ock"), 1), BSet (_("_Set"), 1), LabelInteractivity(_("_Interactivity"), 1), - attrTable() + attrTable(), + CurrentItem(0) { gchar title[500]; sp_ui_dialog_title_string (Inkscape::Verb::get(SP_VERB_DIALOG_ITEM), title); @@ -310,9 +311,17 @@ void SPItemDialog::widget_setup(void) } else { set_sensitive (true); } - blocked = true; - + SPItem *item = selection->singleItem(); + if (CurrentItem == item) + { + //otherwise we would end up wasting resources through the modify selection + //callback when moving an object (endlessly setting the labels and recreating attrTable) + return; + } + blocked = true; + + CurrentItem = item; CBLock.set_active (item->isLocked()); /* Sensitive */ CBHide.set_active(item->isExplicitlyHidden()); /* Hidden */ diff --git a/src/dialogs/item-properties.h b/src/dialogs/item-properties.h index ce4b2a146..f764c46fb 100644 --- a/src/dialogs/item-properties.h +++ b/src/dialogs/item-properties.h @@ -65,7 +65,9 @@ private: Gtk::Label LabelInteractivity; //the label for interactivity Gtk::Expander EInteractivity; //the label for interactivity - SPAttributeTable attrTable; + SPAttributeTable attrTable; //the widget for showing the on... names at the bottom + + SPItem *CurrentItem; //to store the current item, for not wasting resources void MakeWidget(void); void label_changed(void); -- cgit v1.2.3