Commit graph

754 commits

Author SHA1 Message Date
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
Benjamin Berg
77a1225917 network: Fix disconnecting the VPN connection_removed_cb handler
The disconnect was for the wrong object (connection rather than client).
Fix this by simply moving to use g_signal_connect_object which obsoletes
the explicit disconnect calls.
2018-05-29 15:16:50 +02:00
Benjamin Berg
52034ba0be network: Update VPN title when the connection is changed
When the connection is modified then the title might be changed. Call
the UI update function to ensure that widgets are updated.
2018-05-29 15:16:43 +02:00
Benjamin Berg
a51dbcd8ca network: Fix Bluetooth panel showing up after connection removal
The test to check whether the Bluetooth (simple section) contains
elements was testing for NetObjectSimple. However, ethernet connections
are a subclass and check would count these. This causes issue when the
code is run after net object removal.

The fix is to check for the exact object type rather than also allowing
subclasses.
2018-05-29 15:16:43 +02:00
Benjamin Berg
f655e46ce7 tests/network: Add basic testing of network panel
This adds tests for the network panel based on the test service found in
NetworkManager. Another possible solution may be to use the one from
dbusmock, however NetworkManager already has readily available code to
write tests in C which makes checking the widget hierarchy easier.
2018-05-02 22:29:33 +00:00
Benjamin Berg
e91266a8f0 network: Fix crash on connection change after device removal
When a device is removed the callback handler could still be called
because it was connected using g_signal_connect rather than
g_signal_connect_object. This fixes crashes in the UI after a device has
been removed again.
2018-05-02 22:29:31 +00:00
Benjamin Berg
ec50cbcdff network: Ensure devices are removed from UI when disappearing
The "removed" callback from NMObject is never called when the object is
simply finalised because the UI drops the reference. Explicitly call the
handler so that UI elements are removed.
2018-05-02 22:29:30 +00:00
Benjamin Berg
c2f601a9d4 Move common panel code from shell/ to panel/common
This creates a new static library called libwidget which the shell links
against.
2018-04-17 15:26:59 +02:00
Georges Basile Stavracas Neto
250eb01931 network: Cache D-Bus proxies and objects 2018-04-06 22:23:38 -03:00
Georges Basile Stavracas Neto
5659271ec3 build: Drop remaining libnm-glib usage
This library is deprecated for a long time now, and Fedora Rawhide
removed the package. Since our CI is based on Rawhide, it began
to fail.

In the end, the usage was just legacy code that doesn't exist anymore,
so it's pretty safe to just plain drop it.
2018-03-16 13:03:04 -03:00
Benjamin Berg
729db87249 network: Remove dead code trying to use NMConnection as NMActiveConnection
These code paths could never be hit as an NMConnection cannot be an
NMVpnConnection which is a descendant of NMActiveConnection.

https://bugzilla.gnome.org/show_bug.cgi?id=794171
2018-03-12 17:29:53 +01:00
Benjamin Berg
72ef675a36 network: Fix warning about missing cast to GtkWidget*
https://bugzilla.gnome.org/show_bug.cgi?id=794171
2018-03-12 16:15:19 +01:00
Benjamin Berg
3117e2dc4a network: Remove nagging code which removed from libnma
This has been removed long ago and there are only stubs left for g-c-c.

See also:
- https://bugzilla.gnome.org/show_bug.cgi?id=706964
- https://git.gnome.org/browse/network-manager-applet/commit/?id=e21d598896ccd2c52850f52d21fe1d5aaa4e5410

https://bugzilla.gnome.org/show_bug.cgi?id=794171
2018-03-12 16:14:47 +01:00
Bastien Nocera
4663ba2fac network: Fix crash opening "Hidden network" dialogue
Both the Network panel and libnma expect UI resources in the
same location, which will cause problems when the Network panel loads
its own version that doesn't quite match up to the code used in libnma.

This fixes a crash when nma_wifi_dialog_new_for_hidden() is called and
libnma expects a domain widget to be present, which it isn't in our
version of the UI files.

