glade3 r2076 - in trunk: . gladeui plugins/gtk+
- From: tvb svn gnome org
- To: svn-commits-list gnome org
- Subject: glade3 r2076 - in trunk: . gladeui plugins/gtk+
- Date: Mon, 5 Jan 2009 20:07:59 +0000 (UTC)
Author: tvb
Date: Mon Jan 5 20:07:59 2009
New Revision: 2076
URL: http://svn.gnome.org/viewvc/glade3?rev=2076&view=rev
Log:
Added some important fixes
Modified:
trunk/ChangeLog
trunk/gladeui/glade-app.c
trunk/gladeui/glade-base-editor.c
trunk/gladeui/glade-command.c
trunk/gladeui/glade-project.c
trunk/gladeui/glade-widget.c
trunk/gladeui/glade-widget.h
trunk/plugins/gtk+/glade-cell-renderer-editor.c
trunk/plugins/gtk+/glade-gtk.c
trunk/plugins/gtk+/glade-model-data.c
Modified: trunk/gladeui/glade-app.c
==============================================================================
--- trunk/gladeui/glade-app.c (original)
+++ trunk/gladeui/glade-app.c Mon Jan 5 20:07:59 2009
@@ -513,8 +513,7 @@
num = g_list_length (list);
if (num == 1 && !GLADE_IS_PLACEHOLDER (list->data))
glade_editor_load_widget (app->priv->editor,
- glade_widget_get_from_gobject
- (G_OBJECT (list->data)));
+ glade_widget_get_from_gobject (list->data));
else
glade_editor_load_widget (app->priv->editor, NULL);
}
@@ -1121,7 +1120,7 @@
for (list = glade_app_get_selection ();
list && list->data; list = list->next)
{
- widget = glade_widget_get_from_gobject (GTK_WIDGET (list->data));
+ widget = glade_widget_get_from_gobject (list->data);
widgets = g_list_prepend (widgets, widget);
}
@@ -1162,7 +1161,7 @@
for (list = glade_app_get_selection ();
list && list->data; list = list->next)
{
- widget = glade_widget_get_from_gobject (GTK_WIDGET (list->data));
+ widget = glade_widget_get_from_gobject (list->data);
widgets = g_list_prepend (widgets, widget);
}
@@ -1272,7 +1271,8 @@
/* A GladeFixed that doesnt use placeholders can only paste one
* at a time
*/
- if (GTK_WIDGET_TOPLEVEL (widget->object) == FALSE &&
+ if (GTK_IS_WIDGET (widget->object) &&
+ GTK_WIDGET_TOPLEVEL (widget->object) == FALSE &&
parent && fixed && !GWA_USE_PLACEHOLDERS (parent->adaptor) &&
g_list_length (clipboard->selection) != 1)
{
Modified: trunk/gladeui/glade-base-editor.c
==============================================================================
--- trunk/gladeui/glade-base-editor.c (original)
+++ trunk/gladeui/glade-base-editor.c Mon Jan 5 20:07:59 2009
@@ -1353,7 +1353,7 @@
}
/* Set the name */
- glade_widget_set_name (gchild_new, name);
+ glade_command_set_name (gchild_new, name);
if (GTK_IS_WIDGET (child_new))
gtk_widget_show_all (GTK_WIDGET (child_new));
Modified: trunk/gladeui/glade-command.c
==============================================================================
--- trunk/gladeui/glade-command.c (original)
+++ trunk/gladeui/glade-command.c Mon Jan 5 20:07:59 2009
@@ -1300,7 +1300,8 @@
* otherwise prioritize packing defaults.
*/
saved_props =
- glade_widget_dup_properties (cdata->widget->packing_properties,
+ glade_widget_dup_properties (cdata->widget,
+ cdata->widget->packing_properties,
FALSE, FALSE, FALSE);
glade_widget_set_packing_properties (cdata->widget, cdata->parent);
Modified: trunk/gladeui/glade-project.c
==============================================================================
--- trunk/gladeui/glade-project.c (original)
+++ trunk/gladeui/glade-project.c Mon Jan 5 20:07:59 2009
@@ -2440,6 +2440,18 @@
if (glade_project_has_object (project, object))
return;
+ if (old_project &&
+ glade_project_has_object (old_project, object))
+ {
+ g_critical ("Trying to add object %s to a project but its already in another project",
+ gwidget->name);
+ return;
+ }
+
+ /* set the project */
+ if (gwidget->project != project)
+ glade_widget_set_project (gwidget, project);
+
/* Create a name context for newly added toplevels... */
if (!gwidget->parent)
{
Modified: trunk/gladeui/glade-widget.c
==============================================================================
--- trunk/gladeui/glade-widget.c (original)
+++ trunk/gladeui/glade-widget.c Mon Jan 5 20:07:59 2009
@@ -547,6 +547,7 @@
/**
* glade_widget_dup_properties:
+ * @dest_widget: the widget we are copying properties for
* @template_props: the #GladeProperty list to copy
* @as_load: whether to behave as if loading the project
* @copy_parentless: whether to copy reffed widgets at all
@@ -558,7 +559,7 @@
* Returns: A newly allocated #GList of new #GladeProperty objects.
*/
GList *
-glade_widget_dup_properties (GList *template_props, gboolean as_load,
+glade_widget_dup_properties (GladeWidget *dest_widget, GList *template_props, gboolean as_load,
gboolean copy_parentless, gboolean exact)
{
GList *list, *properties = NULL;
@@ -577,17 +578,19 @@
GladeWidget *parentless;
glade_property_get (prop, &object);
+
+ prop = glade_property_dup (prop, NULL);
+
if (object)
{
parentless = glade_widget_get_from_gobject (object);
parentless = glade_widget_dup (parentless, exact);
- prop = glade_property_dup (prop, NULL);
+ glade_widget_set_project (parentless, dest_widget->project);
+
glade_property_set (prop, parentless->object);
}
- else
- prop = glade_property_dup (prop, NULL);
}
else
prop = glade_property_dup (prop, NULL);
@@ -715,7 +718,7 @@
if (gwidget->construct_template)
{
properties = glade_widget_dup_properties
- (gwidget->construct_template->properties, FALSE, TRUE, gwidget->construct_exact);
+ (gwidget, gwidget->construct_template->properties, FALSE, TRUE, gwidget->construct_exact);
glade_widget_set_properties (gwidget, properties);
}
@@ -1472,7 +1475,7 @@
if (gwidget->packing_properties == NULL)
gwidget->packing_properties =
- glade_widget_dup_properties (template_widget->packing_properties, FALSE, FALSE, FALSE);
+ glade_widget_dup_properties (gwidget, template_widget->packing_properties, FALSE, FALSE, FALSE);
/* If custom properties are still at thier
* default value, they need to be synced.
@@ -1539,7 +1542,7 @@
extract->internal_name = g_strdup (gchild->internal);
extract->internal_list = glade_widget_extract_children (gchild);
extract->properties =
- glade_widget_dup_properties (gchild->properties, TRUE, FALSE, FALSE);
+ glade_widget_dup_properties (gchild, gchild->properties, TRUE, FALSE, FALSE);
extract_list = g_list_prepend (extract_list, extract);
@@ -1556,7 +1559,7 @@
*/
extract->properties =
glade_widget_dup_properties
- (gchild->packing_properties, TRUE, FALSE, FALSE);
+ (gchild, gchild->packing_properties, TRUE, FALSE, FALSE);
glade_widget_remove_child (gwidget, gchild);
}
@@ -2206,6 +2209,8 @@
parentless = glade_widget_get_from_gobject (object);
parentless = glade_widget_dup (parentless, exact);
+ glade_widget_set_project (parentless, widget->project);
+
glade_property_set (widget_prop, parentless->object);
}
else
Modified: trunk/gladeui/glade-widget.h
==============================================================================
--- trunk/gladeui/glade-widget.h (original)
+++ trunk/gladeui/glade-widget.h Mon Jan 5 20:07:59 2009
@@ -176,7 +176,8 @@
GladeProperty *glade_widget_get_pack_property (GladeWidget *widget,
const gchar *id_property);
-GList *glade_widget_dup_properties (GList *template_props,
+GList *glade_widget_dup_properties (GladeWidget *dest_widget,
+ GList *template_props,
gboolean as_load,
gboolean copy_parentless,
gboolean exact);
Modified: trunk/plugins/gtk+/glade-cell-renderer-editor.c
==============================================================================
--- trunk/plugins/gtk+/glade-cell-renderer-editor.c (original)
+++ trunk/plugins/gtk+/glade-cell-renderer-editor.c Mon Jan 5 20:07:59 2009
@@ -150,9 +150,9 @@
if (use_attr)
{
- gtk_widget_show (tab->use_attr_label);
+ // gtk_widget_show (tab->use_attr_label);
gtk_widget_show (tab->use_attr_eprop);
- gtk_widget_hide (tab->use_prop_label);
+ //gtk_widget_hide (tab->use_prop_label);
gtk_widget_hide (tab->use_prop_eprop);
}
else
@@ -422,41 +422,47 @@
/* Label appearance... */
hbox = gtk_hbox_new (FALSE, 0);
- str = g_strdup_printf (_("Retrieve <b>%s</b> from model (type %s)"),
- pclass->name, g_type_name (pclass->pspec->value_type));
- label = gtk_label_new (str);
- g_free (str);
-
- gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
- gtk_label_set_line_wrap (GTK_LABEL(label), TRUE);
- gtk_label_set_line_wrap_mode (GTK_LABEL(label), PANGO_WRAP_WORD_CHAR);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+/* str = g_strdup_printf (_("Retrieve <b>%s</b> from model (type %s)"), */
+/* pclass->name, g_type_name (pclass->pspec->value_type)); */
+/* label = gtk_label_new (str); */
+/* g_free (str); */
+
+/* gtk_label_set_use_markup (GTK_LABEL (label), TRUE); */
+/* gtk_label_set_line_wrap (GTK_LABEL(label), TRUE); */
+/* gtk_label_set_line_wrap_mode (GTK_LABEL(label), PANGO_WRAP_WORD_CHAR); */
+/* gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); */
tab->attributes_check = gtk_check_button_new ();
+ str = g_strdup_printf (_("Retrieve %s from model (type %s)"),
+ pclass->name, g_type_name (pclass->pspec->value_type));
+ gtk_widget_set_tooltip_text (tab->attributes_check, str);
+ g_free (str);
gtk_box_pack_start (GTK_BOX (hbox), tab->attributes_check, FALSE, FALSE, 4);
- gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 4);
+ //gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 4);
gtk_box_pack_start (GTK_BOX (renderer_editor), hbox, FALSE, FALSE, 0);
/* A Hack so that PANGO_WRAP_WORD_CHAR works nicely */
g_object_set_data (G_OBJECT (hbox), "attributes-check", tab->attributes_check);
- g_signal_connect (G_OBJECT (hbox), "size-request",
- G_CALLBACK (label_size_request), NULL);
- g_signal_connect_after (G_OBJECT (hbox), "size-allocate",
- G_CALLBACK (label_size_allocate_after), label);
+/* g_signal_connect (G_OBJECT (hbox), "size-request", */
+/* G_CALLBACK (label_size_request), NULL); */
+/* g_signal_connect_after (G_OBJECT (hbox), "size-allocate", */
+/* G_CALLBACK (label_size_allocate_after), label); */
- alignment = gtk_alignment_new (1.0F, 1.0F, 1.0F, 1.0F);
- gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 6, 0, 12, 0);
- gtk_box_pack_start (GTK_BOX (renderer_editor), alignment, FALSE, FALSE, 0);
+/* alignment = gtk_alignment_new (1.0F, 1.0F, 1.0F, 1.0F); */
+/* gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 6, 0, 12, 0); */
+/* gtk_box_pack_start (GTK_BOX (renderer_editor), alignment, FALSE, FALSE, 0); */
- table = gtk_table_new (0, 0, FALSE);
- gtk_container_add (GTK_CONTAINER (alignment), table);
+/* table = gtk_table_new (0, 0, FALSE); */
+/* gtk_container_add (GTK_CONTAINER (alignment), table); */
/* Edit property */
eprop = glade_widget_adaptor_create_eprop (adaptor, pclass, TRUE);
- table_attach (table, eprop->item_label, 0, rows);
- table_attach (table, GTK_WIDGET (eprop), 1, rows++);
+ gtk_box_pack_start (GTK_BOX (hbox), eprop->item_label, TRUE, TRUE, 4);
+ gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (eprop), FALSE, FALSE, 4);
+/* table_attach (table, eprop->item_label, 0, rows); */
+/* table_attach (table, GTK_WIDGET (eprop), 1, rows++); */
renderer_editor->properties = g_list_prepend (renderer_editor->properties, eprop);
tab->use_prop_label = eprop->item_label;
@@ -464,8 +470,9 @@
/* Edit attribute */
eprop = glade_widget_adaptor_create_eprop (adaptor, attr_pclass, TRUE);
- table_attach (table, eprop->item_label, 0, rows);
- table_attach (table, GTK_WIDGET (eprop), 1, rows++);
+ gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (eprop), FALSE, FALSE, 4);
+/* table_attach (table, eprop->item_label, 0, rows); */
+/* table_attach (table, GTK_WIDGET (eprop), 1, rows++); */
renderer_editor->properties = g_list_prepend (renderer_editor->properties, eprop);
tab->use_attr_label = eprop->item_label;
Modified: trunk/plugins/gtk+/glade-gtk.c
==============================================================================
--- trunk/plugins/gtk+/glade-gtk.c (original)
+++ trunk/plugins/gtk+/glade-gtk.c Mon Jan 5 20:07:59 2009
@@ -1273,7 +1273,7 @@
adaptor->title, gwidget->name);
/* Record packing properties */
- saved_props = glade_widget_dup_properties (gwidget->packing_properties, FALSE, FALSE, FALSE);
+ saved_props = glade_widget_dup_properties (gwidget, gwidget->packing_properties, FALSE, FALSE, FALSE);
/* Remove "this" widget */
this_widget.data = gwidget;
Modified: trunk/plugins/gtk+/glade-model-data.c
==============================================================================
--- trunk/plugins/gtk+/glade-model-data.c (original)
+++ trunk/plugins/gtk+/glade-model-data.c Mon Jan 5 20:07:59 2009
@@ -791,7 +791,8 @@
string = glade_utils_string_from_value (&value, GLADE_PROJECT_FORMAT_GTKBUILDER);
- g_object_set (cell, "text", glade_get_displayable_value (G_VALUE_TYPE (&value), string), NULL);
+ g_object_set (cell, "text", string && string[0] ?
+ glade_get_displayable_value (G_VALUE_TYPE (&value), string) : "", NULL);
g_free (string);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]