From: Bastien Nocera Date: Thu, 17 Feb 2022 11:24:51 +0000 (+0100) Subject: inspector: Show app ID and resource path in the General tab X-Git-Tag: archive/raspbian/4.6.5+ds-1+rpi1~1^2~19^2~3^2~76^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1877bb8a270325954e2b0094668a1a864668d5c7;p=gtk4.git inspector: Show app ID and resource path in the General tab This makes it easier to figure out those values (which are mentioned in the GtkApplication documentation) rather than working that out from the way they're generated (or documented as being generated). --- diff --git a/gtk/inspector/general.c b/gtk/inspector/general.c index 2eee163a1e..ad52422fa3 100644 --- a/gtk/inspector/general.c +++ b/gtk/inspector/general.c @@ -97,6 +97,9 @@ struct _GtkInspectorGeneral GtkWidget *vk_device; GtkWidget *vk_api_version; GtkWidget *vk_driver_version; + GtkWidget *app_id_frame; + GtkWidget *app_id; + GtkWidget *resource_path; GtkWidget *prefix; GtkWidget *xdg_data_home; GtkWidget *xdg_data_dirs; @@ -174,6 +177,24 @@ init_version (GtkInspectorGeneral *gen) gtk_label_set_text (GTK_LABEL (gen->gsk_renderer), renderer); } +static void +init_app_id (GtkInspectorGeneral *gen) +{ + GApplication *app; + + app = g_application_get_default (); + if (!app) + { + gtk_widget_hide (gen->app_id_frame); + return; + } + + gtk_label_set_text (GTK_LABEL (gen->app_id), + g_application_get_application_id (app)); + gtk_label_set_text (GTK_LABEL (gen->resource_path), + g_application_get_resource_base_path (app)); +} + static G_GNUC_UNUSED void add_check_row (GtkInspectorGeneral *gen, GtkListBox *list, @@ -1112,6 +1133,9 @@ gtk_inspector_general_class_init (GtkInspectorGeneralClass *klass) gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, vk_device); gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, vk_api_version); gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, vk_driver_version); + gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, app_id_frame); + gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, app_id); + gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, resource_path); gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, prefix); gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, xdg_data_home); gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, xdg_data_dirs); @@ -1136,6 +1160,7 @@ gtk_inspector_general_set_display (GtkInspectorGeneral *gen, init_version (gen); init_env (gen); + init_app_id (gen); init_display (gen); init_pango (gen); init_media (gen); diff --git a/gtk/inspector/general.ui b/gtk/inspector/general.ui index 9a7369e362..a75e532c3d 100644 --- a/gtk/inspector/general.ui +++ b/gtk/inspector/general.ui @@ -181,6 +181,73 @@ + + + + center + + + none + + + + 0 + + + 40 + + + Application ID + start + baseline + 0.0 + + + + + 1 + end + baseline + 1 + + + + + + + + + 0 + + + 40 + + + Resource Path + start + baseline + 0.0 + + + + + 1 + end + baseline + 1 + + + + + + + + + + + center @@ -702,6 +769,8 @@ + + @@ -717,6 +786,7 @@ +