Commit graph

794 commits

Author SHA1 Message Date
Benjamin Berg
0209694978 wifi: Show WEP with a broken security icon
WEP is rather insecure, and using it is a bad idea in general. So show
it as insecure rather than falsely advertising it as being secure.
2019-01-07 15:30:06 +01:00
Benjamin Berg
d126b3db5e wifi: Hook up new connection list widget 2019-01-07 15:29:23 +01:00
Benjamin Berg
fb7e09eb46 wifi: Add new connection list widget
This widget keep track of connections and APs and automatically
creates/refreshes the corresponding list entries.
2019-01-07 15:29:23 +01:00
Benjamin Berg
eec7841027 wifi: Add set_checked function to connection row 2019-01-07 15:29:23 +01:00
Benjamin Berg
5c81b12647 wifi: Handle multiple APs in a connection row
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.
2019-01-07 15:29:23 +01:00
Benjamin Berg
3962aa3028 wifi: Show the connection name when it is different to SSID
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.
2019-01-07 15:29:23 +01:00
Benjamin Berg
8f706f45bd wifi: Remove unused code in wireless_try_to_connect
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.
2019-01-07 15:29:23 +01:00
Benjamin Berg
fb089b7c55 wifi: Use new CcWifiConnectionRow widget
This is in preparation to optimise the AP list updating.
2019-01-07 15:29:23 +01:00
Benjamin Berg
0fb86c82d2 wifi: Add new CcWifiConnectionRow widget for the AP list
This is in preparation to optimize list to not be rebuild completely for
every change.
2019-01-07 15:29:20 +01:00
Benjamin Berg
417624cdab wifi: Fix invalid variant unref in connection editor
If the WiFi secret is not set, then a NULL variant is passed back. We
should not free this variant. Fix this by using g_autoptr instead.
2019-01-07 15:28:38 +01:00
Benjamin Berg
88183c0e9f wifi: Remove old and unused column definitions 2019-01-07 15:28:38 +01:00
Benjamin Berg
0922f1095a wifi: Avoid one level of indentation
Convert an if into an early return rather than nesting the entire logic.
2019-01-07 15:28:38 +01:00
Adrien Plazas
943c90074c wifi: Allow the panel to reach narrower sizes 2018-11-26 15:36:34 +01:00
Robert Ancell
41e3426873 network: Fix warning about freeing const string
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.
2018-11-14 10:40:10 +00:00
Georges Basile Stavracas Neto
120eb2f59e
network: Use #pragma once on headers
Another low hanging fruit that reduces even more the
number of lines of code of the headers.
2018-11-05 08:33:22 -02:00
Georges Basile Stavracas Neto
f1347132d9
net-device-mobile: Remove private field from public structure
We can use pointer arithmetics to retrieve the private field.
2018-11-05 08:33:21 -02:00
Georges Basile Stavracas Neto
724c77a1a4
net-device-mobile: Turn into a final class
Exact same case of NetVpn and NetDeviceWifi.
2018-11-05 08:33:21 -02:00
Georges Basile Stavracas Neto
d4a08c48f1
net-device-mobile: Remove macro to get private field
We can just use the standard, non-deprecated G_DEFINE_TYPE_WITH_PRIVATE
and avoid g_type_class_add_private(), which is deprecated now.
2018-11-05 08:33:21 -02:00
Georges Basile Stavracas Neto
5d10d7121b
net-device-ethernet: Turn into a final class
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.
2018-11-05 08:33:21 -02:00
Georges Basile Stavracas Neto
81922ca5ab
net-proxy: Remove private field from public structure
We can use pointer arithmetics to retrieve the private field.
2018-11-05 08:33:19 -02:00
Georges Basile Stavracas Neto
0b35233412
net-proxy: Turn into a final class
Same case of NetVpn and NetDeviceWifi.
2018-11-05 08:32:39 -02:00
Georges Basile Stavracas Neto
75f57d38fc
net-proxy: Remove macro to get private field
We can just use the standard, non-deprecated G_DEFINE_TYPE_WITH_PRIVATE
and avoid g_type_class_add_private(), which is deprecated now.
2018-11-05 08:31:50 -02:00
Georges Basile Stavracas Neto
66ed8916f0
net-device-simple: Remove GObject boilerplate
Now that NetDeviceSimple is cleaned up, switch to
G_DECLARE_DERIVABLE_TYPE() and remove the old style
GObject boilerplate.
2018-11-05 08:31:50 -02:00
Georges Basile Stavracas Neto
f72e6d2012
net-device-simple: Remove private field from public structure
We can use pointer arithmetics to retrieve the private field.
2018-11-05 08:31:50 -02:00
Georges Basile Stavracas Neto
a04b8ffba8
net-device-simple: Remove macro to get private field
We can just use the standard, non-deprecated G_DEFINE_TYPE_WITH_PRIVATE
and avoid g_type_class_add_private(), which is deprecated now.
2018-11-05 08:31:50 -02:00
Georges Basile Stavracas Neto
0dd7a9785f
net-vpn: Remove private field
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.
2018-11-05 08:31:50 -02:00
Georges Basile Stavracas Neto
e3d125860b
net-vpn: Turn into a final class
Remove the old style GObject boilerplate and replace it by
G_DECLARE_FINAL_TYPE(). Move the NetVpn structure definition
to the .c file too.
2018-11-05 08:31:50 -02:00
Georges Basile Stavracas Neto
8509270562
net-vpn: Remove macro to get private field
We can just use the standard, non-deprecated G_DEFINE_TYPE_WITH_PRIVATE
and avoid g_type_class_add_private(), which is deprecated now.
2018-11-05 08:31:50 -02:00
Georges Basile Stavracas Neto
ccd492d752
net-device-wifi: Remove private field
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.
2018-11-05 08:31:49 -02:00
Georges Basile Stavracas Neto
0ce486ecb5
net-device-wifi: Turn into a final class
Remove the old style GObject boilerplate and replace it by
G_DECLARE_FINAL_TYPE(). Move the NetDeviceWifi structure
definition to the .c file too.
2018-11-05 08:31:49 -02:00
Georges Basile Stavracas Neto
e1dcf21979
net-device-wifi: Remove macro to get private field
We can just use the standard, non-deprecated G_DEFINE_TYPE_WITH_PRIVATE
 and avoid g_type_class_add_private(), which is deprecated now.
