Commit Graph

23 Commits

Author SHA1 Message Date
Georges Basile Stavracas Neto dc1f68c7bc application: Port to gtk_show_uri_full()
A pretty straightfoward port, and most importantly, this function
actually exists in GTK4 :)
2022-07-20 19:23:12 -03:00
Georges Basile Stavracas Neto bb0865eb23 project: Use gtk_window_present() to present windows
Instead of gtk_widget_show(). In practice, it's exactly the same,
but it'll make follow-up patches cleaner.
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 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
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 dcf7265f55 Merge branch 'fix-focus' into 'main'
malcontent-control: Focus controls rather than user selector

See merge request pwithnall/malcontent!126
2021-10-12 14:08:58 +00:00
Philip Withnall 98ebfaa20e malcontent-control: Focus controls rather than user selector
When showing the controls, focus them first rather than the user
selector. The correct user is probably already selected.

This has the added benefit of not drawing attention to the ugly focus
rectangle on the user selector.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-10-07 16:22:51 +01:00
Philip Withnall 6115ebf119 malcontent-control: Fix an unterminated option entry array
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-10-07 14:43:02 +01: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 db54baf9d6 malcontent-control: Add a --user command line argument
This is handled on the primary instance, and causes the tab to be
switched to show the given username (if possible).

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

Fixes: #19
2020-10-19 17:55:47 +01:00
Will Thompson a626236f59 Add translator comments for about dialog strings
When ordering commercial translations, at least one translator
translated these literally, eg "Sitio web de mal gusto" and
"créditos-de-traductor".

It's likely that translators familiar with GNOME would not make this
mistake, but let's be explicit anyway.
2020-04-20 13:47:22 +01:00
Philip Withnall e03bb128b8 malcontent-control: Add an action to launch the help
Also add actions for `app.about` and `app.quit`, for completeness.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-04-03 15:08:47 +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 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 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 bffab0942f malcontent-control: Move the app restrictions into a separate dialogue
Rather than having a scrollable listbox within a scrollable list of
widgets, move the listbox out to a separate dialogue.

This involves separating out all the code to query the apps, to get and
to set the app filter, from `MctUserControls` out into the new
`MctRestrictApplicationsSelector`. Most of it is unchanged, aside from
its interaction with the filter: the filter is now provided to the
widget by the calling code, rather than being queried by the widget
itself. The widget’s status can be queried into an
`MctAppFilterBuilder`, rather than being used to set the app filter
directly.

This commit redesigns the appearance of the relevant widgets in the main
window so that they follow the new list-box-like visual design. A
following commit will apply similar changes to the other widgest in the
main screen.

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