Blame SOURCES/0001-info-Add-subscription-manager-integration.patch

cbd954
From 3283b063af3f97cfc414766a42de80fc5ee43ba4 Mon Sep 17 00:00:00 2001
a780b2
From: Kalev Lember <klember@redhat.com>
a780b2
Date: Fri, 28 Jun 2019 17:14:36 +0200
cbd954
Subject: [PATCH 1/4] info: Add subscription manager integration
a780b2
a780b2
---
a780b2
 panels/info/cc-info-overview-panel.c          | 157 ++++-
a780b2
 panels/info/cc-subscription-details-dialog.c  | 407 ++++++++++++
a780b2
 panels/info/cc-subscription-details-dialog.h  |  32 +
a780b2
 panels/info/cc-subscription-details-dialog.ui | 248 +++++++
a780b2
 panels/info/cc-subscription-register-dialog.c | 403 +++++++++++
a780b2
 panels/info/cc-subscription-register-dialog.h |  32 +
a780b2
 .../info/cc-subscription-register-dialog.ui   | 623 ++++++++++++++++++
a780b2
 panels/info/info-overview.ui                  | 138 +++-
a780b2
 panels/info/info.gresource.xml                |   2 +
a780b2
 panels/info/meson.build                       |   4 +
a780b2
 po/POTFILES.in                                |   4 +
a780b2
 11 files changed, 2038 insertions(+), 12 deletions(-)
a780b2
 create mode 100644 panels/info/cc-subscription-details-dialog.c
a780b2
 create mode 100644 panels/info/cc-subscription-details-dialog.h
a780b2
 create mode 100644 panels/info/cc-subscription-details-dialog.ui
a780b2
 create mode 100644 panels/info/cc-subscription-register-dialog.c
a780b2
 create mode 100644 panels/info/cc-subscription-register-dialog.h
a780b2
 create mode 100644 panels/info/cc-subscription-register-dialog.ui
a780b2
a780b2
diff --git a/panels/info/cc-info-overview-panel.c b/panels/info/cc-info-overview-panel.c
a780b2
index 2256b730c..1467060f9 100644
a780b2
--- a/panels/info/cc-info-overview-panel.c
a780b2
+++ b/panels/info/cc-info-overview-panel.c
cbd954
@@ -1,118 +1,126 @@
cbd954
 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
cbd954
  *
cbd954
  * Copyright (C) 2017 Mohammed Sadiq <sadiq@sadiqpk.org>
cbd954
  * Copyright (C) 2010 Red Hat, Inc
cbd954
  * Copyright (C) 2008 William Jon McCann <jmccann@redhat.com>
cbd954
  *
cbd954
  * This program is free software; you can redistribute it and/or modify
cbd954
  * it under the terms of the GNU General Public License as published by
cbd954
  * the Free Software Foundation; either version 2 of the License, or
cbd954
  * (at your option) any later version.
cbd954
  *
cbd954
  * This program is distributed in the hope that it will be useful,
cbd954
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
cbd954
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
cbd954
  * GNU General Public License for more details.
cbd954
  *
cbd954
  * You should have received a copy of the GNU General Public License
cbd954
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
cbd954
  *
cbd954
  */
cbd954
 
cbd954
 #include <config.h>
cbd954
 
a780b2
 #include "shell/cc-hostname-entry.h"
a780b2
 
a780b2
 #include "cc-info-resources.h"
a780b2
+#include "cc-subscription-details-dialog.h"
a780b2
+#include "cc-subscription-register-dialog.h"
a780b2
 #include "info-cleanup.h"
a780b2
 
a780b2
 #include <glib.h>
cbd954
 #include <glib/gi18n.h>
cbd954
 #include <gio/gio.h>
cbd954
 #include <gio/gunixmounts.h>
cbd954
 #include <gio/gdesktopappinfo.h>
cbd954
 
cbd954
 #include <glibtop/fsusage.h>
cbd954
 #include <glibtop/mountlist.h>
cbd954
 #include <glibtop/mem.h>
cbd954
 #include <glibtop/sysinfo.h>
cbd954
 
cbd954
 #include <gdk/gdk.h>
cbd954
 
cbd954
 #ifdef GDK_WINDOWING_WAYLAND
cbd954
 #include <gdk/gdkwayland.h>
cbd954
 #endif
cbd954
 #ifdef GDK_WINDOWING_X11
cbd954
 #include <gdk/gdkx.h>
cbd954
 #endif
cbd954
 
cbd954
 #include "gsd-disk-space-helper.h"
cbd954
 
cbd954
 #include "cc-info-overview-panel.h"
cbd954
 
cbd954
 
cbd954
 typedef struct {
cbd954
   /* Will be one or 2 GPU name strings, or "Unknown" */
cbd954
   char *hardware_string;
cbd954
 } GraphicsData;
cbd954
 
cbd954
 typedef struct
cbd954
 {
cbd954
   GtkWidget      *system_image;
cbd954
   GtkWidget      *version_label;
cbd954
   GtkWidget      *name_entry;
cbd954
   GtkWidget      *memory_label;
cbd954
   GtkWidget      *processor_label;
cbd954
   GtkWidget      *os_name_label;
cbd954
   GtkWidget      *os_type_label;
a780b2
   GtkWidget      *disk_label;
a780b2
   GtkWidget      *graphics_label;
a780b2
   GtkWidget      *virt_type_label;
a780b2
+  GtkWidget      *subscription_stack;
a780b2
+  GtkWidget      *details_button;
a780b2
+  GtkWidget      *register_button;
a780b2
+  GtkWidget      *updates_separator;
a780b2
   GtkWidget      *updates_button;
a780b2
 
a780b2
   /* Virtualisation labels */
cbd954
   GtkWidget      *label8;
cbd954
   GtkWidget      *grid1;
cbd954
   GtkWidget      *label18;
cbd954
 
cbd954
   char           *gnome_version;
cbd954
   char           *gnome_distributor;
cbd954
   char           *gnome_date;
cbd954
 
cbd954
   GCancellable   *cancellable;
cbd954
 
cbd954
   /* Free space */
cbd954
   GList          *primary_mounts;
a780b2
   guint64         total_bytes;
a780b2
 
a780b2
   GraphicsData   *graphics_data;
a780b2
+
a780b2
+  GDBusProxy     *subscription_proxy;
a780b2
 } CcInfoOverviewPanelPrivate;
a780b2
 
a780b2
 struct _CcInfoOverviewPanel
cbd954
 {
cbd954
  CcPanel parent_instance;
cbd954
 
cbd954
   /*< private >*/
cbd954
  CcInfoOverviewPanelPrivate *priv;
cbd954
 };
cbd954
 
cbd954
 static void get_primary_disc_info_start (CcInfoOverviewPanel *self);
cbd954
 
cbd954
 typedef struct
cbd954
 {
cbd954
   char *major;
cbd954
   char *minor;
cbd954
   char *micro;
cbd954
   char *distributor;
cbd954
   char *date;
cbd954
   char **current;
cbd954
 } VersionData;
cbd954
 
cbd954
 static void
cbd954
 version_data_free (VersionData *data)
cbd954
 {
cbd954
   g_free (data->major);
cbd954
   g_free (data->minor);
cbd954
   g_free (data->micro);
cbd954
   g_free (data->distributor);
cbd954
   g_free (data->date);
cbd954
@@ -559,61 +567,60 @@ get_primary_disc_info (CcInfoOverviewPanel *self)
cbd954
     points = g_unix_mounts_get (NULL);
cbd954
 
cbd954
   for (p = points; p != NULL; p = p->next)
cbd954
     {
cbd954
       GUnixMountEntry *mount = p->data;
cbd954
       const char *mount_path;
cbd954
       const char *device_path;
cbd954
 
cbd954
       mount_path = g_unix_mount_get_mount_path (mount);
cbd954
       device_path = g_unix_mount_get_device_path (mount);
cbd954
 
cbd954
       /* Do not count multiple mounts with same device_path, because it is
cbd954
        * probably something like btrfs subvolume. Use only the first one in
cbd954
        * order to count the real size. */
cbd954
       if (gsd_should_ignore_unix_mount (mount) ||
cbd954
           gsd_is_removable_mount (mount) ||
cbd954
           g_str_has_prefix (mount_path, "/media/") ||
cbd954
           g_str_has_prefix (mount_path, g_get_home_dir ()) ||
cbd954
           g_hash_table_lookup (hash, device_path) != NULL)
cbd954
         {
cbd954
           g_unix_mount_free (mount);
cbd954
           continue;
cbd954
         }
cbd954
 
cbd954
       priv->primary_mounts = g_list_prepend (priv->primary_mounts, mount);
cbd954
       g_hash_table_insert (hash, (gpointer) device_path, (gpointer) device_path);
cbd954
     }
a780b2
   g_list_free (points);
a780b2
   g_hash_table_destroy (hash);
a780b2
 
a780b2
-  priv->cancellable = g_cancellable_new ();
a780b2
   get_primary_disc_info_start (self);
a780b2
 }
a780b2
 
cbd954
 static char *
cbd954
 get_cpu_info (const glibtop_sysinfo *info)
cbd954
 {
cbd954
   g_autoptr(GHashTable) counts = NULL;
cbd954
   g_autoptr(GString) cpu = NULL;
cbd954
   GHashTableIter iter;
cbd954
   gpointer       key, value;
cbd954
   int            i;
cbd954
   int            j;
cbd954
 
cbd954
   counts = g_hash_table_new (g_str_hash, g_str_equal);
cbd954
 
cbd954
   /* count duplicates */
cbd954
   for (i = 0; i != info->ncpu; ++i)
cbd954
     {
cbd954
       const char * const keys[] = { "model name", "cpu", "Processor" };
cbd954
       char *model;
cbd954
       int  *count;
cbd954
 
cbd954
       model = NULL;
cbd954
 
cbd954
       for (j = 0; model == NULL && j != G_N_ELEMENTS (keys); ++j)
cbd954
         {
cbd954
           model = g_hash_table_lookup (info->cpuinfo[i].values,
cbd954
                                        keys[j]);
cbd954
         }
cbd954
 
cbd954
@@ -766,60 +773,191 @@ info_overview_panel_setup_overview (CcInfoOverviewPanel *self)
cbd954
   res = load_gnome_version (&priv->gnome_version,
cbd954
                             &priv->gnome_distributor,
cbd954
                             &priv->gnome_date);
cbd954
   if (res)
cbd954
     {
cbd954
       g_autofree gchar *text = NULL;
cbd954
       text = g_strdup_printf (_("Version %s"), priv->gnome_version);
cbd954
       gtk_label_set_text (GTK_LABEL (priv->version_label), text);
cbd954
     }
cbd954
 
cbd954
   glibtop_get_mem (&mem;;
cbd954
   memory_text = g_format_size_full (mem.total, G_FORMAT_SIZE_IEC_UNITS);
cbd954
   gtk_label_set_text (GTK_LABEL (priv->memory_label), memory_text ? memory_text : "");
cbd954
 
cbd954
   info = glibtop_get_sysinfo ();
cbd954
 
cbd954
   cpu_text = get_cpu_info (info);
cbd954
   gtk_label_set_markup (GTK_LABEL (priv->processor_label), cpu_text ? cpu_text : "");
cbd954
 
cbd954
   os_type_text = get_os_type ();
cbd954
   gtk_label_set_text (GTK_LABEL (priv->os_type_label), os_type_text ? os_type_text : "");
cbd954
 
cbd954
   os_name_text = get_os_name ();
cbd954
   gtk_label_set_text (GTK_LABEL (priv->os_name_label), os_name_text ? os_name_text : "");
cbd954
 
cbd954
   get_primary_disc_info (self);
cbd954
 
a780b2
   gtk_label_set_markup (GTK_LABEL (priv->graphics_label), priv->graphics_data->hardware_string);
a780b2
 }
a780b2
 
a780b2
+typedef enum {
a780b2
+  GSD_SUBMAN_SUBSCRIPTION_STATUS_UNKNOWN,
a780b2
+  GSD_SUBMAN_SUBSCRIPTION_STATUS_VALID,
a780b2
+  GSD_SUBMAN_SUBSCRIPTION_STATUS_INVALID,
a780b2
+  GSD_SUBMAN_SUBSCRIPTION_STATUS_DISABLED,
a780b2
+  GSD_SUBMAN_SUBSCRIPTION_STATUS_PARTIALLY_VALID,
a780b2
+  GSD_SUBMAN_SUBSCRIPTION_STATUS_LAST
a780b2
+} GsdSubmanSubscriptionStatus;
a780b2
+
a780b2
+static gboolean
a780b2
+get_subscription_status (CcInfoOverviewPanel *self, GsdSubmanSubscriptionStatus *status)
a780b2
+{
a780b2
+  CcInfoOverviewPanelPrivate *priv = cc_info_overview_panel_get_instance_private (self);
a780b2
+  g_autoptr(GVariant) status_variant = NULL;
a780b2
+  guint32 u;
a780b2
+
a780b2
+  status_variant = g_dbus_proxy_get_cached_property (priv->subscription_proxy, "SubscriptionStatus");
a780b2
+  if (!status_variant)
a780b2
+    {
a780b2
+      g_debug ("Unable to get SubscriptionStatus property");
a780b2
+      return FALSE;
a780b2
+    }
a780b2
+
a780b2
+  g_variant_get (status_variant, "u", &u);
a780b2
+  *status = u;
a780b2
+
a780b2
+  return TRUE;
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+reload_subscription_status (CcInfoOverviewPanel *self)
a780b2
+{
a780b2
+  CcInfoOverviewPanelPrivate *priv = cc_info_overview_panel_get_instance_private (self);
a780b2
+  GsdSubmanSubscriptionStatus status;
a780b2
+
a780b2
+  if (priv->subscription_proxy == NULL)
a780b2
+    {
a780b2
+      gtk_widget_hide (priv->subscription_stack);
a780b2
+      return;
a780b2
+    }
a780b2
+
a780b2
+  if (!get_subscription_status (self, &status))
a780b2
+    {
a780b2
+      gtk_widget_hide (priv->subscription_stack);
a780b2
+      return;
a780b2
+    }
a780b2
+
a780b2
+  switch (status)
a780b2
+    {
a780b2
+    case GSD_SUBMAN_SUBSCRIPTION_STATUS_UNKNOWN:
a780b2
+    case GSD_SUBMAN_SUBSCRIPTION_STATUS_INVALID:
a780b2
+    case GSD_SUBMAN_SUBSCRIPTION_STATUS_DISABLED:
a780b2
+    case GSD_SUBMAN_SUBSCRIPTION_STATUS_PARTIALLY_VALID:
a780b2
+      gtk_stack_set_visible_child_name (GTK_STACK (priv->subscription_stack), "not-registered");
a780b2
+      gtk_widget_set_sensitive (priv->updates_button, FALSE);
a780b2
+      break;
a780b2
+
a780b2
+    case GSD_SUBMAN_SUBSCRIPTION_STATUS_VALID:
a780b2
+      gtk_stack_set_visible_child_name (GTK_STACK (priv->subscription_stack), "registered");
a780b2
+      gtk_widget_set_sensitive (priv->updates_button, TRUE);
a780b2
+      break;
a780b2
+
a780b2
+    default:
a780b2
+      g_assert_not_reached ();
a780b2
+      break;
a780b2
+    }
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+on_details_button_clicked (GtkWidget           *widget,
a780b2
+                           CcInfoOverviewPanel *self)
a780b2
+{
a780b2
+  CcInfoOverviewPanelPrivate *priv = cc_info_overview_panel_get_instance_private (self);
a780b2
+  CcSubscriptionDetailsDialog *dialog;
a780b2
+  GtkWindow *toplevel;
a780b2
+
a780b2
+  dialog = cc_subscription_details_dialog_new (priv->subscription_proxy);
a780b2
+  toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (self)));
a780b2
+  gtk_window_set_transient_for (GTK_WINDOW (dialog), toplevel);
a780b2
+
a780b2
+  gtk_dialog_run (GTK_DIALOG (dialog));
a780b2
+  gtk_widget_destroy (GTK_WIDGET (dialog));
a780b2
+
a780b2
+  reload_subscription_status (self);
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+on_register_button_clicked (GtkWidget           *widget,
a780b2
+                            CcInfoOverviewPanel *self)
a780b2
+{
a780b2
+  CcInfoOverviewPanelPrivate *priv = cc_info_overview_panel_get_instance_private (self);
a780b2
+  CcSubscriptionRegisterDialog *dialog;
a780b2
+  GtkWindow *toplevel;
a780b2
+
a780b2
+  dialog = cc_subscription_register_dialog_new (priv->subscription_proxy);
a780b2
+  toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (self)));
a780b2
+  gtk_window_set_transient_for (GTK_WINDOW (dialog), toplevel);
a780b2
+
a780b2
+  gtk_dialog_run (GTK_DIALOG (dialog));
a780b2
+  gtk_widget_destroy (GTK_WIDGET (dialog));
a780b2
+
a780b2
+  reload_subscription_status (self);
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+info_overview_panel_setup_subscriptions (CcInfoOverviewPanel *self)
a780b2
+{
a780b2
+  CcInfoOverviewPanelPrivate *priv = cc_info_overview_panel_get_instance_private (self);
a780b2
+  g_autoptr(GError) error = NULL;
a780b2
+
a780b2
+  priv->subscription_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
a780b2
+                                                            G_DBUS_PROXY_FLAGS_NONE,
a780b2
+                                                            NULL,
a780b2
+                                                            "org.gnome.SettingsDaemon.Subscription",
a780b2
+                                                            "/org/gnome/SettingsDaemon/Subscription",
a780b2
+                                                            "org.gnome.SettingsDaemon.Subscription",
a780b2
+                                                            NULL, &error);
a780b2
+  if (error != NULL)
a780b2
+    {
a780b2
+      g_debug ("Unable to create a proxy for org.gnome.SettingsDaemon.Subscription: %s",
a780b2
+               error->message);
a780b2
+      reload_subscription_status (self);
a780b2
+      return;
a780b2
+    }
a780b2
+
a780b2
+  g_signal_connect (priv->details_button, "clicked", G_CALLBACK (on_details_button_clicked), self);
a780b2
+  g_signal_connect (priv->register_button, "clicked", G_CALLBACK (on_register_button_clicked), self);
a780b2
+
a780b2
+  reload_subscription_status (self);
a780b2
+}
a780b2
+
a780b2
 static gboolean
a780b2
 does_gnome_software_exist (void)
a780b2
 {
cbd954
   return g_file_test (BINDIR "/gnome-software", G_FILE_TEST_EXISTS);
cbd954
 }
cbd954
 
cbd954
 static gboolean
cbd954
 does_gpk_update_viewer_exist (void)
cbd954
 {
cbd954
   return g_file_test (BINDIR "/gpk-update-viewer", G_FILE_TEST_EXISTS);
cbd954
 }
cbd954
 
cbd954
 static void
cbd954
 on_updates_button_clicked (GtkWidget           *widget,
cbd954
                            CcInfoOverviewPanel *self)
cbd954
 {
cbd954
   g_autoptr(GError) error = NULL;
cbd954
   gboolean ret;
cbd954
   g_auto(GStrv) argv = NULL;
cbd954
 
cbd954
   argv = g_new0 (gchar *, 3);
cbd954
   if (does_gnome_software_exist ())
cbd954
     {
cbd954
       argv[0] = g_build_filename (BINDIR, "gnome-software", NULL);
cbd954
       argv[1] = g_strdup_printf ("--mode=updates");
cbd954
     }
cbd954
   else
cbd954
     {
cbd954
       argv[0] = g_build_filename (BINDIR, "gpk-update-viewer", NULL);
cbd954
     }
cbd954
@@ -829,88 +967,103 @@ on_updates_button_clicked (GtkWidget           *widget,
cbd954
 }
cbd954
 
cbd954
 static void
cbd954
 cc_info_overview_panel_dispose (GObject *object)
cbd954
 {
cbd954
   CcInfoOverviewPanelPrivate *priv = cc_info_overview_panel_get_instance_private (CC_INFO_OVERVIEW_PANEL (object));
cbd954
 
cbd954
   g_clear_pointer (&priv->graphics_data, graphics_data_free);
cbd954
 
cbd954
   G_OBJECT_CLASS (cc_info_overview_panel_parent_class)->dispose (object);
cbd954
 }
cbd954
 
cbd954
 static void
cbd954
 cc_info_overview_panel_finalize (GObject *object)
cbd954
 {
cbd954
   CcInfoOverviewPanelPrivate *priv = cc_info_overview_panel_get_instance_private (CC_INFO_OVERVIEW_PANEL (object));
cbd954
 
cbd954
   if (priv->cancellable)
cbd954
     {
cbd954
       g_cancellable_cancel (priv->cancellable);
cbd954
       g_clear_object (&priv->cancellable);
cbd954
     }
cbd954
 
cbd954
   if (priv->primary_mounts)
cbd954
     g_list_free_full (priv->primary_mounts, (GDestroyNotify) g_unix_mount_free);
cbd954
 
cbd954
   g_free (priv->gnome_version);
a780b2
   g_free (priv->gnome_date);
a780b2
   g_free (priv->gnome_distributor);
a780b2
 
a780b2
+  g_clear_object (&priv->subscription_proxy);
a780b2
+
a780b2
   G_OBJECT_CLASS (cc_info_overview_panel_parent_class)->finalize (object);
a780b2
 }
a780b2
 
cbd954
 static void
cbd954
 cc_info_overview_panel_class_init (CcInfoOverviewPanelClass *klass)
cbd954
 {
cbd954
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
cbd954
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
cbd954
 
cbd954
   object_class->finalize = cc_info_overview_panel_finalize;
cbd954
   object_class->dispose = cc_info_overview_panel_dispose;
cbd954
 
cbd954
   gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/info/info-overview.ui");
cbd954
 
cbd954
   gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, system_image);
cbd954
   gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, version_label);
cbd954
   gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, name_entry);