2018-11-05 08:31:49 -02:00
Georges Basile Stavracas Neto
c4f34569c0
net-device: Remove GObject boilerplate
Now that NetDevice is a bit more clean, switch to
G_DECLARE_DERIVABLE_TYPE() and remove the old style
GObject boilerplate.
2018-11-05 08:31:49 -02:00
Georges Basile Stavracas Neto
118631e273
net-device: Remove private field from public structure
We can use pointer arithmetics to retrieve the private field.
2018-11-05 08:31:49 -02:00
Georges Basile Stavracas Neto
f4027b9a25
net-device: Remove macro to get private field
We can just use the standard, non-deprecated G_DEFINE_TYPE_WITH_PRIVATE
and avoid g_type_class_add_private(), which is deprecated now.
2018-11-05 08:31:49 -02:00
Georges Basile Stavracas Neto
890dac86e9
net-device-mobile: Initialize variable 2018-11-05 08:31:48 -02:00
Georges Basile Stavracas Neto
881248ef9a
net-object: Turn into a derivable class
This commit removes the old GObject boilerplate, uses
G_DECLARE_DERIVABLE_TYPE() to define NetObject, and
uses "pragma once" at the header.
2018-11-05 08:31:47 -02:00
Jonathan Kang
a0998bbb03 wifi: Disable periodic scan only when Wi-Fi is disabled
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
2018-10-24 04:38:53 +00:00
Robert Ancell
58d5c9411d shell: Remove AppMenu
https://wiki.gnome.org/Initiatives/GnomeGoals/AppMenuRetirement
2018-10-17 22:14:27 +00:00
Robert Ancell
bf67ebc34e wifi: Don't translate placeholder text
Placeholder text was marked as translatable, but this is always replaced so
no need to translate it. Remove two unused tabs with translatable labels.
2018-08-27 22:48:05 +00:00
Robert Ancell
3642cb2d82 wifi: Use g_signal_connect_object
The previous code used the g_signal_connect which could leave the signals
connected even after the NetDeviceWifi object was destroyed.

Automatic crash reports in Ubuntu indicate that this might be happening:
https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/1718727
2018-08-13 23:46:23 +00:00
Georges Basile Stavracas Neto
88c30e8fbd wifi: Keep Airplane Mode always synchronized
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.
2018-07-23 10:13:13 -03:00
Georges Basile Stavracas Neto
b9da351a3d wi-fi: Add empty state for Airplane Mode
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.
2018-07-23 12:56:00 +00:00
Georges Basile Stavracas Neto
4ad1c5dea1 wifi: Expose Airplane Mode row outside access point list
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
2018-07-23 12:55:59 +00:00
Georges Basile Stavracas Neto
f9b9f105dd network: Rename UI files to match C files
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.
2018-07-23 12:55:59 +00:00
Lubomir Rintel
3c61cee1bb network: use nm_device_get_description()
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.
2018-07-17 08:44:16 +02:00
Bastien Nocera
a30e5dbe72 wifi: Use g_debug() for a debug message
Rather than CC_TRACE_MSG() which is supposed to be used for debugging
timing related problems.
2018-06-20 12:53:11 +00:00
Jonathan Kang
ca15b9822d wifi: only manage Wi-Fi devices managed by NM
If a Wi-Fi device is unmanaged by NetworkManager, ignore it.
2018-06-08 13:03:53 +00:00
Robert Ancell
a64ef75ad7 Simplify use of GCancellable
g_cancellable_cancell can be called without checking for a NULL value.
Use g_clear_object instead of g_object_unref
2018-06-01 21:03:19 +00:00
Georges Basile Stavracas Neto
90e7f05057 wi-fi: Remove unused header 2018-05-29 16:09:51 -03:00
Georges Basile Stavracas Neto
4151af5ea2 wifi: Hide when no Wi-Fi adapter is available
It's WIP.
2018-05-29 16:09:51 -03:00