Commit Graph

28 Commits

Author SHA1 Message Date
Philip Withnall 8c7815e33c restrict-applications-dialog: Allow introduction label to wrap
Rather than ellipsising, allow it to wrap. Also ensure it’s
left-aligned.

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

Helps: #11
2020-02-26 09:15:19 +00:00
Philip Withnall 2d43ac38ec libmalcontent-ui: Restyle ‘restricts’ switches in yellow
This has fewer ‘error’ connotations than red. See
https://gitlab.freedesktop.org/pwithnall/malcontent/issues/11#note_419124.

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

Helps: #11
2020-02-25 12:49:29 +00:00
Philip Withnall 3db3a42e8d user-controls: Line wrap labels rather than ellipsising
The labels are too long to fit on a single line, given the default width
of the user controls widget, so allow them to wrap onto multiple lines
rather than unhelpfully ellipsising.

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

Helps: #11
2020-02-25 12:25:40 +00:00
Philip Withnall 008b75edd1 user-controls: Add a drop-down arrow next to the OARS age selector
To make it more obvious that it triggers a drop-down menu. Potentially,
this should be a `GtkComboBox` rather than reinventing the wheel using a
`GtkMenuButton` — but that’s a change for another day.

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

Helps: #11
2020-02-25 12:25:40 +00:00
Philip Withnall 7ad804835a user-controls: Rename OARS widget variables to be more descriptive
This doesn’t introduce any functional changes.

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

Helps: #11
2020-02-25 12:25:40 +00:00
Philip Withnall 5a1bfb842a user-controls: Include user display name in the description labels
This clarifies that the settings apply to that user.

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

Helps: #11
2020-02-25 12:25:40 +00:00
Philip Withnall dee4d92ea9 restrict-applications-dialog: Invert controls to be restrictive
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #11
2020-02-25 12:25:40 +00:00
Philip Withnall 8753109e80 user-controls: Tweak the wording of the ‘application suitability’ label
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #11
2020-02-25 12:25:40 +00:00
Philip Withnall 516e3936eb user-controls: Relabel ‘allow installation’ as ‘restrict installation’
This is part of a move to make all the controls restrictive, rather than
permissive.

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

Helps: #11
2020-02-25 12:25:40 +00:00
Philip Withnall f956fab427 user-controls: Tweak the wording of the ‘restrict applications’ label
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #11
2020-02-25 12:25:40 +00:00
Philip Withnall 8e4fa643d3 user-controls: Relabel ‘allow web browsers’ as ‘restrict web browsers’
This is part of a move to make all the controls restrictive, rather than
permissive.

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

Helps: #11
2020-02-25 12:25:40 +00:00
Philip Withnall b9a2b7a6a7 user-controls: Add CSS to support styling switches as ‘restrictive’
This will be used in upcoming commits to mark switches as restricting
something when they’re active, rather than allowing something. Their
background will be red, rather than blue.

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

Helps: #11
2020-02-25 12:25:40 +00:00
Philip Withnall 67ca6806e6 user-controls: Add separators between rows
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #11
2020-02-25 10:31:38 +00:00
Philip Withnall ef6fc0a7f5 user-controls: Fix icon for ‘Restrict Applications’ button
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #11
2020-02-25 10:31:24 +00:00
Philip Withnall 98395185e3 user-controls: Add full stops to end of control descriptions
They are sentences.

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

Helps: #11
2020-02-25 10:31:24 +00:00
Philip Withnall 1c033f82df user-controls: Allow widgets to be used without an `ActUser`
Allow the user controls widget to be used for user accounts which don’t
currently exist. This is necessary for using them in
gnome-initial-setup.

See the big new documentation comment at the top of the widget for
details of how the new semantics work.

This adds API, but does not break existing API.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-14 12:00:57 +00:00
Philip Withnall fc9ba76331 user-controls: Add some missing includes to the header
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-06 12:52:06 +00:00
Philip Withnall e4fbb570af user-controls: Add some missing documentation comments
The annotations in these fix some GIR warnings.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-06 12:52:06 +00:00
Philip Withnall 7dfd03907d user-controls: Split out app filter construction into a new method
This means that calling code can extract the app filter manually rather
than having to rely on the `MctUserControls` to save it. This will be
useful in a few commits’ time when support is added for using
`MctUserControls` for not-yet-created users.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-06 12:52:06 +00:00
Philip Withnall e3f923b294 user-controls: Don’t clear filter if updating it is a no-op
If `self->user == NULL`, don’t clear the app filter, as that leaves us
in a worse-off position than before.

Rename the method to make it clearer that it queries the filter from the
user.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-06 12:52:06 +00:00
Philip Withnall 3519ac2dc1 user-controls: Tweak the API of an internal helper function
Make it take a `MctUserControls` rather than a member of it. This
introduces no functional changes, but will make some upcoming
refactoring easier.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-06 12:52:06 +00:00
Philip Withnall 608444891f user-controls: Modernise GObject property code
This introduces no functional changes, but does make the code work
better with `-Wswitch-enum`.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-06 12:52:06 +00:00
Philip Withnall 0f2c8d6601 restrict-applications-selector: Drop unnecessary include
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-06 12:52:06 +00:00
Philip Withnall 6b45ad9f76 restrict-applications-dialog: Drop accountsservice dependency
Instead of taking an `ActUser` as a property of the
`MctRestrictApplicationsDialog`, take the display name which we would
have queried from it.

This will allow the restrict applications dialog to be used in
situations where an `ActUser` isn’t available, such as when setting the
parental controls for a yet-to-be-created user.

This breaks the `MctRestrictApplicationsDialog` API, but the previous
API hadn’t yet been released.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-06 12:52:06 +00:00
Philip Withnall acf402dcc5 restrict-applications-dialog: Allow :user to be set at any point
It doesn’t actually need to be construct-only.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-06 12:52:06 +00: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 1f3f0a4560 libmalcontent-ui: Move widgets over from malcontent-control
They need to be re-used in gnome-initial-setup. The other widgets which
remain in malcontent-control don’t need to be used in g-i-s so can stay
where they are for now. They might move across to libmalcontent-ui later
if there’s a need for it.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-04 11:36:58 +00:00
Philip Withnall 3289a37317 libmalcontent-ui: Add initial skeleton for separate UI library
Moving the widgets out of malcontent-control means they can be reused in
other projects. In particular, I’m interested in reusing them in
gnome-initial-setup.

The new library will not build yet, but this introduces all the build
framework necessary for moving the source files over.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-04 11:36:58 +00:00