Commit Graph

33 Commits

Author SHA1 Message Date
Piotr Drąg 8416b0f263 main: Restore previous whitespace in string
So that we don’t change the string for no reason,
invalidating all existing translations.
2022-07-24 15:47:45 +02:00
Georges Basile Stavracas Neto fe785d357d user-controls: Remove AdwPreferencesPage
AdwPreferencesPage is intended to be used as the first widget
inside page. It has an AdwClamp and a scrolled window to handle
just that.

Putting it in the MctUserControls widget is undesired, because
it introduces an oddly positioned scrolled window in the parental
controls page of Initial Setup, and if we ever reintroduce this
widgetry in Settings, it would suffer from the same problem.

Remove AdwPreferencesPage from MctUserControls, and replace it
with a vertical box. Add an AdwPreferencesPage in malcontent-controls
to compensate for that.
2022-07-20 19:23:12 -03:00
Georges Basile Stavracas Neto d204944ae2 main: Improve visuals of loading label
Replace the manual scaling of the font size by a proper style
class, and center-align it vertically.
2022-07-20 19:23:12 -03:00
Georges Basile Stavracas Neto a9290f86b9 main: Make unlock button a pill
And set the 'suggested-action' style class too. This makes the
button more inline with modern GNOME HIG.
2022-07-20 19:23:12 -03:00
Georges Basile Stavracas Neto 0134e5d875 main: Remove has-default from buttons
This property is read-only in GTK4.
2022-07-20 19:23:12 -03:00
Georges Basile Stavracas Neto 977b82f681 main: Remove can-default 2022-07-20 19:23:12 -03:00
Georges Basile Stavracas Neto 3e1c14bda3 project: Port to GtkStack API changes 2022-07-20 19:23:12 -03:00
Georges Basile Stavracas Neto 6cd201166b main: Remove use-popover property from GtkMenuButton
It doesn't exist anymore.
2022-07-20 19:23:12 -03:00
Georges Basile Stavracas Neto 58fc4e0a5b main: Reimplement primary menu accellerator as a shortcut
In GTK4, the replacement to accelerators like this are shortcut
controllers.

Add a global shortcut controller to the primary menu button, and
bind it to F10.
2022-07-20 19:23:12 -03:00
Georges Basile Stavracas Neto 6fc250d5cf main: Adapt to GtkHeaderBar API changes 2022-07-20 19:23:12 -03:00
Georges Basile Stavracas Neto 631df4f1a5 project: Adapt to GtkBox API changes
GtkBox provides a different API surface, such as gtk_box_append()
and gtk_box_prepend(), so switch to that.
2022-07-20 19:23:12 -03:00
Georges Basile Stavracas Neto e322d8cd98 Hdy → Adw
This simply changes namespaces. Fortunately, no further widgetry
changes will be necessary - all the widgets and APIs seem to have
an exact match in libadwaita.
2022-07-20 19:23:12 -03:00
Georges Basile Stavracas Neto d142554ed3 malcontent-control: Replace border-width by margins
The 'border-width' property does not exist in GTK4 anymore, so
replace it with margin-* and in one case just remove it entirely.
2022-07-20 19:23:12 -03:00
Georges Basile Stavracas Neto a8484b9c07 project: Port to GTK4 accessibility framework
This was simple, since few widgets have accessibility properties
manually set. The 'static' role doesn't exist anymore, and GtkLabel
handles everything for us, so we can just drop it.
2022-07-20 19:23:12 -03:00
Georges Basile Stavracas Neto 262d6a6e7a project: Remove most can-focus properties
In GTK4, can-focus usage is much more specific to widget subclasses,
and in almost all cases it's not necessary to set it.

Remove it everywhere, except in one case where it still needs to be
manually set to False.
2022-07-20 19:23:12 -03:00
Georges Basile Stavracas Neto 5bec6e8fdc project: Remove all visible=True properties
Start the GTK4 port by cleaning up all visible=True properties,
since widgets are visible by default on GTK4.
2022-07-20 19:23:12 -03:00
Christopher Davis 554b390cd4 main.ui: Use HdyStatusPage for status pages
We now have a nice pre-built widget for status pages
with an icon, title, description, and children.
We should take advantage of that instead of manually
setting up each status page.
2022-07-20 19:23:12 -03:00
Christopher Davis 358cad3a24 user-controls: Use HdyPreferencesPage and HdyActionRow API
This allows us to get styling consistent with
HdyPreferencesWindow and similar content across GNOME.

