[gnome-initial-setup/wip/port-to-gtk4: 16/23] parental-controls: Port to GTK4




commit 88b828c7da91374779547b53b7046ccbf3c85974
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Sat Jul 16 10:02:29 2022 -0300

    parental-controls: Port to GTK4
    
    Most of the porting work is done in libmalcontent-ui [1] already,
    this page merely consumes the available widgetry.
    
    [1]
    https://gitlab.freedesktop.org/pwithnall/malcontent/-/merge_requests/141

 gnome-initial-setup/gnome-initial-setup.c          |  6 ++---
 gnome-initial-setup/meson.build                    |  4 +--
 gnome-initial-setup/pages/meson.build              |  6 ++---
 .../gis-parental-controls-page.ui                  | 29 ++++++++++++----------
 meson.build                                        |  6 +++--
 subprojects/malcontent-ui.wrap                     |  3 +++
 6 files changed, 31 insertions(+), 23 deletions(-)
---
diff --git a/gnome-initial-setup/gnome-initial-setup.c b/gnome-initial-setup/gnome-initial-setup.c
index e5684eb8..81df2499 100644
--- a/gnome-initial-setup/gnome-initial-setup.c
+++ b/gnome-initial-setup/gnome-initial-setup.c
@@ -38,7 +38,7 @@
 #include "pages/software/gis-software-page.h"
 #include "pages/goa/gis-goa-page.h"
 #include "pages/account/gis-account-pages.h"
-//#include "pages/parental-controls/gis-parental-controls-page.h"
+#include "pages/parental-controls/gis-parental-controls-page.h"
 #include "pages/password/gis-password-page.h"
 #include "pages/summary/gis-summary-page.h"
 
@@ -73,8 +73,8 @@ static PageData page_table[] = {
   PAGE (account,  TRUE),
   PAGE (password, TRUE),
 #ifdef HAVE_PARENTAL_CONTROLS
-  //PAGE (parental_controls, TRUE),
-  //PAGE (parent_password, TRUE),
+  PAGE (parental_controls, TRUE),
+  PAGE (parent_password, TRUE),
 #endif
   PAGE (summary,  FALSE),
   { NULL },
diff --git a/gnome-initial-setup/meson.build b/gnome-initial-setup/meson.build
index 6bd8d8aa..3c057e32 100644
--- a/gnome-initial-setup/meson.build
+++ b/gnome-initial-setup/meson.build
@@ -70,8 +70,8 @@ dependencies = [
     dependency ('rest-1.0'),
     dependency ('webkit2gtk-5.0'),
     ibus_dep,
-    #libmalcontent_dep,
-    #libmalcontent_ui_dep,
+    libmalcontent_dep,
+    libmalcontent_ui_dep,
     libadwaita_dep,
 ]
 
diff --git a/gnome-initial-setup/pages/meson.build b/gnome-initial-setup/pages/meson.build
index 63e33d0c..32305018 100644
--- a/gnome-initial-setup/pages/meson.build
+++ b/gnome-initial-setup/pages/meson.build
@@ -12,9 +12,9 @@ pages = [
    'welcome',
 ]
 
-#if libmalcontent_dep.found() and libmalcontent_ui_dep.found()
-#  pages += 'parental-controls'
-#endif
+if libmalcontent_dep.found() and libmalcontent_ui_dep.found()
+  pages += 'parental-controls'
+endif
 
 foreach page: pages
     subdir (page)
diff --git a/gnome-initial-setup/pages/parental-controls/gis-parental-controls-page.ui 
b/gnome-initial-setup/pages/parental-controls/gis-parental-controls-page.ui
index 8187632d..5efdbd16 100644
--- a/gnome-initial-setup/pages/parental-controls/gis-parental-controls-page.ui
+++ b/gnome-initial-setup/pages/parental-controls/gis-parental-controls-page.ui
@@ -3,23 +3,26 @@
   <!-- interface-requires gtk+ 3.0 -->
   <template class="GisParentalControlsPage" parent="GisPage">
     <child>
-      <object class="GtkBox" id="page">
-        <property name="visible">True</property>
-        <property name="halign">center</property>
-        <property name="valign">fill</property>
-        <property name="orientation">vertical</property>
+      <object class="AdwPreferencesPage">
+
         <child>
-          <object class="GisPageHeader" id="header">
-            <property name="visible">True</property>
-            <property name="margin-top">24</property>
-            <!-- title and subtitle are set in code, so are not set here -->
-            <property name="icon-name">dialog-password-symbolic</property>
-            <property name="show-icon" bind-source="GisParentalControlsPage" bind-property="small-screen" 
bind-flags="invert-boolean|sync-create"/>
+          <object class="AdwPreferencesGroup">
+            <child>
+              <object class="GisPageHeader" id="header">
+                <property name="margin-top">24</property>
+                <!-- title and subtitle are set in code, so are not set here -->
+                <property name="icon-name">dialog-password-symbolic</property>
+                <property name="show-icon" bind-source="GisParentalControlsPage" 
bind-property="small-screen" bind-flags="invert-boolean|sync-create"/>
+              </object>
+            </child>
           </object>
         </child>
+
         <child>
-          <object class="MctUserControls" id="user_controls">
-            <property name="visible">True</property>
+          <object class="AdwPreferencesGroup">
+            <child>
+              <object class="MctUserControls" id="user_controls" />
+            </child>
           </object>
         </child>
       </object>
diff --git a/meson.build b/meson.build
index 51406bc4..17df0edf 100644
--- a/meson.build
+++ b/meson.build
@@ -58,8 +58,10 @@ libmalcontent_dep = dependency ('malcontent-0',
                                 version: '>= 0.6.0',
                                 required: get_option('parental_controls'))
 libmalcontent_ui_dep = dependency ('malcontent-ui-0',
-                                   version: '>= 0.6.0',
-                                   required: get_option('parental_controls'))
+                                   version: '>= 0.11.0',
+                                   required: get_option('parental_controls'),
+                                   fallback: ['malcontent-ui', 'libmalcontent_ui_dep'],
+                                   default_options: ['use_system_libmalcontent=true'])
 have_parental_controls = libmalcontent_dep.found() and libmalcontent_ui_dep.found()
 conf.set('HAVE_PARENTAL_CONTROLS', have_parental_controls)
 
diff --git a/subprojects/malcontent-ui.wrap b/subprojects/malcontent-ui.wrap
new file mode 100644
index 00000000..072642ad
--- /dev/null
+++ b/subprojects/malcontent-ui.wrap
@@ -0,0 +1,3 @@
+[wrap-git]
+url = https://gitlab.freedesktop.org/pwithnall/malcontent.git
+revision = 2f64f3865eef635626e7afeae6a532b29e0fe574
\ No newline at end of file


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