Boy this was hard.
To ease the pain of porting wireless-security to GTK4, add
a new WsFileChooserButton class that mimics the behavior of
a button that triggers a filechooser, as per the migration
guide suggests.
There were lots of GtkGrids, so the diff is particularly
horrendous. Sorry.
This needs serious testing before landing.
Add any wifi devices that have become managed or remove ones that have
become unmanaged. Since a device could have been added or removed
previously, we also have to handle multiple calls to add or remove a
device.
Make the panel class provide a cancellable that will be cancelled when the panel
is destroyed. Panel implementations can use this and not have to mangage the
cancellable themselves. Consolidate cases where panels had multiple cancellables
that were all being used for this behaviour.
The spinner was already present in the UI file! It just needs
minor cleanups (such as moving the bottom margin from the label
to the parent box) and binding the widget to the structure.
We need to monitor which device is visible since the Wi-Fi panel
deals with multiple Wi-Fi devices as well.
Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/issues/551
Currently, we acquire the Rfkill D-Bus proxy and synchronize
the state right after that. However, we don't monitor for
subsequent changes by connecting to the 'g-properties-changed'
GDBusProxy signal, which causes the Airplane Mode not to stay
synchronized when modified from others places, such as GNOME
Shell's aggregate menu.
This commit adds the necessary signal monitoring code to react
to external applications changing the Rfkill properties.
According to the most recent mockups [1], when Airplane
Mode is switched on, the Wi-Fi connection will be turned
off and the Wi-Fi panel should show an empty state for
Airplane Mode. This is currently not implemented in the
codebase.
This commit adds an Airplane Mode empty state for the Wi-Fi
panel, and a small logic adjustment to show it under these
circumstances.
This commit renames {network|wifi}.ui to cc-{network|wifi}-pane.ui,
in order to match the corresponding C files. This introduces no
functional changes.
It's better for human-readable display than nm_device_get_product().
Unlike nm_device_get_product(), it never returns an empty string and
sanitizes the string.
With NM 1.12 it goes to great lengths to clean up the messy udev
strings.
When the user launches Settings with a panel passed
as argument, the following things happen:
1. The Wi-Fi panel starts loading.
2. The command line arguments are passed and the given
panel is activated.
3. The Wi-Fi panel cancels the loading routine, and
rfkill_proxy_acquired_cb() is called with the GError
set as G_IO_ERROR_CANCELLED.
4. Crash in rfkill_proxy_acquired_cb().
The crash is caused because, when rfkill_proxy_acquired_cb()
is called, the CcWifiPanel instance isn't valid anymore. And
yet, the code tries to cast 'gpointer user_data' to a
CcWifiPanel pointer.
Fix that by only trying to cast anything after parsing the
GError set by the callback.
The glory moment has come. The new Wi-Fi panel is finally
introduced using a different code style from the rest of
the Network panel, since Control Center itself is written
using the GTK+ C code style.
The Wi-Fi panel uses modern GTK+ features like template
classes and new widgets. The files are stored together
with the Network panel so that we can reuse the abstraction
layer that the Network panel has to manage devices.
https://bugzilla.gnome.org/show_bug.cgi?id=784818