Commit Graph

9 Commits

Author SHA1 Message Date
Philip Withnall 8ca426f631 build: Hide private structs from generated GIR files
Otherwise the fields in `MctAppFilter` become visible to introspected
languages, which was not the intention.

Spotted in
https://gitlab.freedesktop.org/pwithnall/malcontent/-/issues/65.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2023-12-20 11:02:43 +00:00
Philip Withnall 28d496926d libmalcontent: Add a constructor to bind the translation domain
This ensures that the translation domain is loaded for malcontent as
soon as the library is loaded.

The same is not needed for libmalcontent-ui, because it always causes
libmalcontent to be loaded.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-04-27 12:10:58 +01:00
Philip Withnall aaca135199 libmalcontent: Add enum types to fix introspection of MctManagerError
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>
2020-04-04 00:37:26 +01:00
Philip Withnall b98ec83e66 libmalcontent-ui: Add GIR dependency on libmalcontent
This was missing and causing some problems with GIR compilation for the
UI library.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-06 12:52:06 +00:00
Philip Withnall 2a3f0fd741 libmalcontent: Rework pkg-config file generation
Meson 0.49 has matured its pkg-config file generation a little, and the
API has subtly changed. The main library we’re building a pkg-config
file for is now passed as the first argument; and all dependencies can
be passed to `libraries`/`libraries_private`. Any dependencies which
provide pkg-config files will automatically be moved into the pkg-config
file’s `Requires`/`Requires.private` sections.

See https://mesonbuild.com/Pkgconfig-module.html#implicit-dependencies

This bumps our Meson dependency to ≥ 0.49.0.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-04 11:34:05 +00:00
Philip Withnall 5e49cb7831 libmalcontent: Add a SessionLimits interface for time-limited sessions
This is another extension interface on accountsservice which stores
information about time and usage limits on the user session. Currently,
only a ‘daily schedule’ limit (or no limit) is supported, but additional
types and combinations of limits can be supported in future.

The daily schedule limit allows using the computer between a certain
start time and end time each day (the same each day). The user will be
kicked out of their session when the end time is reached, if they
haven’t already logged out.

This includes the getters for the new data, polkit rules for accessing
it, and some documentation. Changes to `malcontent-client` to support
session limits, setters, and unit tests will all follow.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-01-16 13:17:45 +00:00
Philip Withnall ad45f2813b libmalcontent: Add a top-level header file
This just simplifies including the malcontent headers from projects
which use it.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-04-25 16:56:02 +01:00
Philip Withnall 68ebe8b568 libmalcontent: Factor getting/setting app filter into a manager
Create a new MctManager object which is used as the anchor for getting
or setting MctAppFilters.

This changes the API naming around quite a bit, but doesn’t really
change its behaviour or functionality — see the tests for examples of
how little things change.

This is one step on the way to emitting a signal (from MctManager) when
a user’s parental controls change.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.freedesktop.org/pwithnall/malcontent/issues/1
2019-04-24 13:45:59 +01:00
Philip Withnall 03436eacf5 Rename project from eos-parental-controls to malcontent
Rename the library from libeos-parental-controls to libmalcontent, and
the client from eos-parental-controls-client to malcontent-client.

This was done using the following mechanical edits, and no other
changes:
```
git search-replace -f EPC///MCT
git search-replace -f Epc///Mct
git search-replace -f epc///mct
git search-replace -f eos_parental_controls///malcontent
git search-replace -f eos-parental-controls///malcontent
git search-replace -f EosParentalControls///Malcontent
git search-replace -f 'eos\\-parental\\-controls///malcontent'
git search-replace -f 'Since: 0.1.0///Since: 0.2.0'
```

Note that the accounts-service extension interface has *not* been
renamed, as that would revert people’s parental controls settings in
existing deployments.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-02-26 17:45:14 +00:00