cbd954
   gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, memory_label);
cbd954
   gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, processor_label);
cbd954
   gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, os_name_label);
cbd954
   gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, os_type_label);
a780b2
   gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, disk_label);
a780b2
   gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, graphics_label);
a780b2
   gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, virt_type_label);
a780b2
+  gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, subscription_stack);
a780b2
+  gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, details_button);
a780b2
+  gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, register_button);
a780b2
+  gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, updates_separator);
a780b2
   gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, updates_button);
a780b2
   gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, label8);
a780b2
   gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, grid1);
cbd954
   gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, label18);
cbd954
 
cbd954
   g_type_ensure (CC_TYPE_HOSTNAME_ENTRY);
cbd954
 }
cbd954
 
cbd954
 static void
cbd954
 cc_info_overview_panel_init (CcInfoOverviewPanel *self)
cbd954
 {
cbd954
   CcInfoOverviewPanelPrivate *priv = cc_info_overview_panel_get_instance_private (self);
cbd954
 
cbd954
   gtk_widget_init_template (GTK_WIDGET (self));
a780b2
 
a780b2
   g_resources_register (cc_info_get_resource ());
a780b2
 
a780b2
+  priv->cancellable = g_cancellable_new ();
a780b2
+
a780b2
   priv->graphics_data = get_graphics_data ();
a780b2
 
a780b2
   if (does_gnome_software_exist () || does_gpk_update_viewer_exist ())
a780b2
     g_signal_connect (priv->updates_button, "clicked", G_CALLBACK (on_updates_button_clicked), self);
a780b2
   else
a780b2
-    gtk_widget_destroy (priv->updates_button);
a780b2
+    gtk_widget_hide (priv->updates_button);
a780b2
 
a780b2
   info_overview_panel_setup_overview (self);
a780b2
   info_overview_panel_setup_virt (self);
a780b2
+  info_overview_panel_setup_subscriptions (self);
a780b2
+
a780b2
+  /* show separator when both items are visible */
a780b2
+  if (gtk_widget_get_visible (priv->subscription_stack) && gtk_widget_get_visible (priv->updates_button))
a780b2
+    gtk_widget_show (priv->updates_separator);
a780b2
+  else
a780b2
+    gtk_widget_hide (priv->updates_separator);
a780b2
 }
a780b2
 
a780b2
 GtkWidget *
cbd954
 cc_info_overview_panel_new (void)
cbd954
 {
cbd954
   return g_object_new (CC_TYPE_INFO_OVERVIEW_PANEL,
cbd954
                        NULL);
cbd954
 }
