dia r4228 - in trunk: . objects/SISSI
- From: hans svn gnome org
- To: svn-commits-list gnome org
- Subject: dia r4228 - in trunk: . objects/SISSI
- Date: Sun, 25 Jan 2009 20:48:46 +0000 (UTC)
Author: hans
Date: Sun Jan 25 20:48:46 2009
New Revision: 4228
URL: http://svn.gnome.org/viewvc/dia?rev=4228&view=rev
Log:
2009-01-24 Hans Breuer <hans breuer org>
* objects/SISSI/area.c objects/SISSI/faraday.c objects/SISSI/room.c
objects/SISSI/sissi.[ch] objects/SISSI/sissi_dialog.c
objects/SISSI/sissi_object.c objects/SISSI/site.c : fixed object
method DiaObject::apply_props_from_dialog() for the last known issue
with changing multiple objects properties, bug #60331
(It did not crash because the SISSI object don't contribute anything
to the property list.)
* objects/SISSI/sissi_object.c(280) : local variable 'filename' used
without having been initialized
* objects/SISSI/sissi_dialog.c(380) : incompatible types - from
'struct _GtkWidget *' to 'struct _GtkScrolledWindow *'
Modified:
trunk/ChangeLog
trunk/objects/SISSI/area.c
trunk/objects/SISSI/faraday.c
trunk/objects/SISSI/room.c
trunk/objects/SISSI/sissi.c
trunk/objects/SISSI/sissi.h
trunk/objects/SISSI/sissi_dialog.c
trunk/objects/SISSI/sissi_object.c
trunk/objects/SISSI/site.c
Modified: trunk/objects/SISSI/area.c
==============================================================================
--- trunk/objects/SISSI/area.c (original)
+++ trunk/objects/SISSI/area.c Sun Jan 25 20:48:46 2009
@@ -102,7 +102,7 @@
(MoveFunc) object_sissi_move,
(MoveHandleFunc) object_sissi_move_handle,
(GetPropertiesFunc) object_sissi_get_properties,
- (ApplyPropertiesDialogFunc) object_sissi_apply_properties,
+ (ApplyPropertiesDialogFunc) object_sissi_apply_props_from_dialog,
(ObjectMenuFunc) NULL,
(DescribePropsFunc) area_describe_props,
(GetPropsFunc) area_get_props,
Modified: trunk/objects/SISSI/faraday.c
==============================================================================
--- trunk/objects/SISSI/faraday.c (original)
+++ trunk/objects/SISSI/faraday.c Sun Jan 25 20:48:46 2009
@@ -104,7 +104,7 @@
(MoveFunc) object_sissi_move,
(MoveHandleFunc) object_sissi_move_handle,
(GetPropertiesFunc) object_sissi_get_properties,
- (ApplyPropertiesDialogFunc) object_sissi_apply_properties,
+ (ApplyPropertiesDialogFunc) object_sissi_apply_props_from_dialog,
(ObjectMenuFunc) NULL,
(DescribePropsFunc) faraday_describe_props,
(GetPropsFunc) faraday_get_props,
Modified: trunk/objects/SISSI/room.c
==============================================================================
--- trunk/objects/SISSI/room.c (original)
+++ trunk/objects/SISSI/room.c Sun Jan 25 20:48:46 2009
@@ -103,7 +103,7 @@
(MoveFunc) object_sissi_move,
(MoveHandleFunc) object_sissi_move_handle,
(GetPropertiesFunc) object_sissi_get_properties,
- (ApplyPropertiesDialogFunc) object_sissi_apply_properties,
+ (ApplyPropertiesDialogFunc) object_sissi_apply_props_from_dialog,
(ObjectMenuFunc) NULL,
(DescribePropsFunc) room_describe_props,
(GetPropsFunc) room_get_props,
Modified: trunk/objects/SISSI/sissi.c
==============================================================================
--- trunk/objects/SISSI/sissi.c (original)
+++ trunk/objects/SISSI/sissi.c Sun Jan 25 20:48:46 2009
@@ -773,10 +773,15 @@
return object_sissi_get_properties_dialog(object_sissi, is_default);
}
-void
-object_sissi_apply_properties(ObjetSISSI *object_sissi)
+ObjectChange *
+object_sissi_apply_props_from_dialog(ObjetSISSI *object_sissi, GtkWidget *widget)
{
- object_sissi_apply_properties_dialog(object_sissi);
+ /* with multiple objects selected this function may as well be called with a different dialog */
+ if (object_sissi->properties_dialog != NULL &&
+ object_sissi->properties_dialog->dialog == widget)
+ return object_sissi_apply_properties_dialog(object_sissi);
+ else
+ return object_apply_props_from_dialog (&object_sissi->element.object, widget);
}
SISSI_Property *
Modified: trunk/objects/SISSI/sissi.h
==============================================================================
--- trunk/objects/SISSI/sissi.h (original)
+++ trunk/objects/SISSI/sissi.h Sun Jan 25 20:48:46 2009
@@ -197,7 +197,7 @@
extern ObjetSISSI *object_sissi_load(ObjectNode obj_node, int version, const char *filename, ObjetSISSI *object_sissi,Element *elem,DiaObject *obj);
extern GtkWidget *object_sissi_get_properties(ObjetSISSI *object_sissi, gboolean is_default);
-extern void object_sissi_apply_properties(ObjetSISSI *object_sissi);
+extern ObjectChange *object_sissi_apply_props_from_dialog(ObjetSISSI *object_sissi, GtkWidget *widget);
extern DiaObject *object_sissi_copy_using_properties(ObjetSISSI *object_sissi_origine);
Modified: trunk/objects/SISSI/sissi_dialog.c
==============================================================================
--- trunk/objects/SISSI/sissi_dialog.c (original)
+++ trunk/objects/SISSI/sissi_dialog.c Sun Jan 25 20:48:46 2009
@@ -377,7 +377,7 @@
pScroll_others = gtk_scrolled_window_new(NULL, NULL);
-gtk_scrolled_window_set_policy(pScroll_others,GTK_POLICY_NEVER,GTK_POLICY_AUTOMATIC);
+gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(pScroll_others),GTK_POLICY_NEVER,GTK_POLICY_AUTOMATIC);
/*gtk_window_set_default_size(GTK_WINDOW(pScroll_others), 300, 200);*/
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(pScroll_others), prop_dialog->vbox_others);
@@ -788,7 +788,8 @@
}
}
-static void destroy_properties_dialog (GtkWidget* widget, gpointer user_data)
+static void
+destroy_properties_dialog (GtkWidget* widget, gpointer user_data)
{
ObjetSISSI *object_sissi = (ObjetSISSI *)user_data;
@@ -802,7 +803,8 @@
gtk_widget_destroy(object_sissi->properties_dialog->entity);
gtk_widget_destroy((GtkWidget *)object_sissi->properties_dialog->name);
- g_free(object_sissi->properties_dialog);
+ g_free(object_sissi->properties_dialog);
+ object_sissi->properties_dialog = NULL;
}
static void fill_in_dialog(ObjetSISSI *object_sissi)
@@ -981,7 +983,8 @@
}
/* apply the properties of dialog box to Object */
-extern ObjectChange *object_sissi_apply_properties_dialog(ObjetSISSI *object_sissi)
+extern ObjectChange *
+object_sissi_apply_properties_dialog(ObjetSISSI *object_sissi)
{
SISSIDialog *prop_dialog;
DiaObject *obj;
@@ -990,13 +993,16 @@
GList *disconnected = NULL;
SISSIState *old_state = NULL;
prop_dialog = object_sissi->properties_dialog;
+
+
+ g_return_val_if_fail(prop_dialog != NULL, NULL);
obj = &object_sissi->element.object;
- properties_menaces_read_from_dialog(object_sissi, prop_dialog);
- properties_others_read_from_dialog(object_sissi, prop_dialog);
- document_read_from_dialog(object_sissi, prop_dialog);
- object_sissi_update_data(object_sissi, ANCHOR_MIDDLE, ANCHOR_MIDDLE);
- return new_sissi_change(object_sissi, old_state, added, deleted, disconnected);
+ properties_menaces_read_from_dialog(object_sissi, prop_dialog);
+ properties_others_read_from_dialog(object_sissi, prop_dialog);
+ document_read_from_dialog(object_sissi, prop_dialog);
+ object_sissi_update_data(object_sissi, ANCHOR_MIDDLE, ANCHOR_MIDDLE);
+ return new_sissi_change(object_sissi, old_state, added, deleted, disconnected);
}
static void create_dialog_pages(GtkNotebook *notebook, ObjetSISSI *object_sissi)
Modified: trunk/objects/SISSI/sissi_object.c
==============================================================================
--- trunk/objects/SISSI/sissi_object.c (original)
+++ trunk/objects/SISSI/sissi_object.c Sun Jan 25 20:48:46 2009
@@ -104,7 +104,7 @@
(MoveFunc) object_sissi_move,
(MoveHandleFunc) object_sissi_move_handle,
(GetPropertiesFunc) object_sissi_get_properties,
- (ApplyPropertiesDialogFunc) object_sissi_apply_properties,
+ (ApplyPropertiesDialogFunc) object_sissi_apply_props_from_dialog,
(ObjectMenuFunc) NULL,
(DescribePropsFunc) sissi_object_describe_props,
(GetPropsFunc) sissi_object_get_props,
@@ -164,7 +164,7 @@
Url_Docs *url_doc;
Point pos;
int fd;
- gchar *filename;
+ gchar *filename = NULL;
char composition_filename[255];
xmlDocPtr doc;
xmlNsPtr namespace;
Modified: trunk/objects/SISSI/site.c
==============================================================================
--- trunk/objects/SISSI/site.c (original)
+++ trunk/objects/SISSI/site.c Sun Jan 25 20:48:46 2009
@@ -104,7 +104,7 @@
(MoveFunc) object_sissi_move,
(MoveHandleFunc) object_sissi_move_handle,
(GetPropertiesFunc) object_sissi_get_properties,
- (ApplyPropertiesDialogFunc) object_sissi_apply_properties,
+ (ApplyPropertiesDialogFunc) object_sissi_apply_props_from_dialog,
(ObjectMenuFunc) NULL,
(DescribePropsFunc) site_describe_props,
(GetPropsFunc) site_get_props,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]