WARNING: Project specifies a minimum meson_version '>= 0.49.0' but
uses features which were added in newer versions:
* 0.50.0: {'install arg in configure_file'}
When building without UI, there are no icon or desktop files so there is no need to run the commands to refresh the caches.
It would be even nicer to move the postinstall script to the malcontent-control subdirectory but it really applies to the installation output of the whole project, not just the malcontent-control part.
Without a GType for the error enum, g-ir-scanner fails to properly
associate it with the error quark function, and (for example) error code
matching in JS doesn’t work.
This adds the enum types in a new public header file.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
This is a high-level API to indicate whether parental controls are
‘enabled’ for the given user. It’s a mirror of
`mct_app_filter_is_enabled()`, and exposes the existing
`time_limit_enabled_out` argument of
`mct_session_limits_check_time_remaining()` more conveniently.
Includes tests.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
This is a high-level API to indicate whether parental controls are
‘enabled’ for the given user. Specifically, whether any of the
properties of the `MctAppFilter` differ from their default value.
Includes tests.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Get the system bus higher up in the application, so the same system bus
connection can be shared between different parts of the application if
needed in future.
This also means the synchronous I/O needed to connect to the bus is done
before the application UI is shown, which prevents it unnecessarily
blocking initialisation of the `MctUserControls` widget.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Add methods to serialise and deserialise the app filter, and use them to
replace the code in `MctManager` which was previously doing this. This
exposes the variant format for the app filter in the API (although the
format is described as ‘opaque’) so that user code can log it or store
it separately.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
When unlocking malcontent-control while running as an unprivileged user
to edit *that* user’s parental controls, the `ChangeOwn` and `ReadOwn`
privileges should also be granted.
Otherwise a second polkit authorisation dialogue is popped up after
editing any of the parental controls, to get permission to save the
changes.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
When malcontent-control is run as an unprivileged user (i.e. a child)
the fact that the unlock wording refers to ‘other users’ is a little
confusing, since the purpose of running malcontent-control was likely to
edit the parental controls for *this* user.
Adjust the wording to make this a little clearer.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Rather than building it again; this is the second half of resolving the
dependency cycle from the previous commit.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Fixes: #16
This allows the UI components (libmalcontent-ui and malcontent-control)
to be disabled in the build so that a dependency cycle with flatpak can
be avoided (by building malcontent twice, once with `-Dui=disabled` and
then again with `-Dui=enabled`).
The dependency graph is:
malcontent-control → libmalcontent-ui → flatpak → libmalcontent
which becomes cyclic if libmalcontent-ui and libmalcontent can only be
built at the same time.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Fixes: #16
When the user object changes one of its properties (for example, the
user’s locale might change if the administrator is editing a user in
g-c-c while viewing their parental controls in malcontent-control),
update the UI.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
If the user’s locale changes, we need to update the set of entries in
the OARS menu before selecting a new one and updating the label.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
On laptops which have a 1366 by 768 display, in gnome-initial-setup the
OARS dropdown is cut off by the edge of the screen. Only the first
couple entries are visible. So make it open to the right instead, where
more room is available.
Some of the files in `malcontent-control` are GPL-2.0+.
Use the latest SPDX identifiers in the machine-readable data in
meson.build, but use the deprecated ‘+’ form in the README since it’s a
little more human friendly.
See https://spdx.org/licenses/.
Signed-off-by: Philip Withnall <withnall@endlessm.com>