[gnome-control-center] details: Split overview as a separate panel
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] details: Split overview as a separate panel
- Date: Wed, 29 Mar 2017 20:37:24 +0000 (UTC)
commit fd5c0e855722e22fa5ae952e089927160b0747e0
Author: Mohammed Sadiq <sadiq sadiqpk org>
Date: Sat Feb 25 14:38:00 2017 +0530
details: Split overview as a separate panel
The new shell design requires each panel to be separate.
This commit splits the overview page from details panel as a seperate
panel.
https://bugzilla.gnome.org/show_bug.cgi?id=779216
panels/info/Makefile.am | 2 +
panels/info/cc-info-overview-panel.c | 929 ++++++++++++++++++++++++++++++++++
panels/info/cc-info-overview-panel.h | 36 ++
panels/info/cc-info-panel.c | 758 +---------------------------
panels/info/info-overview.ui | 376 ++++++++++++++
panels/info/info.gresource.xml | 1 +
panels/info/info.ui | 380 +--------------
7 files changed, 1349 insertions(+), 1133 deletions(-)
---
diff --git a/panels/info/Makefile.am b/panels/info/Makefile.am
index 0e53fec..4314def 100644
--- a/panels/info/Makefile.am
+++ b/panels/info/Makefile.am
@@ -21,6 +21,8 @@ libinfo_la_SOURCES = \
$(BUILT_SOURCES) \
cc-info-panel.c \
cc-info-panel.h \
+ cc-info-overview-panel.c \
+ cc-info-overview-panel.h \
gsd-disk-space-helper.h \
gsd-disk-space-helper.c \
info-cleanup.h \
diff --git a/panels/info/cc-info-overview-panel.c b/panels/info/cc-info-overview-panel.c
new file mode 100644
index 0000000..6f7d15c
--- /dev/null
+++ b/panels/info/cc-info-overview-panel.c
@@ -0,0 +1,929 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
+ *
+ * Copyright (C) 2017 Mohammed Sadiq <sadiq sadiqpk org>
+ * Copyright (C) 2010 Red Hat, Inc
+ * Copyright (C) 2008 William Jon McCann <jmccann redhat com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <config.h>
+
+#include "cc-info-panel.h"
+#include "cc-info-resources.h"
+#include "info-cleanup.h"
+
+#include <glib.h>
+#include <glib/gi18n.h>
+#include <gio/gio.h>
+#include <gio/gunixmounts.h>
+#include <gio/gdesktopappinfo.h>
+
+#include <glibtop/fsusage.h>
+#include <glibtop/mountlist.h>
+#include <glibtop/mem.h>
+#include <glibtop/sysinfo.h>
+
+#ifdef GDK_WINDOWING_WAYLAND
+#include <gdk/gdkwayland.h>
+#endif
+#ifdef GDK_WINDOWING_X11
+#include <gdk/gdkx.h>
+#endif
+
+#include "gsd-disk-space-helper.h"
+
+#include "cc-info-overview-panel.h"
+
+
+typedef struct {
+ /* Will be one or 2 GPU name strings, or "Unknown" */
+ char *hardware_string;
+} GraphicsData;
+
+typedef struct
+{
+ GtkWidget *system_image;
+ GtkWidget *version_label;
+ GtkWidget *name_entry;
+ GtkWidget *memory_label;
+ GtkWidget *processor_label;
+ GtkWidget *os_type_label;
+ GtkWidget *disk_label;
+ GtkWidget *graphics_label;
+ GtkWidget *virt_type_label;
+ GtkWidget *updates_button;
+
+ /* Virtualisation labels */
+ GtkWidget *label8;
+ GtkWidget *table1;
+ GtkWidget *label18;
+
+ char *gnome_version;
+ char *gnome_distributor;
+ char *gnome_date;
+
+ GCancellable *cancellable;
+
+ /* Free space */
+ GList *primary_mounts;
+ guint64 total_bytes;
+
+ GraphicsData *graphics_data;
+} CcInfoOverviewPanelPrivate;
+
+struct _CcInfoOverviewPanel
+{
+ GtkBox parent_instance;
+
+ /*< private >*/
+ CcInfoOverviewPanelPrivate *priv;
+};
+
+static void get_primary_disc_info_start (CcInfoOverviewPanel *self);
+
+typedef struct
+{
+ char *major;
+ char *minor;
+ char *micro;
+ char *distributor;
+ char *date;
+ char **current;
+} VersionData;
+
+
+G_DEFINE_TYPE_WITH_PRIVATE (CcInfoOverviewPanel, cc_info_overview_panel, GTK_TYPE_BOX)
+
+static void
+version_start_element_handler (GMarkupParseContext *ctx,
+ const char *element_name,
+ const char **attr_names,
+ const char **attr_values,
+ gpointer user_data,
+ GError **error)
+{
+ VersionData *data = user_data;
+ if (g_str_equal (element_name, "platform"))
+ data->current = &data->major;
+ else if (g_str_equal (element_name, "minor"))
+ data->current = &data->minor;
+ else if (g_str_equal (element_name, "micro"))
+ data->current = &data->micro;
+ else if (g_str_equal (element_name, "distributor"))
+ data->current = &data->distributor;
+ else if (g_str_equal (element_name, "date"))
+ data->current = &data->date;
+ else
+ data->current = NULL;
+}
+
+static void
+version_end_element_handler (GMarkupParseContext *ctx,
+ const char *element_name,
+ gpointer user_data,
+ GError **error)
+{
+ VersionData *data = user_data;
+ data->current = NULL;
+}
+
+static void
+version_text_handler (GMarkupParseContext *ctx,
+ const char *text,
+ gsize text_len,
+ gpointer user_data,
+ GError **error)
+{
+ VersionData *data = user_data;
+ if (data->current != NULL)
+ *data->current = g_strstrip (g_strdup (text));
+}
+
+static gboolean
+load_gnome_version (char **version,
+ char **distributor,
+ char **date)
+{
+ GMarkupParser version_parser = {
+ version_start_element_handler,
+ version_end_element_handler,
+ version_text_handler,
+ NULL,
+ NULL,
+ };
+ GError *error;
+ GMarkupParseContext *ctx;
+ char *contents;
+ gsize length;
+ VersionData *data;
+ gboolean ret;
+
+ ret = FALSE;
+
+ error = NULL;
+ if (!g_file_get_contents (DATADIR "/gnome/gnome-version.xml",
+ &contents,
+ &length,
+ &error))
+ return FALSE;
+
+ data = g_new0 (VersionData, 1);
+ ctx = g_markup_parse_context_new (&version_parser, 0, data, NULL);
+
+ if (!g_markup_parse_context_parse (ctx, contents, length, &error))
+ {
+ g_warning ("Invalid version file: '%s'", error->message);
+ }
+ else
+ {
+ if (version != NULL)
+ *version = g_strdup_printf ("%s.%s.%s", data->major, data->minor, data->micro);
+ if (distributor != NULL)
+ *distributor = g_strdup (data->distributor);
+ if (date != NULL)
+ *date = g_strdup (data->date);
+
+ ret = TRUE;
+ }
+
+ g_markup_parse_context_free (ctx);
+ g_free (data->major);
+ g_free (data->minor);
+ g_free (data->micro);
+ g_free (data->distributor);
+ g_free (data->date);
+ g_free (data);
+ g_free (contents);
+
+ return ret;
+};
+
+static void
+graphics_data_free (GraphicsData *gdata)
+{
+ g_free (gdata->hardware_string);
+ g_slice_free (GraphicsData, gdata);
+}
+
+static char *
+get_renderer_from_session (void)
+{
+ GDBusProxy *session_proxy;
+ GVariant *renderer_variant;
+ char *renderer;
+ GError *error = NULL;
+
+ session_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
+ G_DBUS_PROXY_FLAGS_NONE,
+ NULL,
+ "org.gnome.SessionManager",
+ "/org/gnome/SessionManager",
+ "org.gnome.SessionManager",
+ NULL, &error);
+ if (error != NULL)
+ {
+ g_warning ("Unable to connect to create a proxy for org.gnome.SessionManager: %s",
+ error->message);
+ g_error_free (error);
+ return NULL;
+ }
+
+ renderer_variant = g_dbus_proxy_get_cached_property (session_proxy, "Renderer");
+ g_object_unref (session_proxy);
+
+ if (!renderer_variant)
+ {
+ g_warning ("Unable to retrieve org.gnome.SessionManager.Renderer property");
+ return NULL;
+ }
+
+ renderer = info_cleanup (g_variant_get_string (renderer_variant, NULL));
+ g_variant_unref (renderer_variant);
+
+ return renderer;
+}
+
+static char *
+get_renderer_from_helper (gboolean discrete_gpu)
+{
+ int status;
+ char *argv[] = { GNOME_SESSION_DIR "/gnome-session-check-accelerated", NULL };
+ char **envp = NULL;
+ char *renderer = NULL;
+ char *ret = NULL;
+ GError *error = NULL;
+
+ if (discrete_gpu)
+ {
+ envp = g_get_environ ();
+ envp = g_environ_setenv (envp, "DRI_PRIME", "1", TRUE);
+ }
+
+ if (!g_spawn_sync (NULL, (char **) argv, envp, 0, NULL, NULL, &renderer, NULL, &status, &error))
+ {
+ g_debug ("Failed to get %s GPU: %s",
+ discrete_gpu ? "discrete" : "integrated",
+ error->message);
+ g_error_free (error);
+ goto out;
+ }
+
+ if (!g_spawn_check_exit_status (status, NULL))
+ goto out;
+
+ if (renderer == NULL || *renderer == '\0')
+ goto out;
+
+ ret = info_cleanup (renderer);
+
+out:
+ g_free (renderer);
+ g_strfreev (envp);
+ return ret;
+}
+
+static gboolean
+has_dual_gpu (void)
+{
+ GDBusProxy *switcheroo_proxy;
+ GVariant *dualgpu_variant;
+ gboolean ret;
+ GError *error = NULL;
+
+ switcheroo_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
+ G_DBUS_PROXY_FLAGS_NONE,
+ NULL,
+ "net.hadess.SwitcherooControl",
+ "/net/hadess/SwitcherooControl",
+ "net.hadess.SwitcherooControl",
+ NULL, &error);
+ if (switcheroo_proxy == NULL)
+ {
+ g_debug ("Unable to connect to create a proxy for net.hadess.SwitcherooControl: %s",
+ error->message);
+ g_error_free (error);
+ return FALSE;
+ }
+
+ dualgpu_variant = g_dbus_proxy_get_cached_property (switcheroo_proxy, "HasDualGpu");
+ g_object_unref (switcheroo_proxy);
+
+ if (!dualgpu_variant)
+ {
+ g_debug ("Unable to retrieve net.hadess.SwitcherooControl.HasDualGpu property, the daemon is likely
not running");
+ return FALSE;
+ }
+
+ ret = g_variant_get_boolean (dualgpu_variant);
+ g_variant_unref (dualgpu_variant);
+
+ if (ret)
+ g_debug ("Dual-GPU machine detected");
+
+ return ret;
+}
+
+static GraphicsData *
+get_graphics_data (void)
+{
+ GraphicsData *result;
+ GdkDisplay *display;
+
+ result = g_slice_new0 (GraphicsData);
+
+ display = gdk_display_get_default ();
+
+#if defined(GDK_WINDOWING_X11) || defined(GDK_WINDOWING_WAYLAND)
+ gboolean x11_or_wayland = FALSE;
+#ifdef GDK_WINDOWING_X11
+ x11_or_wayland = GDK_IS_X11_DISPLAY (display);
+#endif
+#ifdef GDK_WINDOWING_WAYLAND
+ x11_or_wayland = x11_or_wayland || GDK_IS_WAYLAND_DISPLAY (display);
+#endif
+
+ if (x11_or_wayland)
+ {
+ char *discrete_renderer = NULL;
+ char *renderer;
+
+ renderer = get_renderer_from_session ();
+ if (!renderer)
+ renderer = get_renderer_from_helper (FALSE);
+ if (has_dual_gpu ())
+ discrete_renderer = get_renderer_from_helper (TRUE);
+ if (!discrete_renderer)
+ result->hardware_string = g_strdup (renderer);
+ else
+ result->hardware_string = g_strdup_printf ("%s / %s",
+ renderer,
+ discrete_renderer);
+ g_free (renderer);
+ g_free (discrete_renderer);
+ }
+#endif
+
+ if (!result->hardware_string)
+ result->hardware_string = g_strdup (_("Unknown"));
+
+ return result;
+}
+
+static GHashTable*
+get_os_info (void)
+{
+ GHashTable *hashtable;
+ gchar *buffer;
+
+ hashtable = NULL;
+
+ if (g_file_get_contents ("/etc/os-release", &buffer, NULL, NULL))
+ {
+ gchar **lines;
+ gint i;
+
+ lines = g_strsplit (buffer, "\n", -1);
+
+ for (i = 0; lines[i] != NULL; i++)
+ {
+ gchar *delimiter, *key, *value;
+
+ /* Initialize the hash table if needed */
+ if (!hashtable)
+ hashtable = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
+
+ delimiter = strstr (lines[i], "=");
+ value = NULL;
+ key = NULL;
+
+ if (delimiter != NULL)
+ {
+ gint size;
+
+ key = g_strndup (lines[i], delimiter - lines[i]);
+
+ /* Jump the '=' */
+ delimiter += strlen ("=");
+
+ /* Eventually jump the ' " ' character */
+ if (g_str_has_prefix (delimiter, "\""))
+ delimiter += strlen ("\"");
+
+ size = strlen (delimiter);
+
+ /* Don't consider the last ' " ' too */
+ if (g_str_has_suffix (delimiter, "\""))
+ size -= strlen ("\"");
+
+ value = g_strndup (delimiter, size);
+
+ g_hash_table_insert (hashtable, key, value);
+ }
+ }
+
+ g_strfreev (lines);
+ g_free (buffer);
+ }
+
+ return hashtable;
+}
+
+static char *
+get_os_type (void)
+{
+ GHashTable *os_info;
+ gchar *name, *result, *build_id;
+ int bits;
+
+ os_info = get_os_info ();
+
+ if (!os_info)
+ return NULL;
+
+ name = g_hash_table_lookup (os_info, "PRETTY_NAME");
+ build_id = g_hash_table_lookup (os_info, "BUILD_ID");
+
+ if (GLIB_SIZEOF_VOID_P == 8)
+ bits = 64;
+ else
+ bits = 32;
+
+ if (build_id)
+ {
+ if (name)
+ /* translators: This is the name of the OS, followed by the type
+ * of architecture and the build id, for example:
+ * "Fedora 18 (Spherical Cow) 64-bit (Build ID: xyz)" or
+ * "Ubuntu (Oneric Ocelot) 32-bit (Build ID: jki)" */
+ result = g_strdup_printf (_("%s %d-bit (Build ID: %s)"), name, bits, build_id);
+ else
+ result = g_strdup_printf (_("%d-bit (Build ID: %s)"), bits, build_id);
+ }
+ else
+ {
+ if (name)
+ /* translators: This is the name of the OS, followed by the type
+ * of architecture, for example:
+ * "Fedora 18 (Spherical Cow) 64-bit" or "Ubuntu (Oneric Ocelot) 32-bit" */
+ result = g_strdup_printf (_("%s %d-bit"), name, bits);
+ else
+ result = g_strdup_printf (_("%d-bit"), bits);
+ }
+
+ g_clear_pointer (&os_info, g_hash_table_destroy);
+
+ return result;
+}
+
+static void
+query_done (GFile *file,
+ GAsyncResult *res,
+ CcInfoOverviewPanel *self)
+{
+ GFileInfo *info;
+ GError *error = NULL;
+ CcInfoOverviewPanelPrivate *priv = cc_info_overview_panel_get_instance_private (self);
+
+ priv->cancellable = NULL;
+ info = g_file_query_filesystem_info_finish (file, res, &error);
+ if (info != NULL)
+ {
+ priv->total_bytes += g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_FILESYSTEM_SIZE);
+ g_object_unref (info);
+ }
+ else
+ {
+ char *path;
+ path = g_file_get_path (file);
+ g_warning ("Failed to get filesystem free space for '%s': %s", path, error->message);
+ g_free (path);
+ g_error_free (error);
+ }
+
+ /* And onto the next element */
+ get_primary_disc_info_start (self);
+}
+
+static void
+get_primary_disc_info_start (CcInfoOverviewPanel *self)
+{
+ GUnixMountEntry *mount;
+ GFile *file;
+ CcInfoOverviewPanelPrivate *priv = cc_info_overview_panel_get_instance_private (self);
+
+ if (priv->primary_mounts == NULL)
+ {
+ char *size;
+
+ size = g_format_size (priv->total_bytes);
+ gtk_label_set_text (GTK_LABEL (priv->disk_label), size);
+ g_free (size);
+
+ return;
+ }
+
+ mount = priv->primary_mounts->data;
+ priv->primary_mounts = g_list_remove (priv->primary_mounts, mount);
+ file = g_file_new_for_path (g_unix_mount_get_mount_path (mount));
+ g_unix_mount_free (mount);
+
+ priv->cancellable = g_cancellable_new ();
+
+ g_file_query_filesystem_info_async (file,
+ G_FILE_ATTRIBUTE_FILESYSTEM_SIZE,
+ 0,
+ priv->cancellable,
+ (GAsyncReadyCallback) query_done,
+ self);
+ g_object_unref (file);
+}
+
+static void
+get_primary_disc_info (CcInfoOverviewPanel *self)
+{
+ GList *points;
+ GList *p;
+ CcInfoOverviewPanelPrivate *priv = cc_info_overview_panel_get_instance_private (self);
+
+ points = g_unix_mount_points_get (NULL);
+
+ /* If we do not have /etc/fstab around, try /etc/mtab */
+ if (points == NULL)
+ points = g_unix_mounts_get (NULL);
+
+ for (p = points; p != NULL; p = p->next)
+ {
+ GUnixMountEntry *mount = p->data;
+ const char *mount_path;
+
+ mount_path = g_unix_mount_get_mount_path (mount);
+
+ if (gsd_should_ignore_unix_mount (mount) ||
+ gsd_is_removable_mount (mount) ||
+ g_str_has_prefix (mount_path, "/media/") ||
+ g_str_has_prefix (mount_path, g_get_home_dir ()))
+ {
+ g_unix_mount_free (mount);
+ continue;
+ }
+
+ priv->primary_mounts = g_list_prepend (priv->primary_mounts, mount);
+ }
+ g_list_free (points);
+
+ get_primary_disc_info_start (self);
+}
+
+static char *
+get_cpu_info (const glibtop_sysinfo *info)
+{
+ GHashTable *counts;
+ GString *cpu;
+ char *ret;
+ GHashTableIter iter;
+ gpointer key, value;
+ int i;
+ int j;
+
+ counts = g_hash_table_new (g_str_hash, g_str_equal);
+
+ /* count duplicates */
+ for (i = 0; i != info->ncpu; ++i)
+ {
+ const char * const keys[] = { "model name", "cpu", "Processor" };
+ char *model;
+ int *count;
+
+ model = NULL;
+
+ for (j = 0; model == NULL && j != G_N_ELEMENTS (keys); ++j)
+ {
+ model = g_hash_table_lookup (info->cpuinfo[i].values,
+ keys[j]);
+ }
+
+ if (model == NULL)
+ continue;
+
+ count = g_hash_table_lookup (counts, model);
+ if (count == NULL)
+ g_hash_table_insert (counts, model, GINT_TO_POINTER (1));
+ else
+ g_hash_table_replace (counts, model, GINT_TO_POINTER (GPOINTER_TO_INT (count) + 1));
+ }
+
+ cpu = g_string_new (NULL);
+ g_hash_table_iter_init (&iter, counts);
+ while (g_hash_table_iter_next (&iter, &key, &value))
+ {
+ char *cleanedup;
+ int count;
+
+ count = GPOINTER_TO_INT (value);
+ cleanedup = info_cleanup ((const char *) key);
+ if (count > 1)
+ g_string_append_printf (cpu, "%s \303\227 %d ", cleanedup, count);
+ else
+ g_string_append_printf (cpu, "%s ", cleanedup);
+ g_free (cleanedup);
+ }
+
+ g_hash_table_destroy (counts);
+
+ ret = g_string_free (cpu, FALSE);
+
+ return ret;
+}
+
+static void
+move_one_up (GtkWidget *table,
+ GtkWidget *child)
+{
+ int top_attach, bottom_attach;
+
+ gtk_container_child_get (GTK_CONTAINER (table),
+ child,
+ "top-attach", &top_attach,
+ "bottom-attach", &bottom_attach,
+ NULL);
+ gtk_container_child_set (GTK_CONTAINER (table),
+ child,
+ "top-attach", top_attach - 1,
+ "bottom-attach", bottom_attach - 1,
+ NULL);
+}
+
+static struct {
+ const char *id;
+ const char *display;
+} const virt_tech[] = {
+ { "kvm", "KVM" },
+ { "qemu", "QEmu" },
+ { "vmware", "VMware" },
+ { "microsoft", "Microsoft" },
+ { "oracle", "Oracle" },
+ { "xen", "Xen" },
+ { "bochs", "Bochs" },
+ { "chroot", "chroot" },
+ { "openvz", "OpenVZ" },
+ { "lxc", "LXC" },
+ { "lxc-libvirt", "LXC (libvirt)" },
+ { "systemd-nspawn", "systemd (nspawn)" }
+};
+
+static void
+set_virtualization_label (CcInfoOverviewPanel *self,
+ const char *virt)
+{
+ const char *display_name;
+ CcInfoOverviewPanelPrivate *priv = cc_info_overview_panel_get_instance_private (self);
+ guint i;
+
+ if (virt == NULL || *virt == '\0')
+ {
+ gtk_widget_hide (priv->virt_type_label);
+ gtk_widget_hide (priv->label18);
+ move_one_up (priv->table1, priv->label8);
+ move_one_up (priv->table1, priv->disk_label);
+ return;
+ }
+
+ display_name = NULL;
+ for (i = 0; i < G_N_ELEMENTS (virt_tech); i++)
+ {
+ if (g_str_equal (virt_tech[i].id, virt))
+ {
+ display_name = _(virt_tech[i].display);
+ break;
+ }
+ }
+
+ gtk_label_set_text (GTK_LABEL (priv->virt_type_label), display_name ? display_name : virt);
+}
+
+static void
+info_overview_panel_setup_virt (CcInfoOverviewPanel *self)
+{
+ GError *error = NULL;
+ GDBusProxy *systemd_proxy;
+ GVariant *variant;
+ GVariant *inner;
+ char *str;
+
+ str = NULL;
+
+ systemd_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
+ G_DBUS_PROXY_FLAGS_NONE,
+ NULL,
+ "org.freedesktop.systemd1",
+ "/org/freedesktop/systemd1",
+ "org.freedesktop.systemd1",
+ NULL,
+ &error);
+
+ if (systemd_proxy == NULL)
+ {
+ g_debug ("systemd not available, bailing: %s", error->message);
+ g_error_free (error);
+ goto bail;
+ }
+
+ variant = g_dbus_proxy_call_sync (systemd_proxy,
+ "org.freedesktop.DBus.Properties.Get",
+ g_variant_new ("(ss)", "org.freedesktop.systemd1.Manager",
"Virtualization"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ NULL,
+ &error);
+ if (variant == NULL)
+ {
+ g_debug ("Failed to get property '%s': %s", "Virtualization", error->message);
+ g_error_free (error);
+ g_object_unref (systemd_proxy);
+ goto bail;
+ }
+
+ g_variant_get (variant, "(v)", &inner);
+ str = g_variant_dup_string (inner, NULL);
+ g_variant_unref (variant);
+
+ g_object_unref (systemd_proxy);
+
+bail:
+ set_virtualization_label (self, str);
+ g_free (str);
+}
+
+static void
+info_overview_panel_setup_overview (CcInfoOverviewPanel *self)
+{
+ gboolean res;
+ glibtop_mem mem;
+ const glibtop_sysinfo *info;
+ char *text;
+ CcInfoOverviewPanelPrivate *priv = cc_info_overview_panel_get_instance_private (self);
+
+ res = load_gnome_version (&priv->gnome_version,
+ &priv->gnome_distributor,
+ &priv->gnome_date);
+ if (res)
+ {
+ text = g_strdup_printf (_("Version %s"), priv->gnome_version);
+ gtk_label_set_text (GTK_LABEL (priv->version_label), text);
+ g_free (text);
+ }
+
+ glibtop_get_mem (&mem);
+ text = g_format_size_full (mem.total, G_FORMAT_SIZE_IEC_UNITS);
+ gtk_label_set_text (GTK_LABEL (priv->memory_label), text ? text : "");
+ g_free (text);
+
+ info = glibtop_get_sysinfo ();
+
+ text = get_cpu_info (info);
+ gtk_label_set_markup (GTK_LABEL (priv->processor_label), text ? text : "");
+ g_free (text);
+
+ text = get_os_type ();
+ gtk_label_set_text (GTK_LABEL (priv->os_type_label), text ? text : "");
+ g_free (text);
+
+ get_primary_disc_info (self);
+
+ gtk_label_set_markup (GTK_LABEL (priv->graphics_label), priv->graphics_data->hardware_string);
+}
+
+static gboolean
+does_gnome_software_exist (void)
+{
+ return g_file_test (BINDIR "/gnome-software", G_FILE_TEST_EXISTS);
+}
+
+static gboolean
+does_gpk_update_viewer_exist (void)
+{
+ return g_file_test (BINDIR "/gpk-update-viewer", G_FILE_TEST_EXISTS);
+}
+
+static void
+on_updates_button_clicked (GtkWidget *widget,
+ CcInfoOverviewPanel *self)
+{
+ GError *error = NULL;
+ gboolean ret;
+ gchar **argv;
+
+ argv = g_new0 (gchar *, 3);
+ if (does_gnome_software_exist ())
+ {
+ argv[0] = g_build_filename (BINDIR, "gnome-software", NULL);
+ argv[1] = g_strdup_printf ("--mode=updates");
+ }
+ else
+ {
+ argv[0] = g_build_filename (BINDIR, "gpk-update-viewer", NULL);
+ }
+ ret = g_spawn_async (NULL, argv, NULL, 0, NULL, NULL, NULL, &error);
+ if (!ret)
+ {
+ g_warning ("Failed to spawn %s: %s", argv[0], error->message);
+ g_error_free (error);
+ }
+ g_strfreev (argv);
+}
+
+static void
+cc_info_overview_panel_dispose (GObject *object)
+{
+ CcInfoOverviewPanelPrivate *priv = cc_info_overview_panel_get_instance_private (CC_INFO_OVERVIEW_PANEL
(object));
+
+ g_clear_pointer (&priv->graphics_data, graphics_data_free);
+
+ G_OBJECT_CLASS (cc_info_overview_panel_parent_class)->dispose (object);
+}
+
+static void
+cc_info_overview_panel_finalize (GObject *object)
+{
+ CcInfoOverviewPanelPrivate *priv = cc_info_overview_panel_get_instance_private (CC_INFO_OVERVIEW_PANEL
(object));
+
+ if (priv->cancellable)
+ {
+ g_cancellable_cancel (priv->cancellable);
+ g_clear_object (&priv->cancellable);
+ }
+
+ g_free (priv->gnome_version);
+ g_free (priv->gnome_date);
+ g_free (priv->gnome_distributor);
+
+ G_OBJECT_CLASS (cc_info_overview_panel_parent_class)->finalize (object);
+}
+
+static void
+cc_info_overview_panel_class_init (CcInfoOverviewPanelClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
+ object_class->finalize = cc_info_overview_panel_finalize;
+ object_class->dispose = cc_info_overview_panel_dispose;
+
+ gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/control-center/info/info-overview.ui");
+
+ gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, system_image);
+ gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, version_label);
+ gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, name_entry);
+ gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, memory_label);
+ gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, processor_label);
+ gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, os_type_label);
+ gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, disk_label);
+ gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, graphics_label);
+ gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, virt_type_label);
+ gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, updates_button);
+ gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, label8);
+ gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, table1);
+ gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, label18);
+}
+
+static void
+cc_info_overview_panel_init (CcInfoOverviewPanel *self)
+{
+ CcInfoOverviewPanelPrivate *priv = cc_info_overview_panel_get_instance_private (self);
+
+ gtk_widget_init_template (GTK_WIDGET (self));
+
+ priv->graphics_data = get_graphics_data ();
+
+ if (does_gnome_software_exist () || does_gpk_update_viewer_exist ())
+ {
+ g_signal_connect (priv->updates_button, "clicked", G_CALLBACK (on_updates_button_clicked), self);
+ }
+ else
+ {
+ gtk_widget_destroy (priv->updates_button);
+ }
+
+ info_overview_panel_setup_overview (self);
+ info_overview_panel_setup_virt (self);
+}
+
+GtkWidget *
+cc_info_overview_panel_new (void)
+{
+ return g_object_new (CC_TYPE_INFO_OVERVIEW_PANEL,
+ NULL);
+}
diff --git a/panels/info/cc-info-overview-panel.h b/panels/info/cc-info-overview-panel.h
new file mode 100644
index 0000000..7747cf9
--- /dev/null
+++ b/panels/info/cc-info-overview-panel.h
@@ -0,0 +1,36 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
+ *
+ * Copyright (C) 2017 Mohammed Sadiq <sadiq sadiqpk org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef CC_INFO_OVERVIEWPANEL_H
+#define CC_INFO_OVERVIEWPANEL_H
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define CC_TYPE_INFO_OVERVIEW_PANEL (cc_info_overview_panel_get_type ())
+
+G_DECLARE_FINAL_TYPE (CcInfoOverviewPanel, cc_info_overview_panel, CC, INFO_OVERVIEW_PANEL, GtkBox);
+
+GtkWidget *cc_info_overview_panel_new (void);
+
+
+G_END_DECLS
+
+#endif /* CC_INFO_OVERVIEWPANEL_H */
diff --git a/panels/info/cc-info-panel.c b/panels/info/cc-info-panel.c
index 3ce8b57..71d3ee5 100644
--- a/panels/info/cc-info-panel.c
+++ b/panels/info/cc-info-panel.c
@@ -21,6 +21,7 @@
#include <config.h>
#include "cc-info-panel.h"
+#include "cc-info-overview-panel.h"
#include "cc-info-resources.h"
#include "info-cleanup.h"
@@ -68,7 +69,7 @@ typedef struct {
char *hardware_string;
} GraphicsData;
-typedef struct
+typedef struct
{
const char *content_type;
const char *label;
@@ -99,121 +100,6 @@ struct _CcInfoPanelPrivate
GraphicsData *graphics_data;
};
-static void get_primary_disc_info_start (CcInfoPanel *self);
-
-typedef struct
-{
- char *major;
- char *minor;
- char *micro;
- char *distributor;
- char *date;
- char **current;
-} VersionData;
-
-static void
-version_start_element_handler (GMarkupParseContext *ctx,
- const char *element_name,
- const char **attr_names,
- const char **attr_values,
- gpointer user_data,
- GError **error)
-{
- VersionData *data = user_data;
- if (g_str_equal (element_name, "platform"))
- data->current = &data->major;
- else if (g_str_equal (element_name, "minor"))
- data->current = &data->minor;
- else if (g_str_equal (element_name, "micro"))
- data->current = &data->micro;
- else if (g_str_equal (element_name, "distributor"))
- data->current = &data->distributor;
- else if (g_str_equal (element_name, "date"))
- data->current = &data->date;
- else
- data->current = NULL;
-}
-
-static void
-version_end_element_handler (GMarkupParseContext *ctx,
- const char *element_name,
- gpointer user_data,
- GError **error)
-{
- VersionData *data = user_data;
- data->current = NULL;
-}
-
-static void
-version_text_handler (GMarkupParseContext *ctx,
- const char *text,
- gsize text_len,
- gpointer user_data,
- GError **error)
-{
- VersionData *data = user_data;
- if (data->current != NULL)
- *data->current = g_strstrip (g_strdup (text));
-}
-
-static gboolean
-load_gnome_version (char **version,
- char **distributor,
- char **date)
-{
- GMarkupParser version_parser = {
- version_start_element_handler,
- version_end_element_handler,
- version_text_handler,
- NULL,
- NULL,
- };
- GError *error;
- GMarkupParseContext *ctx;
- char *contents;
- gsize length;
- VersionData *data;
- gboolean ret;
-
- ret = FALSE;
-
- error = NULL;
- if (!g_file_get_contents (DATADIR "/gnome/gnome-version.xml",
- &contents,
- &length,
- &error))
- return FALSE;
-
- data = g_new0 (VersionData, 1);
- ctx = g_markup_parse_context_new (&version_parser, 0, data, NULL);
-
- if (!g_markup_parse_context_parse (ctx, contents, length, &error))
- {
- g_warning ("Invalid version file: '%s'", error->message);
- }
- else
- {
- if (version != NULL)
- *version = g_strdup_printf ("%s.%s.%s", data->major, data->minor, data->micro);
- if (distributor != NULL)
- *distributor = g_strdup (data->distributor);
- if (date != NULL)
- *date = g_strdup (data->date);
-
- ret = TRUE;
- }
-
- g_markup_parse_context_free (ctx);
- g_free (data->major);
- g_free (data->minor);
- g_free (data->micro);
- g_free (data->distributor);
- g_free (data->date);
- g_free (data);
- g_free (contents);
-
- return ret;
-};
static void
graphics_data_free (GraphicsData *gdata)
@@ -222,170 +108,6 @@ graphics_data_free (GraphicsData *gdata)
g_slice_free (GraphicsData, gdata);
}
-static char *
-get_renderer_from_session (void)
-{
- GDBusProxy *session_proxy;
- GVariant *renderer_variant;
- char *renderer;
- GError *error = NULL;
-
- session_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
- G_DBUS_PROXY_FLAGS_NONE,
- NULL,
- "org.gnome.SessionManager",
- "/org/gnome/SessionManager",
- "org.gnome.SessionManager",
- NULL, &error);
- if (error != NULL)
- {
- g_warning ("Unable to connect to create a proxy for org.gnome.SessionManager: %s",
- error->message);
- g_error_free (error);
- return NULL;
- }
-
- renderer_variant = g_dbus_proxy_get_cached_property (session_proxy, "Renderer");
- g_object_unref (session_proxy);
-
- if (!renderer_variant)
- {
- g_warning ("Unable to retrieve org.gnome.SessionManager.Renderer property");
- return NULL;
- }
-
- renderer = info_cleanup (g_variant_get_string (renderer_variant, NULL));
- g_variant_unref (renderer_variant);
-
- return renderer;
-}
-
-static char *
-get_renderer_from_helper (gboolean discrete_gpu)
-{
- int status;
- char *argv[] = { GNOME_SESSION_DIR "/gnome-session-check-accelerated", NULL };
- char **envp = NULL;
- char *renderer = NULL;
- char *ret = NULL;
- GError *error = NULL;
-
- if (discrete_gpu)
- {
- envp = g_get_environ ();
- envp = g_environ_setenv (envp, "DRI_PRIME", "1", TRUE);
- }
-
- if (!g_spawn_sync (NULL, (char **) argv, envp, 0, NULL, NULL, &renderer, NULL, &status, &error))
- {
- g_debug ("Failed to get %s GPU: %s",
- discrete_gpu ? "discrete" : "integrated",
- error->message);
- g_error_free (error);
- goto out;
- }
-
- if (!g_spawn_check_exit_status (status, NULL))
- goto out;
-
- if (renderer == NULL || *renderer == '\0')
- goto out;
-
- ret = info_cleanup (renderer);
-
-out:
- g_free (renderer);
- g_strfreev (envp);
- return ret;
-}
-
-static gboolean
-has_dual_gpu (void)
-{
- GDBusProxy *switcheroo_proxy;
- GVariant *dualgpu_variant;
- gboolean ret;
- GError *error = NULL;
-
- switcheroo_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
- G_DBUS_PROXY_FLAGS_NONE,
- NULL,
- "net.hadess.SwitcherooControl",
- "/net/hadess/SwitcherooControl",
- "net.hadess.SwitcherooControl",
- NULL, &error);
- if (switcheroo_proxy == NULL)
- {
- g_debug ("Unable to connect to create a proxy for net.hadess.SwitcherooControl: %s",
- error->message);
- g_error_free (error);
- return FALSE;
- }
-
- dualgpu_variant = g_dbus_proxy_get_cached_property (switcheroo_proxy, "HasDualGpu");
- g_object_unref (switcheroo_proxy);
-
- if (!dualgpu_variant)
- {
- g_debug ("Unable to retrieve net.hadess.SwitcherooControl.HasDualGpu property, the daemon is likely
not running");
- return FALSE;
- }
-
- ret = g_variant_get_boolean (dualgpu_variant);
- g_variant_unref (dualgpu_variant);
-
- if (ret)
- g_debug ("Dual-GPU machine detected");
-
- return ret;
-}
-
-static GraphicsData *
-get_graphics_data (void)
-{
- GraphicsData *result;
- GdkDisplay *display;
-
- result = g_slice_new0 (GraphicsData);
-
- display = gdk_display_get_default ();
-
-#if defined(GDK_WINDOWING_X11) || defined(GDK_WINDOWING_WAYLAND)
- gboolean x11_or_wayland = FALSE;
-#ifdef GDK_WINDOWING_X11
- x11_or_wayland = GDK_IS_X11_DISPLAY (display);
-#endif
-#ifdef GDK_WINDOWING_WAYLAND
- x11_or_wayland = x11_or_wayland || GDK_IS_WAYLAND_DISPLAY (display);
-#endif
-
- if (x11_or_wayland)
- {
- char *discrete_renderer = NULL;
- char *renderer;
-
- renderer = get_renderer_from_session ();
- if (!renderer)
- renderer = get_renderer_from_helper (FALSE);
- if (has_dual_gpu ())
- discrete_renderer = get_renderer_from_helper (TRUE);
- if (!discrete_renderer)
- result->hardware_string = g_strdup (renderer);
- else
- result->hardware_string = g_strdup_printf ("%s / %s",
- renderer,
- discrete_renderer);
- g_free (renderer);
- g_free (discrete_renderer);
- }
-#endif
-
- if (!result->hardware_string)
- result->hardware_string = g_strdup (_("Unknown"));
-
- return result;
-}
-
static void
cc_info_panel_dispose (GObject *object)
{
@@ -426,271 +148,8 @@ cc_info_panel_class_init (CcInfoPanelClass *klass)
object_class->dispose = cc_info_panel_dispose;
object_class->finalize = cc_info_panel_finalize;
-}
-
-static GHashTable*
-get_os_info (void)
-{
- GHashTable *hashtable;
- gchar *buffer;
-
- hashtable = NULL;
-
- if (g_file_get_contents ("/etc/os-release", &buffer, NULL, NULL))
- {
- gchar **lines;
- gint i;
-
- lines = g_strsplit (buffer, "\n", -1);
-
- for (i = 0; lines[i] != NULL; i++)
- {
- gchar *delimiter, *key, *value;
-
- /* Initialize the hash table if needed */
- if (!hashtable)
- hashtable = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
-
- delimiter = strstr (lines[i], "=");
- value = NULL;
- key = NULL;
-
- if (delimiter != NULL)
- {
- gint size;
-
- key = g_strndup (lines[i], delimiter - lines[i]);
-
- /* Jump the '=' */
- delimiter += strlen ("=");
-
- /* Eventually jump the ' " ' character */
- if (g_str_has_prefix (delimiter, "\""))
- delimiter += strlen ("\"");
-
- size = strlen (delimiter);
-
- /* Don't consider the last ' " ' too */
- if (g_str_has_suffix (delimiter, "\""))
- size -= strlen ("\"");
-
- value = g_strndup (delimiter, size);
-
- g_hash_table_insert (hashtable, key, value);
- }
- }
-
- g_strfreev (lines);
- g_free (buffer);
- }
-
- return hashtable;
-}
-
-static char *
-get_os_type (void)
-{
- GHashTable *os_info;
- gchar *name, *result, *build_id;
- int bits;
-
- os_info = get_os_info ();
-
- if (!os_info)
- return NULL;
-
- name = g_hash_table_lookup (os_info, "PRETTY_NAME");
- build_id = g_hash_table_lookup (os_info, "BUILD_ID");
-
- if (GLIB_SIZEOF_VOID_P == 8)
- bits = 64;
- else
- bits = 32;
-
- if (build_id)
- {
- if (name)
- /* translators: This is the name of the OS, followed by the type
- * of architecture and the build id, for example:
- * "Fedora 18 (Spherical Cow) 64-bit (Build ID: xyz)" or
- * "Ubuntu (Oneric Ocelot) 32-bit (Build ID: jki)" */
- result = g_strdup_printf (_("%s %d-bit (Build ID: %s)"), name, bits, build_id);
- else
- result = g_strdup_printf (_("%d-bit (Build ID: %s)"), bits, build_id);
- }
- else
- {
- if (name)
- /* translators: This is the name of the OS, followed by the type
- * of architecture, for example:
- * "Fedora 18 (Spherical Cow) 64-bit" or "Ubuntu (Oneric Ocelot) 32-bit" */
- result = g_strdup_printf (_("%s %d-bit"), name, bits);
- else
- result = g_strdup_printf (_("%d-bit"), bits);
- }
- g_clear_pointer (&os_info, g_hash_table_destroy);
-
- return result;
-}
-
-static void
-query_done (GFile *file,
- GAsyncResult *res,
- CcInfoPanel *self)
-{
- GFileInfo *info;
- GError *error = NULL;
-
- self->priv->cancellable = NULL;
- info = g_file_query_filesystem_info_finish (file, res, &error);
- if (info != NULL)
- {
- self->priv->total_bytes += g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_FILESYSTEM_SIZE);
- g_object_unref (info);
- }
- else
- {
- char *path;
- path = g_file_get_path (file);
- g_warning ("Failed to get filesystem free space for '%s': %s", path, error->message);
- g_free (path);
- g_error_free (error);
- }
-
- /* And onto the next element */
- get_primary_disc_info_start (self);
-}
-
-static void
-get_primary_disc_info_start (CcInfoPanel *self)
-{
- GUnixMountEntry *mount;
- GFile *file;
-
- if (self->priv->primary_mounts == NULL)
- {
- char *size;
- GtkWidget *widget;
-
- size = g_format_size (self->priv->total_bytes);
- widget = WID ("disk_label");
- gtk_label_set_text (GTK_LABEL (widget), size);
- g_free (size);
-
- return;
- }
-
- mount = self->priv->primary_mounts->data;
- self->priv->primary_mounts = g_list_remove (self->priv->primary_mounts, mount);
- file = g_file_new_for_path (g_unix_mount_get_mount_path (mount));
- g_unix_mount_free (mount);
-
- self->priv->cancellable = g_cancellable_new ();
-
- g_file_query_filesystem_info_async (file,
- G_FILE_ATTRIBUTE_FILESYSTEM_SIZE,
- 0,
- self->priv->cancellable,
- (GAsyncReadyCallback) query_done,
- self);
- g_object_unref (file);
-}
-
-static void
-get_primary_disc_info (CcInfoPanel *self)
-{
- GList *points;
- GList *p;
-
- points = g_unix_mount_points_get (NULL);
-
- /* If we do not have /etc/fstab around, try /etc/mtab */
- if (points == NULL)
- points = g_unix_mounts_get (NULL);
-
- for (p = points; p != NULL; p = p->next)
- {
- GUnixMountEntry *mount = p->data;
- const char *mount_path;
-
- mount_path = g_unix_mount_get_mount_path (mount);
-
- if (gsd_should_ignore_unix_mount (mount) ||
- gsd_is_removable_mount (mount) ||
- g_str_has_prefix (mount_path, "/media/") ||
- g_str_has_prefix (mount_path, g_get_home_dir ()))
- {
- g_unix_mount_free (mount);
- continue;
- }
-
- self->priv->primary_mounts = g_list_prepend (self->priv->primary_mounts, mount);
- }
- g_list_free (points);
-
- get_primary_disc_info_start (self);
-}
-
-static char *
-get_cpu_info (const glibtop_sysinfo *info)
-{
- GHashTable *counts;
- GString *cpu;
- char *ret;
- GHashTableIter iter;
- gpointer key, value;
- int i;
- int j;
-
- counts = g_hash_table_new (g_str_hash, g_str_equal);
-
- /* count duplicates */
- for (i = 0; i != info->ncpu; ++i)
- {
- const char * const keys[] = { "model name", "cpu", "Processor" };
- char *model;
- int *count;
-
- model = NULL;
-
- for (j = 0; model == NULL && j != G_N_ELEMENTS (keys); ++j)
- {
- model = g_hash_table_lookup (info->cpuinfo[i].values,
- keys[j]);
- }
-
- if (model == NULL)
- continue;
-
- count = g_hash_table_lookup (counts, model);
- if (count == NULL)
- g_hash_table_insert (counts, model, GINT_TO_POINTER (1));
- else
- g_hash_table_replace (counts, model, GINT_TO_POINTER (GPOINTER_TO_INT (count) + 1));
- }
-
- cpu = g_string_new (NULL);
- g_hash_table_iter_init (&iter, counts);
- while (g_hash_table_iter_next (&iter, &key, &value))
- {
- char *cleanedup;
- int count;
-
- count = GPOINTER_TO_INT (value);
- cleanedup = info_cleanup ((const char *) key);
- if (count > 1)
- g_string_append_printf (cpu, "%s \303\227 %d ", cleanedup, count);
- else
- g_string_append_printf (cpu, "%s ", cleanedup);
- g_free (cleanedup);
- }
-
- g_hash_table_destroy (counts);
-
- ret = g_string_free (cpu, FALSE);
-
- return ret;
+ g_type_ensure (CC_TYPE_INFO_OVERVIEW_PANEL);
}
static void
@@ -722,126 +181,6 @@ on_section_changed (GtkTreeSelection *selection,
}
static void
-move_one_up (GtkWidget *table,
- GtkWidget *child)
-{
- int top_attach, bottom_attach;
-
- gtk_container_child_get (GTK_CONTAINER (table),
- child,
- "top-attach", &top_attach,
- "bottom-attach", &bottom_attach,
- NULL);
- gtk_container_child_set (GTK_CONTAINER (table),
- child,
- "top-attach", top_attach - 1,
- "bottom-attach", bottom_attach - 1,
- NULL);
-}
-
-static struct {
- const char *id;
- const char *display;
-} const virt_tech[] = {
- { "kvm", "KVM" },
- { "qemu", "QEmu" },
- { "vmware", "VMware" },
- { "microsoft", "Microsoft" },
- { "oracle", "Oracle" },
- { "xen", "Xen" },
- { "bochs", "Bochs" },
- { "chroot", "chroot" },
- { "openvz", "OpenVZ" },
- { "lxc", "LXC" },
- { "lxc-libvirt", "LXC (libvirt)" },
- { "systemd-nspawn", "systemd (nspawn)" }
-};
-
-static void
-set_virtualization_label (CcInfoPanel *self,
- const char *virt)
-{
- const char *display_name;
- GtkWidget *widget;
- guint i;
-
- if (virt == NULL || *virt == '\0')
- {
- gtk_widget_hide (WID ("virt_type_label"));
- gtk_widget_hide (WID ("label18"));
- move_one_up (WID("table1"), WID("label8"));
- move_one_up (WID("table1"), WID("disk_label"));
- return;
- }
-
- display_name = NULL;
- for (i = 0; i < G_N_ELEMENTS (virt_tech); i++)
- {
- if (g_str_equal (virt_tech[i].id, virt))
- {
- display_name = _(virt_tech[i].display);
- break;
- }
- }
-
- widget = WID ("virt_type_label");
- gtk_label_set_text (GTK_LABEL (widget), display_name ? display_name : virt);
-}
-
-static void
-info_panel_setup_virt (CcInfoPanel *self)
-{
- GError *error = NULL;
- GDBusProxy *systemd_proxy;
- GVariant *variant;
- GVariant *inner;
- char *str;
-
- str = NULL;
-
- systemd_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
- G_DBUS_PROXY_FLAGS_NONE,
- NULL,
- "org.freedesktop.systemd1",
- "/org/freedesktop/systemd1",
- "org.freedesktop.systemd1",
- NULL,
- &error);
-
- if (systemd_proxy == NULL)
- {
- g_debug ("systemd not available, bailing: %s", error->message);
- g_error_free (error);
- goto bail;
- }
-
- variant = g_dbus_proxy_call_sync (systemd_proxy,
- "org.freedesktop.DBus.Properties.Get",
- g_variant_new ("(ss)", "org.freedesktop.systemd1.Manager",
"Virtualization"),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- NULL,
- &error);
- if (variant == NULL)
- {
- g_debug ("Failed to get property '%s': %s", "Virtualization", error->message);
- g_error_free (error);
- g_object_unref (systemd_proxy);
- goto bail;
- }
-
- g_variant_get (variant, "(v)", &inner);
- str = g_variant_dup_string (inner, NULL);
- g_variant_unref (variant);
-
- g_object_unref (systemd_proxy);
-
-bail:
- set_virtualization_label (self, str);
- g_free (str);
-}
-
-static void
default_app_changed (GtkAppChooserButton *button,
CcInfoPanel *self)
{
@@ -1486,93 +825,15 @@ static void
info_panel_setup_overview (CcInfoPanel *self)
{
GtkWidget *widget;
- gboolean res;
- glibtop_mem mem;
- const glibtop_sysinfo *info;
- char *text;
-
- res = load_gnome_version (&self->priv->gnome_version,
- &self->priv->gnome_distributor,
- &self->priv->gnome_date);
- if (res)
- {
- widget = WID ("version_label");
- text = g_strdup_printf (_("Version %s"), self->priv->gnome_version);
- gtk_label_set_text (GTK_LABEL (widget), text);
- g_free (text);
- }
-
- glibtop_get_mem (&mem);
- text = g_format_size_full (mem.total, G_FORMAT_SIZE_IEC_UNITS);
- widget = WID ("memory_label");
- gtk_label_set_text (GTK_LABEL (widget), text ? text : "");
- g_free (text);
-
- info = glibtop_get_sysinfo ();
-
- widget = WID ("processor_label");
- text = get_cpu_info (info);
- gtk_label_set_markup (GTK_LABEL (widget), text ? text : "");
- g_free (text);
-
- widget = WID ("os_type_label");
- text = get_os_type ();
- gtk_label_set_text (GTK_LABEL (widget), text ? text : "");
- g_free (text);
-
- get_primary_disc_info (self);
-
- widget = WID ("graphics_label");
- gtk_label_set_markup (GTK_LABEL (widget), self->priv->graphics_data->hardware_string);
widget = WID ("info_vbox");
gtk_container_add (GTK_CONTAINER (self), widget);
}
-static gboolean
-does_gnome_software_exist (void)
-{
- return g_file_test (BINDIR "/gnome-software", G_FILE_TEST_EXISTS);
-}
-
-static gboolean
-does_gpk_update_viewer_exist (void)
-{
- return g_file_test (BINDIR "/gpk-update-viewer", G_FILE_TEST_EXISTS);
-}
-
-static void
-on_updates_button_clicked (GtkWidget *widget,
- CcInfoPanel *self)
-{
- GError *error = NULL;
- gboolean ret;
- gchar **argv;
-
- argv = g_new0 (gchar *, 3);
- if (does_gnome_software_exist ())
- {
- argv[0] = g_build_filename (BINDIR, "gnome-software", NULL);
- argv[1] = g_strdup_printf ("--mode=updates");
- }
- else
- {
- argv[0] = g_build_filename (BINDIR, "gpk-update-viewer", NULL);
- }
- ret = g_spawn_async (NULL, argv, NULL, 0, NULL, NULL, NULL, &error);
- if (!ret)
- {
- g_warning ("Failed to spawn %s: %s", argv[0], error->message);
- g_error_free (error);
- }
- g_strfreev (argv);
-}
-
static void
cc_info_panel_init (CcInfoPanel *self)
{
GError *error = NULL;
- GtkWidget *widget;
self->priv = INFO_PANEL_PRIVATE (self);
g_resources_register (cc_info_get_resource ());
@@ -1592,21 +853,8 @@ cc_info_panel_init (CcInfoPanel *self)
self->priv->extra_options_dialog = WID ("extra_options_dialog");
- self->priv->graphics_data = get_graphics_data ();
-
- widget = WID ("updates_button");
- if (does_gnome_software_exist () || does_gpk_update_viewer_exist ())
- {
- g_signal_connect (widget, "clicked", G_CALLBACK (on_updates_button_clicked), self);
- }
- else
- {
- gtk_widget_destroy (widget);
- }
-
info_panel_setup_selector (self);
info_panel_setup_overview (self);
info_panel_setup_default_apps (self);
info_panel_setup_media (self);
- info_panel_setup_virt (self);
}
diff --git a/panels/info/info-overview.ui b/panels/info/info-overview.ui
new file mode 100644
index 0000000..4b67a69
--- /dev/null
+++ b/panels/info/info-overview.ui
@@ -0,0 +1,376 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <template class="CcInfoOverviewPanel" parent="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">18</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkImage" id="system_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="resource">/org/gnome/control-center/info/GnomeLogoVerticalMedium.svg</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="version_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">Version 3.0</property>
+ <property name="selectable">True</property>
+ <attributes>
+ <attribute name="scale" value="1.25"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkTable" id="table1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="n_rows">7</property>
+ <property name="n_columns">3</property>
+ <property name="column_spacing">12</property>
+ <property name="row_spacing">5</property>
+ <child>
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Device name</property>
+ <property name="mnemonic_widget">name_entry</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Memory</property>
+ <property name="mnemonic_widget">memory_label</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Processor</property>
+ <property name="mnemonic_widget">processor_label</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes" comments="To translators: this field contains the
distro name, version and type">Base system</property>
+ <property name="mnemonic_widget">os_type_label</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ <packing>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label8">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Disk</property>
+ <property name="mnemonic_widget">disk_label</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ <packing>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
+ </packing>
+ </child>
+ <child>
+ <object class="CcHostnameEntry" id="name_entry">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="memory_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label">Unknown</property>
+ <property name="selectable">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="processor_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label">Unknown</property>
+ <property name="selectable">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="os_type_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label">Unknown</property>
+ <property name="selectable">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="disk_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Calculating…</property>
+ <property name="selectable">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label9">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"> </property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label10">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"> </property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label11">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"> </property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label12">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"> </property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label13">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"> </property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label14">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Graphics</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ <packing>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label15">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"> </property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="graphics_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label">Unknown</property>
+ <property name="selectable">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label18">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Virtualization</property>
+ <property name="mnemonic_widget">virt_type_label</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ <packing>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="virt_type_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label">Unknown</property>
+ <property name="selectable">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButtonBox" id="hbuttonbox1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <property name="orientation">horizontal</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkButton" id="updates_button">
+ <property name="label" translatable="yes">Check for updates</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </template>
+</interface>
diff --git a/panels/info/info.gresource.xml b/panels/info/info.gresource.xml
index fde3333..d371dbc 100644
--- a/panels/info/info.gresource.xml
+++ b/panels/info/info.gresource.xml
@@ -2,6 +2,7 @@
<gresources>
<gresource prefix="/org/gnome/control-center/info">
<file preprocess="xml-stripblanks">info.ui</file>
+ <file preprocess="xml-stripblanks">info-overview.ui</file>
<file>GnomeLogoVerticalMedium.svg</file>
</gresource>
</gresources>
diff --git a/panels/info/info.ui b/panels/info/info.ui
index 1967fdf..d0843e8 100644
--- a/panels/info/info.ui
+++ b/panels/info/info.ui
@@ -191,384 +191,8 @@
<property name="show_tabs">False</property>
<property name="show_border">False</property>
<child>
- <object class="GtkAlignment" id="overview_container">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="top_padding">20</property>
- <child>
- <object class="GtkBox" id="vbox2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">18</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkImage" id="system_image">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property
name="resource">/org/gnome/control-center/info/GnomeLogoVerticalMedium.svg</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="version_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label">Version 3.0</property>
- <property name="selectable">True</property>
- <attributes>
- <attribute name="scale" value="1.25"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkTable" id="table1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="n_rows">7</property>
- <property name="n_columns">3</property>
- <property name="column_spacing">12</property>
- <property name="row_spacing">5</property>
- <child>
- <object class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">Device name</property>
- <property name="mnemonic_widget">name_entry</property>
- <style>
- <class name="dim-label"/>
- </style>
- </object>
- </child>
- <child>
- <object class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">Memory</property>
- <property name="mnemonic_widget">memory_label</property>
- <style>
- <class name="dim-label"/>
- </style>
- </object>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label6">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">Processor</property>
- <property name="mnemonic_widget">processor_label</property>
- <style>
- <class name="dim-label"/>
- </style>
- </object>
- <packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label7">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes" comments="To translators: this
field contains the distro name, version and type">Base system</property>
- <property name="mnemonic_widget">os_type_label</property>
- <style>
- <class name="dim-label"/>
- </style>
- </object>
- <packing>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label8">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">Disk</property>
- <property name="mnemonic_widget">disk_label</property>
- <style>
- <class name="dim-label"/>
- </style>
- </object>
- <packing>
- <property name="top_attach">6</property>
- <property name="bottom_attach">7</property>
- </packing>
- </child>
- <child>
- <object class="CcHostnameEntry" id="name_entry">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="memory_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label">Unknown</property>
- <property name="selectable">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="processor_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label">Unknown</property>
- <property name="selectable">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="os_type_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label">Unknown</property>
- <property name="selectable">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="disk_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Calculating…</property>
- <property name="selectable">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">6</property>
- <property name="bottom_attach">7</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label9">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label"> </property>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label10">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label"> </property>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label11">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label"> </property>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label12">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label"> </property>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label13">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label"> </property>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="x_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label14">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">Graphics</property>
- <style>
- <class name="dim-label"/>
- </style>
- </object>
- <packing>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label15">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label"> </property>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="graphics_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label">Unknown</property>
- <property name="selectable">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <object class="GtkLabel" id="label18">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">Virtualization</property>
- <property name="mnemonic_widget">virt_type_label</property>
- <style>
- <class name="dim-label"/>
- </style>
- </object>
- <packing>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="virt_type_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label">Unknown</property>
- <property name="selectable">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkButtonBox" id="hbuttonbox1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="layout_style">end</property>
- <property name="orientation">horizontal</property>
- <child>
- <placeholder/>
- </child>
- <child>
- <object class="GtkButton" id="updates_button">
- <property name="label" translatable="yes">Check for updates</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">end</property>
- <property name="position">3</property>
- </packing>
- </child>
- </object>
- </child>
+ <object class="CcInfoOverviewPanel" id="overview_container">
+ <property name="visible">true</property>
</object>
</child>
<child type="tab">
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]