[gnome-control-center/gbsneto/gtk4: 62/72] diagnostics: Port to GTK4




commit 4787cb0b62ffad372048736623f0df488e66b017
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Thu Oct 21 20:11:04 2021 -0300

    diagnostics: Port to GTK4
    
    A trivial one.

 panels/diagnostics/cc-diagnostics-panel.c  |  5 -----
 panels/diagnostics/cc-diagnostics-panel.ui | 26 ++++++--------------------
 panels/meson.build                         |  2 +-
 shell/cc-panel-loader.c                    |  6 +++---
 4 files changed, 10 insertions(+), 29 deletions(-)
---
diff --git a/panels/diagnostics/cc-diagnostics-panel.c b/panels/diagnostics/cc-diagnostics-panel.c
index 0ea554ee9..4ef0ae982 100644
--- a/panels/diagnostics/cc-diagnostics-panel.c
+++ b/panels/diagnostics/cc-diagnostics-panel.c
@@ -18,7 +18,6 @@
  * Author: Matthias Clasen <mclasen redhat com>
  */
 
-#include "list-box-helper.h"
 #include "cc-diagnostics-panel.h"
 #include "cc-diagnostics-resources.h"
 #include "cc-util.h"
@@ -124,10 +123,6 @@ cc_diagnostics_panel_init (CcDiagnosticsPanel *self)
 
   gtk_widget_init_template (GTK_WIDGET (self));
 
-  gtk_list_box_set_header_func (self->diagnostics_list_box,
-                                cc_list_box_update_header_func,
-                                NULL, NULL);
-
   self->privacy_settings = g_settings_new ("org.gnome.desktop.privacy");
 
   g_settings_bind (self->privacy_settings, "report-technical-problems",
diff --git a/panels/diagnostics/cc-diagnostics-panel.ui b/panels/diagnostics/cc-diagnostics-panel.ui
index 4838a63e4..f4f8d75ac 100644
--- a/panels/diagnostics/cc-diagnostics-panel.ui
+++ b/panels/diagnostics/cc-diagnostics-panel.ui
@@ -3,14 +3,11 @@
 <interface>
   <requires lib="gtk+" version="3.14"/>
   <template class="CcDiagnosticsPanel" parent="CcPanel">
-    <property name="visible">True</property>
     <child>
       <object class="GtkScrolledWindow">
-        <property name="visible">1</property>
         <property name="hscrollbar-policy">never</property>
         <child>
-          <object class="HdyClamp">
-            <property name="visible">True</property>
+          <object class="AdwClamp">
             <property name="margin_top">32</property>
             <property name="margin_bottom">32</property>
             <property name="margin_start">12</property>
@@ -18,12 +15,10 @@
 
             <child>
               <object class="GtkBox">
-                <property name="visible">1</property>
                 <property name="orientation">vertical</property>
                 <property name="hexpand">1</property>
                 <child>
                   <object class="GtkLabel">
-                    <property name="visible">1</property>
                     <property name="margin-bottom">12</property>
                     <property name="label" translatable="yes">Problem Reporting</property>
                     <property name="wrap">1</property>
@@ -36,7 +31,6 @@
                 </child>
                 <child>
                   <object class="GtkLabel" id="diagnostics_explanation_label">
-                    <property name="visible">1</property>
                     <property name="margin-bottom">12</property>
                     <property name="use-markup">1</property>
                     <property name="wrap">1</property>
@@ -46,35 +40,31 @@
                 </child>
                 <child>
                   <object class="GtkListBox" id="diagnostics_list_box">
-                    <property name="visible">1</property>
-                    <property name="can-focus">1</property>
                     <property name="selection-mode">none</property>
+                    <style>
+                      <class name="content"/>
+                    </style>
                     <child>
                       <object class="GtkListBoxRow">
-                        <property name="visible">1</property>
                         <child>
                           <object class="GtkBox">
-                            <property name="visible">1</property>
                         <property name="margin_start">12</property>
                         <property name="margin_end">12</property>
                         <property name="margin_top">12</property>
                         <property name="margin_bottom">12</property>
                             <child>
                               <object class="GtkLabel">
-                                <property name="visible">1</property>
                                 <property name="label" translatable="yes">_Automatic Problem 
Reporting</property>
+                                <property name="hexpand">True</property>
+                                <property name="vexpand">True</property>
                                 <property name="use_underline">1</property>
                                 <property name="mnemonic_widget">abrt_switch</property>
                                 <property name="xalign">0</property>
                                 <property name="valign">center</property>
                               </object>
-                              <packing>
-                                <property name="expand">1</property>
-                              </packing>
                             </child>
                             <child>
                               <object class="GtkSwitch" id="abrt_switch">
-                                <property name="visible">1</property>
                                 <property name="halign">end</property>
                                 <property name="valign">center</property>
                               </object>
@@ -83,10 +73,6 @@
                         </child>
                       </object>
                     </child>
-                    <style>
-                      <class name="view"/>
-                      <class name="frame"/>
-                    </style>
                   </object>
                 </child>
               </object>
diff --git a/panels/meson.build b/panels/meson.build
index b49f25655..57342333d 100644
--- a/panels/meson.build
+++ b/panels/meson.build
@@ -7,7 +7,7 @@ panels = [
 #  'color',
 #  'datetime',
   'default-apps',
-#  'diagnostics',
+  'diagnostics',
 #  'display',
   'info-overview',
 #  'keyboard',
diff --git a/shell/cc-panel-loader.c b/shell/cc-panel-loader.c
index 9e640f35b..a512d96cd 100644
--- a/shell/cc-panel-loader.c
+++ b/shell/cc-panel-loader.c
@@ -73,10 +73,10 @@ extern GType cc_camera_panel_get_type (void);
 extern GType cc_microphone_panel_get_type (void);
 extern GType cc_usage_panel_get_type (void);
 extern GType cc_lock_panel_get_type (void);
-//extern GType cc_diagnostics_panel_get_type (void);
+extern GType cc_diagnostics_panel_get_type (void);
 
 /* Static init functions */
-//extern void cc_diagnostics_panel_static_init_func (void);
+extern void cc_diagnostics_panel_static_init_func (void);
 #ifdef BUILD_NETWORK
 //extern void cc_wifi_panel_static_init_func (void);
 #endif /* BUILD_NETWORK */
@@ -106,7 +106,7 @@ static CcPanelLoaderVtable default_panels[] =
   //PANEL_TYPE("color",            cc_color_panel_get_type,                NULL),
   //PANEL_TYPE("datetime",         cc_date_time_panel_get_type,            NULL),
   PANEL_TYPE("default-apps",     cc_default_apps_panel_get_type,         NULL),
-  //PANEL_TYPE("diagnostics",      cc_diagnostics_panel_get_type,          
cc_diagnostics_panel_static_init_func),
+  PANEL_TYPE("diagnostics",      cc_diagnostics_panel_get_type,          
cc_diagnostics_panel_static_init_func),
   //PANEL_TYPE("display",          cc_display_panel_get_type,              NULL),
   PANEL_TYPE("info-overview",    cc_info_overview_panel_get_type,        NULL),
   //PANEL_TYPE("keyboard",         cc_keyboard_panel_get_type,             NULL),


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