[gnome-software: 2/4] Use GsInfoWindow




commit 0016ab01c9c849f99b33a1d48805ca187fb4ab7d
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Wed Sep 1 13:01:07 2021 +0200

    Use GsInfoWindow
    
    This homogeneizes and simplifies the many windows implementing this
    pattern. This doesn't apply it to GsFirstRunDialog as it doesn't have a close
    button, and hence implements a slightly different pattern.
    
    Indentation in UI files is purposefully left broken to make the change
    easier to review, and will be fixed in the next commit.

 src/gs-age-rating-context-dialog.c        | 35 ++-----------------------------
 src/gs-age-rating-context-dialog.h        |  3 ++-
 src/gs-age-rating-context-dialog.ui       | 26 +----------------------
 src/gs-app-translation-dialog.c           | 34 ++----------------------------
 src/gs-app-translation-dialog.h           |  3 ++-
 src/gs-app-translation-dialog.ui          | 25 +---------------------
 src/gs-hardware-support-context-dialog.c  | 35 ++-----------------------------
 src/gs-hardware-support-context-dialog.h  |  3 ++-
 src/gs-hardware-support-context-dialog.ui | 26 +----------------------
 src/gs-safety-context-dialog.c            | 35 ++-----------------------------
 src/gs-safety-context-dialog.h            |  3 ++-
 src/gs-safety-context-dialog.ui           | 26 +----------------------
 src/gs-storage-context-dialog.c           | 34 ++----------------------------
 src/gs-storage-context-dialog.h           |  3 ++-
 src/gs-storage-context-dialog.ui          | 26 +----------------------
 15 files changed, 25 insertions(+), 292 deletions(-)
---
diff --git a/src/gs-age-rating-context-dialog.c b/src/gs-age-rating-context-dialog.c
index c81f9ae59..135db46e4 100644
--- a/src/gs-age-rating-context-dialog.c
+++ b/src/gs-age-rating-context-dialog.c
@@ -43,7 +43,7 @@
 
 struct _GsAgeRatingContextDialog
 {
-       HdyWindow                parent_instance;
+       GsInfoWindow             parent_instance;
 
        GsApp                   *app;  /* (nullable) (owned) */
        gulong                   app_notify_handler_content_rating;
@@ -55,7 +55,7 @@ struct _GsAgeRatingContextDialog
        GtkListBox              *attributes_list;
 };
 