https://bugzilla.gnome.org/show_bug.cgi?id=785099
2018-03-12 14:39:10 +01:00
Bastien Nocera
7289e21ef1 network: Fix crash due to object name clashes in NM and g-c-c
1. open Wi-Fi Settings
2. Menu -> Known Wi-fi Networks
3. Click settings of some Wi-Fi network listed there.
4. Press escape twice to close all the dialogs
5. Menu -> Connect to Hidden network..,

Fix crashes when some object type names (WirelessSecurity and
EAPMethod in this case) are duplicated across the Network
panel and libnma.

Fixes a regression in commit 0470c04

https://bugzilla.gnome.org/show_bug.cgi?id=785099
2018-03-12 14:27:18 +01:00
Will Cooke
817a065e50 network: Use monospace font for wi-fi hotspot password
https://bugzilla.gnome.org/show_bug.cgi?id=785413
2018-03-01 11:22:38 -05:00
Piotr Drąg
7265bd53a0 Add translator comments to .desktop files
Icons are confusing translators, and gettext
is unlikely to get fixed any time soon.
2018-02-23 18:49:35 +01:00
Bastien Nocera
e047753ea6 wifi: Show the "Wi-Fi disabled" page if it is disabled
Rather than an empty "Visible Networks" table.

https://bugzilla.gnome.org/show_bug.cgi?id=793647
2018-02-21 12:29:40 +01:00
Bastien Nocera
84279c4aaa network: Request periodic Wi-Fi scans
As NetworkManager from version 1.10 doesn't handle background scanning
itself, to minimise battery drain, we need to periodically request it to
scan for Wi-Fi Access Points.

We now do this request every 15 seconds, as NetworkManager-applet and
gnome-shell do, and disable that periodic scan if Wi-Fi is disabled.

https://bugzilla.gnome.org/show_bug.cgi?id=793647
2018-02-21 12:29:40 +01:00
Felipe Borges
849e50b70e wifi: Revert "Add a refresh button"
This reverts commit 5ad72b6faa.

See https://bugzilla.gnome.org/793238
2018-02-20 10:04:48 +01:00
Bastien Nocera
6df5cc00ce network: Really really fix cloned MAC support
And now that we're reading a text entry, read the correct one 🙄
Follow-up to a2a70c7
2018-02-16 13:26:13 +01:00
Bastien Nocera
9b9e0e076a network: Don't show "Auto-connect" for VPNs
It's not supported for VPNs.

