MalcontentUi.UserControls¶
- Subclasses:
None
Methods¶
- Inherited:
Adw.Bin (3), Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1)
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
The user’s current app filter, used to set up the user controls, or |
||
r/w/co/en |
A connection to the system bus. |
||
r/w/en |
The description for the currently selected user account, or |
||
r/w/en |
Permission to change parental controls |
||
r/w/en |
User |
||
r/w/en |
The type of the currently selected user account. |
||
r/w/en |
The display name for the currently selected user account, or |
||
r/w/en |
The locale for the currently selected user account, or |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class MalcontentUi.UserControls(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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 usingMalcontentUi.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’sNone
, or if permissions are not currently granted, theMalcontentUi.UserControls
will be insensitive.New in version 0.5.0.
- build_app_filter(builder)¶
- Parameters:
builder (
Malcontent.AppFilterBuilder
) – an existingMalcontent.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:
Get the value of
MalcontentUi.UserControls
:app-filter
. If the app filter is unknown or could not be retrieved fromMalcontentUi.UserControls
:user
, this will beNone
.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, orNone
if permission is not allowed or is unknown- Return type:
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:
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:
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:
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:
Get the value of
MalcontentUi.UserControls
:user-locale
.New in version 0.5.0.
- set_app_filter(app_filter)¶
- Parameters:
app_filter (
Malcontent.AppFilter
orNone
) – the app filter to configure the user controls from, orNone
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 ifMalcontentUi.UserControls
:user
is set.New in version 0.5.0.
- set_description(description)¶
-
Set the value of
MalcontentUi.UserControls
:description
.New in version 0.11.0.
- set_permission(permission)¶
- Parameters:
permission (
Gio.Permission
orNone
) – theGio.Permission
indicating whether the current user has permission to view or change parental controls, orNone
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
orNone
) – the user to configure the controls for, orNone
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
orNone
) – the display name of the user to configure the controls for, orNone
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
orNone
) – the locale of the user to configure the controls for, orNone
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:
- Default Value:
- Flags:
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 fromMalcontentUi.UserControls
:user
fails.New in version 0.5.0.
- MalcontentUi.UserControls.props.dbus_connection¶
- Name:
dbus-connection
- Type:
- Default Value:
- Flags:
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:
- Default Value:
- Flags:
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:
- Default Value:
- Flags:
Permission to change parental controls
- MalcontentUi.UserControls.props.user¶
- Name:
user
- Type:
- Default Value:
- Flags:
User
- MalcontentUi.UserControls.props.user_account_type¶
- Name:
user-account-type
- Type:
- Default Value:
- Flags:
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:
- Default Value:
- Flags:
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:
- Default Value:
- Flags:
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, andcodeset
is a character set or encoding identifier likeISO-8859-1
orUTF-8
.New in version 0.5.0.