Merge branch 'csm-guidance' into 'master'

malcontent-control: Add link to guidance on how to set parental controls

See merge request pwithnall/malcontent!103
This commit is contained in:
Philip Withnall 2020-12-08 12:18:07 +00:00
commit 854ea21fb4
3 changed files with 49 additions and 8 deletions

View File

@ -4,7 +4,6 @@
<requires lib="gtk+" version="3.12"/> <requires lib="gtk+" version="3.12"/>
<template class="MctUserControls" parent="GtkGrid"> <template class="MctUserControls" parent="GtkGrid">
<property name="visible">True</property> <property name="visible">True</property>
<property name="margin-top">18</property>
<property name="row-spacing">6</property> <property name="row-spacing">6</property>
<property name="column-spacing">12</property> <property name="column-spacing">12</property>
<property name="valign">start</property> <property name="valign">start</property>

View File

@ -80,6 +80,7 @@ struct _MctApplication
GtkLabel *error_message; GtkLabel *error_message;
GtkLockButton *lock_button; GtkLockButton *lock_button;
GtkButton *user_accounts_panel_button; GtkButton *user_accounts_panel_button;
GtkLabel *help_label;
}; };
G_DEFINE_TYPE (MctApplication, mct_application, GTK_TYPE_APPLICATION) G_DEFINE_TYPE (MctApplication, mct_application, GTK_TYPE_APPLICATION)
@ -211,6 +212,7 @@ mct_application_activate (GApplication *application)
self->error_message = GTK_LABEL (gtk_builder_get_object (builder, "error_message")); self->error_message = GTK_LABEL (gtk_builder_get_object (builder, "error_message"));
self->lock_button = GTK_LOCK_BUTTON (gtk_builder_get_object (builder, "lock_button")); self->lock_button = GTK_LOCK_BUTTON (gtk_builder_get_object (builder, "lock_button"));
self->user_accounts_panel_button = GTK_BUTTON (gtk_builder_get_object (builder, "user_accounts_panel_button")); self->user_accounts_panel_button = GTK_BUTTON (gtk_builder_get_object (builder, "user_accounts_panel_button"));
self->help_label = GTK_LABEL (gtk_builder_get_object (builder, "help_label"));
/* Connect signals. */ /* Connect signals. */
g_signal_connect_object (self->user_selector, "notify::user", g_signal_connect_object (self->user_selector, "notify::user",
@ -391,6 +393,24 @@ update_main_stack (MctApplication *self)
} }
else if (is_permission_loaded && is_user_manager_loaded) else if (is_permission_loaded && is_user_manager_loaded)
{ {
g_autofree gchar *help_label = NULL;
/* Translators: Replace the link to commonsensemedia.org with some
* localised guidance for parents/carers on how to set restrictions on
* their child/caree in a responsible way which is in keeping with the
* best practice and culture of the region. If no suitable localised
* guidance exists, and if the default commonsensemedia.org link is not
* suitable, please file an issue against malcontent so we can discuss
* further!
* https://gitlab.freedesktop.org/pwithnall/malcontent/-/issues/new
*/
help_label = g_strdup_printf (_("Its recommended that restrictions are "
"set as part of an ongoing conversation "
"with %s. <a href='https://www.commonsensemedia.org/privacy-and-internet-safety'>"
"Read guidance</a> on what to consider."),
act_user_get_real_name (selected_user));
gtk_label_set_markup (self->help_label, help_label);
mct_user_controls_set_user (self->user_controls, selected_user); mct_user_controls_set_user (self->user_controls, selected_user);
new_page_name = "controls"; new_page_name = "controls";

View File

@ -3,8 +3,8 @@
<interface> <interface>
<requires lib="gtk+" version="3.12"/> <requires lib="gtk+" version="3.12"/>
<object class="GtkApplicationWindow" id="main_window"> <object class="GtkApplicationWindow" id="main_window">
<property name="default-width">500</property> <property name="default-width">540</property>
<property name="default-height">520</property> <property name="default-height">580</property>
<child type="titlebar"> <child type="titlebar">
<object class="GtkHeaderBar" id="header"> <object class="GtkHeaderBar" id="header">
<property name="show-close-button">True</property> <property name="show-close-button">True</property>
@ -55,16 +55,38 @@
<object class="GtkScrolledWindow"> <object class="GtkScrolledWindow">
<property name="visible">True</property> <property name="visible">True</property>
<property name="hscrollbar-policy">never</property> <property name="hscrollbar-policy">never</property>
<property name="min-content-height">350</property> <property name="min-content-height">370</property>
<child>
<object class="GtkBox">
<property name="margin">18</property>
<property name="orientation">vertical</property>
<property name="spacing">18</property>
<property name="visible">True</property>
<child>
<object class="GtkLabel" id="help_label">
<!-- Content is set in code; this string is just a placeholder -->
<property name="label">Its recommended that restrictions are set as part of an ongoing conversation with $name. Read guidance on what to consider.</property>
<property name="visible">True</property>
<property name="wrap">True</property>
<property name="xalign">0.0</property>
<property name="yalign">0.0</property>
<child internal-child="accessible">
<object class="AtkObject">
<property name="AtkObject::accessible-role">static</property>
</object>
</child>
</object>
</child>
<child> <child>
<object class="MctUserControls" id="user_controls"> <object class="MctUserControls" id="user_controls">
<property name="halign">center</property> <property name="halign">center</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="margin">12</property>
<property name="dbus-connection">dbus_connection</property> <property name="dbus-connection">dbus_connection</property>
</object> </object>
</child> </child>
</object> </object>
</child>
</object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
</packing> </packing>