Note that this also changes the way to detect that the connection is
currently active. This change is not required but but does simplify the
code a little bit.
In almost all cases, the SSID will be identical with the connection name
(in fact, we do not even allow modifying the connection name). However,
as it is now, we can end up with multiple connections with the same name
in the list.
Change the list to indicate the SSID separately in a way that will not
result in any changes in the usual case.
The code tries to establish a connect by using an existing connection.
However, if that is possible the function will not even be called.
Remove the code in question.
The use of g_clear_pointer (&str, g_free) with str being a const gchar *
caused warning errors.
Instead of using str for both constant and allocated strings use separate
variables. Autofree the allocated strings.
This one did not require any specific changes beyond moving
the struct definition to the .c file, and removing the old
style GObject boilerplate. Remarkably easy.
Like NetDeviceWifi, NetVpn is now a final class, and thus does not
need a private field. Remove this field and use the NetVpn struct
itself to store the previously private variables.
NetDeviceWifi is a final class, and thus does not need a private
field. Remove this field and use the NetDeviceWifi struct itself
to store the previously private variables.
The periodic Wi-Fi scan is introduced in 84279c4a. It's designed to
scan the Wi-Fi list every 15 seconds and disable the scan when Wi-Fi is
disabled.
But currently the periodic check is disabled every time
wireless_enabled_toggled() is called, which is wrong. Because it can
mean Wi-Fi is enabled or disabled.
Fix that by disabling periodic scan only when Wi-Fi is disabled.
fixes 84279c4a
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.
The current Wi-Fi panel ties the Airplane Mode row to the access
point list of a given Wi-Fi adapter. That has unintended but
bad side effects: when enabling Airplane Mode, the row disappears
and we have to switch to another panel (e.g. Bluetooth) in order
to disable it. This is functionally wrong: we should be able to
enable or disable Airplane Mode from where we initially changed
it.
This commit reorganizes the widget hierarchy in order to put the
Airplane Mode row outside of the main GtkStack page. This is
necessary in order to fully implement the proposed mockups[1]
and, in general, because it's the right thing to do.
Notice that the logic of the empty states in [1] is not fully
implemented yet; this commit only reorganizes the widgets that
already exist to get closer to the mockups. Subsequent commits
will implement more of the empty states.
[1] https://github.com/gnome-design-team/gnome-mockups/raw/master/system-settings/network/aday3/wi-fi-wires.png
Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/issues/121
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.