Commit 2606b29f authored by Tristan Van Berkom's avatar Tristan Van Berkom

Loaded and watched the new support_warning on GladeWidget


	* gladeui/glade-editor.c, gladeui/glade-editor.h:
	Loaded and watched the new support_warning on GladeWidget

	* gladeui/glade-editor-property.c, gladeui/glade-editor-property.h:
	Loaded and watched the new support_warning on GladeProperty
	
	* gladeui/glade-widget.c, gladeui/glade-widget.h: Keep a support-warning
	property around as metadata updated by GladeProject.

	* gladeui/glade-property.c, gladeui/glade-property.h:
	Added new support_warning and state properties.

	* gladeui/glade-project.c, gladeui/glade-project.h:
	Now GladeProject generates strings to show in the normal
	UI along with longer style reports, always updates widgets
	warning message metadata when they come into the project 
	or when the format or target versions change.

	* gladeui/glade-signal.c: Removed a bogus return.


svn path=/trunk/; revision=1788
parent 1e2f5fb3
2008-04-10 Tristan Van Berkom <tvb@gnome.org>
* gladeui/glade-editor.c, gladeui/glade-editor.h:
Loaded and watched the new support_warning on GladeWidget
* gladeui/glade-editor-property.c, gladeui/glade-editor-property.h:
Loaded and watched the new support_warning on GladeProperty
* gladeui/glade-widget.c, gladeui/glade-widget.h: Keep a support-warning
property around as metadata updated by GladeProject.
* gladeui/glade-property.c, gladeui/glade-property.h:
Added new support_warning and state properties.
* gladeui/glade-project.c, gladeui/glade-project.h:
Now GladeProject generates strings to show in the normal
UI along with longer style reports, always updates widgets
warning message metadata when they come into the project
or when the format or target versions change.
* gladeui/glade-signal.c: Removed a bogus return.
2008-04-09 Tristan Van Berkom <tvb@gnome.org>
* NEWS, configure.ac: Rolling 3.5.2. quick bugfix release
......
......@@ -107,14 +107,23 @@ glade_editor_property_commit (GladeEditorProperty *eprop,
}
static void
glade_editor_property_tooltip_cb (GladeProperty *property,
const gchar *tooltip,
const gchar *insensitive,
const gchar *support,
GladeEditorProperty *eprop)
{
gtk_widget_set_tooltip_text (eprop->input, tooltip);
gtk_widget_set_tooltip_text (eprop->item_label, tooltip);
const gchar *choice_tooltip;
if (glade_property_get_sensitive (property))
choice_tooltip = tooltip;
else
choice_tooltip = insensitive;
gtk_widget_set_tooltip_text (eprop->input, choice_tooltip);
gtk_widget_set_tooltip_text (eprop->label, choice_tooltip);
gtk_widget_set_tooltip_text (eprop->warning, support);
}
static void
......@@ -141,6 +150,59 @@ glade_editor_property_value_changed_cb (GladeProperty *property,
glade_editor_property_load (eprop, eprop->property);
}
static void
glade_editor_property_fix_label (GladeEditorProperty *eprop)
{
gchar *text = NULL;
if (!eprop->property)
return;
/* refresh label */
switch (eprop->property->state)
{
case GLADE_STATE_NORMAL:
case GLADE_STATE_UNSUPPORTED:
text = g_strdup_printf ("%s:", eprop->klass->name);
break;
case GLADE_STATE_CHANGED:
case GLADE_STATE_UNSUPPORTED_CHANGED:
text = g_strdup_printf ("<b>%s:</b>", eprop->klass->name);
break;
default:
g_assert_not_reached ();
}
/* refresh icon */
switch (eprop->property->state)
{
case GLADE_STATE_NORMAL:
case GLADE_STATE_CHANGED:
gtk_widget_hide (eprop->warning);
break;
case GLADE_STATE_UNSUPPORTED:
case GLADE_STATE_UNSUPPORTED_CHANGED:
gtk_widget_show (eprop->warning);
break;
default:
g_assert_not_reached ();
}
gtk_label_set_markup (GTK_LABEL (eprop->label), text);
g_free (text);
}
static void
glade_editor_property_state_cb (GladeProperty *property,
GParamSpec *pspec,
GladeEditorProperty *eprop)
{
glade_editor_property_fix_label (eprop);
}
static void
glade_editor_property_enabled_cb (GladeProperty *property,
GParamSpec *pspec,
......@@ -210,6 +272,16 @@ glade_editor_property_create_info_button (GladeEditorProperty *eprop)
return button;
}
static GtkWidget *
glade_editor_property_create_warning_icon (GladeEditorProperty *eprop)
{
GtkWidget *widget = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING,
GTK_ICON_SIZE_MENU);
gtk_widget_set_no_show_all (widget, TRUE);
return widget;
}
static GObject *
glade_editor_property_constructor (GType type,
guint n_construct_properties,
......@@ -217,7 +289,6 @@ glade_editor_property_constructor (GType type,
{
GObject *obj;
GladeEditorProperty *eprop;
gchar *text;
/* Invoke parent constructor (eprop->klass should be resolved by this point) . */
obj = G_OBJECT_CLASS (table_class)->constructor
......@@ -225,13 +296,6 @@ glade_editor_property_constructor (GType type,
eprop = GLADE_EDITOR_PROPERTY (obj);
/* Create label */
text = g_strdup_printf ("%s:", eprop->klass->name);
eprop->item_label = gtk_label_new (text);
g_free (text);
gtk_misc_set_alignment (GTK_MISC (eprop->item_label), 1.0, 0.5);
/* Create hbox and possibly check button
*/
if (eprop->klass->optional)
......@@ -246,14 +310,25 @@ glade_editor_property_constructor (GType type,
/* Create the class specific input widget and add it */
eprop->input = GLADE_EDITOR_PROPERTY_GET_CLASS (eprop)->create_input (eprop);
gtk_widget_show (eprop->input);
gtk_box_pack_start (GTK_BOX (eprop), eprop->input, TRUE, TRUE, 0);
/* Create the informational button and add it */
eprop->info = glade_editor_property_create_info_button (eprop);
g_signal_connect (G_OBJECT (eprop->info), "clicked",
G_CALLBACK (glade_editor_property_info_clicked_cb), eprop);
/* Create the warning icon and add it */
eprop->warning = glade_editor_property_create_warning_icon (eprop);
/* Create label */
eprop->item_label = gtk_hbox_new (FALSE, 4);
eprop->label = gtk_label_new (NULL);
gtk_misc_set_alignment (GTK_MISC (eprop->label), 1.0, 0.5);
gtk_box_pack_start (GTK_BOX (eprop->item_label), eprop->label, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (eprop->item_label), eprop->warning, FALSE, TRUE, 0);
glade_editor_property_fix_label (eprop);
gtk_box_pack_start (GTK_BOX (eprop), eprop->input, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (eprop), eprop->info, FALSE, FALSE, 2);
return obj;
......@@ -330,6 +405,7 @@ glade_eprop_property_finalized (GladeEditorProperty *eprop,
eprop->sensitive_id = 0;
eprop->changed_id = 0;
eprop->enabled_id = 0;
eprop->state_id = 0;
eprop->property = NULL;
glade_editor_property_load (eprop, NULL);
......@@ -364,14 +440,15 @@ glade_editor_property_load_common (GladeEditorProperty *eprop,
if (eprop->changed_id > 0)
g_signal_handler_disconnect (eprop->property,
eprop->changed_id);
if (eprop->enabled_id > 0)
if (eprop->state_id > 0)
g_signal_handler_disconnect (eprop->property,
eprop->enabled_id);
eprop->state_id);
eprop->tooltip_id = 0;
eprop->sensitive_id = 0;
eprop->changed_id = 0;
eprop->enabled_id = 0;
eprop->state_id = 0;
/* Unref it here */
g_object_weak_unref (G_OBJECT (eprop->property),
......@@ -415,6 +492,12 @@ glade_editor_property_load_common (GladeEditorProperty *eprop,
"notify::enabled",
G_CALLBACK (glade_editor_property_enabled_cb),
eprop);
eprop->state_id =
g_signal_connect (G_OBJECT (eprop->property),
"notify::state",
G_CALLBACK (glade_editor_property_state_cb),
eprop);
/* In query dialogs when the user hits cancel,
* these babies go away (so better stay protected).
......@@ -426,7 +509,11 @@ glade_editor_property_load_common (GladeEditorProperty *eprop,
/* Load initial tooltips
*/
glade_editor_property_tooltip_cb
(property, glade_property_get_tooltip (property), eprop);
(property,
property->klass->tooltip,
property->insensitive_tooltip,
property->support_warning,
eprop);
/* Load initial enabled state
*/
......@@ -435,6 +522,10 @@ glade_editor_property_load_common (GladeEditorProperty *eprop,
/* Load initial sensitive state.
*/
glade_editor_property_sensitivity_cb (property, NULL, eprop);
/* Load intial label state
*/
glade_editor_property_state_cb (property, NULL, eprop);
}
}
......
......@@ -85,8 +85,15 @@ struct _GladeEditorProperty
GladeProperty *property; /* The currently loaded property
*/
GtkWidget *item_label; /* Name of property (need a handle to set visual insensitive state)
GtkWidget *item_label; /* The property name portion of the eprop
*/
GtkWidget *label; /* The actual property name label
*/
GtkWidget *warning; /* Icon to show warnings
*/
GtkWidget *input; /* Input part of property (need to set sensitivity seperately)
*/
......@@ -100,6 +107,7 @@ struct _GladeEditorProperty
gulong sensitive_id; /* signal connection id for sensitivity changes */
gulong changed_id; /* signal connection id for value changes */
gulong enabled_id; /* signal connection id for enable/disable changes */
gulong state_id; /* signal connection id for state changes */
gboolean loading; /* True during glade_editor_property_load calls, this
* is used to avoid feedback from input widgets.
......
......@@ -488,21 +488,35 @@ glade_editor_table_append_name_field (GladeEditorTable *table)
static void
glade_editor_table_append_class_field (GladeEditorTable *table)
{
GtkWidget *label;
GtkWidget *class_entry;
GtkWidget *label, *class_label, *icon;
GtkWidget *hbox_class_value, *hbox_class_name;
/* Class */
hbox_class_name = gtk_hbox_new (FALSE, 4);
label = gtk_label_new (_("Class:"));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
gtk_widget_show (label);
gtk_box_pack_start (GTK_BOX (hbox_class_name), label, TRUE, TRUE, 0);
class_entry = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (class_entry), table->adaptor->name);
gtk_editable_set_editable (GTK_EDITABLE (class_entry), FALSE);
gtk_widget_show (class_entry);
glade_editor_table_attach (table->table_widget, label, 0, table->rows);
glade_editor_table_attach (table->table_widget, class_entry, 1, table->rows);
table->warning = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING,
GTK_ICON_SIZE_MENU);
gtk_widget_set_no_show_all (table->warning, TRUE);
gtk_box_pack_start (GTK_BOX (hbox_class_name), table->warning, FALSE, TRUE, 0);
gtk_widget_show_all (hbox_class_name);
hbox_class_value = gtk_hbox_new (FALSE, 2);
icon = gtk_image_new_from_icon_name
(table->adaptor->icon_name, GTK_ICON_SIZE_MENU);
gtk_box_pack_start (GTK_BOX (hbox_class_value), icon, FALSE, TRUE, 4);
class_label = gtk_label_new (table->adaptor->name);
gtk_misc_set_alignment (GTK_MISC (class_label), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (hbox_class_value), class_label, TRUE, TRUE, 0);
gtk_widget_show_all (hbox_class_value);
/* FIXME: find a better way to pack this. */
gtk_widget_set_size_request (hbox_class_value, -1, 25);
glade_editor_table_attach (table->table_widget, hbox_class_name, 0, table->rows);
glade_editor_table_attach (table->table_widget, hbox_class_value, 1, table->rows);
table->rows++;
}
......@@ -877,6 +891,26 @@ glade_editor_load_table (GladeEditor *editor,
}
}
static void
glade_editor_update_class_warning_cb (GladeWidget *widget,
GParamSpec *pspec,
GladeEditor *editor)
{
GladeEditorTable *table;
if (!(table = glade_editor_get_table_from_class
(editor, editor->loaded_adaptor, TABLE_TYPE_GENERAL)))
return;
if (widget->support_warning)
gtk_widget_show (table->warning);
else
gtk_widget_hide (table->warning);
gtk_widget_set_tooltip_text (table->warning, widget->support_warning);
}
static void
glade_editor_load_widget_real (GladeEditor *editor, GladeWidget *widget)
{
......@@ -890,7 +924,10 @@ glade_editor_load_widget_real (GladeEditor *editor, GladeWidget *widget)
project = glade_widget_get_project (editor->loaded_widget);
g_signal_handler_disconnect (G_OBJECT (project),
editor->project_closed_signal_id);
g_signal_handler_disconnect (G_OBJECT (editor->loaded_widget),
editor->widget_warning_id);
}
/* Load the GladeWidgetClass */
adaptor = widget ? widget->adaptor : NULL;
if (editor->loaded_adaptor != adaptor || adaptor == NULL)
......@@ -924,11 +961,18 @@ glade_editor_load_widget_real (GladeEditor *editor, GladeWidget *widget)
editor->loaded_widget = widget;
editor->loading = FALSE;
/* Update warning once */
glade_editor_update_class_warning_cb (widget, NULL, editor);
/* Connect to new widget */
project = glade_widget_get_project (editor->loaded_widget);
editor->project_closed_signal_id =
g_signal_connect (G_OBJECT (project), "close",
G_CALLBACK (glade_editor_close_cb), editor);
editor->widget_warning_id =
g_signal_connect (G_OBJECT (widget), "notify::support-warning",
G_CALLBACK (glade_editor_update_class_warning_cb),
editor);
}
/**
......@@ -1237,7 +1281,7 @@ glade_editor_reset_selection_changed_cb (GtkTreeSelection *selection,
text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (desc_view));
gtk_tree_model_get (model, &iter, COLUMN_PROPERTY, &property, -1);
gtk_text_buffer_set_text (text_buffer,
property ? glade_property_get_tooltip (property) : message,
property ? property->klass->tooltip : message,
-1);
if (property)
g_object_unref (G_OBJECT (property));
......
......@@ -102,6 +102,8 @@ struct _GladeEditor
gulong project_closed_signal_id; /* Unload widget when widget's project closes.
*/
gulong widget_warning_id; /* Update when widget changes warning messages.
*/
GtkWidget *reset_button; /* The reset button
*/
......@@ -156,6 +158,11 @@ struct _GladeEditorTable
* we load into the inputs inside this table
* the information about the selected widget.
*/
GtkWidget *warning; /* A pointer to an icon we can show in the class
* property to publish tooltips for class related
* versioning errors.
*/
GtkWidget *name_entry; /* A pointer to the gtk_entry that holds
* the name of the widget. This is the
......
This diff is collapsed.
......@@ -172,6 +172,9 @@ GladeProjectFormat glade_project_get_format (GladeProject *project);
void glade_project_preferences (GladeProject *project);
void glade_project_verify_properties (GladeWidget *widget);
G_END_DECLS
#endif /* __GLADE_PROJECT_H__ */
......@@ -71,7 +71,8 @@ enum
PROP_SENSITIVE,
PROP_I18N_TRANSLATABLE,
PROP_I18N_HAS_CONTEXT,
PROP_I18N_COMMENT
PROP_I18N_COMMENT,
PROP_STATE
};
static guint glade_property_signals[LAST_SIGNAL] = { 0 };
......@@ -210,6 +211,32 @@ glade_property_verify (GladeProperty *property, const GValue *value)
}
}
static void
glade_property_fix_state (GladeProperty *property)
{
property->state = GLADE_STATE_NORMAL;
if (!property->sensitive)
property->state = GLADE_STATE_NORMAL;
else if (property->support_warning)
{
if (glade_property_default (property))
property->state = GLADE_STATE_UNSUPPORTED;
else
property->state = GLADE_STATE_UNSUPPORTED_CHANGED;
}
else
{
if (glade_property_default (property))
property->state = GLADE_STATE_NORMAL;
else
property->state = GLADE_STATE_CHANGED;
}
g_object_notify (G_OBJECT (property), "state");
}
static void
glade_property_set_value_impl (GladeProperty *property, const GValue *value)
{
......@@ -270,11 +297,15 @@ glade_property_set_value_impl (GladeProperty *property, const GValue *value)
GLADE_PROPERTY_GET_KLASS (property)->sync (property);
glade_property_fix_state (property);
if (changed && property->widget)
{
g_signal_emit (G_OBJECT (property),
glade_property_signals[VALUE_CHANGED],
0, &old_value, property->value);
glade_project_verify_properties (property->widget);
}
g_value_unset (&old_value);
......@@ -355,17 +386,6 @@ glade_property_load_impl (GladeProperty *property)
g_object_get_property (object, property->klass->id, property->value);
}
static G_CONST_RETURN gchar *
glade_property_get_tooltip_impl (GladeProperty *property)
{
gchar *tooltip = NULL;
if (property->sensitive == FALSE)
tooltip = property->insensitive_tooltip;
else
tooltip = property->klass->tooltip;
return tooltip;
}
/*******************************************************************************
GObjectClass & Object Construction
*******************************************************************************/
......@@ -425,6 +445,9 @@ glade_property_get_real_property (GObject *object,
case PROP_I18N_COMMENT:
g_value_set_string (value, glade_property_i18n_get_comment (property));
break;
case PROP_STATE:
g_value_set_int (value, property->state);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -479,7 +502,6 @@ glade_property_klass_init (GladePropertyKlass *prop_class)
prop_class->get_default = glade_property_get_default_impl;
prop_class->sync = glade_property_sync_impl;
prop_class->load = glade_property_load_impl;
prop_class->get_tooltip = glade_property_get_tooltip_impl;
prop_class->value_changed = NULL;
prop_class->tooltip_changed = NULL;
......@@ -519,6 +541,16 @@ glade_property_klass_init (GladePropertyKlass *prop_class)
_("Whether or not the translatable string has a context prefix"),
FALSE, G_PARAM_READWRITE));
g_object_class_install_property
(object_class, PROP_STATE,
g_param_spec_int
("state", _("Visual State"),
_("Priority information for the property editor to act on"),
GLADE_STATE_NORMAL,
GLADE_N_STATES - 1,
GLADE_STATE_NORMAL,
G_PARAM_READABLE));
/* Signal */
glade_property_signals[VALUE_CHANGED] =
g_signal_new ("value-changed",
......@@ -537,8 +569,8 @@ glade_property_klass_init (GladePropertyKlass *prop_class)
G_STRUCT_OFFSET (GladePropertyKlass,
tooltip_changed),
NULL, NULL,
g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE, 1, G_TYPE_POINTER);
glade_marshal_VOID__STRING_STRING_STRING,
G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
}
......@@ -1201,20 +1233,6 @@ glade_property_remove_object (GladeProperty *property,
glade_property_set (property, list);
}
/**
* glade_property_get_tooltip:
* @property: a #GladeProperty
*
* Returns: The appropriate tooltip for the editor
*/
G_CONST_RETURN gchar *
glade_property_get_tooltip (GladeProperty *property)
{
g_return_val_if_fail (GLADE_IS_PROPERTY (property), NULL);
return GLADE_PROPERTY_GET_KLASS (property)->get_tooltip (property);
}
/* Parameters for translatable properties. */
void
glade_property_i18n_set_comment (GladeProperty *property,
......@@ -1285,15 +1303,19 @@ glade_property_set_sensitive (GladeProperty *property,
if (property->sensitive != sensitive)
{
gchar *tooltip;
property->sensitive = sensitive;
tooltip = (gchar *)GLADE_PROPERTY_GET_KLASS
(property)->get_tooltip (property);
/* Clear it */
if (sensitive)
property->insensitive_tooltip =
(g_free (property->insensitive_tooltip), NULL);
g_signal_emit (G_OBJECT (property),
glade_property_signals[TOOLTIP_CHANGED],
0, tooltip);
0,
property->klass->tooltip,
property->insensitive_tooltip,
property->support_warning);
}
g_object_notify (G_OBJECT (property), "sensitive");
......@@ -1306,6 +1328,27 @@ glade_property_get_sensitive (GladeProperty *property)
return property->sensitive;
}
void
glade_property_set_support_warning (GladeProperty *property,
const gchar *reason)
{
g_return_if_fail (GLADE_IS_PROPERTY (property));
if (property->support_warning)
g_free (property->support_warning);
property->support_warning = g_strdup (reason);
g_signal_emit (G_OBJECT (property),
glade_property_signals[TOOLTIP_CHANGED],
0,
property->klass->tooltip,
property->insensitive_tooltip,
property->support_warning);
glade_property_fix_state (property);
}
/**
* glade_property_set_save_always:
* @property: A #GladeProperty
......
......@@ -15,6 +15,14 @@ G_BEGIN_DECLS
typedef struct _GladePropertyKlass GladePropertyKlass;
typedef enum {
GLADE_STATE_NORMAL = 0,
GLADE_STATE_CHANGED,
GLADE_STATE_UNSUPPORTED,
GLADE_STATE_UNSUPPORTED_CHANGED,
GLADE_N_STATES
} GladePropertyState;
/* A GladeProperty is an instance of a GladePropertyClass.
* There will be one GladePropertyClass for "GtkLabel->label" but one
* GladeProperty for each GtkLabel in the GladeProject.
......@@ -29,6 +37,9 @@ struct _GladeProperty
GladeWidget *widget; /* A pointer to the GladeWidget that this
* GladeProperty is modifying
*/
GladePropertyState state; /* Current property state, used by editing widgets.
*/
GValue *value; /* The value of the property
*/
......@@ -37,9 +48,16 @@ struct _GladeProperty
* property is "optional" this takes precedence).
*/
gchar *insensitive_tooltip; /* Tooltip to display when in insensitive state
* (used to explain why the property is insensitive)
* (used to explain why the property is
* insensitive)
*/
gchar *support_warning; /* Tooltip to display when the property
* has format problems
* (used to explain why the property is
* insensitive)
*/
gboolean enabled; /* Enabled is a flag that is used for GladeProperties
* that have the optional flag set to let us know
* if this widget has this GladeSetting enabled or
......@@ -78,11 +96,11 @@ struct _GladePropertyKlass
void (* get_default) (GladeProperty *, GValue *);
void (* sync) (GladeProperty *);
void (* load) (GladeProperty *);
G_CONST_RETURN gchar * (* get_tooltip) (GladeProperty *);
/* Signals */
void (* value_changed) (GladeProperty *, GValue *, GValue *);
void (* tooltip_changed) (GladeProperty *, const gchar *);
void (* tooltip_changed) (GladeProperty *, const gchar *,
const gchar *, const gchar *);
};
......@@ -148,12 +166,13 @@ void glade_property_write (GladeProperty
GladeXmlContext *context,
GladeXmlNode *node);
G_CONST_RETURN gchar *glade_property_get_tooltip (GladeProperty *property);
void glade_property_set_sensitive (GladeProperty *property,
gboolean sensitive,
const gchar *reason);
void glade_property_set_support_warning (GladeProperty *property,
const gchar *reason);
gboolean glade_property_get_sensitive (GladeProperty *property);
......
......@@ -158,7 +158,6 @@ glade_signal_write (GladeSignal *signal,
GLADE_XML_TAG_SIGNAL_TRUE);
g_free (name);
return TRUE;
}
......
......@@ -91,7 +91,8 @@ enum
PROP_TEMPLATE,
PROP_REASON,
PROP_TOPLEVEL_WIDTH,
PROP_TOPLEVEL_HEIGHT
PROP_TOPLEVEL_HEIGHT,
PROP_SUPPORT_WARNING
};
static guint glade_widget_signals[LAST_SIGNAL] = {0};
......@@ -902,6 +903,9 @@ glade_widget_get_real_property (GObject *object,
case PROP_TOPLEVEL_HEIGHT:
g_value_set_int (value, widget->height);
break;
case PROP_SUPPORT_WARNING:
g_value_set_string (value, widget->support_warning);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -1084,6 +1088,12 @@ glade_widget_class_init (GladeWidgetClass *klass)
-1,
G_PARAM_READWRITE));
g_object_class_install_property
(object_class, PROP_SUPPORT_WARNING,
g_param_spec_string ("support warning", _("Support Warning"),
_("A warning string about version mismatches"),
NULL, G_PARAM_READABLE));
/**
* GladeWidget::add-signal-handler:
* @gladewidget: the #GladeWidget which received the signal.
......@@ -4089,3 +4099,16 @@ glade_widget_generate_path_name (GladeWidget *widget)
return g_string_free (string, FALSE);
}
void
glade_widget_set_support_warning (GladeWidget *widget,
const gchar *warning)
{
g_return_if_fail (GLADE_IS_WIDGET (widget));
if (widget->support_warning)
g_free (widget->support_warning);
widget->support_warning = g_strdup (warning);
g_object_notify (G_OBJECT (widget), "support-warning");
}
......@@ -36,6 +36,10 @@ struct _GladeWidget
* button2. This is a unique name and is the one
* used when loading widget with libglade
*/
gchar *support_warning; /* A warning message for version incompatabilities
* in this widget
*/
gchar *internal; /* If the widget is an internal child of
* another widget this is the name of the
......@@ -395,6 +399,9 @@ void glade_widget_push_superuser (void);
void glade_widget_pop_superuser (void);