MalcontentUi.UserControls

g Adw.Bin Adw.Bin MalcontentUi.UserControls MalcontentUi.UserControls Adw.Bin->MalcontentUi.UserControls GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Gtk.Widget->Adw.Bin

Subclasses:

None

Methods

Inherited:

Adw.Bin (3), Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

build_app_filter (builder)

get_app_filter ()

get_permission ()

get_user ()

get_user_account_type ()

get_user_display_name ()

get_user_locale ()

set_app_filter (app_filter)

set_description (description)

set_permission (permission)

set_user (user)

set_user_account_type (user_account_type)

set_user_display_name (user_display_name)

set_user_locale (user_locale)

Virtual Methods

Inherited:

Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)

Properties

Inherited:

Adw.Bin (1), Gtk.Widget (34), Gtk.Accessible (1)

Name

Type

Flags

Short Description

app-filter

Malcontent.AppFilter

r/w/en

The user’s current app filter, used to set up the user controls, or None if unknown.

dbus-connection

Gio.DBusConnection

r/w/co/en

A connection to the system bus.

description

str

r/w/en

The description for the currently selected user account, or None if no user is selected.

permission

Gio.Permission

r/w/en

Permission to change parental controls

user

AccountsService.User

r/w/en

User

user-account-type

AccountsService.UserAccountType

r/w/en

The type of the currently selected user account.

user-display-name

str

r/w/en

The display name for the currently selected user account, or None if no user is selected.

user-locale

str

r/w/en

The locale for the currently selected user account, or None if no user is selected.

Signals

Inherited:

Gtk.Widget (13), GObject.Object (1)

Fields

Inherited:

Gtk.Widget (13), GObject.Object (1)

Class Details

class MalcontentUi.UserControls(**kwargs)
Bases:

Adw.Bin

Abstract:

No

Structure:

MalcontentUi.UserControlsClass

A group of widgets which allow setting the parental controls for a given user.

If MalcontentUi.UserControls :user is set, the current parental controls settings for that user will be loaded and displayed, and any changes made via the controls will be automatically saved for that user (potentially after a short timeout).

If MalcontentUi.UserControls :user is unset (for example, if setting the parental controls for a user account which hasn’t yet been created), the controls can be initialised by setting:

When MalcontentUi.UserControls :user is unset, changes made to the parental controls cannot be saved automatically, and must be queried using MalcontentUi.UserControls.build_app_filter(), then saved by the calling code.

As parental controls are system settings, privileges are needed to view and edit them (for the current user or for other users). These can be acquired using polkit. MalcontentUi.UserControls :permission is used to query the current permissions for getting/setting parental controls. If it’s None, or if permissions are not currently granted, the MalcontentUi.UserControls will be insensitive.

New in version 0.5.0.

build_app_filter(builder)
Parameters:

builder (Malcontent.AppFilterBuilder) – an existing Malcontent.AppFilterBuilder to modify

Get the app filter settings currently configured in the user controls, by modifying the given builder. This can be used to save the settings manually.

New in version 0.5.0.

get_app_filter()
Returns:

the initial app filter used to populate the user controls, or None if unknown

Return type:

Malcontent.AppFilter or None

Get the value of MalcontentUi.UserControls :app-filter. If the app filter is unknown or could not be retrieved from MalcontentUi.UserControls :user, this will be None.

New in version 0.5.0.

get_permission()
Returns:

a Gio.Permission indicating whether the current user has permission to view or change parental controls, or None if permission is not allowed or is unknown

Return type:

Gio.Permission or None

Get the value of MalcontentUi.UserControls :permission.

New in version 0.5.0.

get_user()
Returns:

the user the controls are configured for, or None if unknown

Return type:

AccountsService.User or None

Get the value of MalcontentUi.UserControls :user.

New in version 0.5.0.

get_user_account_type()
Returns:

the account type of the user the controls are configured for

Return type:

AccountsService.UserAccountType

Get the value of MalcontentUi.UserControls :user-account-type.

New in version 0.5.0.

get_user_display_name()
Returns:

the display name of the user the controls are configured for, or None if unknown