a780b2
diff --git a/panels/info/cc-subscription-details-dialog.c b/panels/info/cc-subscription-details-dialog.c
a780b2
new file mode 100644
a780b2
index 000000000..1931ced81
a780b2
--- /dev/null
a780b2
+++ b/panels/info/cc-subscription-details-dialog.c
a780b2
@@ -0,0 +1,407 @@
a780b2
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
a780b2
+ *
a780b2
+ * Copyright 2019  Red Hat, Inc,
a780b2
+ *
a780b2
+ * This program is free software; you can redistribute it and/or modify
a780b2
+ * it under the terms of the GNU General Public License as published by
a780b2
+ * the Free Software Foundation; either version 2 of the License, or
a780b2
+ * (at your option) any later version.
a780b2
+ *
a780b2
+ * This program is distributed in the hope that it will be useful,
a780b2
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
a780b2
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a780b2
+ * GNU General Public License for more details.
a780b2
+ *
a780b2
+ * You should have received a copy of the GNU General Public License
a780b2
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
a780b2
+ *
a780b2
+ * Written by: Kalev Lember <klember@redhat.com>
a780b2
+ */
a780b2
+
a780b2
+#include "config.h"
a780b2
+
a780b2
+#include <glib.h>
a780b2
+#include <glib/gi18n.h>
a780b2
+#include <gtk/gtk.h>
a780b2
+
a780b2
+#include "cc-subscription-details-dialog.h"
a780b2
+
a780b2
+#define DBUS_TIMEOUT 300000 /* 5 minutes */
a780b2
+
a780b2
+typedef enum {
a780b2
+  DIALOG_STATE_SHOW_DETAILS,
a780b2
+  DIALOG_STATE_UNREGISTER,
a780b2
+  DIALOG_STATE_UNREGISTERING
a780b2
+} DialogState;
a780b2
+
a780b2
+struct _CcSubscriptionDetailsDialog
a780b2
+{
a780b2
+  GtkDialog     parent_instance;
a780b2
+
a780b2
+  DialogState   state;
a780b2
+  GCancellable *cancellable;
a780b2
+  GDBusProxy   *subscription_proxy;
a780b2
+  GPtrArray    *products;
a780b2
+
a780b2
+  /* template widgets */
a780b2
+  GtkButton    *back_button;
a780b2
+  GtkSpinner   *spinner;
a780b2
+  GtkButton    *header_unregister_button;
a780b2
+  GtkRevealer  *notification_revealer;
a780b2
+  GtkLabel     *error_label;
a780b2
+  GtkStack     *stack;
a780b2
+  GtkBox       *products_box1;
a780b2
+  GtkBox       *products_box2;
a780b2
+  GtkButton    *unregister_button;
a780b2
+};
a780b2
+
a780b2
+G_DEFINE_TYPE (CcSubscriptionDetailsDialog, cc_subscription_details_dialog, GTK_TYPE_DIALOG);
a780b2
+
a780b2
+typedef struct
a780b2
+{
a780b2
+  gchar *product_name;
a780b2
+  gchar *product_id;
a780b2
+  gchar *version;
a780b2
+  gchar *arch;
a780b2
+  gchar *status;
a780b2
+  gchar *starts;
a780b2
+  gchar *ends;
a780b2
+} ProductData;
a780b2
+
a780b2
+static void
a780b2
+product_data_free (ProductData *product)
a780b2
+{
a780b2
+  g_free (product->product_name);
a780b2
+  g_free (product->product_id);
a780b2
+  g_free (product->version);
a780b2
+  g_free (product->arch);
a780b2
+  g_free (product->status);
a780b2
+  g_free (product->starts);
a780b2
+  g_free (product->ends);
a780b2
+  g_free (product);
a780b2
+}
a780b2
+
a780b2
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProductData, product_data_free);
a780b2
+
a780b2
+static void
a780b2
+add_product_row (GtkGrid *product_grid, const gchar *name, const gchar *value, gint top_attach)
a780b2
+{
a780b2
+  GtkWidget *w;
a780b2
+
a780b2
+  w = gtk_label_new (name);
a780b2
+  gtk_style_context_add_class (gtk_widget_get_style_context (w), "dim-label");
a780b2
+  gtk_grid_attach (product_grid, w, 0, top_attach, 1, 1);
a780b2
+  gtk_widget_set_halign (w, GTK_ALIGN_END);
a780b2
+  gtk_widget_show (w);
a780b2
+
a780b2
+  if (value == NULL)
a780b2
+    value = _("Unknown");
a780b2
+
a780b2
+  w = gtk_label_new (value);
a780b2
+  gtk_grid_attach (product_grid, w, 1, top_attach, 1, 1);
a780b2
+  gtk_widget_set_halign (w, GTK_ALIGN_START);
a780b2
+  gtk_widget_set_hexpand (w, TRUE);
a780b2
+  gtk_widget_show (w);
a780b2
+}
a780b2
+
a780b2
+static GtkWidget *
a780b2
+add_product (CcSubscriptionDetailsDialog *self, ProductData *product)
a780b2
+{
a780b2
+  GtkGrid *product_grid;
a780b2
+  const gchar *status_text;
a780b2
+
a780b2
+  if (g_strcmp0 (product->status, "subscribed") == 0)
a780b2
+    status_text = _("Subscribed");
a780b2
+  else
a780b2
+    status_text = _("Not Subscribed (Not supported by a valid subscription.)");
a780b2
+
a780b2
+  product_grid = GTK_GRID (gtk_grid_new ());
a780b2
+  gtk_grid_set_column_spacing (product_grid, 12);
a780b2
+  gtk_grid_set_row_spacing (product_grid, 6);
a780b2
+  gtk_widget_set_margin_top (GTK_WIDGET (product_grid), 18);
a780b2
+  gtk_widget_set_margin_bottom (GTK_WIDGET (product_grid), 12);
a780b2
+  gtk_widget_show (GTK_WIDGET (product_grid));
a780b2
+
a780b2
+  add_product_row (product_grid, _("Product Name"), product->product_name, 0);
a780b2
+  add_product_row (product_grid, _("Product ID"), product->product_id, 1);
a780b2
+  add_product_row (product_grid, _("Version"), product->version, 2);
a780b2
+  add_product_row (product_grid, _("Arch"), product->arch, 3);
a780b2
+  add_product_row (product_grid, _("Status"), status_text, 4);
a780b2
+  add_product_row (product_grid, _("Starts"), product->starts, 5);
a780b2
+  add_product_row (product_grid, _("Ends"), product->ends, 6);
a780b2
+
a780b2
+  return GTK_WIDGET (product_grid);
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+remove_all_children (GtkContainer *container)
a780b2
+{
a780b2
+  g_autoptr(GList) list = gtk_container_get_children (container);
a780b2
+
a780b2
+  for (GList *l = list; l != NULL; l = l->next)
a780b2
+    gtk_container_remove (container, (GtkWidget *) l->data);
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+dialog_reload (CcSubscriptionDetailsDialog *self)
a780b2
+{
a780b2
+  GtkHeaderBar *header = GTK_HEADER_BAR (gtk_dialog_get_header_bar (GTK_DIALOG (self)));
a780b2
+
a780b2
+  switch (self->state)
a780b2
+    {
a780b2
+    case DIALOG_STATE_SHOW_DETAILS:
a780b2
+      gtk_header_bar_set_show_close_button (header, TRUE);
a780b2
+
a780b2
+      gtk_window_set_title (GTK_WINDOW (self), _("Registration Details"));
a780b2
+      gtk_widget_set_sensitive (GTK_WIDGET (self->header_unregister_button), TRUE);
a780b2
+
a780b2
+      gtk_widget_hide (GTK_WIDGET (self->back_button));
a780b2
+      gtk_widget_hide (GTK_WIDGET (self->header_unregister_button));
a780b2
+
a780b2
+      gtk_stack_set_visible_child_name (self->stack, "show-details");
a780b2
+      break;
a780b2
+
a780b2
+    case DIALOG_STATE_UNREGISTER:
a780b2
+      gtk_header_bar_set_show_close_button (header, FALSE);
a780b2
+
a780b2
+      gtk_window_set_title (GTK_WINDOW (self), _("Unregister System"));
a780b2
+      gtk_widget_set_sensitive (GTK_WIDGET (self->header_unregister_button), TRUE);
a780b2
+
a780b2
+      gtk_widget_show (GTK_WIDGET (self->back_button));
a780b2
+      gtk_widget_show (GTK_WIDGET (self->header_unregister_button));
a780b2
+
a780b2
+      gtk_stack_set_visible_child_name (self->stack, "unregister");
a780b2
+      break;
a780b2
+
a780b2
+    case DIALOG_STATE_UNREGISTERING:
a780b2
+      gtk_header_bar_set_show_close_button (header, FALSE);
a780b2
+
a780b2
+      gtk_window_set_title (GTK_WINDOW (self), _("Unregistering System…"));
a780b2
+      gtk_widget_set_sensitive (GTK_WIDGET (self->header_unregister_button), FALSE);
a780b2
+
a780b2
+      gtk_widget_show (GTK_WIDGET (self->back_button));
a780b2
+      gtk_widget_show (GTK_WIDGET (self->header_unregister_button));
a780b2
+
a780b2
+      gtk_stack_set_visible_child_name (self->stack, "unregister");
a780b2
+      break;
a780b2
+
a780b2
+    default:
a780b2
+      g_assert_not_reached ();
a780b2
+      break;
a780b2
+    }
a780b2
+
a780b2
+  remove_all_children (GTK_CONTAINER (self->products_box1));
a780b2
+  remove_all_children (GTK_CONTAINER (self->products_box2));
a780b2
+
a780b2
+  if (self->products == NULL || self->products->len == 0)
a780b2
+    {
a780b2
+      /* the widgets are duplicate to allow sliding between two stack pages */
a780b2
+      GtkWidget *w1 = gtk_label_new (_("No installed products detected."));
a780b2
+      GtkWidget *w2 = gtk_label_new (_("No installed products detected."));
a780b2
+      gtk_widget_show (w1);
a780b2
+      gtk_widget_show (w2);
a780b2
+      gtk_container_add (GTK_CONTAINER (self->products_box1), w1);
a780b2
+      gtk_container_add (GTK_CONTAINER (self->products_box2), w2);
a780b2
+      return;
a780b2
+    }
a780b2
+
a780b2
+  for (guint i = 0; i < self->products->len; i++)
a780b2
+    {
a780b2
+      ProductData *product = g_ptr_array_index (self->products, i);
a780b2
+      /* the widgets are duplicate to allow sliding between two stack pages */
a780b2
+      GtkWidget *w1 = add_product (self, product);
a780b2
+      GtkWidget *w2 = add_product (self, product);
a780b2
+      gtk_container_add (GTK_CONTAINER (self->products_box1), w1);
a780b2
+      gtk_container_add (GTK_CONTAINER (self->products_box2), w2);
a780b2
+    }
a780b2
+}
a780b2
+
a780b2
+static ProductData *
a780b2
+parse_product_variant (GVariant *product_variant)
a780b2
+{
a780b2
+  g_autoptr(ProductData) product = g_new0 (ProductData, 1);
a780b2
+  g_auto(GVariantDict) dict;
a780b2
+
a780b2
+  g_variant_dict_init (&dict, product_variant);
a780b2
+
a780b2
+  g_variant_dict_lookup (&dict, "product-name", "s", &product->product_name);
a780b2
+  g_variant_dict_lookup (&dict, "product-id", "s", &product->product_id);
a780b2
+  g_variant_dict_lookup (&dict, "version", "s", &product->version);
a780b2
+  g_variant_dict_lookup (&dict, "arch", "s", &product->arch);
a780b2
+  g_variant_dict_lookup (&dict, "status", "s", &product->status);
a780b2
+  g_variant_dict_lookup (&dict, "starts", "s", &product->starts);
a780b2
+  g_variant_dict_lookup (&dict, "ends", "s", &product->ends);
a780b2
+
a780b2
+  return g_steal_pointer (&product);
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+load_installed_products (CcSubscriptionDetailsDialog *self)
a780b2
+{
a780b2
+  GVariantIter iter_array;
a780b2
+  GVariant *child;
a780b2
+  g_autoptr(GError) error = NULL;
a780b2
+  g_autoptr(GVariant) installed_products_variant = NULL;
a780b2
+
a780b2
+  installed_products_variant = g_dbus_proxy_get_cached_property (self->subscription_proxy, "InstalledProducts");
a780b2
+  if (installed_products_variant == NULL)
a780b2
+    {
a780b2
+      g_debug ("Unable to get InstalledProducts dbus property");
a780b2
+      return;
a780b2
+    }
a780b2
+
a780b2
+  g_ptr_array_set_size (self->products, 0);
a780b2
+
a780b2
+  g_variant_iter_init (&iter_array, installed_products_variant);
a780b2
+  while ((child = g_variant_iter_next_value (&iter_array)) != NULL)
a780b2
+    {
a780b2
+      g_autoptr(GVariant) product_variant = g_steal_pointer (&child);
a780b2
+      g_ptr_array_add (self->products, parse_product_variant (product_variant));
a780b2
+    }
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+unregistration_done_cb (GObject      *source_object,
a780b2
+                        GAsyncResult *res,
a780b2
+                        gpointer      user_data)
a780b2
+{
a780b2
+  CcSubscriptionDetailsDialog *self = (CcSubscriptionDetailsDialog *) user_data;
a780b2
+  g_autoptr(GVariant) results = NULL;
a780b2
+  g_autoptr(GError) error = NULL;
a780b2
+
a780b2
+  results = g_dbus_proxy_call_finish (G_DBUS_PROXY (source_object),
a780b2
+                                      res,
a780b2
+                                      &error);
a780b2
+  if (results == NULL)
a780b2
+    {
a780b2
+      if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
a780b2
+        return;
a780b2
+
a780b2
+      g_dbus_error_strip_remote_error (error);
a780b2
+      gtk_label_set_text (self->error_label, error->message);
a780b2
+      gtk_revealer_set_reveal_child (self->notification_revealer, TRUE);
a780b2
+
a780b2
+      gtk_spinner_stop (self->spinner);
a780b2
+
a780b2
+      self->state = DIALOG_STATE_UNREGISTER;
a780b2
+      dialog_reload (self);
a780b2
+      return;
a780b2
+    }
a780b2
+
a780b2
+  gtk_spinner_stop (self->spinner);
a780b2
+
a780b2
+  gtk_dialog_response (GTK_DIALOG (self), GTK_RESPONSE_ACCEPT);
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+header_unregister_button_clicked_cb (CcSubscriptionDetailsDialog *self)
a780b2
+{
a780b2
+  gtk_spinner_start (self->spinner);
a780b2
+
a780b2
+  self->state = DIALOG_STATE_UNREGISTERING;
a780b2
+  dialog_reload (self);
a780b2
+
a780b2
+  g_dbus_proxy_call (self->subscription_proxy,
a780b2
+                     "Unregister",
a780b2
+                     NULL,
a780b2
+                     G_DBUS_CALL_FLAGS_NONE,
a780b2
+                     DBUS_TIMEOUT,
a780b2
+                     self->cancellable,
a780b2
+                     unregistration_done_cb,
a780b2
+                     self);
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+back_button_clicked_cb (CcSubscriptionDetailsDialog *self)
a780b2
+{
a780b2
+  gtk_spinner_stop (self->spinner);
a780b2
+
a780b2
+  self->state = DIALOG_STATE_SHOW_DETAILS;
a780b2
+  dialog_reload (self);
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+unregister_button_clicked_cb (CcSubscriptionDetailsDialog *self)
a780b2
+{
a780b2
+  self->state = DIALOG_STATE_UNREGISTER;
a780b2
+  dialog_reload (self);
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+dismiss_notification (CcSubscriptionDetailsDialog *self)
a780b2
+{
a780b2
+  gtk_revealer_set_reveal_child (self->notification_revealer, FALSE);
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+cc_subscription_details_dialog_init (CcSubscriptionDetailsDialog *self)
a780b2
+{
a780b2
+  gtk_widget_init_template (GTK_WIDGET (self));
a780b2
+
a780b2
+  self->cancellable = g_cancellable_new ();
a780b2
+  self->products = g_ptr_array_new_with_free_func ((GDestroyNotify) product_data_free);
a780b2
+  self->state = DIALOG_STATE_SHOW_DETAILS;
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+cc_subscription_details_dialog_dispose (GObject *obj)
a780b2
+{
a780b2
+  CcSubscriptionDetailsDialog *self = (CcSubscriptionDetailsDialog *) obj;
a780b2
+
a780b2
+  g_cancellable_cancel (self->cancellable);
a780b2
+  g_clear_object (&self->cancellable);
a780b2
+  g_clear_object (&self->subscription_proxy);
a780b2
+
a780b2
+  G_OBJECT_CLASS (cc_subscription_details_dialog_parent_class)->dispose (obj);
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+cc_subscription_details_dialog_finalize (GObject *obj)
a780b2
+{
a780b2
+  CcSubscriptionDetailsDialog *self = (CcSubscriptionDetailsDialog *) obj;
a780b2
+
a780b2
+  g_clear_pointer (&self->products, g_ptr_array_unref);
a780b2
+
a780b2
+  G_OBJECT_CLASS (cc_subscription_details_dialog_parent_class)->finalize (obj);
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+cc_subscription_details_dialog_class_init (CcSubscriptionDetailsDialogClass *klass)
a780b2
+{
a780b2
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
a780b2
+  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
a780b2
+
a780b2
+  object_class->dispose = cc_subscription_details_dialog_dispose;
a780b2
+  object_class->finalize = cc_subscription_details_dialog_finalize;
a780b2
+
a780b2
+  gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/info/cc-subscription-details-dialog.ui");
a780b2
+
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionDetailsDialog, back_button);
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionDetailsDialog, spinner);
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionDetailsDialog, header_unregister_button);
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionDetailsDialog, notification_revealer);
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionDetailsDialog, error_label);
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionDetailsDialog, stack);
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionDetailsDialog, products_box1);
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionDetailsDialog, products_box2);
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionDetailsDialog, unregister_button);
a780b2
+
a780b2
+  gtk_widget_class_bind_template_callback (widget_class, back_button_clicked_cb);
a780b2
+  gtk_widget_class_bind_template_callback (widget_class, header_unregister_button_clicked_cb);
a780b2
+  gtk_widget_class_bind_template_callback (widget_class, unregister_button_clicked_cb);
a780b2
+  gtk_widget_class_bind_template_callback (widget_class, dismiss_notification);
a780b2
+}
a780b2
+
a780b2
+CcSubscriptionDetailsDialog *
a780b2
+cc_subscription_details_dialog_new (GDBusProxy *subscription_proxy)
a780b2
+{
a780b2
+  CcSubscriptionDetailsDialog *self;
a780b2
+
a780b2
+  self = g_object_new (CC_TYPE_SUBSCRIPTION_DETAILS_DIALOG, "use-header-bar", TRUE, NULL);
a780b2
+  self->subscription_proxy = g_object_ref (subscription_proxy);
a780b2
+
a780b2
+  load_installed_products (self);
a780b2
+  dialog_reload (self);
a780b2
+
a780b2
+  return self;
a780b2
+}
a780b2
diff --git a/panels/info/cc-subscription-details-dialog.h b/panels/info/cc-subscription-details-dialog.h
a780b2
new file mode 100644
a780b2
index 000000000..a61a22838
a780b2
--- /dev/null
a780b2
+++ b/panels/info/cc-subscription-details-dialog.h
a780b2
@@ -0,0 +1,32 @@
a780b2
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
a780b2
+ *
a780b2
+ * Copyright 2019  Red Hat, Inc,
a780b2
+ *
a780b2
+ * This program is free software; you can redistribute it and/or modify
a780b2
+ * it under the terms of the GNU General Public License as published by
a780b2
+ * the Free Software Foundation; either version 2 of the License, or
a780b2
+ * (at your option) any later version.
a780b2
+ *
a780b2
+ * This program is distributed in the hope that it will be useful,
a780b2
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
a780b2
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a780b2
+ * GNU General Public License for more details.
a780b2
+ *
a780b2
+ * You should have received a copy of the GNU General Public License
a780b2
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
a780b2
+ *
a780b2
+ * Written by: Kalev Lember <klember@redhat.com>
a780b2
+ */
a780b2
+
a780b2
+#pragma once
a780b2
+
a780b2
+#include <gtk/gtk.h>
a780b2
+
a780b2
+G_BEGIN_DECLS
a780b2
+
a780b2
+#define CC_TYPE_SUBSCRIPTION_DETAILS_DIALOG (cc_subscription_details_dialog_get_type ())
a780b2
+G_DECLARE_FINAL_TYPE (CcSubscriptionDetailsDialog, cc_subscription_details_dialog, CC, SUBSCRIPTION_DETAILS_DIALOG, GtkDialog)
a780b2
+
a780b2
+CcSubscriptionDetailsDialog *cc_subscription_details_dialog_new (GDBusProxy *subscription_proxy);
a780b2
+
a780b2
+G_END_DECLS
a780b2
diff --git a/panels/info/cc-subscription-details-dialog.ui b/panels/info/cc-subscription-details-dialog.ui
a780b2
new file mode 100644
a780b2
index 000000000..6f0b16930
a780b2
--- /dev/null
a780b2
+++ b/panels/info/cc-subscription-details-dialog.ui
a780b2
@@ -0,0 +1,248 @@
a780b2
+
a780b2
+<interface>
a780b2
+  <template class="CcSubscriptionDetailsDialog" parent="GtkDialog">
a780b2
+    <property name="can_focus">False</property>
a780b2
+    <property name="resizable">False</property>
a780b2
+    <property name="modal">True</property>
a780b2
+    <property name="destroy_with_parent">True</property>
a780b2
+    <property name="type_hint">dialog</property>
a780b2
+    <property name="title" translatable="yes">Registration Details</property>
a780b2
+    <property name="use_header_bar">1</property>
a780b2
+    <child internal-child="headerbar">
a780b2
+      <object class="GtkHeaderBar">
a780b2
+        <property name="visible">True</property>
a780b2
+        <property name="can_focus">False</property>
a780b2
+        <property name="show_close_button">False</property>
a780b2
+        <child>
a780b2
+          <object class="GtkButton" id="back_button">
a780b2
+            <property name="visible">True</property>
a780b2
+            <property name="can_focus">True</property>
a780b2
+            <property name="receives_default">True</property>
a780b2
+            <property name="valign">center</property>
a780b2
+            <signal name="clicked" handler="back_button_clicked_cb" object="CcSubscriptionDetailsDialog" swapped="yes"/>
a780b2
+            <child>
a780b2
+              <object class="GtkImage">
a780b2
+                <property name="visible">True</property>
a780b2
+                <property name="can_focus">False</property>
a780b2
+                <property name="icon_name">go-previous-symbolic</property>
a780b2
+              </object>
a780b2
+            </child>
a780b2
+            <style>
a780b2
+              <class name="image-button"/>
a780b2
+            </style>
a780b2
+          </object>
a780b2
+        </child>
a780b2
+        <child>
a780b2
+          <object class="GtkButton" id="header_unregister_button">
a780b2
+            <property name="label" translatable="yes">_Unregister</property>
a780b2
+            <property name="visible">True</property>
a780b2
+            <property name="can_focus">True</property>
a780b2
+            <property name="can_default">True</property>
a780b2
+            <property name="has_default">True</property>
a780b2
+            <property name="receives_default">True</property>
a780b2
+            <property name="use_action_appearance">False</property>
a780b2
+            <property name="use_underline">True</property>
a780b2
+            <property name="valign">center</property>
a780b2
+            <signal name="clicked" handler="header_unregister_button_clicked_cb" object="CcSubscriptionDetailsDialog" swapped="yes"/>
a780b2
+            <style>
a780b2
+              <class name="text-button"/>
a780b2
+              <class name="destructive-action"/>
a780b2
+            </style>
a780b2
+          </object>
a780b2
+          <packing>
a780b2
+            <property name="pack_type">end</property>
a780b2
+          </packing>
a780b2
+        </child>
a780b2
+        <child>
a780b2
+          <object class="GtkSpinner" id="spinner">
a780b2
+            <property name="visible">True</property>
a780b2
+            <property name="can_focus">False</property>
a780b2
+            <property name="valign">center</property>
a780b2
+            <property name="margin_start">6</property>
a780b2
+            <property name="margin_end">6</property>
a780b2
+          </object>
a780b2
+          <packing>
a780b2
+            <property name="pack_type">end</property>
a780b2
+          </packing>
a780b2
+        </child>
a780b2
+      </object>
a780b2
+    </child>
a780b2
+    <child internal-child="vbox">
a780b2
+      <object class="GtkBox">
a780b2
+        <property name="visible">True</property>
a780b2
+        <property name="can_focus">False</property>
a780b2
+        <property name="orientation">vertical</property>
a780b2
+        <property name="border_width">0</property>
a780b2
+        <child>
a780b2
+          <object class="GtkOverlay" id="overlay">
a780b2
+            <property name="visible">True</property>
a780b2
+            <child type="overlay">
a780b2
+              <object class="GtkRevealer" id="notification_revealer">
a780b2
+                <property name="visible">True</property>
a780b2
+                <property name="halign">fill</property>
a780b2
+                <property name="hexpand">True</property>
a780b2
+                <property name="margin_start">20</property>
a780b2
+                <property name="margin_end">20</property>
a780b2
+                <property name="valign">start</property>
a780b2
+                <child>
a780b2
+                  <object class="GtkBox">
a780b2
+                    <property name="visible">True</property>
a780b2
+                    <property name="spacing">6</property>
a780b2
+                    <style>
a780b2
+                      <class name="app-notification"/>
a780b2
+                    </style>
a780b2
+                    <child>
a780b2
+                      <object class="GtkBox">
a780b2
+                        <property name="visible">True</property>
a780b2
+                        <property name="orientation">vertical</property>
a780b2
+                        <property name="margin_start">6</property>
a780b2
+                        <property name="margin_end">6</property>
a780b2
+                        <property name="hexpand">True</property>
a780b2
+                        <property name="halign">start</property>
a780b2
+                        <child>
a780b2
+                          <object class="GtkLabel">
a780b2
+                            <property name="visible">True</property>
a780b2
+                            <property name="halign">start</property>
a780b2
+                            <property name="wrap">True</property>
a780b2
+                            <property name="label" translatable="yes">Failed to Unregister System</property>
a780b2
+                            <attributes>
a780b2
+                              <attribute name="weight" value="bold"/>
a780b2
+                            </attributes>
a780b2
+                          </object>
a780b2
+                        </child>
a780b2
+                        <child>
a780b2
+                          <object class="GtkLabel" id="error_label">
a780b2
+                            <property name="visible">True</property>
a780b2
+                            <property name="xalign">0</property>
a780b2
+                            <property name="halign">start</property>
a780b2
+                            <property name="wrap">True</property>
a780b2
+                            <property name="wrap_mode">word-char</property>
a780b2
+                            <property name="label">Unable to reach developers.redhat.com. Please try again later.</property>
a780b2
+                          </object>
a780b2
+                        </child>
a780b2
+                      </object>
a780b2
+                    </child>
a780b2
+                    <child>
a780b2
+                      <object class="GtkButton" id="dismiss_button">
a780b2
+                        <property name="visible">True</property>
a780b2
+                        <property name="valign">start</property>
a780b2
+                        <signal name="clicked" handler="dismiss_notification" object="CcSubscriptionDetailsDialog" swapped="yes"/>
a780b2
+                        <style>
a780b2
+                          <class name="flat"/>
a780b2
+                        </style>
a780b2
+                        <child>
a780b2
+                          <object class="GtkImage">
a780b2
+                            <property name="visible">True</property>
a780b2
+                            <property name="icon_name">window-close-symbolic</property>
a780b2
+                          </object>
a780b2
+                        </child>
a780b2
+                      </object>
a780b2
+                    </child>
a780b2
+                  </object>
a780b2
+                </child>
a780b2
+              </object>
a780b2
+            </child>
a780b2
+            <child>
a780b2
+              <object class="GtkStack" id="stack">
a780b2
+                <property name="visible">True</property>
a780b2
+                <property name="can_focus">False</property>
a780b2
+                <property name="transition-type">slide-left-right</property>
a780b2
+                <child>
a780b2
+                  <object class="GtkBox">
a780b2
+                    <property name="visible">True</property>
a780b2
+                    <property name="orientation">vertical</property>
a780b2
+                    <property name="margin_top">24</property>
a780b2
+                    <property name="margin_start">32</property>
a780b2
+                    <property name="margin_end">32</property>
a780b2
+                    <property name="margin_bottom">20</property>
a780b2
+                    <child>
a780b2
+                      <object class="GtkLabel">
a780b2
+                        <property name="visible">True</property>
a780b2
+                        <property name="can_focus">False</property>
a780b2
+                        <property name="label" translatable="yes">Registration with Red Hat allows this system to receive software updates.</property>
a780b2
+                        <property name="width_chars">45</property>
a780b2
+                        <property name="max_width_chars">45</property>
a780b2
+                        <property name="xalign">0</property>
a780b2
+                        <property name="halign">start</property>
a780b2
+                        <property name="wrap">True</property>
a780b2
+                        <style>
a780b2
+                          <class name="dim-label"/>
a780b2
+                        </style>
a780b2
+                      </object>
a780b2
+                    </child>
a780b2
+                    <child>
a780b2
+                      <object class="GtkBox" id="products_box1">
a780b2
+                        <property name="visible">True</property>
a780b2
+                        <property name="orientation">vertical</property>
a780b2
+                        <property name="margin_top">6</property>
a780b2
+                        <property name="margin_bottom">6</property>
a780b2
+                        <property name="hexpand">True</property>
a780b2
+                      </object>
a780b2
+                    </child>
a780b2
+                    <child>
a780b2
+                      <object class="GtkButton" id="unregister_button">
a780b2
+                        <property name="label" translatable="yes">_Unregister…</property>
a780b2
+                        <property name="can_focus">True</property>
a780b2
+                        <property name="use_underline">True</property>
a780b2
+                        <property name="receives_default">True</property>
a780b2
+                        <property name="use_action_appearance">False</property>
a780b2
+                        <property name="halign">end</property>
a780b2
+                        <property name="visible">True</property>
a780b2
+                        <signal name="clicked" handler="unregister_button_clicked_cb" object="CcSubscriptionDetailsDialog" swapped="yes"/>
a780b2
+                        <style>
a780b2
+                          <class name="text-button"/>
a780b2
+                        </style>
a780b2
+                      </object>
a780b2
+                    </child>
a780b2
+                  </object>
a780b2
+                  <packing>
a780b2
+                    <property name="name">show-details</property>
a780b2
+                  </packing>
a780b2
+                </child>
a780b2
+                <child>
a780b2
+                  <object class="GtkBox">
a780b2
+                    <property name="visible">True</property>
a780b2
+                    <property name="orientation">vertical</property>
a780b2
+                    <property name="margin_top">24</property>
a780b2
+                    <property name="margin_start">32</property>
a780b2
+                    <property name="margin_end">32</property>
a780b2
+                    <property name="margin_bottom">20</property>
a780b2
+                    <child>
a780b2
+                      <object class="GtkLabel">
a780b2
+                        <property name="visible">True</property>
a780b2
+                        <property name="can_focus">False</property>
a780b2
+                        <property name="label" translatable="yes">Warning: unregistering this system will result in it no longer receiving software updates.</property>
a780b2
+                        <property name="width_chars">45</property>
a780b2
+                        <property name="max_width_chars">45</property>
a780b2
+                        <property name="xalign">0</property>
a780b2
+                        <property name="halign">start</property>
a780b2
+                        <property name="wrap">True</property>
a780b2
+                      </object>
a780b2
+                    </child>
a780b2
+                    <child>
a780b2
+                      <object class="GtkBox" id="products_box2">
a780b2
+                        <property name="visible">True</property>
a780b2
+                        <property name="orientation">vertical</property>
a780b2
+                        <property name="margin_top">6</property>
a780b2
+                        <property name="margin_bottom">6</property>
a780b2
+                        <property name="hexpand">True</property>
a780b2
+                      </object>
a780b2
+                    </child>
a780b2
+                  </object>
a780b2
+                  <packing>
a780b2
+                    <property name="name">unregister</property>
a780b2
+                  </packing>
a780b2
+                </child>
a780b2
+              </object>
a780b2
+            </child>
a780b2
+          </object>
a780b2
+          <packing>
a780b2
+            <property name="expand">False</property>
a780b2
+            <property name="fill">True</property>
a780b2
+            <property name="position">0</property>
a780b2
+          </packing>
a780b2
+        </child>
a780b2
+      </object>
a780b2
+    </child>
a780b2
+  </template>
a780b2
+</interface>
a780b2
diff --git a/panels/info/cc-subscription-register-dialog.c b/panels/info/cc-subscription-register-dialog.c
a780b2
new file mode 100644
a780b2
index 000000000..d7a17cc99
a780b2
--- /dev/null
a780b2
+++ b/panels/info/cc-subscription-register-dialog.c
a780b2
@@ -0,0 +1,403 @@
a780b2
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
a780b2
+ *
a780b2
+ * Copyright 2019  Red Hat, Inc,
a780b2
+ *
a780b2
+ * This program is free software; you can redistribute it and/or modify
a780b2
+ * it under the terms of the GNU General Public License as published by
a780b2
+ * the Free Software Foundation; either version 2 of the License, or
a780b2
+ * (at your option) any later version.
a780b2
+ *
a780b2
+ * This program is distributed in the hope that it will be useful,
a780b2
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
a780b2
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a780b2
+ * GNU General Public License for more details.
a780b2
+ *
a780b2
+ * You should have received a copy of the GNU General Public License
a780b2
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
a780b2
+ *
a780b2
+ * Written by: Kalev Lember <klember@redhat.com>
a780b2
+ */
a780b2
+
a780b2
+#include "config.h"
a780b2
+
a780b2
+#include <glib.h>
a780b2
+#include <glib/gi18n.h>
a780b2
+#include <gtk/gtk.h>
a780b2
+
a780b2
+#include "cc-subscription-register-dialog.h"
a780b2
+
a780b2
+#define DBUS_TIMEOUT 300000 /* 5 minutes */
a780b2
+#define SERVER_URL "subscription.rhsm.redhat.com"
a780b2
+
a780b2
+typedef enum {
a780b2
+  DIALOG_STATE_REGISTER,
a780b2
+  DIALOG_STATE_REGISTERING
a780b2
+} DialogState;
a780b2
+
a780b2
+static void dialog_validate (CcSubscriptionRegisterDialog *self);
a780b2
+
a780b2
+struct _CcSubscriptionRegisterDialog
a780b2
+{
a780b2
+  GtkDialog       parent_instance;
a780b2
+
a780b2
+  DialogState     state;
a780b2
+  GCancellable   *cancellable;
a780b2
+  GDBusProxy     *subscription_proxy;
a780b2
+  gboolean        valid;
a780b2
+
a780b2
+  /* template widgets */
a780b2
+  GtkSpinner     *spinner;
a780b2
+  GtkButton      *register_button;
a780b2
+  GtkRevealer    *notification_revealer;
a780b2
+  GtkLabel       *error_label;
a780b2
+  GtkRadioButton *default_url_radio;
a780b2
+  GtkRadioButton *custom_url_radio;
a780b2
+  GtkRadioButton *register_radio;
a780b2
+  GtkRadioButton *register_with_activation_keys_radio;
a780b2
+  GtkStack       *stack;
a780b2
+  GtkGrid        *register_grid;
a780b2
+  GtkGrid        *register_with_activation_keys_grid;
a780b2
+  GtkEntry       *url_label;
a780b2
+  GtkEntry       *url_entry;
a780b2
+  GtkEntry       *login_entry;
a780b2
+  GtkEntry       *password_entry;
a780b2
+  GtkEntry       *activation_keys_entry;
a780b2
+  GtkLabel       *organization_label;
a780b2
+  GtkEntry       *organization_entry;
a780b2
+  GtkEntry       *organization_entry_with_activation_keys;
a780b2
+};
a780b2
+
a780b2
+G_DEFINE_TYPE (CcSubscriptionRegisterDialog, cc_subscription_register_dialog, GTK_TYPE_DIALOG);
a780b2
+
a780b2
+static void
a780b2
+dialog_reload (CcSubscriptionRegisterDialog *self)
a780b2
+{
a780b2
+  gboolean sensitive;
a780b2
+  gboolean url_entry_enabled;
a780b2
+
a780b2
+  switch (self->state)
a780b2
+    {
a780b2
+    case DIALOG_STATE_REGISTER:
a780b2
+      gtk_window_set_title (GTK_WINDOW (self), _("Register System"));
a780b2
+      gtk_widget_set_sensitive (GTK_WIDGET (self->register_button), self->valid);
a780b2
+
a780b2
+      sensitive = TRUE;
a780b2
+      break;
a780b2
+
a780b2
+    case DIALOG_STATE_REGISTERING:
a780b2
+      gtk_window_set_title (GTK_WINDOW (self), _("Registering System…"));
a780b2
+      gtk_widget_set_sensitive (GTK_WIDGET (self->register_button), FALSE);
a780b2
+
a780b2
+      sensitive = FALSE;
a780b2
+      break;
a780b2
+
a780b2
+    default:
a780b2
+      g_assert_not_reached ();
a780b2
+      break;
a780b2
+    }
a780b2
+
a780b2
+  url_entry_enabled = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->custom_url_radio));
a780b2
+  gtk_widget_set_sensitive (GTK_WIDGET (self->url_entry), sensitive && url_entry_enabled);
a780b2
+
a780b2
+  gtk_widget_set_sensitive (GTK_WIDGET (self->default_url_radio), sensitive);
a780b2
+  gtk_widget_set_sensitive (GTK_WIDGET (self->custom_url_radio), sensitive);
a780b2
+  gtk_widget_set_sensitive (GTK_WIDGET (self->register_radio), sensitive);
a780b2
+  gtk_widget_set_sensitive (GTK_WIDGET (self->register_with_activation_keys_radio), sensitive);
a780b2
+  gtk_widget_set_sensitive (GTK_WIDGET (self->login_entry), sensitive);
a780b2
+  gtk_widget_set_sensitive (GTK_WIDGET (self->password_entry), sensitive);
a780b2
+  gtk_widget_set_sensitive (GTK_WIDGET (self->activation_keys_entry), sensitive);
a780b2
+  gtk_widget_set_sensitive (GTK_WIDGET (self->password_entry), sensitive);
a780b2
+  gtk_widget_set_sensitive (GTK_WIDGET (self->organization_entry), sensitive);
a780b2
+  gtk_widget_set_sensitive (GTK_WIDGET (self->organization_entry_with_activation_keys), sensitive);
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+custom_url_radio_toggled_cb (CcSubscriptionRegisterDialog *self)
a780b2
+{
a780b2
+  gboolean active;
a780b2
+
a780b2
+  active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->custom_url_radio));
a780b2
+  if (active)
a780b2
+    {
a780b2
+      gtk_widget_set_sensitive (GTK_WIDGET (self->url_entry), TRUE);
a780b2
+      gtk_widget_set_sensitive (GTK_WIDGET (self->url_label), TRUE);
a780b2
+
a780b2
+      gtk_entry_set_text (self->url_entry, "");
a780b2
+      gtk_widget_grab_focus (GTK_WIDGET (self->url_entry));
a780b2
+    }
a780b2
+  else
a780b2
+    {
a780b2
+      gtk_widget_set_sensitive (GTK_WIDGET (self->url_entry), FALSE);
a780b2
+      gtk_widget_set_sensitive (GTK_WIDGET (self->url_label), FALSE);
a780b2
+
a780b2
+      gtk_entry_set_text (self->url_entry, SERVER_URL);
a780b2
+    }
a780b2
+
a780b2
+  dialog_validate (self);
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+register_with_activation_keys_radio_toggled_cb (CcSubscriptionRegisterDialog *self)
a780b2
+{
a780b2
+  gint active;
a780b2
+
a780b2
+  active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->register_with_activation_keys_radio));
a780b2
+  if (active)
a780b2
+    {
a780b2
+      gtk_stack_set_visible_child_name (self->stack, "register-with-activation-keys");
a780b2
+      gtk_widget_grab_focus (GTK_WIDGET (self->activation_keys_entry));
a780b2
+    }
a780b2
+  else
a780b2
+    {
a780b2
+      gtk_stack_set_visible_child_name (self->stack, "register");
a780b2
+      gtk_widget_grab_focus (GTK_WIDGET (self->login_entry));
a780b2
+    }
a780b2
+
a780b2
+  dialog_validate (self);
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+dialog_validate (CcSubscriptionRegisterDialog *self)
a780b2
+{
a780b2
+  gboolean valid_url = TRUE;
a780b2
+  gboolean valid_login = TRUE;
a780b2
+  gboolean valid_password = TRUE;
a780b2
+  gboolean valid_activation_keys = TRUE;
a780b2
+  gboolean valid_organization = TRUE;
a780b2
+
a780b2
+  /* require url when custom url radio is selected */
a780b2
+  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->custom_url_radio)))
a780b2
+    {
a780b2
+      const gchar *url;
a780b2
+
a780b2
+      url = gtk_entry_get_text (self->url_entry);
a780b2
+      valid_url = url != NULL && strlen (url) != 0;
a780b2
+    }
a780b2
+
a780b2
+  /* activation keys radio selected */
a780b2
+  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->register_with_activation_keys_radio)))
a780b2
+    {
a780b2
+      const gchar *activation_keys;
a780b2
+      const gchar *organization;
a780b2
+
a780b2
+      /* require activation keys */
a780b2
+      activation_keys = gtk_entry_get_text (self->activation_keys_entry);
a780b2
+      valid_activation_keys = activation_keys != NULL && strlen (activation_keys) != 0;
a780b2
+
a780b2
+      /* organization is required when using activation keys */
a780b2
+      organization = gtk_entry_get_text (self->organization_entry_with_activation_keys);
a780b2
+      valid_organization = organization != NULL && strlen (organization) != 0;
a780b2
+
a780b2
+      /* username/password radio selected */
a780b2
+    }
a780b2
+  else
a780b2
+    {
a780b2
+      const gchar *login;
a780b2
+      const gchar *password;
a780b2
+
a780b2
+      /* require login */
a780b2
+      login = gtk_entry_get_text (self->login_entry);
a780b2
+      valid_login = login != NULL && strlen (login) != 0;
a780b2
+
a780b2
+      /* require password */
a780b2
+      password = gtk_entry_get_text (self->password_entry);
a780b2
+      valid_password = password != NULL && strlen (password) != 0;
a780b2
+    }
a780b2
+
a780b2
+  self->valid = valid_url && valid_login && valid_password && valid_activation_keys && valid_organization;
a780b2
+  gtk_widget_set_sensitive (GTK_WIDGET (self->register_button), self->valid);
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+registration_done_cb (GObject      *source_object,
a780b2
+                      GAsyncResult *res,
a780b2
+                      gpointer      user_data)
a780b2
+{
a780b2
+  CcSubscriptionRegisterDialog *self = (CcSubscriptionRegisterDialog *) user_data;
a780b2
+  g_autoptr(GVariant) results = NULL;
a780b2
+  g_autoptr(GError) error = NULL;
a780b2
+
a780b2
+  results = g_dbus_proxy_call_finish (G_DBUS_PROXY (source_object),
a780b2
+                                      res,
a780b2
+                                      &error);
a780b2
+  if (results == NULL)
a780b2
+    {
a780b2
+      if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
a780b2
+        return;
a780b2
+
a780b2
+      g_dbus_error_strip_remote_error (error);
a780b2
+      gtk_label_set_text (self->error_label, error->message);
a780b2
+      gtk_revealer_set_reveal_child (self->notification_revealer, TRUE);
a780b2
+
a780b2
+      gtk_spinner_stop (self->spinner);
a780b2
+
a780b2
+      self->state = DIALOG_STATE_REGISTER;
a780b2
+      dialog_reload (self);
a780b2
+      return;
a780b2
+    }
a780b2
+
a780b2
+  gtk_spinner_stop (self->spinner);
a780b2
+  gtk_dialog_response (GTK_DIALOG (self), GTK_RESPONSE_ACCEPT);
a780b2
+  return;
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+subscription_register_with_activation_keys (CcSubscriptionRegisterDialog *self)
a780b2
+{
a780b2
+  g_autoptr(GVariantBuilder) options_builder = NULL;
a780b2
+  const gchar *hostname;
a780b2
+  const gchar *organization;
a780b2
+  const gchar *activation_keys;
a780b2
+
a780b2
+  hostname = gtk_entry_get_text (self->url_entry);
a780b2
+  organization = gtk_entry_get_text (self->organization_entry_with_activation_keys);
a780b2
+  activation_keys = gtk_entry_get_text (self->activation_keys_entry);
a780b2
+
a780b2
+  options_builder = g_variant_builder_new (G_VARIANT_TYPE ("a{sv}"));
a780b2
+  g_variant_builder_add (options_builder, "{sv}", "kind", g_variant_new_string ("key"));
a780b2
+  g_variant_builder_add (options_builder, "{sv}", "hostname", g_variant_new_string (hostname));
a780b2
+  g_variant_builder_add (options_builder, "{sv}", "organisation", g_variant_new_string (organization));
a780b2
+  g_variant_builder_add (options_builder, "{sv}", "activation-key", g_variant_new_string (activation_keys));
a780b2
+
a780b2
+  g_dbus_proxy_call (self->subscription_proxy,
a780b2
+                     "Register",
a780b2
+                     g_variant_new ("(a{sv})",
a780b2
+                                    options_builder),
a780b2
+                     G_DBUS_CALL_FLAGS_NONE,
a780b2
+                     DBUS_TIMEOUT,
a780b2
+                     self->cancellable,
a780b2
+                     registration_done_cb,
a780b2
+                     self);
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+subscription_register_with_username (CcSubscriptionRegisterDialog *self)
a780b2
+{
a780b2
+  g_autoptr(GVariantBuilder) options_builder = NULL;
a780b2
+  const gchar *hostname;
a780b2
+  const gchar *organization;
a780b2
+  const gchar *username;
a780b2
+  const gchar *password;
a780b2
+
a780b2
+  hostname = gtk_entry_get_text (self->url_entry);
a780b2
+  organization = gtk_entry_get_text (self->organization_entry);
a780b2
+  username = gtk_entry_get_text (self->login_entry);
a780b2
+  password = gtk_entry_get_text (self->password_entry);
a780b2
+
a780b2
+  options_builder = g_variant_builder_new (G_VARIANT_TYPE ("a{sv}"));
a780b2
+  g_variant_builder_add (options_builder, "{sv}", "kind", g_variant_new_string ("username"));
a780b2
+  g_variant_builder_add (options_builder, "{sv}", "hostname", g_variant_new_string (hostname));
a780b2
+  g_variant_builder_add (options_builder, "{sv}", "organisation", g_variant_new_string (organization));
a780b2
+  g_variant_builder_add (options_builder, "{sv}", "username", g_variant_new_string (username));
a780b2
+  g_variant_builder_add (options_builder, "{sv}", "password", g_variant_new_string (password));
a780b2
+
a780b2
+  g_dbus_proxy_call (self->subscription_proxy,
a780b2
+                     "Register",
a780b2
+                     g_variant_new ("(a{sv})", options_builder),
a780b2
+                     G_DBUS_CALL_FLAGS_NONE,
a780b2
+                     DBUS_TIMEOUT,
a780b2
+                     self->cancellable,
a780b2
+                     registration_done_cb,
a780b2
+                     self);
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+register_button_clicked_cb (CcSubscriptionRegisterDialog *self)
a780b2
+{
a780b2
+  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->register_with_activation_keys_radio)))
a780b2
+    subscription_register_with_activation_keys (self);
a780b2
+  else
a780b2
+    subscription_register_with_username (self);
a780b2
+
a780b2
+  gtk_spinner_start (self->spinner);
a780b2
+
a780b2
+  self->state = DIALOG_STATE_REGISTERING;
a780b2
+  dialog_reload (self);
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+dismiss_notification (CcSubscriptionRegisterDialog *self)
a780b2
+{
a780b2
+  gtk_revealer_set_reveal_child (self->notification_revealer, FALSE);
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+cc_subscription_register_dialog_init (CcSubscriptionRegisterDialog *self)
a780b2
+{
a780b2
+  gtk_widget_init_template (GTK_WIDGET (self));
a780b2
+
a780b2
+  self->cancellable = g_cancellable_new ();
a780b2
+  self->state = DIALOG_STATE_REGISTER;
a780b2
+
a780b2
+  gtk_entry_set_text (self->url_entry, SERVER_URL);
a780b2
+  gtk_widget_grab_focus (GTK_WIDGET (self->login_entry));
a780b2
+  dialog_validate (self);
a780b2
+  dialog_reload (self);
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+cc_subscription_register_dialog_dispose (GObject *obj)
a780b2
+{
a780b2
+  CcSubscriptionRegisterDialog *self = (CcSubscriptionRegisterDialog *) obj;
a780b2
+
a780b2
+  g_cancellable_cancel (self->cancellable);
a780b2
+  g_clear_object (&self->cancellable);
a780b2
+  g_clear_object (&self->subscription_proxy);
a780b2
+
a780b2
+  G_OBJECT_CLASS (cc_subscription_register_dialog_parent_class)->dispose (obj);
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+cc_subscription_register_dialog_finalize (GObject *obj)
a780b2
+{
a780b2
+  G_OBJECT_CLASS (cc_subscription_register_dialog_parent_class)->finalize (obj);
a780b2
+}
a780b2
+
a780b2
+static void
a780b2
+cc_subscription_register_dialog_class_init (CcSubscriptionRegisterDialogClass *klass)
a780b2
+{
a780b2
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
a780b2
+  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
a780b2
+
a780b2
+  object_class->dispose = cc_subscription_register_dialog_dispose;
a780b2
+  object_class->finalize = cc_subscription_register_dialog_finalize;
a780b2
+
a780b2
+  gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/info/cc-subscription-register-dialog.ui");
a780b2
+
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionRegisterDialog, spinner);
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionRegisterDialog, register_button);
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionRegisterDialog, notification_revealer);
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionRegisterDialog, error_label);
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionRegisterDialog, default_url_radio);
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionRegisterDialog, custom_url_radio);
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionRegisterDialog, register_radio);
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionRegisterDialog, register_with_activation_keys_radio);
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionRegisterDialog, stack);
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionRegisterDialog, register_grid);
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionRegisterDialog, register_with_activation_keys_grid);
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionRegisterDialog, url_label);
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionRegisterDialog, url_entry);
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionRegisterDialog, login_entry);
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionRegisterDialog, password_entry);
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionRegisterDialog, activation_keys_entry);
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionRegisterDialog, organization_label);
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionRegisterDialog, organization_entry);
a780b2
+  gtk_widget_class_bind_template_child (widget_class, CcSubscriptionRegisterDialog, organization_entry_with_activation_keys);
a780b2
+
a780b2
+  gtk_widget_class_bind_template_callback (widget_class, dialog_validate);
a780b2
+  gtk_widget_class_bind_template_callback (widget_class, register_button_clicked_cb);
a780b2
+  gtk_widget_class_bind_template_callback (widget_class, dismiss_notification);
a780b2
+  gtk_widget_class_bind_template_callback (widget_class, custom_url_radio_toggled_cb);
a780b2
+  gtk_widget_class_bind_template_callback (widget_class, register_with_activation_keys_radio_toggled_cb);
a780b2
+}
a780b2
+
a780b2
+CcSubscriptionRegisterDialog *
a780b2
+cc_subscription_register_dialog_new (GDBusProxy *subscription_proxy)
a780b2
+{
a780b2
+  CcSubscriptionRegisterDialog *self;
a780b2
+
a780b2
+  self = g_object_new (CC_TYPE_SUBSCRIPTION_REGISTER_DIALOG, "use-header-bar", TRUE, NULL);
a780b2
+  self->subscription_proxy = g_object_ref (subscription_proxy);
a780b2
+
a780b2
+  return self;
a780b2
+}
a780b2
diff --git a/panels/info/cc-subscription-register-dialog.h b/panels/info/cc-subscription-register-dialog.h
a780b2
new file mode 100644
a780b2
index 000000000..c5918df9f
a780b2
--- /dev/null
a780b2
+++ b/panels/info/cc-subscription-register-dialog.h
a780b2
@@ -0,0 +1,32 @@
a780b2
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
a780b2
+ *
a780b2
+ * Copyright 2019  Red Hat, Inc,
a780b2
+ *
a780b2
+ * This program is free software; you can redistribute it and/or modify
a780b2
+ * it under the terms of the GNU General Public License as published by
a780b2
+ * the Free Software Foundation; either version 2 of the License, or
a780b2
+ * (at your option) any later version.
a780b2
+ *
a780b2
+ * This program is distributed in the hope that it will be useful,
a780b2
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
a780b2
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a780b2
+ * GNU General Public License for more details.
a780b2
+ *
a780b2
+ * You should have received a copy of the GNU General Public License
a780b2
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
a780b2
+ *
a780b2
+ * Written by: Kalev Lember <klember@redhat.com>
a780b2
+ */
a780b2
+
a780b2
+#pragma once
a780b2
+
a780b2
+#include <gtk/gtk.h>
a780b2
+
a780b2
+G_BEGIN_DECLS
a780b2
+
a780b2
+#define CC_TYPE_SUBSCRIPTION_REGISTER_DIALOG (cc_subscription_register_dialog_get_type ())
a780b2
+G_DECLARE_FINAL_TYPE (CcSubscriptionRegisterDialog, cc_subscription_register_dialog, CC, SUBSCRIPTION_REGISTER_DIALOG, GtkDialog)
a780b2
+
a780b2
+CcSubscriptionRegisterDialog *cc_subscription_register_dialog_new (GDBusProxy *subscription_proxy);
a780b2
+
a780b2
+G_END_DECLS
a780b2
diff --git a/panels/info/cc-subscription-register-dialog.ui b/panels/info/cc-subscription-register-dialog.ui
a780b2
new file mode 100644
a780b2
index 000000000..21e317b41
a780b2
--- /dev/null
a780b2
+++ b/panels/info/cc-subscription-register-dialog.ui
a780b2
@@ -0,0 +1,623 @@
a780b2
+
a780b2
+<interface>
a780b2
+  <template class="CcSubscriptionRegisterDialog" parent="GtkDialog">
a780b2
+    <property name="can_focus">False</property>
a780b2
+    <property name="resizable">False</property>
a780b2
+    <property name="modal">True</property>
a780b2
+    <property name="destroy_with_parent">True</property>
a780b2
+    <property name="type_hint">dialog</property>
a780b2
+    <property name="title" translatable="yes">Register System</property>
a780b2
+    <property name="use_header_bar">1</property>
a780b2
+    <child internal-child="headerbar">
a780b2
+      <object class="GtkHeaderBar">
a780b2
+        <property name="visible">True</property>
a780b2
+        <property name="can_focus">False</property>
a780b2
+        <property name="show_close_button">False</property>
a780b2
+        <child>
a780b2
+          <object class="GtkButton" id="cancel_button">
a780b2
+            <property name="label" translatable="yes">_Cancel</property>
a780b2
+            <property name="visible">True</property>
a780b2
+            <property name="visible">True</property>
a780b2
+            <property name="can_focus">True</property>
a780b2
+            <property name="can_default">True</property>
a780b2
+            <property name="receives_default">True</property>
a780b2
+            <property name="use_action_appearance">False</property>
a780b2
+            <property name="use_underline">True</property>
a780b2
+            <property name="valign">center</property>
a780b2
+            <style>
a780b2
+              <class name="text-button"/>
a780b2
+            </style>
a780b2
+          </object>
a780b2
+          <packing>
a780b2
+            <property name="pack_type">start</property>
a780b2
+          </packing>
a780b2
+        </child>
a780b2
+        <child>
a780b2
+          <object class="GtkButton" id="register_button">
a780b2
+            <property name="label" translatable="yes">_Register</property>
a780b2
+            <property name="visible">True</property>
a780b2
+            <property name="can_focus">True</property>
a780b2
+            <property name="can_default">True</property>
a780b2
+            <property name="has_default">True</property>
a780b2
+            <property name="receives_default">True</property>
a780b2
+            <property name="use_action_appearance">False</property>
a780b2
+            <property name="use_underline">True</property>
a780b2
+            <property name="valign">center</property>
a780b2
+            <signal name="clicked" handler="register_button_clicked_cb" object="CcSubscriptionRegisterDialog" swapped="yes"/>
a780b2
+            <style>
a780b2
+              <class name="text-button"/>
a780b2
+              <class name="suggested-action"/>
a780b2
+            </style>
a780b2
+          </object>
a780b2
+          <packing>
a780b2
+            <property name="pack_type">end</property>
a780b2
+          </packing>
a780b2
+        </child>
a780b2
+        <child>
a780b2
+          <object class="GtkSpinner" id="spinner">
a780b2
+            <property name="visible">True</property>
a780b2
+            <property name="can_focus">False</property>
a780b2
+            <property name="valign">center</property>
a780b2
+            <property name="margin_start">6</property>
a780b2
+            <property name="margin_end">6</property>
a780b2
+          </object>
a780b2
+          <packing>
a780b2
+            <property name="pack_type">end</property>
a780b2
+          </packing>
a780b2
+        </child>
a780b2
+      </object>
a780b2
+    </child>
a780b2
+    <child internal-child="vbox">
a780b2
+      <object class="GtkBox">
a780b2
+        <property name="visible">True</property>
a780b2
+        <property name="can_focus">False</property>
a780b2
+        <property name="orientation">vertical</property>
a780b2
+        <property name="border_width">0</property>
a780b2
+        <child>
a780b2
+          <object class="GtkOverlay" id="overlay">
a780b2
+            <property name="visible">True</property>
a780b2
+            <child type="overlay">
a780b2
+              <object class="GtkRevealer" id="notification_revealer">
a780b2
+                <property name="visible">True</property>
a780b2
+                <property name="halign">fill</property>
a780b2
+                <property name="hexpand">True</property>
a780b2
+                <property name="margin_start">20</property>
a780b2
+                <property name="margin_end">20</property>
a780b2
+                <property name="valign">start</property>
a780b2
+                <child>
a780b2
+                  <object class="GtkBox">
a780b2
+                    <property name="visible">True</property>
a780b2
+                    <property name="spacing">6</property>
a780b2
+                    <style>
a780b2
+                      <class name="app-notification"/>
a780b2
+                    </style>
a780b2
+                    <child>
a780b2
+                      <object class="GtkBox">
a780b2
+                        <property name="visible">True</property>
a780b2
+                        <property name="orientation">vertical</property>
a780b2
+                        <property name="margin_start">6</property>
a780b2
+                        <property name="margin_end">6</property>
a780b2
+                        <property name="hexpand">True</property>
a780b2
+                        <property name="halign">start</property>
a780b2
+                        <child>
a780b2
+                          <object class="GtkLabel">
a780b2
+                            <property name="visible">True</property>
a780b2
+                            <property name="halign">start</property>
a780b2
+                            <property name="wrap">True</property>
a780b2
+                            <property name="label" translatable="yes">Failed to Register System</property>
a780b2
+                            <attributes>
a780b2
+                              <attribute name="weight" value="bold"/>
a780b2
+                            </attributes>
a780b2
+                          </object>
a780b2
+                        </child>
a780b2
+                        <child>
a780b2
+                          <object class="GtkLabel" id="error_label">
a780b2
+                            <property name="visible">True</property>
a780b2
+                            <property name="xalign">0</property>
a780b2
+                            <property name="halign">start</property>
a780b2
+                            <property name="wrap">True</property>
a780b2
+                            <property name="wrap_mode">word-char</property>
a780b2
+                            <property name="label">Unable to reach developers.redhat.com. Please try again later.</property>
a780b2
+                          </object>
a780b2
+                        </child>
a780b2
+                      </object>
a780b2
+                    </child>
a780b2
+                    <child>
a780b2
+                      <object class="GtkButton" id="dismiss_button">
a780b2
+                        <property name="visible">True</property>
a780b2
+                        <property name="valign">start</property>
a780b2
+                        <signal name="clicked" handler="dismiss_notification" object="CcSubscriptionRegisterDialog" swapped="yes"/>
a780b2
+                        <style>
a780b2
+                          <class name="flat"/>
a780b2
+                        </style>
a780b2
+                        <child>
a780b2
+                          <object class="GtkImage">
a780b2
+                            <property name="visible">True</property>
a780b2
+                            <property name="icon_name">window-close-symbolic</property>
a780b2
+                          </object>
a780b2
+                        </child>
a780b2
+                      </object>
a780b2
+                    </child>
a780b2
+                  </object>
a780b2
+                </child>
a780b2
+              </object>
a780b2
+            </child>
a780b2
+            <child>
a780b2
+              <object class="GtkGrid">
a780b2
+                <property name="visible">True</property>
a780b2
+                <property name="hexpand">True</property>
a780b2
+                <property name="column_spacing">6</property>
a780b2
+                <property name="row_spacing">6</property>
a780b2
+                <property name="margin_top">24</property>
a780b2
+                <property name="margin_start">32</property>
a780b2
+                <property name="margin_end">32</property>
a780b2
+                <property name="margin_bottom">20</property>
a780b2
+                <child>
a780b2
+                  <object class="GtkLabel">
a780b2
+                    <property name="visible">True</property>
a780b2
+                    <property name="can_focus">False</property>
a780b2
+                    <property name="label" translatable="yes">Register this system with Red Hat to receive software updates.</property>
a780b2
+                    <property name="width_chars">45</property>
a780b2
+                    <property name="max_width_chars">45</property>
a780b2
+                    <property name="xalign">0</property>
a780b2
+                    <property name="halign">start</property>
a780b2
+                    <property name="wrap">True</property>
a780b2
+                    <style>
a780b2
+                      <class name="dim-label"/>
a780b2
+                    </style>
a780b2
+                  </object>
a780b2
+                  <packing>
a780b2
+                    <property name="left_attach">0</property>
a780b2
+                    <property name="top_attach">0</property>
a780b2
+                    <property name="width">2</property>
a780b2
+                  </packing>
a780b2
+                </child>
a780b2
+                <child>
a780b2
+                  <object class="GtkLabel">
a780b2
+                    <property name="visible">True</property>
a780b2
+                    <property name="can_focus">False</property>
a780b2
+                    <property name="label" translatable="yes">Registration Server</property>
a780b2
+                    <property name="margin_top">12</property>
a780b2
+                    <property name="halign">start</property>
a780b2
+                    <attributes>
a780b2
+                      <attribute name="weight" value="bold"/>
a780b2
+                    </attributes>
a780b2
+                  </object>
a780b2
+                  <packing>
a780b2
+                    <property name="left_attach">0</property>
a780b2
+                    <property name="top_attach">1</property>
a780b2
+                    <property name="width">2</property>
a780b2
+                  </packing>
a780b2
+                </child>
a780b2
+                <child>
a780b2
+                  <object class="GtkBox">
a780b2
+                    <property name="visible">True</property>
a780b2
+                    <property name="orientation">vertical</property>
a780b2
+                    <property name="margin_bottom">3</property>
a780b2
+                    <child>
a780b2
+                      <object class="GtkRadioButton" id="default_url_radio">
a780b2
+                        <property name="label" translatable="yes">Red Hat</property>
a780b2
+                        <property name="visible">True</property>
a780b2
+                        <property name="can_focus">True</property>
a780b2
+                        <property name="receives_default">False</property>
a780b2
+                        <property name="active">True</property>
a780b2
+                        <property name="draw_indicator">True</property>
a780b2
+                      </object>
a780b2
+                      <packing>
a780b2
+                        <property name="position">0</property>
a780b2
+                      </packing>
a780b2
+                    </child>
a780b2
+                    <child>
a780b2
+                      <object class="GtkRadioButton" id="custom_url_radio">
a780b2
+                        <property name="label" translatable="yes">Custom Address</property>
a780b2
+                        <property name="visible">True</property>
a780b2
+                        <property name="can_focus">True</property>
a780b2
+                        <property name="receives_default">False</property>
a780b2
+                        <property name="active">True</property>
a780b2
+                        <property name="draw_indicator">True</property>
a780b2
+                        <property name="group">default_url_radio</property>
a780b2
+                        <signal name="toggled" handler="custom_url_radio_toggled_cb" object="CcSubscriptionRegisterDialog" swapped="yes"/>
a780b2
+                      </object>
a780b2
+                      <packing>
a780b2
+                        <property name="position">1</property>
a780b2
+                      </packing>
a780b2
+                    </child>
a780b2
+                  </object>
a780b2
+                  <packing>
a780b2
+                    <property name="left_attach">0</property>
a780b2
+                    <property name="top_attach">2</property>
a780b2
+                    <property name="width">3</property>
a780b2
+                  </packing>
a780b2
+                </child>
a780b2
+                <child>
a780b2
+                  <object class="GtkLabel" id="url_label">
a780b2
+                    <property name="visible">True</property>
a780b2
+                    <property name="xalign">1</property>
a780b2
+                    <property name="label" translatable="yes">_URL</property>
a780b2
+                    <property name="sensitive">False</property>
a780b2
+                    <property name="use_underline">True</property>
a780b2
+                    <property name="mnemonic_widget">url_entry</property>
a780b2
+                    <style>
a780b2
+                      <class name="dim-label"/>
a780b2
+                    </style>
a780b2
+                  </object>
a780b2
+                  <packing>
a780b2
+                    <property name="left_attach">0</property>
a780b2
+                    <property name="top_attach">3</property>
a780b2
+                  </packing>
a780b2
+                </child>
a780b2
+                <child>
a780b2
+                  <object class="GtkEntry" id="url_entry">
a780b2
+                    <property name="visible">True</property>
a780b2
+                    <property name="sensitive">False</property>
a780b2
+                    <property name="max-length">255</property>
a780b2
+                    <property name="can_focus">True</property>
a780b2
+                    <property name="activates_default">True</property>
a780b2
+                    <property name="hexpand">True</property>
a780b2
+                    <property name="has_focus">True</property>
a780b2
+                    <signal name="changed" handler="dialog_validate" object="CcSubscriptionRegisterDialog" swapped="yes"/>
a780b2
+                    <signal name="activate" handler="dialog_validate" object="CcSubscriptionRegisterDialog" swapped="yes"/>
a780b2
+                  </object>
a780b2
+                  <packing>
a780b2
+                    <property name="left_attach">1</property>
a780b2
+                    <property name="top_attach">3</property>
a780b2
+                  </packing>
a780b2
+                </child>
a780b2
+                <child>
a780b2
+                  <object class="GtkLabel">
a780b2
+                    <property name="visible">True</property>
a780b2
+                    <property name="can_focus">False</property>
a780b2
+                    <property name="label" translatable="yes">Registration Type</property>
a780b2
+                    <property name="margin_top">12</property>
a780b2
+                    <property name="halign">start</property>
a780b2
+                    <attributes>
a780b2
+                      <attribute name="weight" value="bold"/>
a780b2
+                    </attributes>
a780b2
+                  </object>
a780b2
+                  <packing>
a780b2
+                    <property name="left_attach">0</property>
a780b2
+                    <property name="top_attach">4</property>
a780b2
+                    <property name="width">2</property>
a780b2
+                  </packing>
a780b2
+                </child>
a780b2
+                <child>
a780b2
+                  <object class="GtkBox">
a780b2
+                    <property name="visible">True</property>
a780b2
+                    <property name="orientation">vertical</property>
a780b2
+                    <child>
a780b2
+                      <object class="GtkRadioButton" id="register_radio">
a780b2
+                        <property name="label" translatable="yes">Red Hat Account</property>
a780b2
+                        <property name="visible">True</property>
a780b2
+                        <property name="can_focus">True</property>
a780b2
+                        <property name="receives_default">False</property>
a780b2
+                        <property name="active">True</property>
a780b2
+                        <property name="draw_indicator">True</property>
a780b2
+                      </object>
a780b2
+                      <packing>
a780b2
+                        <property name="position">0</property>
a780b2
+                      </packing>
a780b2
+                    </child>
a780b2
+                    <child>
a780b2
+                      <object class="GtkRadioButton" id="register_with_activation_keys_radio">
a780b2
+                        <property name="label" translatable="yes">Activation Keys</property>
a780b2
+                        <property name="visible">True</property>
a780b2
+                        <property name="can_focus">True</property>
a780b2
+                        <property name="receives_default">False</property>
a780b2
+                        <property name="active">True</property>
a780b2
+                        <property name="draw_indicator">True</property>
a780b2
+                        <property name="group">register_radio</property>
a780b2
+                        <signal name="toggled" handler="register_with_activation_keys_radio_toggled_cb" object="CcSubscriptionRegisterDialog" swapped="yes"/>
a780b2
+                      </object>
a780b2
+                      <packing>
a780b2
+                        <property name="position">1</property>
a780b2
+                      </packing>
a780b2
+                    </child>
a780b2
+                  </object>
a780b2
+                  <packing>
a780b2
+                    <property name="left_attach">0</property>
a780b2
+                    <property name="top_attach">5</property>
a780b2
+                    <property name="width">3</property>
a780b2
+                  </packing>
a780b2
+                </child>
a780b2
+                <child>
a780b2
+                  <object class="GtkStack" id="stack">
a780b2
+                    <property name="visible">True</property>
a780b2
+                    <property name="can_focus">False</property>
a780b2
+                    <property name="transition-type">none</property>
a780b2
+                    <child>
a780b2
+                      <object class="GtkGrid" id="register_grid">
a780b2
+                        <property name="visible">True</property>
a780b2
+                        <property name="hexpand">True</property>
a780b2
+                        <property name="column_spacing">6</property>
a780b2
+                        <property name="row_spacing">6</property>
a780b2
+                        <child>
a780b2
+                          <object class="GtkLabel">
a780b2
+                            <property name="visible">True</property>
a780b2
+                            <property name="can_focus">False</property>
a780b2
+                            <property name="label" translatable="yes">Registration Details</property>
a780b2
+                            <property name="margin_top">12</property>
a780b2
+                            <property name="margin_bottom">6</property>
a780b2
+                            <property name="halign">start</property>
a780b2
+                            <attributes>
a780b2
+                              <attribute name="weight" value="bold"/>
a780b2
+                            </attributes>
a780b2
+                          </object>
a780b2
+                          <packing>
a780b2
+                            <property name="left_attach">0</property>
a780b2
+                            <property name="top_attach">0</property>
a780b2
+                            <property name="width">2</property>
a780b2
+                          </packing>
a780b2
+                        </child>
a780b2
+                        <child>
a780b2
+                          <object class="GtkLabel" id="login_label">
a780b2
+                            <property name="visible">True</property>
a780b2
+                            <property name="xalign">1</property>
a780b2
+                            <property name="label" translatable="yes">_Login</property>
a780b2
+                            <property name="use_underline">True</property>
a780b2
+                            <property name="mnemonic_widget">login_entry</property>
a780b2
+                            <style>
a780b2
+                              <class name="dim-label"/>
a780b2
+                            </style>
a780b2
+                          </object>
a780b2
+                          <packing>
a780b2
+                            <property name="left_attach">0</property>
a780b2
+                            <property name="top_attach">2</property>
a780b2
+                          </packing>
a780b2
+                        </child>
a780b2
+                        <child>
a780b2
+                          <object class="GtkEntry" id="login_entry">
a780b2
+                            <property name="visible">True</property>
a780b2
+                            <property name="max-length">255</property>
a780b2
+                            <property name="can_focus">True</property>
a780b2
+                            <property name="activates_default">True</property>
a780b2
+                            <property name="hexpand">True</property>
a780b2
+                            <property name="has_focus">True</property>
a780b2
+                            <signal name="changed" handler="dialog_validate" object="CcSubscriptionRegisterDialog" swapped="yes"/>
a780b2
+                            <signal name="activate" handler="dialog_validate" object="CcSubscriptionRegisterDialog" swapped="yes"/>
a780b2
+                          </object>
a780b2
+                          <packing>
a780b2
+                            <property name="left_attach">1</property>
a780b2
+                            <property name="top_attach">2</property>
a780b2
+                          </packing>
a780b2
+                        </child>
a780b2
+                        <child>
a780b2
+                          <object class="GtkLabel" id="password_label">
a780b2
+                            <property name="visible">True</property>
a780b2
+                            <property name="can_focus">False</property>
a780b2
+                            <property name="xalign">1</property>
a780b2
+                            <property name="label" translatable="yes">_Password</property>
a780b2
+                            <property name="use_underline">True</property>
a780b2
+                            <property name="mnemonic_widget">password_entry</property>
a780b2
+                            <style>
a780b2
+                              <class name="dim-label"/>
a780b2
+                            </style>
a780b2
+                          </object>
a780b2
+                          <packing>
a780b2
+                            <property name="left_attach">0</property>
a780b2
+                            <property name="top_attach">3</property>
a780b2
+                            <property name="width">1</property>
a780b2
+                            <property name="height">1</property>
a780b2
+                          </packing>
a780b2
+                        </child>
a780b2
+                        <child>
a780b2
+                          <object class="GtkEntry" id="password_entry">
a780b2
+                            <property name="visible">True</property>
a780b2
+                            <property name="can_focus">True</property>
a780b2
+                            <property name="has_tooltip">True</property>
a780b2
+                            <property name="visibility">False</property>
a780b2
+                            <property name="invisible_char">●</property>
a780b2
+                            <property name="invisible_char_set">True</property>
a780b2
+                            <property name="hexpand">True</property>
a780b2
+                            <property name="activates_default">True</property>
a780b2
+                            <property name="input_purpose">password</property>
a780b2
+                            <signal name="notify::text" handler="dialog_validate" object="CcSubscriptionRegisterDialog" swapped="yes"/>
a780b2
+                            <signal name="activate" handler="dialog_validate" object="CcSubscriptionRegisterDialog" swapped="yes"/>
a780b2
+                          </object>
a780b2
+                          <packing>
a780b2
+                            <property name="left_attach">1</property>
a780b2
+                            <property name="top_attach">3</property>
a780b2
+                            <property name="width">1</property>
a780b2
+                            <property name="height">1</property>
a780b2
+                          </packing>
a780b2
+                        </child>
a780b2
+                        <child>
a780b2
+                          <object class="GtkLabel" id="organization_label">
a780b2
+                            <property name="visible">True</property>
a780b2
+                            <property name="xalign">1</property>
a780b2
+                            <property name="label" translatable="yes">_Organization</property>
a780b2
+                            <property name="use_underline">True</property>
a780b2
+                            <property name="mnemonic_widget">organization_entry</property>
a780b2
+                            <style>
a780b2
+                              <class name="dim-label"/>
a780b2
+                            </style>
a780b2
+                          </object>
a780b2
+                          <packing>
a780b2
+                            <property name="left_attach">0</property>
a780b2
+                            <property name="top_attach">4</property>
a780b2
+                          </packing>
a780b2
+                        </child>
a780b2
+                        <child>
a780b2
+                          <object class="GtkEntry" id="organization_entry">
a780b2
+                            <property name="visible">True</property>
a780b2
+                            <property name="max-length">255</property>
a780b2
+                            <property name="can_focus">True</property>
a780b2
+                            <property name="activates_default">True</property>
a780b2
+                            <property name="hexpand">True</property>
a780b2
+                            <property name="has_focus">True</property>
a780b2
+                            <signal name="changed" handler="dialog_validate" object="CcSubscriptionRegisterDialog" swapped="yes"/>
a780b2
+                            <signal name="activate" handler="dialog_validate" object="CcSubscriptionRegisterDialog" swapped="yes"/>
a780b2
+                          </object>
a780b2
+                          <packing>
a780b2
+                            <property name="left_attach">1</property>
a780b2
+                            <property name="top_attach">4</property>
a780b2
+                          </packing>
a780b2
+                        </child>
a780b2
+                      </object>
a780b2
+                      <packing>
a780b2
+                        <property name="name">register</property>
a780b2
+                      </packing>
a780b2
+                    </child>
a780b2
+                    <child>
a780b2
+                      <object class="GtkGrid" id="register_with_activation_keys_grid">
a780b2
+                        <property name="visible">True</property>
a780b2
+                        <property name="hexpand">True</property>
a780b2
+                        <property name="column_spacing">6</property>
a780b2
+                        <property name="row_spacing">6</property>
a780b2
+                        <child>
a780b2
+                          <object class="GtkLabel">
a780b2
+                            <property name="visible">True</property>
a780b2
+                            <property name="can_focus">False</property>
a780b2
+                            <property name="label" translatable="yes">Registration Details</property>
a780b2
+                            <property name="margin_top">12</property>
a780b2
+                            <property name="halign">start</property>
a780b2
+                            <attributes>
a780b2
+                              <attribute name="weight" value="bold"/>
a780b2
+                            </attributes>
a780b2
+                          </object>
a780b2
+                          <packing>
a780b2
+                            <property name="left_attach">0</property>
a780b2
+                            <property name="top_attach">0</property>
a780b2
+                            <property name="width">2</property>
a780b2
+                          </packing>
a780b2
+                        </child>
a780b2
+                        <child>
a780b2
+                          <object class="GtkLabel">
a780b2
+                            <property name="visible">True</property>
a780b2
+                            <property name="can_focus">False</property>
a780b2
+                            <property name="label" translatable="yes">Enter comma separated activation key(s). If the activation keys have conflicting settings, the rightmost key takes precedence.</property>
a780b2
+                            <property name="width_chars">45</property>
a780b2
+                            <property name="max_width_chars">45</property>
a780b2
+                            <property name="wrap">True</property>
a780b2
+                            <property name="xalign">0</property>
a780b2
+                            <property name="halign">start</property>
a780b2
+                            <property name="margin_bottom">6</property>
a780b2
+                            <style>
a780b2
+                              <class name="dim-label"/>
a780b2
+                            </style>
a780b2
+                          </object>
a780b2
+                          <packing>
a780b2
+                            <property name="left_attach">0</property>
a780b2
+                            <property name="top_attach">1</property>
a780b2
+                            <property name="width">2</property>
a780b2
+                          </packing>
a780b2
+                        </child>
a780b2
+                        <child>
a780b2
+                          <object class="GtkLabel" id="activation_keys_label">
a780b2
+                            <property name="visible">True</property>
a780b2
+                            <property name="xalign">1</property>
a780b2
+                            <property name="label" translatable="yes">_Activation Keys</property>
a780b2
+                            <property name="use_underline">True</property>
a780b2
+                            <property name="mnemonic_widget">activation_keys_entry</property>
a780b2
+                            <style>
a780b2
+                              <class name="dim-label"/>
a780b2
+                            </style>
a780b2
+                          </object>
a780b2
+                          <packing>
a780b2
+                            <property name="left_attach">0</property>
a780b2
+                            <property name="top_attach">2</property>
a780b2
+                          </packing>
a780b2
+                        </child>
a780b2
+                        <child>
a780b2
+                          <object class="GtkEntry" id="activation_keys_entry">
a780b2
+                            <property name="visible">True</property>
a780b2
+                            <property name="max-length">255</property>
a780b2
+                            <property name="can_focus">True</property>
a780b2
+                            <property name="activates_default">True</property>
a780b2
+                            <property name="hexpand">True</property>
a780b2
+                            <property name="has_focus">True</property>
a780b2
+                            <signal name="changed" handler="dialog_validate" object="CcSubscriptionRegisterDialog" swapped="yes"/>
a780b2
+                            <signal name="activate" handler="dialog_validate" object="CcSubscriptionRegisterDialog" swapped="yes"/>
a780b2
+                          </object>
a780b2
+                          <packing>
a780b2
+                            <property name="left_attach">1</property>
a780b2
+                            <property name="top_attach">2</property>
a780b2
+                          </packing>
a780b2
+                        </child>
a780b2
+                        <child>
a780b2
+                          <object class="GtkLabel" id="organization_label_with_activation_keys">
a780b2
+                            <property name="visible">True</property>
a780b2
+                            <property name="xalign">1</property>
a780b2
+                            <property name="label" translatable="yes">_Organization</property>
a780b2
+                            <property name="use_underline">True</property>
a780b2
+                            <property name="mnemonic_widget">organization_entry_with_activation_keys</property>
a780b2
+                            <style>
a780b2
+                              <class name="dim-label"/>
a780b2
+                            </style>
a780b2
+                          </object>
a780b2
+                          <packing>
a780b2
+                            <property name="left_attach">0</property>
a780b2
+                            <property name="top_attach">3</property>
a780b2
+                          </packing>
a780b2
+                        </child>
a780b2
+                        <child>
a780b2
+                          <object class="GtkEntry" id="organization_entry_with_activation_keys">
a780b2
+                            <property name="visible">True</property>
a780b2
+                            <property name="max-length">255</property>
a780b2
+                            <property name="can_focus">True</property>
a780b2
+                            <property name="activates_default">True</property>
a780b2
+                            <property name="hexpand">True</property>
a780b2
+                            <property name="has_focus">True</property>
a780b2
+                            <signal name="changed" handler="dialog_validate" object="CcSubscriptionRegisterDialog" swapped="yes"/>
a780b2
+                            <signal name="activate" handler="dialog_validate" object="CcSubscriptionRegisterDialog" swapped="yes"/>
a780b2
+                          </object>
a780b2
+                          <packing>
a780b2
+                            <property name="left_attach">1</property>
a780b2
+                            <property name="top_attach">3</property>
a780b2
+                          </packing>
a780b2
+                        </child>
a780b2
+                      </object>
a780b2
+                      <packing>
a780b2
+                        <property name="name">register-with-activation-keys</property>
a780b2
+                      </packing>
a780b2
+                    </child>
a780b2
+                  </object>
a780b2
+                  <packing>
a780b2
+                    <property name="left_attach">0</property>
a780b2
+                    <property name="top_attach">8</property>
a780b2
+                    <property name="width">2</property>
a780b2
+                  </packing>
a780b2
+                </child>
a780b2
+              </object>
a780b2
+            </child>
a780b2
+          </object>
a780b2
+          <packing>
a780b2
+            <property name="expand">False</property>
a780b2
+            <property name="fill">True</property>
a780b2
+            <property name="position">0</property>
a780b2
+          </packing>
a780b2
+        </child>
a780b2
+      </object>
a780b2
+    </child>
a780b2
+    <action-widgets>
a780b2
+      <action-widget response="-6">cancel_button</action-widget>
a780b2
+    </action-widgets>
a780b2
+  </template>
a780b2
+  <object class="GtkSizeGroup">
a780b2
+    <widgets>
a780b2
+      <widget name="url_label"/>
a780b2
+      <widget name="login_label"/>
a780b2
+      <widget name="password_label"/>
a780b2
+      <widget name="activation_keys_label"/>
a780b2
+      <widget name="organization_label"/>
a780b2
+      <widget name="organization_label_with_activation_keys"/>
a780b2
+    </widgets>
a780b2
+  </object>
a780b2
+  <object class="GtkSizeGroup">
a780b2
+    <widgets>
a780b2
+      <widget name="url_entry"/>
a780b2
+      <widget name="login_entry"/>
a780b2
+      <widget name="password_entry"/>
a780b2
+      <widget name="activation_keys_entry"/>
a780b2
+      <widget name="password_entry"/>
a780b2
+      <widget name="organization_entry"/>
a780b2
+      <widget name="organization_entry_with_activation_keys"/>
a780b2
+    </widgets>
a780b2
+  </object>
a780b2
+  <object class="GtkSizeGroup">
a780b2
+    <property name="mode">horizontal</property>
a780b2
+    <widgets>
a780b2
+      <widget name="register_button"/>
a780b2
+      <widget name="cancel_button"/>
a780b2
+    </widgets>
a780b2
+  </object>
a780b2
+</interface>
a780b2
diff --git a/panels/info/info-overview.ui b/panels/info/info-overview.ui
a780b2
index aa87fbec2..e33ba399a 100644
a780b2
--- a/panels/info/info-overview.ui
a780b2
+++ b/panels/info/info-overview.ui
cbd954
@@ -1,46 +1,47 @@
cbd954
 
