[gnome-control-center/wip/hadess/add-windowing-system: 7/7] info: Add windowing system field
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/wip/hadess/add-windowing-system: 7/7] info: Add windowing system field
- Date: Mon, 4 Nov 2019 21:59:33 +0000 (UTC)
commit e121dbcebc7ca34a791b705d21c5d420dc965b13
Author: Bastien Nocera <hadess hadess net>
Date: Wed Oct 30 13:49:32 2019 +0100
info: Add windowing system field
This is supposed to give information that's not easily accessible to an
end user otherwise. It's supposed to give information "at a glance" and
should be removed when X11 is removed.
panels/info-overview/cc-info-overview-panel.c | 22 ++++++++++++++++++++++
panels/info-overview/cc-info-overview-panel.ui | 9 +++++++++
2 files changed, 31 insertions(+)
---
diff --git a/panels/info-overview/cc-info-overview-panel.c b/panels/info-overview/cc-info-overview-panel.c
index e304c4123..2816f80da 100644
--- a/panels/info-overview/cc-info-overview-panel.c
+++ b/panels/info-overview/cc-info-overview-panel.c
@@ -72,6 +72,7 @@ struct _CcInfoOverviewPanel
CcListRow *processor_row;
CcListRow *software_updates_row;
CcListRow *virtualization_row;
+ CcListRow *windowing_system_row;
};
typedef struct
@@ -588,6 +589,24 @@ info_overview_panel_setup_virt (CcInfoOverviewPanel *self)
set_virtualization_label (self, g_variant_get_string (inner, NULL));
}
+static const char *
+get_windowing_system (void)
+{
+ GdkDisplay *display;
+
+ display = gdk_display_get_default ();
+
+#if defined(GDK_WINDOWING_X11)
+ if (GDK_IS_X11_DISPLAY (display))
+ return _("X11");
+#endif /* GDK_WINDOWING_X11 */
+#if defined(GDK_WINDOWING_WAYLAND)
+ if (GDK_IS_WAYLAND_DISPLAY (display))
+ return _("Wayland");
+#endif /* GDK_WINDOWING_WAYLAND */
+ return C_("Windowing system (Wayland, X11, or Unknown)", "Unknown");
+}
+
static void
info_overview_panel_setup_overview (CcInfoOverviewPanel *self)
{
@@ -603,6 +622,8 @@ info_overview_panel_setup_overview (CcInfoOverviewPanel *self)
if (load_gnome_version (&gnome_version, NULL, NULL))
cc_list_row_set_secondary_label (self->gnome_version_row, gnome_version);
+ cc_list_row_set_secondary_label (self->windowing_system_row, get_windowing_system ());
+
glibtop_get_mem (&mem);
memory_text = g_format_size_full (mem.total, G_FORMAT_SIZE_IEC_UNITS);
cc_list_row_set_secondary_label (self->memory_row, memory_text);
@@ -724,6 +745,7 @@ cc_info_overview_panel_class_init (CcInfoOverviewPanelClass *klass)
gtk_widget_class_bind_template_child (widget_class, CcInfoOverviewPanel, processor_row);
gtk_widget_class_bind_template_child (widget_class, CcInfoOverviewPanel, software_updates_row);
gtk_widget_class_bind_template_child (widget_class, CcInfoOverviewPanel, virtualization_row);
+ gtk_widget_class_bind_template_child (widget_class, CcInfoOverviewPanel, windowing_system_row);
gtk_widget_class_bind_template_callback (widget_class, cc_info_panel_row_activated_cb);
diff --git a/panels/info-overview/cc-info-overview-panel.ui b/panels/info-overview/cc-info-overview-panel.ui
index 691611f4b..bd43be8c9 100644
--- a/panels/info-overview/cc-info-overview-panel.ui
+++ b/panels/info-overview/cc-info-overview-panel.ui
@@ -146,6 +146,15 @@
</object>
</child>
+ <!-- Windowing System -->
+ <child>
+ <object class="CcListRow" id="windowing_system_row">
+ <property name="visible">True</property>
+ <property name="activatable">False</property>
+ <property name="title" translatable="yes">Windowing System</property>
+ </object>
+ </child>
+
<!-- Virtualization -->
<child>
<object class="CcListRow" id="virtualization_row">
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]