? Diagram1.dia.autosave ? lib/diamarshal.c ? lib/diamarshal.h ? plug-ins/gprint/Makefile ? plug-ins/gprint/Makefile.in Index: ChangeLog =================================================================== RCS file: /cvs/gnome/dia/ChangeLog,v retrieving revision 1.1657 diff -u -r1.1657 ChangeLog --- ChangeLog 31 Dec 2004 20:13:35 -0000 1.1657 +++ ChangeLog 10 Jan 2005 18:49:55 -0000 @@ -1,3 +1,9 @@ +2004-01-10 Philip Van Hoof + + * app/properties.c: A properties box when multiple objects + are selected. The intersection of the available properties + is showed. + 2004-12-31 Hans Breuer * lib/dia_dirs.c(dia_get_canonical_path) : complete Index: app/commands.c =================================================================== RCS file: /cvs/gnome/dia/app/commands.c,v retrieving revision 1.128 diff -u -r1.128 commands.c --- app/commands.c 6 Nov 2004 16:51:23 -0000 1.128 +++ app/commands.c 10 Jan 2005 18:49:56 -0000 @@ -1082,8 +1082,13 @@ if (!dia) return; if (dia->data->selected != NULL) { + + properties_of_selected_show (dia, dia->data->selected); +/* selected = dia->data->selected->data; properties_show(dia, selected); +*/ + } else { diagram_properties_show(dia); } Index: app/properties.c =================================================================== RCS file: /cvs/gnome/dia/app/properties.c,v retrieving revision 1.35 diff -u -r1.35 properties.c --- app/properties.c 4 Jul 2004 23:03:07 -0000 1.35 +++ app/properties.c 10 Jan 2005 18:49:57 -0000 @@ -22,7 +22,7 @@ #include #include - +#include "propinternals.h" #include "intl.h" #include "properties.h" #include "object_ops.h" @@ -163,6 +163,96 @@ return 0; } + +extern gboolean pdtpp_is_visible_no_standard(const PropDescription *pdesc); +void +properties_of_selected_show (Diagram *dia, GList *selected_in) +{ + GList *selected = g_list_first(selected_in); + + if (selected) + { + gint dialog_retval = 0; + PropDialog *pdialog = prop_dialog_new (selected->data, FALSE); + GList *have = NULL; + PropDescription *pdesc = NULL; + GtkWidget *dialog = gtk_dialog_new_with_buttons( + ("Properties of multiple objects"), + GTK_WINDOW (ddisplay_active()->shell), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, + GTK_STOCK_APPLY, GTK_RESPONSE_APPLY, + GTK_STOCK_OK, GTK_RESPONSE_OK, + NULL); + + gtk_dialog_set_default_response (GTK_DIALOG(dialog), GTK_RESPONSE_OK); + + + have = g_list_append (have, (gpointer)object_get_prop_descriptions (selected->data)); + + while (selected) + { + DiaObject *obj = selected->data; + if (object_complies_with_stdprop (obj)) + { + guint i; + GPtrArray *props = NULL; + + + have = g_list_append (have, (gpointer)object_get_prop_descriptions (obj)); + pdesc = prop_desc_lists_intersection (have); + + props = prop_list_from_descs(pdesc, pdtpp_is_visible_no_standard); + + obj->ops->get_props(obj,props); + + for (i = 0; i < props->len; i++) { + Property *prop = (Property*)g_ptr_array_index(props,i); + prop_dialog_add_property(pdialog, prop); + } + + + } + + selected = g_list_next (selected); + } + + g_list_free (have); + + + gtk_box_pack_start_defaults (GTK_BOX (GTK_DIALOG (dialog)->vbox), prop_dialog_get_widget(pdialog)); + gtk_widget_show_all (prop_dialog_get_widget (pdialog)); + + + dialog_retval = gtk_dialog_run (GTK_DIALOG(dialog)); + + if (dialog_retval == GTK_RESPONSE_APPLY || dialog_retval == GTK_RESPONSE_OK) + { + + selected = selected_in; + while (selected) + { + if (selected->data) + { + + current_obj = selected->data; + current_dia = dia; + object_part = pdialog->widget; + + // object_apply_props_from_dialog (current_obj, object_part); + prop_get_data_from_widgets(pdialog); + object_apply_props(selected->data, pdialog->props); + + } + selected = g_list_next (selected); + } + } + + gtk_widget_destroy (dialog); + + } +} + void properties_show(Diagram *dia, DiaObject *obj) Index: app/properties.h =================================================================== RCS file: /cvs/gnome/dia/app/properties.h,v retrieving revision 1.6 diff -u -r1.6 properties.h --- app/properties.h 21 May 2004 15:48:33 -0000 1.6 +++ app/properties.h 10 Jan 2005 18:49:57 -0000 @@ -21,6 +21,7 @@ #include "object.h" #include "diagram.h" +void properties_of_selected_show (Diagram *dia, GList *selected_in); void properties_show(Diagram *dia, DiaObject *obj); void properties_update_if_shown(Diagram *dia, DiaObject *obj); void properties_hide_if_shown(Diagram *dia, DiaObject *obj);