cbd954
 <interface>
cbd954
   
a780b2
   <template class="CcInfoOverviewPanel" parent="CcPanel">
a780b2
     <property name="visible">True</property>
a780b2
     <property name="can-focus">False</property>
a780b2
-    <property name="valign">center</property>
a780b2
-    <property name="halign">center</property>
a780b2
     <property name="expand">True</property>
a780b2
-    <property name="margin">24</property>
a780b2
     <child>
a780b2
       <object class="GtkBox">
a780b2
         <property name="visible">True</property>
a780b2
         <property name="can_focus">False</property>
a780b2
         <property name="spacing">6</property>
a780b2
         <property name="orientation">vertical</property>
a780b2
+        <property name="margin_top">63</property>
a780b2
+        <property name="margin_start">12</property>
a780b2
+        <property name="margin_end">12</property>
a780b2
+        <property name="margin_bottom">12</property>
a780b2
         <child>
a780b2
           <object class="GtkImage" id="system_image">
a780b2
             <property name="visible">True</property>
cbd954
             <property name="can_focus">False</property>
cbd954
             <property name="pixel_size">128</property>
cbd954
             <property name="icon_name">fedora-logo-icon</property>
cbd954
           </object>
cbd954
           <packing>
cbd954
             <property name="expand">False</property>