Part of a consistency push for GNOME 40
2022-07-20 19:23:12 -03:00
Christopher Davis d80ed10592 malcontent-control: Use HdyWindow and HdyHeaderBar 2022-07-13 12:00:33 -03:00
Philip Withnall ebad35703b ui: Increase spacing between labels and buttons to 18px
Was previously 12px, but the buttons are slightly logically separate
from the labels, so it should be 18px according to
https://developer.gnome.org/hig/stable/visual-layout.html.en.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Fixes: #15
2020-12-09 15:53:31 +00:00
Philip Withnall 9335565fe3 malcontent-control: Change wording on no-other-users page
Clarify that a standard user account has to be created, and then
parental controls enabled for it — and that clicking the button will
open the control centre.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #25
Helps: #26
2020-12-08 16:35:07 +00:00
Philip Withnall 2010898947 malcontent-control: Add link to guidance on how to set parental controls
Try and nudge parents/carers towards the best practice for how to set
parental controls on a user, by linking them to appropriate external
content from people who know what they’re talking about.

This external content can vary in the translations so that parents are
pointed to appropriate localised guidelines. In the UK, for example,
this may be
https://www.nspcc.org.uk/keeping-children-safe/online-safety/.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-12-04 11:58:06 +00:00
Philip Withnall cd36d90091 malcontent-control: Drop ‘Restrict Application Installation for Others’
This simplifies the UI, as nobody really understood the difference
between ‘Restrict Application Installation’ and ‘Restrict Application
Installation for Others’. Now there’s just a ‘Restrict Application
Installation’ checkbox, which controls application installation in the
home and system flatpak repos.

The underlying app-filter representation in libmalcontent still supports
restricting installation to them separately, but the UI will always set
them to the same value.

There is a suggestion that we may want to support user repos again in
future iff the user has added a remote to their user repo. However,
figuring that out for other users (which is what the admin would have to
do when setting this all up) starts to get tricky with permissions for
reading other users’ home directories. Skip that for the moment — we can
reconsider adding that option in future if someone argues a case for it.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #30
2020-11-15 17:31:21 +00:00
Philip Withnall 9b3dedd9ed malcontent-control: Centre the user controls
This causes the controls on the main window to be centred at their full
width (when there’s enough window width to do so), rather than expanding
to fill the entire window.

It’s not currently possible with GTK+3 to easily set a maximum width
(of, say, 600px) to the column, without writing a custom widget (like
`HdyColumn` does).

From a suggestion by Nick Richards
(https://www.nedrichards.com/2020/04/endless-3.8.0-beta-1-trip-report/).

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-05-01 16:11:39 +01:00
Philip Withnall 99736b3f6c malcontent-control: Add a header bar and primary menu
This makes it easier to access the help and about dialogue, and brings
the application in line with the [GNOME
HIG](https://developer.gnome.org/hig/stable/header-bars.html.en).

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-04-06 12:38:11 +01:00
Philip Withnall f917f6e79a malcontent-control: Refactor bus initialisation
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>
2020-03-23 14:43:22 +00:00
Philip Withnall cbc9b93348 malcontent-control: Tweak polkit label wording
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>
2020-03-17 17:30:49 +00:00
Philip Withnall 2ab9924d8d malcontent-control: Hide administrator accounts
Children can’t be administrator accounts, otherwise applying parental
controls to them would be pointless and ineffective. So hide the
administrator accounts from the parental controls app.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-03 17:29:17 +00:00
Philip Withnall a05ac751a1 malcontent-control: Add a main stack page for when there are no users
Point the admin towards gnome-control-center so they can add child user
accounts.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-03 17:29:17 +00:00
Philip Withnall 8badee7fa9 malcontent-control: Add polkit policy support
Add an unlock screen to the application, which is shown on startup if
the current user doesn’t have permission to view the parental controls
of other users. It requests permission using a new polkit action which
implies the various accounts-service actions we need.

This adds a dependency on `polkit-gobject-1`.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-03 17:29:17 +00:00
Philip Withnall 36162c2c23 malcontent-control: Tweak default window height to match new controls
A fairly arbitrary decision which seems to match the new controls a bit
better, removing the large whitespace gap at the bottom of the window.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-03 17:29:17 +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 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