[glade/gbinding] Simplified glade_editor_property_tooltip_cb() (thanks Juan!)
- From: Denis Washington <denisw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade/gbinding] Simplified glade_editor_property_tooltip_cb() (thanks Juan!)
- Date: Fri, 10 Jun 2011 12:54:06 +0000 (UTC)
commit 66fdf54273eac12c56cfd8dfb6fb0d3d166aa9f3
Author: Denis Washington <denisw src gnome org>
Date: Fri Jun 10 14:29:51 2011 +0200
Simplified glade_editor_property_tooltip_cb() (thanks Juan!)
gladeui/glade-editor-property.c | 34 ++++++++++++++++++----------------
1 files changed, 18 insertions(+), 16 deletions(-)
---
diff --git a/gladeui/glade-editor-property.c b/gladeui/glade-editor-property.c
index 241ddd7..d68671f 100644
--- a/gladeui/glade-editor-property.c
+++ b/gladeui/glade-editor-property.c
@@ -186,7 +186,9 @@ glade_editor_property_tooltip_cb (GladeProperty * property,
const gchar * support,
GladeEditorProperty * eprop)
{
- const gchar *choice_tooltip;
+ GladeEditorPropertyPrivate *priv = eprop->priv;
+ gchar *markup = NULL;
+ const gchar *tip;
if (glade_property_get_sensitive (property))
{
@@ -195,30 +197,30 @@ glade_editor_property_tooltip_cb (GladeProperty * property,
if ((binding = glade_property_get_binding (property)) != NULL)
{
GladeProperty *source;
- const gchar *src_obj, *src_prop;
+ const gchar *source_obj, *source_prop;
source = glade_binding_get_source (binding);
- src_prop = glade_property_class_id (glade_property_get_class (source));
- src_obj = glade_widget_get_name (glade_property_get_widget (source));
+ source_prop = glade_property_class_id (glade_property_get_class (source));
+ source_obj = glade_widget_get_name (glade_property_get_widget (source));
- choice_tooltip = g_strdup_printf ("%s\n"
- "<span size=\"smaller\">"
- "(Bound to property <b>%s</b> of <b>%s</b>)"
- "</span>",
- tooltip, src_prop, src_obj);
+ tip = markup = g_strdup_printf ("%s\n"
+ "<span size=\"smaller\">"
+ "(Bound to property <b>%s</b>"
+ " of <b>%s</b>)"
+ "</span>",
+ tooltip, source_prop, source_obj);
}
else
- choice_tooltip = tooltip;
+ tip = tooltip;
}
else
- choice_tooltip = insensitive;
+ tip = insensitive;
- gtk_widget_set_tooltip_markup (eprop->priv->input, choice_tooltip);
- gtk_widget_set_tooltip_markup (eprop->priv->label, choice_tooltip);
- gtk_widget_set_tooltip_text (eprop->priv->warning, support);
+ gtk_widget_set_tooltip_markup (priv->input, tip);
+ gtk_widget_set_tooltip_markup (priv->label, tip);
+ gtk_widget_set_tooltip_text (priv->warning, support);
- if (glade_property_get_binding (property))
- g_free ((gchar *) choice_tooltip);
+ g_free (markup);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]