Return type:

str or None

Get the value of MalcontentUi.UserControls :user-display-name.

New in version 0.5.0.

get_user_locale()
Returns:

the locale of the user the controls are configured for, or None if unknown

Return type:

str or None

Get the value of MalcontentUi.UserControls :user-locale.

New in version 0.5.0.

set_app_filter(app_filter)
Parameters:

app_filter (Malcontent.AppFilter or None) – the app filter to configure the user controls from, or None if unknown

Set the value of MalcontentUi.UserControls :app-filter.

This will overwrite any user changes to the controls, so they should be saved first using MalcontentUi.UserControls.build_app_filter() if desired. They will be saved automatically if MalcontentUi.UserControls :user is set.

New in version 0.5.0.

set_description(description)
Parameters:

description (str or None) – the description shown above the controls, or None if none.

Set the value of MalcontentUi.UserControls :description.

New in version 0.11.0.

set_permission(permission)
Parameters:

permission (Gio.Permission or None) – the Gio.Permission indicating whether the current user has permission to view or change parental controls, or None if permission is not allowed or is unknown

Set the value of MalcontentUi.UserControls :permission.

New in version 0.5.0.

set_user(user)
Parameters:

user (AccountsService.User or None) – the user to configure the controls for, or None if unknown

Set the value of MalcontentUi.UserControls :user.

New in version 0.5.0.

set_user_account_type(user_account_type)
Parameters:

user_account_type (AccountsService.UserAccountType) – the account type of the user to configure the controls for

Set the value of MalcontentUi.UserControls :user-account-type.

New in version 0.5.0.

set_user_display_name(user_display_name)
Parameters:

user_display_name (str or None) – the display name of the user to configure the controls for, or None if unknown

Set the value of MalcontentUi.UserControls :user-display-name.

New in version 0.5.0.

set_user_locale(user_locale)
Parameters:

user_locale (str or None) – the locale of the user to configure the controls for, or None if unknown

Set the value of MalcontentUi.UserControls :user-locale.

New in version 0.5.0.

Property Details

MalcontentUi.UserControls.props.app_filter
Name:

app-filter

Type:

Malcontent.AppFilter

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The user’s current app filter, used to set up the user controls. As app filters are immutable, it is not updated as the user controls are changed. Use MalcontentUi.UserControls.build_app_filter() to build the new app filter.

This may be None if the app filter is unknown, or if querying it from MalcontentUi.UserControls :user fails.

New in version 0.5.0.

MalcontentUi.UserControls.props.dbus_connection
Name:

dbus-connection

Type:

Gio.DBusConnection

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY, EXPLICIT_NOTIFY

A connection to the system bus. This will be used for retrieving details of user accounts, and must be provided at construction time.

New in version 0.7.0.

MalcontentUi.UserControls.props.description
Name:

description

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The description for the currently selected user account, or None if no user is selected.

If set, it must be valid UTF-8 and non-empty.

New in version 0.11.0.

MalcontentUi.UserControls.props.permission
Name:

permission

Type:

Gio.Permission

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Permission to change parental controls

MalcontentUi.UserControls.props.user
Name:

user

Type:

AccountsService.User

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

User

MalcontentUi.UserControls.props.user_account_type
Name:

user-account-type

Type:

AccountsService.UserAccountType

Default Value:

AccountsService.UserAccountType.STANDARD

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The type of the currently selected user account.

New in version 0.5.0.

MalcontentUi.UserControls.props.user_display_name
Name:

user-display-name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The display name for the currently selected user account, or None if no user is selected. This will typically be the user’s full name (if known) or their username.

If set, it must be valid UTF-8 and non-empty.

New in version 0.5.0.

MalcontentUi.UserControls.props.user_locale
Name:

user-locale

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The locale for the currently selected user account, or None if no user is selected.

If set, it must be in the format documented by setlocale()): `` language[_territory][.codeset][@modifier] `` where language is an ISO 639 language code, territory is an ISO 3166 country code, and codeset is a character set or encoding identifier like ISO-8859-1 or UTF-8.

New in version 0.5.0.