dia r4151 - in trunk: . app objects/Database objects/UML plug-ins



Author: hans
Date: Mon Dec  8 08:29:41 2008
New Revision: 4151
URL: http://svn.gnome.org/viewvc/dia?rev=4151&view=rev

Log:
	* objects/UML/class.c : don't crash when 
	umlclass_apply_props_from_dialog() get callesd without 
	umlclass_get_properties(), instead fall back to 
	object_apply_props_from_dialog() than
	* objects/Database/table.c : same here
	
	* app/properties.c : for a single object let Object::get_properties()
	create the "object part" of the property dialog



Modified:
   trunk/ChangeLog
   trunk/app/properties.c
   trunk/objects/Database/table.c
   trunk/objects/UML/class.c
   trunk/plug-ins/makefile.msc

Modified: trunk/app/properties.c
==============================================================================
--- trunk/app/properties.c	(original)
+++ trunk/app/properties.c	Mon Dec  8 08:29:41 2008
@@ -199,6 +199,7 @@
 object_list_properties_show(Diagram *dia, GList *objects)
 {
   GtkWidget *properties;
+  DiaObject *one_obj;
 
   if (!dialog)
     create_dialog();
@@ -210,14 +211,17 @@
     return;
   }
 
-  properties = object_list_create_props_dialog(objects, FALSE);
+  one_obj = (g_list_length(objects) == 1) ? objects->data : NULL;
+  if (one_obj)
+    properties = one_obj->ops->get_properties(one_obj, FALSE);
+  else
+    properties = object_list_create_props_dialog(objects, FALSE);
   if (properties == NULL) {
     properties = no_properties_dialog;
   }
 
-  if (g_list_length(objects) == 1) {
-    DiaObject *obj = (DiaObject*)objects->data;
-    DiaObjectType *otype = obj->type;
+  if (one_obj) {
+    DiaObjectType *otype = one_obj->type;
     gchar *buf;
     
     buf = g_strconcat(_("Properties: "), otype->name, NULL);

Modified: trunk/objects/Database/table.c
==============================================================================
--- trunk/objects/Database/table.c	(original)
+++ trunk/objects/Database/table.c	Mon Dec  8 08:29:41 2008
@@ -67,6 +67,8 @@
 static PropDescription * table_describe_props (Table *);
 static void         table_get_props (Table *, GPtrArray *);
 static void         table_set_props (Table *, GPtrArray *);
+ObjectChange *_table_dialog_apply_changes (Table * table, GtkWidget * widget);
+
 static void         table_draw (Table *, DiaRenderer *);
 static real         table_draw_namebox (Table *, DiaRenderer *, Element *);
 static real         table_draw_attributesbox (Table *, DiaRenderer *,
@@ -896,6 +898,16 @@
     }
 }
 
+ObjectChange *
+_table_dialog_apply_changes (Table * table, GtkWidget * widget)
+{
+  /* fallback, if it isn't our dialog, e.g. during multiple selection change */
+  if (!table->prop_dialog)
+    return object_apply_props_from_dialog(&table->element.object, widget);
+  else
+    return table_dialog_apply_changes(table, widget);
+}
+
 /**
  * Init the height and width of the underlying element. This routine
  * uses `table_calculate_namebox_data' and

Modified: trunk/objects/UML/class.c
==============================================================================
--- trunk/objects/UML/class.c	(original)
+++ trunk/objects/UML/class.c	Mon Dec  8 08:29:41 2008
@@ -77,6 +77,8 @@
 static void fill_in_fontdata(UMLClass *umlclass);
 static int umlclass_num_dynamic_connectionpoints(UMLClass *class);
 
+static ObjectChange *_umlclass_apply_props_from_dialog(UMLClass *umlclass, GtkWidget *widget);
+
 static ObjectTypeOps umlclass_type_ops =
 {
   (CreateFunc) umlclass_create,
@@ -113,7 +115,7 @@
   (MoveFunc)            umlclass_move,
   (MoveHandleFunc)      umlclass_move_handle,
   (GetPropertiesFunc)   umlclass_get_properties,
-  (ApplyPropertiesDialogFunc) umlclass_apply_props_from_dialog,
+  (ApplyPropertiesDialogFunc) _umlclass_apply_props_from_dialog,
   (ObjectMenuFunc)      umlclass_object_menu,
   (DescribePropsFunc)   umlclass_describe_props,
   (GetPropsFunc)        umlclass_get_props,
@@ -214,6 +216,17 @@
   PROP_DESC_END
 };
 
+ObjectChange *
+_umlclass_apply_props_from_dialog(UMLClass *umlclass, GtkWidget *widget)
+{
+  DiaObject *obj = &umlclass->element.object;
+  /* fallback, if it isn't our dialog, e.g. during multiple selection change */
+  if (!umlclass->properties_dialog)
+    return object_apply_props_from_dialog (obj, widget);
+  else
+    return umlclass_apply_props_from_dialog (umlclass, widget);
+}
+
 static PropDescription *
 umlclass_describe_props(UMLClass *umlclass)
 {

Modified: trunk/plug-ins/makefile.msc
==============================================================================
--- trunk/plug-ins/makefile.msc	(original)
+++ trunk/plug-ins/makefile.msc	Mon Dec  8 08:29:41 2008
@@ -1,9 +1,8 @@
 !IFNDEF PACKAGE
 
 # dummy sissi
-PLUGINS = gprint cairo cgm dxf hpgl libart metapost pgf pixbuf \
-	postscript pstricks shape svg vdx wmf wpg xfig xslt \
-	autolayout
+PLUGINS = cairo cgm dxf hpgl libart metapost pgf pixbuf \
+	postscript pstricks shape svg vdx wmf wpg xfig xslt
 
 #broken since StdProp overhaul : diaimport 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]