cbd954
             <property name="fill">False</property>
cbd954
             <property name="position">0</property>
cbd954
           </packing>
cbd954
         </child>
cbd954
         <child>
cbd954
           <object class="GtkLabel" id="os_name_label">
cbd954
             <property name="visible">True</property>
cbd954
             <property name="can_focus">False</property>
cbd954
             <property name="label">Version 3.0</property>
cbd954
             <property name="selectable">True</property>
cbd954
             <property name="margin-bottom">24</property>
cbd954
             <attributes>
cbd954
               <attribute name="scale" value="1.25"/>
cbd954
             </attributes>
cbd954
           </object>
cbd954
           <packing>
cbd954
             <property name="expand">False</property>
cbd954
             <property name="fill">False</property>
cbd954
             <property name="position">1</property>
cbd954
           </packing>
cbd954
         </child>
cbd954
@@ -276,64 +277,181 @@
cbd954
                 <property name="label" translatable="yes">Calculating…</property>
cbd954
                 <property name="selectable">True</property>
cbd954
               </object>
cbd954
               <packing>
cbd954
                 <property name="top-attach">7</property>
cbd954
                 <property name="left-attach">2</property>
cbd954
               </packing>
cbd954
             </child>
cbd954
             <child>
cbd954
               <object class="GtkLabel" id="dummy1">
