libmalcontent-ui: Move widgets over from malcontent-control

They need to be re-used in gnome-initial-setup. The other widgets which
remain in malcontent-control don’t need to be used in g-i-s so can stay
where they are for now. They might move across to libmalcontent-ui later
if there’s a need for it.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Philip Withnall 2020-01-30 11:43:46 +00:00
parent 3289a37317
commit 1f3f0a4560
18 changed files with 29 additions and 25 deletions

View File

@ -2,5 +2,8 @@
<!-- Copyright © 2020 Endless Mobile, Inc. --> <!-- Copyright © 2020 Endless Mobile, Inc. -->
<gresources> <gresources>
<gresource prefix="/org/freedesktop/MalcontentUi/ui"> <gresource prefix="/org/freedesktop/MalcontentUi/ui">
<file preprocess="xml-stripblanks">restrict-applications-dialog.ui</file>
<file preprocess="xml-stripblanks">restrict-applications-selector.ui</file>
<file preprocess="xml-stripblanks">user-controls.ui</file>
</gresource> </gresource>
</gresources> </gresources>

View File

@ -22,3 +22,6 @@
#pragma once #pragma once
#include <libmalcontent-ui/restrict-applications-dialog.h>
#include <libmalcontent-ui/restrict-applications-selector.h>
#include <libmalcontent-ui/user-controls.h>

View File

@ -12,11 +12,19 @@ resources = gnome.compile_resources(
) )
libmalcontent_ui_sources = [ libmalcontent_ui_sources = [
'gs-content-rating.c',
'restrict-applications-dialog.c',
'restrict-applications-selector.c',
'user-controls.c',
] + resources ] + resources
libmalcontent_ui_headers = [ libmalcontent_ui_headers = [
'malcontent-ui.h', 'malcontent-ui.h',
'restrict-applications-dialog.h',
'restrict-applications-selector.h',
'user-controls.h',
] ]
libmalcontent_ui_private_headers = [ libmalcontent_ui_private_headers = [
'gs-content-rating.h',
] ]
libmalcontent_ui_public_deps = [ libmalcontent_ui_public_deps = [
@ -83,6 +91,9 @@ if xmllint.found()
'--nonet', '--noblanks', '--noout', '--nonet', '--noblanks', '--noout',
'--relaxng', join_paths(gtk_prefix, 'share', 'gtk-3.0', 'gtkbuilder.rng'), '--relaxng', join_paths(gtk_prefix, 'share', 'gtk-3.0', 'gtkbuilder.rng'),
files( files(
'restrict-applications-dialog.ui',
'restrict-applications-selector.ui',
'user-controls.ui',
), ),
], ],
suite: ['libmalcontent-ui'], suite: ['libmalcontent-ui'],

View File

@ -186,7 +186,7 @@ mct_restrict_applications_dialog_class_init (MctRestrictApplicationsDialogClass
g_object_class_install_properties (object_class, G_N_ELEMENTS (properties), properties); g_object_class_install_properties (object_class, G_N_ELEMENTS (properties), properties);
gtk_widget_class_set_template_from_resource (widget_class, "/org/freedesktop/MalcontentControl/ui/restrict-applications-dialog.ui"); gtk_widget_class_set_template_from_resource (widget_class, "/org/freedesktop/MalcontentUi/ui/restrict-applications-dialog.ui");
gtk_widget_class_bind_template_child (widget_class, MctRestrictApplicationsDialog, selector); gtk_widget_class_bind_template_child (widget_class, MctRestrictApplicationsDialog, selector);
gtk_widget_class_bind_template_child (widget_class, MctRestrictApplicationsDialog, description); gtk_widget_class_bind_template_child (widget_class, MctRestrictApplicationsDialog, description);

View File

@ -209,7 +209,7 @@ mct_restrict_applications_selector_class_init (MctRestrictApplicationsSelectorCl
g_cclosure_marshal_VOID__VOID, g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0); G_TYPE_NONE, 0);
gtk_widget_class_set_template_from_resource (widget_class, "/org/freedesktop/MalcontentControl/ui/restrict-applications-selector.ui"); gtk_widget_class_set_template_from_resource (widget_class, "/org/freedesktop/MalcontentUi/ui/restrict-applications-selector.ui");
gtk_widget_class_bind_template_child (widget_class, MctRestrictApplicationsSelector, listbox); gtk_widget_class_bind_template_child (widget_class, MctRestrictApplicationsSelector, listbox);
} }

View File

