[gnome-software/wip/mcrha/gs-update-dialog-ui-title: 32/33] gs-os-update-page: Add read-only 'title' property
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/mcrha/gs-update-dialog-ui-title: 32/33] gs-os-update-page: Add read-only 'title' property
- Date: Tue, 2 Nov 2021 07:56:00 +0000 (UTC)
commit 1637c340f27222e36f185e5d7196c31a666d7dc4
Author: Milan Crha <mcrha redhat com>
Date: Tue Nov 2 08:49:14 2021 +0100
gs-os-update-page: Add read-only 'title' property
Reflects current window title, to be tight to the parent's window title.
src/gs-os-update-page.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
---
diff --git a/src/gs-os-update-page.c b/src/gs-os-update-page.c
index 68d94da3a..0856f27bc 100644
--- a/src/gs-os-update-page.c
+++ b/src/gs-os-update-page.c
@@ -36,6 +36,7 @@ typedef enum {
typedef enum {
PROP_APP = 1,
+ PROP_TITLE,
} GsOsUpdatePageProperty;
enum {
@@ -43,7 +44,7 @@ enum {
SIGNAL_LAST
};
-static GParamSpec *obj_props[PROP_APP + 1] = { NULL, };
+static GParamSpec *obj_props[PROP_TITLE + 1] = { NULL, };
static guint signals[SIGNAL_LAST] = { 0 };
@@ -429,6 +430,7 @@ gs_os_update_page_set_app (GsOsUpdatePage *page, GsApp *app)
}
g_object_notify_by_pspec (G_OBJECT (page), obj_props[PROP_APP]);
+ g_object_notify_by_pspec (G_OBJECT (page), obj_props[PROP_TITLE]);
}
static void
@@ -450,6 +452,9 @@ gs_os_update_page_get_property (GObject *object, guint prop_id, GValue *value, G
case PROP_APP:
g_value_set_object (value, gs_os_update_page_get_app (page));
break;
+ case PROP_TITLE:
+ g_value_set_string (value, adw_window_title_get_title (page->window_title));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -499,6 +504,18 @@ gs_os_update_page_class_init (GsOsUpdatePageClass *klass)
GS_TYPE_APP,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
+ /**
+ * GsOsUpdatePage:title
+ *
+ * Read-only window title.
+ *
+ * Since: 42
+ */
+ obj_props[PROP_TITLE] =
+ g_param_spec_string ("title", NULL, NULL,
+ NULL,
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
+
g_object_class_install_properties (object_class, G_N_ELEMENTS (obj_props), obj_props);
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]