https://bugzilla.gnome.org/show_bug.cgi?id=792365
2018-02-16 10:52:08 +01:00
Bastien Nocera
c50d1adb0f network: Don't warn when setting empty IPv4 gateway
Set an empty string when there's no IPv4 gateway rather than warn.
2018-02-06 11:11:56 +01:00
Bastien Nocera
a2a70c7376 network: Really fix clone MAC support
This isn't a container, but a text entry. Bug introduced in commit
6b043fd.
2018-02-06 11:10:53 +01:00
Bastien Nocera
dd8b63bdeb network: Consider empty IPv6 gateway to be valid
The string we get back from the text entries are never NULL (as long as
the UI isn't broken that is), but can be empty strings. Consider an
empty IPv6 address to be invalid, but an empty gateway to be valid.

See https://bugzilla.redhat.com/show_bug.cgi?id=1467308
2018-02-06 10:46:33 +01:00
Bastien Nocera
6b043fd3dd network: Fix cloned MAC not being saved for Ethernet
We read the MAC as being the cloned MAC, which NM would likely take to
mean that we didn't want a cloned MAC.

See https://bugzilla.redhat.com/show_bug.cgi?id=1467295

https://bugzilla.gnome.org/show_bug.cgi?id=793072
2018-02-06 10:42:18 +01:00
Georges Basile Stavracas Neto
a124a233ea network: Replace GtkVBox with GtkBox
GtkVBox is deprecated, and GtkBox with the vertical
orientation has the exact same layout.
2018-01-26 22:25:18 -02:00
Georges Basile Stavracas Neto
dc5bf7e658 network: Undo accidentally changed string
A colon was added but not spotted on time.

https://bugzilla.gnome.org/show_bug.cgi?id=787882
2018-01-26 22:19:11 -02:00
Jonathan Kang
81b68bc6ed wifi: Use GtkGrid for Wi-Fi Security settings page
GtkTable is deprecated. Use GtkGrid instead.

https://bugzilla.gnome.org/show_bug.cgi?id=787882
2018-01-26 21:17:47 -02:00
Jonathan Kang
b8568474dc network: Make details labels selectable
https://bugzilla.gnome.org/show_bug.cgi?id=779982
2018-01-26 20:50:00 -02:00
Bastien Nocera
17c6563e69 network: Fix runtime warning
Gtk-WARNING **: Failed to set property GtkImage.icon-size to button: Could not parse integer 'button'

Replaced it with the non-symbolic value "4".
2018-01-23 10:58:00 +01:00
Iñigo Martínez
0dd386f405 build: Migrate from Intltool to Gettext
Recent versions of Gettext are able to translate several formats
that are used in GNOME applications. This patch migrates from
Intltool to Gettext by using meson's i18n features.

https://bugzilla.gnome.org/show_bug.cgi?id=787588
2018-01-23 10:49:31 +01:00
Georges Basile Stavracas Neto
90a1187dd4 wifi: Improve empty state
Make it more consistent with the Bluetooth panel.

https://bugzilla.gnome.org/show_bug.cgi?id=790704
2018-01-21 13:13:51 -02:00
Xiang Fan
5ad72b6faa wifi: Add a refresh button
This way, user can scan anytime without having to wait.

https://bugzilla.gnome.org/show_bug.cgi?id=789869
2018-01-21 13:12:29 -02:00
Xiang Fan
c12c3b9298 wifi: Fix indentation
https://bugzilla.gnome.org/show_bug.cgi?id=786736
2018-01-21 13:03:23 -02:00
Xiang Fan
823c4868a6 wifi: Update the list when AP properties change
The best AP can be chosen even if no AP is added/removed.

https://bugzilla.gnome.org/show_bug.cgi?id=786736
2018-01-21 13:03:19 -02:00
Georges Basile Stavracas Neto
24abbcf303 network: Turn metered data switch into a check button
Per guidance of the design team, since the dialog has not
enough room for switches.
2018-01-18 14:00:23 -02:00
Iñigo Martínez
dc0988d47c build: Remove autotools
To avoid the burden of maintaining multiple build systems, this
patch removes autotools support.

https://bugzilla.gnome.org/show_bug.cgi?id=785414
2018-01-18 12:20:08 +01:00
Georges Basile Stavracas Neto
a37d04df42 connection-editor: Expose metered connection switch
NetworkManager supports marking a connection as metered, meaning
that connection is e.g. charged by its usage or extremely limited.
When a network is metered, background network usage must cease
and the behavior of the various OS pieces must be adjusted.

This patch adds a switch to set a connection as metered or not.
The property is imediately propagated to NetworkManager.

https://bugzilla.gnome.org/show_bug.cgi?id=792608
2018-01-18 00:37:31 -02:00
Piotr Drąg
b65e31323a panels: Remove soft hyphens from .desktop files
With the old shell gone, there is no need to work around cut off panel
names (bug #647087). As it stands now, it only confuses translators
(invisible characters are hard to, well, see).

https://bugzilla.gnome.org/show_bug.cgi?id=792629
2018-01-18 00:12:04 -02:00
Iñigo Martínez
32edd6789e build: Port to meson build system
Meson is a build system focused on speed an ease of use, which
helps speeding up the software development. This patch adds meson
support along autotools.

https://bugzilla.gnome.org/show_bug.cgi?id=785414
2018-01-17 20:09:35 -02:00