summaryrefslogtreecommitdiffstats
path: root/src/dialogs/object-attributes.cpp
diff options
context:
space:
mode:
authorKris De Gussem <kris.degussem@gmail.com>2012-01-01 12:18:42 +0000
committerKris <Kris.De.Gussem@hotmail.com>2012-01-01 12:18:42 +0000
commit0b983c4b758727e27347abf67467883f40741aa0 (patch)
treefe991bcf42ea02efda23a77e8c243bc850651285 /src/dialogs/object-attributes.cpp
parentAdded signal for desktop destruction to allow for proper removal of tracked s... (diff)
downloadinkscape-0b983c4b758727e27347abf67467883f40741aa0.tar.gz
inkscape-0b983c4b758727e27347abf67467883f40741aa0.zip
Item and image properties dialog update: restoring correct behaviour in case of deleting an object
(bzr r10815)
Diffstat (limited to 'src/dialogs/object-attributes.cpp')
-rw-r--r--src/dialogs/object-attributes.cpp26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/dialogs/object-attributes.cpp b/src/dialogs/object-attributes.cpp
index b4b2fe256..808e9a16a 100644
--- a/src/dialogs/object-attributes.cpp
+++ b/src/dialogs/object-attributes.cpp
@@ -66,6 +66,19 @@ static const SPAttrDesc image_nohref_desc[] = {
{ NULL, NULL}
};
+static void object_released( SPObject */*object*/, GtkWidget *widget )
+{
+ gtk_widget_destroy (widget);
+}
+
+
+
+static void window_destroyed( GtkObject *window, GtkObject */*object*/ )
+{
+ sigc::connection *release_connection = (sigc::connection *)g_object_get_data(G_OBJECT(window), "release_connection");
+ release_connection->disconnect();
+ delete release_connection;
+}
static void sp_object_attr_show_dialog ( SPObject *object,
const SPAttrDesc *desc,
@@ -95,8 +108,17 @@ static void sp_object_attr_show_dialog ( SPObject *object,
}
window = Inkscape::UI::window_new (title.c_str(), true);
- t = new SPAttributeTable (object, labels, attrs, NULL);
- window->show_all();
+ t = new SPAttributeTable (object, labels, attrs, (GtkWidget*)window->gobj());
+
+ g_signal_connect (window->gobj(), "destroy",
+ G_CALLBACK (window_destroyed), object );
+
+ sigc::connection *release_connection = new sigc::connection();
+ *release_connection = object->connectRelease(sigc::bind<1>(sigc::ptr_fun(&object_released), (GtkWidget*)window->gobj()));
+ g_object_set_data((GObject*)window->gobj(), "release_connection", release_connection);
+
+ t->show();
+ window->show();
} // end of sp_object_attr_show_dialog()