Commit Graph

116 Commits

Author SHA1 Message Date
Philip Withnall 0e22ad7861 malcontent-control: Use g_signal_connect_object() when we don’t hold ref
The application doesn’t hold a ref to some of the widgets it holds a
pointer to, since their ownership is controlled by the main window. The
main window’s lifecycle is controlled by the application, but its
dispose cycle runs at a slightly different time.

Hence, we should disconnect from the widget signals when we can, but
without holding a strong ref.
2020-02-03 17:19:59 +00:00
Philip Withnall f3aea0247a malcontent-control: Use new error domain and codes
The error domain was renamed in libmalcontent, so we should use the new
domain rather than the compatibility defines.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-01-30 09:38:33 +00:00
Philip Withnall e220fd9919 malcontent-control: Allow NULL user accounts
If there are no suitable users to show in the user selector, then no
user can be selected, so the controls have to handle a NULL user.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-01-30 09:38:33 +00:00
Philip Withnall f670880382 malcontent-control: Fix a typo in an enum value
The values are the same so this doesn’t introduce any functional
changes, but it does fix the type.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-01-30 09:38:33 +00:00
Philip Withnall e54f7eaf8a malcontent-control: Ignore a harmless error
This is a backport of
https://github.com/endlessm/gnome-control-center/pull/205 from Endless’
gnome-control-center fork, applied there after the code was copied over
here.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-01-30 09:31:40 +00:00
Philip Withnall 368cc1fb76 malcontent-control: Fix a crash when flushing changes
The `GSource` was being removed twice, once in `blacklist_apps_cb()` and
once in `flush_update_blacklisted_apps()`, leading to a critical warning
from GLib.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-01-30 09:31:40 +00:00
Philip Withnall c7f975bb2b malcontent-control: Add initial draft of main interface
This replicates the old interface from Endless’ gnome-control-center,
with no attempt to improve or rework it. That will come later.

It might not work fully.

It allows a user to be selected, and their parental controls to be
changed. It currently doesn’t filter the users.

It supports a simple ‘Loading’ screen, before displaying the main
interface. If loading fails (due to a D-Bus error with accountsservice),
an error page is displayed instead.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-01-30 09:31:40 +00:00
Philip Withnall 1623876fbc malcontent-control: Add an MctUserSelector widget
This isn’t used yet, but will be soon. It encapsulates an
`ActUserManager` with an `MctCarousel` to provide an all-inclusive
widget for selecting a user account.

It’s based off code from the user accounts panel of
gnome-control-center, licenced as GPLv2+, and authored by many people
over time (see
https://gitlab.gnome.org/GNOME/gnome-control-center/commits/master/panels/user-accounts).

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-01-30 09:31:40 +00:00
Philip Withnall 484993b658 malcontent-control: Add basic accessibility support to g-c-c widgets
Not submitting this upstream as it hasn’t been tested thoroughly enough.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-01-29 15:31:42 +00:00
Philip Withnall 9e73c34664 malcontent-control: Fix some minor leaks in MctCarousel
Relevant chunks upstreamed in
https://gitlab.gnome.org/GNOME/gnome-control-center/merge_requests/683.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-01-29 15:31:42 +00:00
Philip Withnall 2c043a6bd5 malcontent-control: Reformat and rename code from gnome-control-center
Make it fit in with the surrounding code style, and rename the classes
to `MctCarousel` and `MctUserControls`. List them in `meson.build` and
`POTFILES.in`. No other changes.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-01-29 15:31:42 +00:00
Philip Withnall aa6ece8a91 malcontent-control: Add widgets from gnome-control-center
Add `CcCarousel` and `CcAppPermissions` from gnome-control-center and
rename the files. None of the contents of the files have been changed
yet. The files are from git master of gnome-control-center on
2020-01-08.

`carousel.{c,h,ui}` are licensed under GPLv2+, and are copyright 2016
Red Hat, Inc. The original author was Felipe Borges.

`user-controls.{c,h,ui}` are licensed under GPLv3+, and are copyright
2018, 2019 Endless, Inc.

`gs-content-rating.{c,h}` are originally from gnome-software, are
licensed under GPLv2+, and are copyright 2015, 2016 Richard Hughes. He
was also the original author. These files are needed by
`user-controls.{c,h}`.

`user-image.{c,h}` are licensed under GPLv2+ and are copyright 2015, Red
Hat, Inc. The original author was Ondrej Holy.

This code will not stay as copy-paste code for too long. The ultimate
plan is to rework most of the widgets:
 • `CcCarousel`: Will be reworked to provide more information about the
   screen time usage of each user. It will become a summary widget as
   well as a selector.
 • `GsContentRating`: Will be abstracted out into libappstream-glib, or
   some other suitable library, where its implementation can be shared
   between gnome-software and malcontent.
 • `CcUserControls`: Will be reworked as the UI of malcontent evolves.
   Will also be removed from gnome-control-center once malcontent-control
   is released.
 • `CcUserImage`: As per `CcCarousel`, this will evolve into a new
   widget.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-01-29 15:28:21 +00:00
Philip Withnall b0f72c432f malcontent-control: Add initial main window
It’s currently empty, but it’s a start.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-01-29 15:27:33 +00:00
Philip Withnall cf6331cac6 malcontent-control: Add an AppData file
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-01-29 15:27:33 +00:00
Philip Withnall 8b62f08cf6 malcontent-control: Add a desktop file
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-01-29 15:27:33 +00:00
Philip Withnall 1d8f7d665c malcontent-control: Add initial skeleton application
This does nothing at the moment (not even showing a main window), but it
soon will do.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-01-29 15:07:15 +00:00