-G_DEFINE_TYPE (GsAgeRatingContextDialog, gs_age_rating_context_dialog, HDY_TYPE_WINDOW)
+G_DEFINE_TYPE (GsAgeRatingContextDialog, gs_age_rating_context_dialog, GS_TYPE_INFO_WINDOW)
 
 typedef enum {
        PROP_APP = 1,
@@ -751,35 +751,6 @@ sort_cb (GtkListBoxRow *row1,
        return g_strcmp0 (title1, title2);
 }
 
-static gboolean
-key_press_event_cb (GtkWidget            *sender,
-                    GdkEvent             *event,
-                    HdyPreferencesWindow *self)
-{
-       guint keyval;
-       GdkModifierType state;
-       GdkKeymap *keymap;
-       GdkEventKey *key_event = (GdkEventKey *) event;
-
-       gdk_event_get_state (event, &state);
-
-       keymap = gdk_keymap_get_for_display (gtk_widget_get_display (sender));
-
-       gdk_keymap_translate_keyboard_state (keymap,
-                                            key_event->hardware_keycode,
-                                            state,
-                                            key_event->group,
-                                            &keyval, NULL, NULL, NULL);
-
-       if (keyval == GDK_KEY_Escape) {
-               gtk_window_close (GTK_WINDOW (self));
-
-               return GDK_EVENT_STOP;
-       }
-
-       return GDK_EVENT_PROPAGATE;
-}
-
 static void
 gs_age_rating_context_dialog_init (GsAgeRatingContextDialog *self)
 {
@@ -868,8 +839,6 @@ gs_age_rating_context_dialog_class_init (GsAgeRatingContextDialogClass *klass)
        gtk_widget_class_bind_template_child (widget_class, GsAgeRatingContextDialog, lozenge);
        gtk_widget_class_bind_template_child (widget_class, GsAgeRatingContextDialog, title);
        gtk_widget_class_bind_template_child (widget_class, GsAgeRatingContextDialog, attributes_list);
-
-       gtk_widget_class_bind_template_callback (widget_class, key_press_event_cb);
 }
 
 /**
diff --git a/src/gs-age-rating-context-dialog.h b/src/gs-age-rating-context-dialog.h
index ed6c42ac5..38902f83b 100644
--- a/src/gs-age-rating-context-dialog.h
+++ b/src/gs-age-rating-context-dialog.h
@@ -15,12 +15,13 @@
 #include <gtk/gtk.h>
 
 #include "gs-app.h"
+#include "gs-info-window.h"
 
 G_BEGIN_DECLS
 
 #define GS_TYPE_AGE_RATING_CONTEXT_DIALOG (gs_age_rating_context_dialog_get_type ())
 
-G_DECLARE_FINAL_TYPE (GsAgeRatingContextDialog, gs_age_rating_context_dialog, GS, AGE_RATING_CONTEXT_DIALOG, 
HdyWindow)
+G_DECLARE_FINAL_TYPE (GsAgeRatingContextDialog, gs_age_rating_context_dialog, GS, AGE_RATING_CONTEXT_DIALOG, 
GsInfoWindow)
 
 GsAgeRatingContextDialog       *gs_age_rating_context_dialog_new               (GsApp                        
  *app);
 
diff --git a/src/gs-age-rating-context-dialog.ui b/src/gs-age-rating-context-dialog.ui
index 8e90ed419..97443f274 100644
--- a/src/gs-age-rating-context-dialog.ui
+++ b/src/gs-age-rating-context-dialog.ui
@@ -1,30 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <requires lib="gtk+" version="3.10"/>
-  <template class="GsAgeRatingContextDialog" parent="HdyWindow">
-    <property name="modal">True</property>
-    <property name="window_position">center</property>
-    <property name="destroy_with_parent">True</property>
-    <property name="icon_name">dialog-information</property>
+  <template class="GsAgeRatingContextDialog" parent="GsInfoWindow">
     <property name="title" translatable="yes" comments="Translators: This is the title of the dialog which 
contains information about the suitability of an app for different ages.">Age Rating</property>
-    <property name="type_hint">dialog</property>
-    <property name="default-width">640</property>
-    <property name="default-height">576</property>
-    <signal name="key-press-event" handler="key_press_event_cb" after="yes" swapped="no"/>
-    <style>
-      <class name="toolbox"/>
-    </style>
-
-    <child>
-      <object class="GtkOverlay">
-        <property name="visible">True</property>
-        <child type="overlay">
-          <object class="HdyHeaderBar">
-            <property name="show_close_button">True</property>
-            <property name="visible">True</property>
-            <property name="valign">start</property>
-          </object>
-        </child>
         <child>
           <object class="HdyPreferencesPage">
             <property name="visible">True</property>
@@ -125,7 +103,5 @@
             </child>
           </object>
         </child>
-      </object>
-    </child>
   </template>
 </interface>
diff --git a/src/gs-app-translation-dialog.c b/src/gs-app-translation-dialog.c
index d57a63c29..b96ac1dc3 100644
--- a/src/gs-app-translation-dialog.c
+++ b/src/gs-app-translation-dialog.c
@@ -40,7 +40,7 @@
 
 struct _GsAppTranslationDialog
 {
-       HdyWindow                parent_instance;
+       GsInfoWindow             parent_instance;
 
        GsApp                   *app;  /* (not nullable) (owned) */
        gulong                   app_notify_name_handler;
@@ -49,7 +49,7 @@ struct _GsAppTranslationDialog
        GtkLabel                *description;
 };
 
