diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-04-27 23:03:01 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-04-27 23:09:30 -0400 |
commit | 2805ba64c692b4f0ce35e5ad9c9735331d7fc604 (patch) | |
tree | ecb233c2b387c20e22593aa65455855e08669242 /gtk/gtkdialog.c | |
parent | 86ca248c994e39f19a49dbe2cab91378aeb73db4 (diff) | |
download | gtk+-2805ba64c692b4f0ce35e5ad9c9735331d7fc604.tar.gz |
GtkDialog: Use _gtk_builder_lookup_object
Diffstat (limited to 'gtk/gtkdialog.c')
-rw-r--r-- | gtk/gtkdialog.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c index bc8792e9a4..78ee0125aa 100644 --- a/gtk/gtkdialog.c +++ b/gtk/gtkdialog.c @@ -1667,6 +1667,8 @@ typedef struct { gchar *widget_name; gint response_id; gboolean is_default; + gint line; + gint col; } ActionWidgetInfo; typedef struct { @@ -1678,6 +1680,8 @@ typedef struct { gboolean is_text; GString *string; gboolean in_action_widgets; + gint line; + gint col; } SubParserData; static void @@ -1718,6 +1722,7 @@ parser_start_element (GMarkupParseContext *context, data->is_default = is_default; data->is_text = TRUE; g_string_set_size (data->string, 0); + g_markup_parse_context_get_position (context, &data->line, &data->col); } else if (strcmp (element_name, "action-widgets") == 0) { @@ -1768,6 +1773,8 @@ parser_end_element (GMarkupParseContext *context, item->widget_name = g_strdup (data->string->str); item->response_id = data->response_id; item->is_default = data->is_default; + item->line = data->line; + item->col = data->col; data->items = g_slist_prepend (data->items, item); data->is_default = FALSE; @@ -1843,14 +1850,9 @@ gtk_dialog_buildable_custom_finished (GtkBuildable *buildable, ActionWidgetInfo *item = l->data; gboolean is_action; - object = gtk_builder_get_object (builder, item->widget_name); + object = _gtk_builder_lookup_object (builder, item->widget_name, item->line, item->col); if (!object) - { - g_warning ("Unknown object %s specified in action-widgets of %s", - item->widget_name, - gtk_buildable_get_name (GTK_BUILDABLE (buildable))); - continue; - } + continue; /* If the widget already has reponse data at this point, it * was either added by gtk_dialog_add_action_widget(), or via |