@ -749,7 +749,7 @@ mct_user_controls_class_init (MctUserControlsClass *klass)
g_object_class_install_properties (object_class, N_PROPS, properties); g_object_class_install_properties (object_class, N_PROPS, properties);
gtk_widget_class_set_template_from_resource (widget_class, "/org/freedesktop/MalcontentControl/ui/user-controls.ui"); gtk_widget_class_set_template_from_resource (widget_class, "/org/freedesktop/MalcontentUi/ui/user-controls.ui");
gtk_widget_class_bind_template_child (widget_class, MctUserControls, age_menu); gtk_widget_class_bind_template_child (widget_class, MctUserControls, age_menu);
gtk_widget_class_bind_template_child (widget_class, MctUserControls, allow_system_installation_switch); gtk_widget_class_bind_template_child (widget_class, MctUserControls, allow_system_installation_switch);

View File

@ -27,10 +27,10 @@
#include <glib/gi18n-lib.h> #include <glib/gi18n-lib.h>
#include <gio/gio.h> #include <gio/gio.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <libmalcontent-ui/malcontent-ui.h>
#include <polkit/polkit.h> #include <polkit/polkit.h>
#include "application.h" #include "application.h"
#include "user-controls.h"
#include "user-selector.h" #include "user-selector.h"

View File

@ -5,9 +5,6 @@
<file>carousel.css</file> <file>carousel.css</file>
<file preprocess="xml-stripblanks">carousel.ui</file> <file preprocess="xml-stripblanks">carousel.ui</file>
<file preprocess="xml-stripblanks">main.ui</file> <file preprocess="xml-stripblanks">main.ui</file>
<file preprocess="xml-stripblanks">restrict-applications-dialog.ui</file>
<file preprocess="xml-stripblanks">restrict-applications-selector.ui</file>
<file preprocess="xml-stripblanks">user-controls.ui</file>
<file preprocess="xml-stripblanks">user-selector.ui</file> <file preprocess="xml-stripblanks">user-selector.ui</file>
</gresource> </gresource>
</gresources> </gresources>

View File

@ -16,15 +16,7 @@ malcontent_control = executable('malcontent-control',
'application.h', 'application.h',
'carousel.c', 'carousel.c',
'carousel.h', 'carousel.h',
'gs-content-rating.c',
'gs-content-rating.h',
'main.c', 'main.c',
'restrict-applications-dialog.c',
'restrict-applications-dialog.h',
'restrict-applications-selector.c',
'restrict-applications-selector.h',
'user-controls.c',
'user-controls.h',
'user-image.c', 'user-image.c',
'user-image.h', 'user-image.h',
'user-selector.c', 'user-selector.c',
@ -39,6 +31,7 @@ malcontent_control = executable('malcontent-control',
dependency('flatpak'), dependency('flatpak'),
dependency('polkit-gobject-1'), dependency('polkit-gobject-1'),
libmalcontent_dep, libmalcontent_dep,
libmalcontent_ui_dep,
], ],
include_directories: root_inc, include_directories: root_inc,
install: true, install: true,
@ -95,9 +88,6 @@ if xmllint.found()
files( files(
'carousel.ui', 'carousel.ui',
'main.ui', 'main.ui',
'restrict-applications-dialog.ui',
'restrict-applications-selector.ui',
'user-controls.ui',
'user-selector.ui', 'user-selector.ui',
), ),
], ],

View File

@ -2,16 +2,16 @@
# Please keep this file sorted alphabetically. # Please keep this file sorted alphabetically.
accounts-service/com.endlessm.ParentalControls.policy.in accounts-service/com.endlessm.ParentalControls.policy.in
libmalcontent/manager.c libmalcontent/manager.c
libmalcontent-ui/gs-content-rating.c
libmalcontent-ui/restrict-applications-dialog.c
libmalcontent-ui/restrict-applications-dialog.ui
libmalcontent-ui/restrict-applications-selector.c
libmalcontent-ui/restrict-applications-selector.ui
libmalcontent-ui/user-controls.c
libmalcontent-ui/user-controls.ui
malcontent-control/application.c malcontent-control/application.c
malcontent-control/gs-content-rating.c
malcontent-control/main.ui malcontent-control/main.ui
malcontent-control/org.freedesktop.MalcontentControl.appdata.xml.in malcontent-control/org.freedesktop.MalcontentControl.appdata.xml.in
malcontent-control/org.freedesktop.MalcontentControl.desktop.in malcontent-control/org.freedesktop.MalcontentControl.desktop.in
malcontent-control/org.freedesktop.MalcontentControl.policy.in malcontent-control/org.freedesktop.MalcontentControl.policy.in
malcontent-control/restrict-applications-dialog.c
malcontent-control/restrict-applications-dialog.ui
malcontent-control/restrict-applications-selector.c
malcontent-control/restrict-applications-selector.ui
malcontent-control/user-controls.c
malcontent-control/user-controls.ui
pam/pam_malcontent.c pam/pam_malcontent.c