cbd954
                 <property name="visible">True</property>
cbd954
                 <property name="can_focus">False</property>
cbd954
                 <property name="label">    </property>
cbd954
               </object>
cbd954
               <packing>
cbd954
                 <property name="top-attach">1</property>
cbd954
                 <property name="left-attach">3</property>
cbd954
               </packing>
cbd954
             </child>
cbd954
             <child>
cbd954
               <placeholder/>
cbd954
             </child>
cbd954
           </object>
cbd954
           <packing>
cbd954
             <property name="expand">False</property>
cbd954
             <property name="fill">False</property>
cbd954
             <property name="position">2</property>
a780b2
           </packing>
a780b2
         </child>
a780b2
         <child>
a780b2
-          <object class="GtkButtonBox" id="hbuttonbox1">
a780b2
+          <object class="GtkBox">
a780b2
             <property name="visible">True</property>
a780b2
             <property name="can_focus">False</property>
a780b2
-            <property name="layout_style">end</property>
a780b2
             <property name="orientation">horizontal</property>
a780b2
+            <property name="margin_top">12</property>
a780b2
+            <property name="spacing">12</property>
a780b2
             <child>
a780b2
-              <placeholder/>
a780b2
+              <object class="GtkStack" id="subscription_stack">
a780b2
+                <property name="visible">True</property>
a780b2
+                <property name="can_focus">False</property>
a780b2
+                <child>
a780b2
+                  <object class="GtkBox">
a780b2
+                    <property name="visible">True</property>
a780b2
+                    <property name="can_focus">False</property>
a780b2
+                    <property name="orientation">horizontal</property>
a780b2
+                    <property name="spacing">12</property>
a780b2
+                    <child>
a780b2
+                      <object class="GtkBox">
a780b2
+                        <property name="visible">True</property>
a780b2
+                        <property name="can_focus">False</property>
a780b2
+                        <property name="orientation">vertical</property>
a780b2
+                        <child>
a780b2
+                          <object class="GtkLabel">
a780b2
+                            <property name="visible">True</property>
a780b2
+                            <property name="can_focus">False</property>
a780b2
+                            <property name="xalign">0</property>
a780b2
+                            <property name="label" translatable="yes">System Not Registered</property>
a780b2
+                            <attributes>
a780b2
+                              <attribute name="scale" value="0.95"/>
a780b2
+                              <attribute name="weight" value="bold"/>
a780b2
+                            </attributes>
a780b2
+                          </object>
a780b2
+                        </child>
a780b2
+                        <child>
a780b2
+                          <object class="GtkLabel">
a780b2
+                            <property name="visible">True</property>
a780b2
+                            <property name="can_focus">False</property>
a780b2
+                            <property name="xalign">0</property>
a780b2
+                            <property name="label" translatable="yes">Register this system to receive software updates.</property>
a780b2
+                            <attributes>
a780b2
+                              <attribute name="scale" value="0.8"/>
a780b2
+                            </attributes>
a780b2
+                          </object>
a780b2
+                        </child>
a780b2
+                      </object>
a780b2
+                    </child>
a780b2
+                    <child>
a780b2
+                      <object class="GtkButton" id="register_button">
a780b2
+                        <property name="label" translatable="yes">_Register…</property>
a780b2
+                        <property name="can_focus">True</property>
a780b2
+                        <property name="use_underline">True</property>
a780b2
+                        <property name="use_action_appearance">False</property>
a780b2
+                        <property name="hexpand">True</property>
a780b2
+                        <property name="halign">end</property>
a780b2
+                        <property name="visible">True</property>
a780b2
+                        <style>
a780b2
+                          <class name="suggested-action"/>
a780b2
+                        </style>
a780b2
+                      </object>
a780b2
+                    </child>
a780b2
+                  </object>
a780b2
+                  <packing>
a780b2
+                    <property name="name">not-registered</property>
a780b2
+                  </packing>
a780b2
+                </child>
a780b2
+                <child>
a780b2
+                  <object class="GtkBox">
a780b2
+                    <property name="visible">True</property>
a780b2
+                    <property name="can_focus">False</property>
a780b2
+                    <property name="orientation">horizontal</property>
a780b2
+                    <property name="spacing">12</property>
a780b2
+                    <child>
a780b2
+                      <object class="GtkBox">
a780b2
+                        <property name="visible">True</property>
a780b2
+                        <property name="can_focus">False</property>
a780b2
+                        <property name="orientation">vertical</property>
a780b2
+                        <child>
a780b2
+                          <object class="GtkLabel">
a780b2
+                            <property name="visible">True</property>
a780b2
+                            <property name="can_focus">False</property>
a780b2
+                            <property name="xalign">0</property>
a780b2
+                            <property name="label" translatable="yes">Registered System</property>
a780b2
+                            <attributes>
a780b2
+                              <attribute name="scale" value="0.95"/>
a780b2
+                              <attribute name="weight" value="bold"/>
a780b2
+                            </attributes>
a780b2
+                          </object>
a780b2
+                        </child>
a780b2
+                        <child>
a780b2
+                          <object class="GtkLabel">
a780b2
+                            <property name="visible">True</property>
a780b2
+                            <property name="can_focus">False</property>
a780b2
+                            <property name="xalign">0</property>
a780b2
+                            <property name="label" translatable="yes">System is registered and able to receive software updates.</property>
a780b2
+                            <attributes>
a780b2
+                              <attribute name="scale" value="0.8"/>
a780b2
+                            </attributes>
a780b2
+                          </object>
a780b2
+                        </child>
a780b2
+                      </object>
a780b2
+                    </child>
a780b2
+                    <child>
a780b2
+                      <object class="GtkButton" id="details_button">
a780b2
+                        <property name="label" translatable="yes">_Details</property>
a780b2
+                        <property name="can_focus">True</property>
a780b2
+                        <property name="use_underline">True</property>
a780b2
+                        <property name="receives_default">True</property>
a780b2
+                        <property name="use_action_appearance">False</property>
a780b2
+                        <property name="hexpand">True</property>
a780b2
+                        <property name="halign">end</property>
a780b2
+                        <property name="visible">True</property>
a780b2
+                      </object>
a780b2
+                    </child>
a780b2
+                  </object>
a780b2
+                  <packing>
a780b2
+                    <property name="name">registered</property>
a780b2
+                  </packing>
a780b2
+                </child>
a780b2
+              </object>
a780b2
+            </child>
a780b2
+            <child>
a780b2
+              <object class="GtkSeparator" id="updates_separator">
a780b2
+                <property name="visible">True</property>
a780b2
+              </object>
a780b2
             </child>
