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.
This commit is contained in:
parent
dba1e59e95
commit
e121dbcebc
2 changed files with 31 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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">
|
||||
|
|
Loading…
Add table
Reference in a new issue