-G_DEFINE_TYPE (GsAppTranslationDialog, gs_app_translation_dialog, HDY_TYPE_WINDOW)
+G_DEFINE_TYPE (GsAppTranslationDialog, gs_app_translation_dialog, GS_TYPE_INFO_WINDOW)
 
 typedef enum {
        PROP_APP = 1,
@@ -88,35 +88,6 @@ app_notify_cb (GObject    *obj,
        update_labels (self);
 }
 
-static gboolean
-key_press_event_cb (GtkWidget            *sender,
-                    GdkEvent             *event,
-                    HdyPreferencesWindow *self)
-{
-       guint keyval;
-       GdkModifierType state;
-       GdkKeymap *keymap;
-       GdkEventKey *key_event = (GdkEventKey *) event;
-
-       gdk_event_get_state (event, &state);
-
-       keymap = gdk_keymap_get_for_display (gtk_widget_get_display (sender));
-
-       gdk_keymap_translate_keyboard_state (keymap,
-                                            key_event->hardware_keycode,
-                                            state,
-                                            key_event->group,
-                                            &keyval, NULL, NULL, NULL);
-
-       if (keyval == GDK_KEY_Escape) {
-               gtk_window_close (GTK_WINDOW (self));
-
-               return GDK_EVENT_STOP;
-       }
-
-       return GDK_EVENT_PROPAGATE;
-}
-
 static const gchar *
 get_url_for_app (GsApp *app)
 {
@@ -243,7 +214,6 @@ gs_app_translation_dialog_class_init (GsAppTranslationDialogClass *klass)
        gtk_widget_class_bind_template_child (widget_class, GsAppTranslationDialog, title);
        gtk_widget_class_bind_template_child (widget_class, GsAppTranslationDialog, description);
 
-       gtk_widget_class_bind_template_callback (widget_class, key_press_event_cb);
        gtk_widget_class_bind_template_callback (widget_class, button_clicked_cb);
 }
 
diff --git a/src/gs-app-translation-dialog.h b/src/gs-app-translation-dialog.h
index 2f1974b60..2c7353e72 100644
--- a/src/gs-app-translation-dialog.h
+++ b/src/gs-app-translation-dialog.h
@@ -15,12 +15,13 @@
 #include <gtk/gtk.h>
 
 #include "gs-app.h"
+#include "gs-info-window.h"
 
 G_BEGIN_DECLS
 
 #define GS_TYPE_APP_TRANSLATION_DIALOG (gs_app_translation_dialog_get_type ())
 
-G_DECLARE_FINAL_TYPE (GsAppTranslationDialog, gs_app_translation_dialog, GS, APP_TRANSLATION_DIALOG, 
HdyWindow)
+G_DECLARE_FINAL_TYPE (GsAppTranslationDialog, gs_app_translation_dialog, GS, APP_TRANSLATION_DIALOG, 
GsInfoWindow)
 
 GsAppTranslationDialog *gs_app_translation_dialog_new          (GsApp                  *app);
 
diff --git a/src/gs-app-translation-dialog.ui b/src/gs-app-translation-dialog.ui
index edf077a66..303e12af5 100644
--- a/src/gs-app-translation-dialog.ui
+++ b/src/gs-app-translation-dialog.ui
@@ -1,29 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <requires lib="gtk+" version="3.10"/>
-  <template class="GsAppTranslationDialog" parent="HdyWindow">
-    <property name="modal">True</property>
-    <property name="window_position">center</property>
-    <property name="destroy_with_parent">True</property>
-    <property name="icon_name">dialog-information</property>
+  <template class="GsAppTranslationDialog" parent="GsInfoWindow">
     <property name="title" translatable="yes">Translations</property>
-    <property name="type_hint">dialog</property>
-    <property name="default-width">380</property>
-    <signal name="key-press-event" handler="key_press_event_cb" after="yes" swapped="no"/>
-    <style>
-      <class name="toolbox"/>
-    </style>
-
-    <child>
-      <object class="GtkOverlay">
-        <property name="visible">True</property>
-        <child type="overlay">
-          <object class="HdyHeaderBar">
-            <property name="show_close_button">True</property>
-            <property name="visible">True</property>
-            <property name="valign">start</property>
-          </object>
-        </child>
         <child>
           <object class="HdyPreferencesPage">
             <property name="visible">True</property>
@@ -150,7 +129,5 @@
             </child>
           </object>
         </child>
-      </object>
-    </child>
   </template>
 </interface>
diff --git a/src/gs-hardware-support-context-dialog.c b/src/gs-hardware-support-context-dialog.c
index a017bd351..3ebb907f3 100644
--- a/src/gs-hardware-support-context-dialog.c
+++ b/src/gs-hardware-support-context-dialog.c
@@ -43,7 +43,7 @@
 
 struct _GsHardwareSupportContextDialog
 {
-       HdyWindow                parent_instance;
+       GsInfoWindow             parent_instance;
 
        GsApp                   *app;  /* (nullable) (owned) */
        gulong                   app_notify_handler_relations;
@@ -55,7 +55,7 @@ struct _GsHardwareSupportContextDialog
        GtkListBox              *relations_list;
 };
 
-G_DEFINE_TYPE (GsHardwareSupportContextDialog, gs_hardware_support_context_dialog, HDY_TYPE_WINDOW)
+G_DEFINE_TYPE (GsHardwareSupportContextDialog, gs_hardware_support_context_dialog, GS_TYPE_INFO_WINDOW)
 
 typedef enum {
        PROP_APP = 1,
@@ -744,35 +744,6 @@ app_notify_cb (GObject    *obj,
        update_relations_list (self);
 }
 
-static gboolean
-key_press_event_cb (GtkWidget            *sender,
-                    GdkEvent             *event,
-                    HdyPreferencesWindow *self)
-{
-       guint keyval;
-       GdkModifierType state;
-       GdkKeymap *keymap;
-       GdkEventKey *key_event = (GdkEventKey *) event;
-
-       gdk_event_get_state (event, &state);
-
-       keymap = gdk_keymap_get_for_display (gtk_widget_get_display (sender));
-
-       gdk_keymap_translate_keyboard_state (keymap,
-                                            key_event->hardware_keycode,
-                                            state,
-                                            key_event->group,
-                                            &keyval, NULL, NULL, NULL);
-
-       if (keyval == GDK_KEY_Escape) {
-               gtk_window_close (GTK_WINDOW (self));
-
-               return GDK_EVENT_STOP;
-       }
-
-       return GDK_EVENT_PROPAGATE;
-}
-
 static void
 gs_hardware_support_context_dialog_init (GsHardwareSupportContextDialog *self)
 {
@@ -858,8 +829,6 @@ gs_hardware_support_context_dialog_class_init (GsHardwareSupportContextDialogCla
        gtk_widget_class_bind_template_child (widget_class, GsHardwareSupportContextDialog, lozenge);
        gtk_widget_class_bind_template_child (widget_class, GsHardwareSupportContextDialog, title);
        gtk_widget_class_bind_template_child (widget_class, GsHardwareSupportContextDialog, relations_list);
-
-       gtk_widget_class_bind_template_callback (widget_class, key_press_event_cb);
 }
 
 /**
diff --git a/src/gs-hardware-support-context-dialog.h b/src/gs-hardware-support-context-dialog.h
index 1c9f6b99c..8983c7425 100644
--- a/src/gs-hardware-support-context-dialog.h
+++ b/src/gs-hardware-support-context-dialog.h
@@ -15,12 +15,13 @@
 #include <gtk/gtk.h>
 
 #include "gs-app.h"
+#include "gs-info-window.h"
 
 G_BEGIN_DECLS
 
 #define GS_TYPE_HARDWARE_SUPPORT_CONTEXT_DIALOG (gs_hardware_support_context_dialog_get_type ())
 
-G_DECLARE_FINAL_TYPE (GsHardwareSupportContextDialog, gs_hardware_support_context_dialog, GS, 
HARDWARE_SUPPORT_CONTEXT_DIALOG, HdyWindow)
+G_DECLARE_FINAL_TYPE (GsHardwareSupportContextDialog, gs_hardware_support_context_dialog, GS, 
HARDWARE_SUPPORT_CONTEXT_DIALOG, GsInfoWindow)
 
 GsHardwareSupportContextDialog *gs_hardware_support_context_dialog_new         (GsApp                        
  *app);
 
diff --git a/src/gs-hardware-support-context-dialog.ui b/src/gs-hardware-support-context-dialog.ui
index 36edf5293..b8084bfb6 100644
--- a/src/gs-hardware-support-context-dialog.ui
+++ b/src/gs-hardware-support-context-dialog.ui
@@ -1,30 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <requires lib="gtk+" version="3.10"/>
-  <template class="GsHardwareSupportContextDialog" parent="HdyWindow">
-    <property name="modal">True</property>
-    <property name="window_position">center</property>
-    <property name="destroy_with_parent">True</property>
-    <property name="icon_name">dialog-information</property>
+  <template class="GsHardwareSupportContextDialog" parent="GsInfoWindow">
     <property name="title" translatable="yes" comments="Translators: This is the title of the dialog which 
contains information about the hardware support/requirements of an app">Hardware Support</property>
-    <property name="type_hint">dialog</property>
-    <property name="default-width">640</property>
-    <property name="default-height">576</property>
-    <signal name="key-press-event" handler="key_press_event_cb" after="yes" swapped="no"/>
-    <style>
-      <class name="toolbox"/>
-    </style>
-
-    <child>
-      <object class="GtkOverlay">
-        <property name="visible">True</property>
-        <child type="overlay">
-          <object class="HdyHeaderBar">
-            <property name="show_close_button">True</property>
-            <property name="visible">True</property>
-            <property name="valign">start</property>
-          </object>
-        </child>
         <child>
           <object class="HdyPreferencesPage">
             <property name="visible">True</property>
@@ -124,7 +102,5 @@
             </child>
           </object>
         </child>
-      </object>
-    </child>
   </template>
 </interface>
diff --git a/src/gs-safety-context-dialog.c b/src/gs-safety-context-dialog.c
index 02cc49789..d6f579fea 100644
--- a/src/gs-safety-context-dialog.c
+++ b/src/gs-safety-context-dialog.c
@@ -42,7 +42,7 @@
 
 struct _GsSafetyContextDialog
 {
-       HdyWindow                parent_instance;
+       GsInfoWindow             parent_instance;
 
        GsApp                   *app;  /* (nullable) (owned) */
        gulong                   app_notify_handler_permissions;
@@ -64,7 +64,7 @@ struct _GsSafetyContextDialog
        GtkWidget               *sdk_row;
 };
 
-G_DEFINE_TYPE (GsSafetyContextDialog, gs_safety_context_dialog, HDY_TYPE_WINDOW)
+G_DEFINE_TYPE (GsSafetyContextDialog, gs_safety_context_dialog, GS_TYPE_INFO_WINDOW)
 
 typedef enum {
        PROP_APP = 1,
@@ -417,35 +417,6 @@ app_notify_related_cb (GObject    *obj,
        update_sdk (self);
 }
 
-static gboolean
-key_press_event_cb (GtkWidget            *sender,
-                    GdkEvent             *event,
-                    HdyPreferencesWindow *self)
-{
-       guint keyval;
-       GdkModifierType state;
-       GdkKeymap *keymap;
-       GdkEventKey *key_event = (GdkEventKey *) event;
-
-       gdk_event_get_state (event, &state);
-
-       keymap = gdk_keymap_get_for_display (gtk_widget_get_display (sender));
-
-       gdk_keymap_translate_keyboard_state (keymap,
-                                            key_event->hardware_keycode,
-                                            state,
-                                            key_event->group,
-                                            &keyval, NULL, NULL, NULL);
-
-       if (keyval == GDK_KEY_Escape) {
-               gtk_window_close (GTK_WINDOW (self));
-
-               return GDK_EVENT_STOP;
-       }
-
-       return GDK_EVENT_PROPAGATE;
-}
-
 static void
 gs_safety_context_dialog_init (GsSafetyContextDialog *self)
 {
@@ -535,8 +506,6 @@ gs_safety_context_dialog_class_init (GsSafetyContextDialogClass *klass)
        gtk_widget_class_bind_template_child (widget_class, GsSafetyContextDialog, source_label);
        gtk_widget_class_bind_template_child (widget_class, GsSafetyContextDialog, sdk_label);
        gtk_widget_class_bind_template_child (widget_class, GsSafetyContextDialog, sdk_row);
-
-       gtk_widget_class_bind_template_callback (widget_class, key_press_event_cb);
 }
 
 /**
diff --git a/src/gs-safety-context-dialog.h b/src/gs-safety-context-dialog.h
index 85e9e7322..f37e277f4 100644
--- a/src/gs-safety-context-dialog.h
+++ b/src/gs-safety-context-dialog.h
@@ -15,12 +15,13 @@
 #include <gtk/gtk.h>
 
 #include "gs-app.h"
+#include "gs-info-window.h"
 
 G_BEGIN_DECLS
 
 #define GS_TYPE_SAFETY_CONTEXT_DIALOG (gs_safety_context_dialog_get_type ())
 
-G_DECLARE_FINAL_TYPE (GsSafetyContextDialog, gs_safety_context_dialog, GS, SAFETY_CONTEXT_DIALOG, HdyWindow)
+G_DECLARE_FINAL_TYPE (GsSafetyContextDialog, gs_safety_context_dialog, GS, SAFETY_CONTEXT_DIALOG, 
GsInfoWindow)
 
 GsSafetyContextDialog  *gs_safety_context_dialog_new           (GsApp                  *app);
 
diff --git a/src/gs-safety-context-dialog.ui b/src/gs-safety-context-dialog.ui
index 3356afb68..aec2d5c14 100644
--- a/src/gs-safety-context-dialog.ui
+++ b/src/gs-safety-context-dialog.ui
@@ -1,30 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <requires lib="gtk+" version="3.10"/>
-  <template class="GsSafetyContextDialog" parent="HdyWindow">
-    <property name="modal">True</property>
-    <property name="window_position">center</property>
-    <property name="destroy_with_parent">True</property>
-    <property name="icon_name">dialog-information</property>
+  <template class="GsSafetyContextDialog" parent="GsInfoWindow">
     <property name="title" translatable="yes" comments="Translators: This is the title of the dialog which 
contains information about the permissions of an app">Safety</property>
-    <property name="type_hint">dialog</property>
-    <property name="default-width">640</property>
-    <property name="default-height">576</property>
-    <signal name="key-press-event" handler="key_press_event_cb" after="yes" swapped="no"/>
-    <style>
-      <class name="toolbox"/>
-    </style>
-
-    <child>
-      <object class="GtkOverlay">
-        <property name="visible">True</property>
-        <child type="overlay">
-          <object class="HdyHeaderBar">
-            <property name="show_close_button">True</property>
-            <property name="visible">True</property>
-            <property name="valign">start</property>
-          </object>
-        </child>
         <child>
           <object class="HdyPreferencesPage">
             <property name="visible">True</property>
@@ -273,8 +251,6 @@
             </child>
           </object>
         </child>
-      </object>
-    </child>
   </template>
 
   <object class="GtkSizeGroup" id="details_size_group">
diff --git a/src/gs-storage-context-dialog.c b/src/gs-storage-context-dialog.c
index 2d24434e8..5c3f2911f 100644
--- a/src/gs-storage-context-dialog.c
+++ b/src/gs-storage-context-dialog.c
@@ -42,7 +42,7 @@
 
 struct _GsStorageContextDialog
 {
-       HdyWindow                parent_instance;
+       GsInfoWindow             parent_instance;
 
        GsApp                   *app;  /* (nullable) (owned) */
        gulong                   app_notify_handler;
@@ -55,7 +55,7 @@ struct _GsStorageContextDialog
        GtkLabel                *manage_storage_label;
 };
 
-G_DEFINE_TYPE (GsStorageContextDialog, gs_storage_context_dialog, HDY_TYPE_WINDOW)
+G_DEFINE_TYPE (GsStorageContextDialog, gs_storage_context_dialog, GS_TYPE_INFO_WINDOW)
 
 typedef enum {
        PROP_APP = 1,
@@ -196,35 +196,6 @@ app_notify_cb (GObject    *obj,
                update_sizes_list (self);
 }
 
-static gboolean
-key_press_event_cb (GtkWidget            *sender,
-                    GdkEvent             *event,
-                    HdyPreferencesWindow *self)
-{
-       guint keyval;
-       GdkModifierType state;
-       GdkKeymap *keymap;
-       GdkEventKey *key_event = (GdkEventKey *) event;
-
-       gdk_event_get_state (event, &state);
-
-       keymap = gdk_keymap_get_for_display (gtk_widget_get_display (sender));
-
-       gdk_keymap_translate_keyboard_state (keymap,
-                                            key_event->hardware_keycode,
-                                            state,
-                                            key_event->group,
-                                            &keyval, NULL, NULL, NULL);
-
-       if (keyval == GDK_KEY_Escape) {
-               gtk_window_close (GTK_WINDOW (self));
-
-               return GDK_EVENT_STOP;
-       }
-
-       return GDK_EVENT_PROPAGATE;
-}
-
 static gboolean
 manage_storage_activate_link_cb (GtkLabel    *label,
                                  const gchar *uri,
@@ -348,7 +319,6 @@ gs_storage_context_dialog_class_init (GsStorageContextDialogClass *klass)
        gtk_widget_class_bind_template_child (widget_class, GsStorageContextDialog, sizes_list);
        gtk_widget_class_bind_template_child (widget_class, GsStorageContextDialog, manage_storage_label);
 
-       gtk_widget_class_bind_template_callback (widget_class, key_press_event_cb);
        gtk_widget_class_bind_template_callback (widget_class, manage_storage_activate_link_cb);
 }
 
diff --git a/src/gs-storage-context-dialog.h b/src/gs-storage-context-dialog.h
index 900ab6924..e1ff22b5f 100644
--- a/src/gs-storage-context-dialog.h
+++ b/src/gs-storage-context-dialog.h
@@ -15,12 +15,13 @@
 #include <gtk/gtk.h>
 
 #include "gs-app.h"
+#include "gs-info-window.h"
 
 G_BEGIN_DECLS
 
 #define GS_TYPE_STORAGE_CONTEXT_DIALOG (gs_storage_context_dialog_get_type ())
 
-G_DECLARE_FINAL_TYPE (GsStorageContextDialog, gs_storage_context_dialog, GS, STORAGE_CONTEXT_DIALOG, 
HdyWindow)
+G_DECLARE_FINAL_TYPE (GsStorageContextDialog, gs_storage_context_dialog, GS, STORAGE_CONTEXT_DIALOG, 
GsInfoWindow)
 
 GsStorageContextDialog *gs_storage_context_dialog_new          (GsApp                  *app);
 
diff --git a/src/gs-storage-context-dialog.ui b/src/gs-storage-context-dialog.ui
index d0c949639..cd6288ad8 100644
--- a/src/gs-storage-context-dialog.ui
+++ b/src/gs-storage-context-dialog.ui
@@ -1,30 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <requires lib="gtk+" version="3.10"/>
-  <template class="GsStorageContextDialog" parent="HdyWindow">
-    <property name="modal">True</property>
-    <property name="window_position">center</property>
-    <property name="destroy_with_parent">True</property>
-    <property name="icon_name">dialog-information</property>
+  <template class="GsStorageContextDialog" parent="GsInfoWindow">
     <property name="title" translatable="yes" comments="Translators: This is the title of the dialog which 
contains information about the storage or download size needed for an app">Storage</property>
-    <property name="type_hint">dialog</property>
-    <property name="default-width">640</property>
-    <property name="default-height">576</property>
-    <signal name="key-press-event" handler="key_press_event_cb" after="yes" swapped="no"/>
-    <style>
-      <class name="toolbox"/>
-    </style>
-
-    <child>
-      <object class="GtkOverlay">
-        <property name="visible">True</property>
-        <child type="overlay">
-          <object class="HdyHeaderBar">
-            <property name="show_close_button">True</property>
-            <property name="visible">True</property>
-            <property name="valign">start</property>
-          </object>
-        </child>
         <child>
           <object class="HdyPreferencesPage">
             <property name="visible">True</property>
@@ -128,8 +106,6 @@
             </child>
           </object>
         </child>
-      </object>
-    </child>
   </template>
 
   <object class="GtkSizeGroup" id="lozenge_size_group">


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]