a780b2
             <child>
a780b2
               <object class="GtkButton" id="updates_button">
a780b2
-                <property name="label" translatable="yes">Check for updates</property>
a780b2
+                <property name="label" translatable="yes">_View Updates</property>
a780b2
                 <property name="can_focus">True</property>
a780b2
+                <property name="use_underline">True</property>
a780b2
                 <property name="receives_default">True</property>
a780b2
                 <property name="use_action_appearance">False</property>
a780b2
+                <property name="halign">end</property>
a780b2
                 <property name="visible">True</property>
a780b2
               </object>
a780b2
               <packing>
a780b2
-                <property name="expand">False</property>
a780b2
-                <property name="fill">True</property>
a780b2
-                <property name="position">1</property>
a780b2
+                <property name="pack_type">end</property>
a780b2
               </packing>
a780b2
             </child>
a780b2
           </object>
cbd954
           <packing>
cbd954
             <property name="expand">False</property>
cbd954
             <property name="fill">False</property>
cbd954
             <property name="pack_type">end</property>
cbd954
             <property name="position">3</property>
cbd954
           </packing>
cbd954
         </child>
cbd954
       </object>
cbd954
     </child>
cbd954
   </template>
cbd954
 </interface>
a780b2
diff --git a/panels/info/info.gresource.xml b/panels/info/info.gresource.xml
a780b2
index c96722350..15d18daac 100644
a780b2
--- a/panels/info/info.gresource.xml
a780b2
+++ b/panels/info/info.gresource.xml
cbd954
@@ -1,9 +1,11 @@
cbd954
 
cbd954
 <gresources>
cbd954
   <gresource prefix="/org/gnome/control-center/info">
a780b2
     <file preprocess="xml-stripblanks">info-overview.ui</file>
a780b2
     <file preprocess="xml-stripblanks">info-default-apps.ui</file>
a780b2
     <file preprocess="xml-stripblanks">info-removable-media.ui</file>
a780b2
+    <file preprocess="xml-stripblanks">cc-subscription-details-dialog.ui</file>
a780b2
+    <file preprocess="xml-stripblanks">cc-subscription-register-dialog.ui</file>
a780b2
     <file>GnomeLogoVerticalMedium.svg</file>
a780b2
   </gresource>
a780b2
 </gresources>
a780b2
diff --git a/panels/info/meson.build b/panels/info/meson.build
a780b2
index 13015b96c..a4ff83a42 100644
a780b2
--- a/panels/info/meson.build
a780b2
+++ b/panels/info/meson.build
cbd954
@@ -14,65 +14,69 @@ foreach name: panel_names
cbd954
     output: desktop + '.in',
cbd954
     configuration: desktop_conf
cbd954
   )
cbd954
 
cbd954
   i18n.merge_file(
cbd954
     desktop,
cbd954
     type: 'desktop',
cbd954
     input: desktop_in,
cbd954
     output: desktop,
cbd954
     po_dir: po_dir,
cbd954
     install: true,
cbd954
     install_dir: control_center_desktopdir
cbd954
   )
cbd954
 endforeach
cbd954
 
cbd954
 cflags += [
cbd954
   '-DBINDIR="@0@"'.format(control_center_bindir),
cbd954
   '-DDATADIR="@0@"'.format(control_center_datadir),
cbd954
   '-DGNOME_SESSION_DIR="@0@"'.format(gnome_session_libexecdir),
cbd954
   '-DGNOMELOCALEDIR="@0@"'.format(control_center_localedir)
cbd954
 ]
cbd954
 
cbd954
 gsd_headers = ['gsd-disk-space-helper.h']
cbd954
 
cbd954
 gsd_sources = ['gsd-disk-space-helper.c']
cbd954
 
cbd954
 sources = files(gsd_sources) + files(
a780b2
   'cc-info-default-apps-panel.c',
a780b2
   'cc-info-overview-panel.c',
a780b2
   'cc-info-removable-media-panel.c',
a780b2
+  'cc-subscription-details-dialog.c',
a780b2
+  'cc-subscription-register-dialog.c',
a780b2
   'info-cleanup.c'
a780b2
 )
a780b2
 
a780b2
 resource_data = files(
a780b2
   'GnomeLogoVerticalMedium.svg',
a780b2
+  'cc-subscription-details-dialog.ui',
a780b2
+  'cc-subscription-register-dialog.ui',
a780b2
   'info-default-apps.ui',
a780b2
   'info-overview.ui',
a780b2
   'info-removable-media.ui'
cbd954
 )
cbd954
 
cbd954
 sources += gnome.compile_resources(
cbd954
   'cc-' + cappletname + '-resources',
cbd954
   cappletname + '.gresource.xml',
cbd954
   c_name: 'cc_' + cappletname,
cbd954
   dependencies: resource_data,
cbd954
   export: true
cbd954
 )
cbd954
 
cbd954
 deps = common_deps + [
cbd954
   polkit_gobject_dep,
cbd954
   dependency('libgtop-2.0')
cbd954
 ]
cbd954
 
cbd954
 panels_libs += static_library(
cbd954
   cappletname,
cbd954
   sources: sources,
cbd954
   include_directories: top_inc,
cbd954
   dependencies: deps,
cbd954
   c_args: cflags
cbd954
 )
cbd954
 
cbd954
 test_name = 'test-info-cleanup'
cbd954
 
cbd954
 sources = files(
cbd954
   'info-cleanup.c',
a780b2
diff --git a/po/POTFILES.in b/po/POTFILES.in
a780b2
index dfd8ccff0..6cb8938e9 100644
a780b2
--- a/po/POTFILES.in
a780b2
+++ b/po/POTFILES.in
cbd954
@@ -7,60 +7,64 @@ panels/background/cc-background-item.c
cbd954
 panels/background/cc-background-panel.c
cbd954
 panels/background/gnome-background-panel.desktop.in.in
cbd954
 panels/bluetooth/bluetooth.ui
cbd954
 panels/bluetooth/cc-bluetooth-panel.c
cbd954
 panels/bluetooth/gnome-bluetooth-panel.desktop.in.in
cbd954
 panels/color/cc-color-calibrate.c
cbd954
 panels/color/cc-color-common.c
cbd954
 panels/color/cc-color-device.c
cbd954
 panels/color/cc-color-panel.c
cbd954
 panels/color/cc-color-profile.c
cbd954
 panels/color/color-calibrate.ui
cbd954
 panels/color/color.ui
cbd954
 panels/color/gnome-color-panel.desktop.in.in
cbd954
 panels/common/cc-common-language.c
cbd954
 panels/common/cc-language-chooser.c
cbd954
 panels/common/cc-util.c
cbd954
 panels/common/language-chooser.ui
cbd954
 panels/datetime/big.ui
cbd954
 panels/datetime/cc-datetime-panel.c
cbd954
 panels/datetime/datetime.ui
cbd954
 panels/datetime/gnome-datetime-panel.desktop.in.in
cbd954
 panels/datetime/little.ui
cbd954
 panels/datetime/middle.ui
cbd954
 panels/datetime/org.gnome.controlcenter.datetime.policy.in
cbd954
 panels/datetime/ydm.ui
cbd954
 panels/display/cc-display-panel.c
cbd954
 panels/display/display.ui
a780b2
 panels/display/gnome-display-panel.desktop.in.in
a780b2
 panels/info/cc-info-overview-panel.c
a780b2
 panels/info/cc-info-removable-media-panel.c
a780b2
+panels/info/cc-subscription-details-dialog.c
a780b2
+panels/info/cc-subscription-details-dialog.ui
a780b2
+panels/info/cc-subscription-register-dialog.c
a780b2
+panels/info/cc-subscription-register-dialog.ui
a780b2
 panels/info/gnome-default-apps-panel.desktop.in.in
a780b2
 panels/info/gnome-info-overview-panel.desktop.in.in
a780b2
 panels/info/gnome-removable-media-panel.desktop.in.in
cbd954
 panels/info/info-default-apps.ui
cbd954
 panels/info/info-overview.ui
cbd954
 panels/info/info-removable-media.ui
cbd954
 panels/keyboard/00-multimedia.xml.in
cbd954
 panels/keyboard/01-input-sources.xml.in
cbd954
 panels/keyboard/01-launchers.xml.in
cbd954
 panels/keyboard/01-screenshot.xml.in
cbd954
 panels/keyboard/01-system.xml.in
cbd954
 panels/keyboard/50-accessibility.xml.in
cbd954
 panels/keyboard/cc-keyboard-manager.c
cbd954
 panels/keyboard/cc-keyboard-option.c
cbd954
 panels/keyboard/cc-keyboard-panel.c
cbd954
 panels/keyboard/cc-keyboard-shortcut-editor.c
cbd954
 panels/keyboard/gnome-keyboard-panel.desktop.in.in
cbd954
 panels/keyboard/gnome-keyboard-panel.ui
cbd954
 panels/keyboard/keyboard-shortcuts.c
cbd954
 panels/keyboard/shortcut-editor.ui
cbd954
 panels/mouse/cc-mouse-panel.c
cbd954
 panels/mouse/gnome-mouse-panel.desktop.in.in
cbd954
 panels/mouse/gnome-mouse-properties.c
cbd954
 panels/mouse/gnome-mouse-properties.ui
cbd954
 panels/mouse/gnome-mouse-test.c
cbd954
 panels/mouse/gnome-mouse-test.ui
cbd954
 panels/network/cc-network-panel.c
cbd954
 panels/network/cc-wifi-panel.c
cbd954
 panels/network/connection-editor/8021x-security-page.ui
cbd954
 panels/network/connection-editor/ce-page-8021x-security.c
a780b2
-- 
cbd954
2.28.0
a780b2