Commit graph

1132 commits

Author SHA1 Message Date
Alessandro Bono
3182b7019f net-device-ethernet: Don't check device iface name
If the interface name is wrong we shouldn't add the device in the first
place. The device comes from NM. If the interface name is wrong is a bug
at NM level.
2022-10-12 13:56:19 +02:00
Alessandro Bono
f6fa2fafec net-device-ethernet: Prevent double free
Fixes: ee53bfd8b6
2022-10-12 13:56:19 +02:00
Luciano da Silva Ribas
ee53bfd8b6 network: Fixed Network profiles shown on wrong device
Added missing interface name during network profile creation.

Fixes #353

Fixed issues from code review
2022-10-12 08:43:22 +00:00
Lubomir Rintel
ad0db360e2 network: Fix an assertion failure
Entering the Wi-Fi page without connected to a network trips an
assertion failure:

  (gnome-control-center:14943): nm-CRITICAL **: 16:36:16.732: nm_access_point_get_frequency: assertion 'NM_IS_ACCESS_POINT(ap)' failed

  Thread 1 "gnome-control-c" received signal SIGTRAP, Trace/breakpoint trap.
  0x00007ffff7c8ee51 in g_logv () from /lib64/libglib-2.0.so.0
  (gdb) bt
  #0  0x00007ffff7c8ee51 in g_logv () at /lib64/libglib-2.0.so.0
  #1  0x00007ffff7c8f0d3 in g_log () at /lib64/libglib-2.0.so.0
  #2  0x00007ffff63b7b8a in nm_access_point_get_frequency () at /lib64/libnm.so.0
  #3  0x00000000005965b1 in connect_details_page (self=0x4658210) at ../panels/network/connection-editor/ce-page-details.c:264
  #4  0x0000000000597f9e in ce_page_details_new (connection=0xfbde70, device=0xd52360, ap=0x0, editor=0x50a4350) at ../panels/network/connection-editor/ce-page-details.c:570
  #5  0x0000000000593273 in net_connection_editor_set_connection (self=0x50a4350, connection=0x7fffcc096770) at ../panels/network/connection-editor/net-connection-editor.c:522
  #6  0x0000000000593f7d in net_connection_editor_new (connection=0x7fffcc096770, device=0xd52360, ap=0x0, client=0xd3a0c0) at ../panels/network/connection-editor/net-connection-editor.c:790
  #7  0x0000000000582b16 in show_details_for_row (self=0xcc3040, row=0x46587b0, list=0x4273b40) at ../panels/network/net-device-wifi.c:987
  #8  0x00007ffff7d83845 in g_cclosure_marshal_VOID__OBJECTv () at /lib64/libgobject-2.0.so.0
  #9  0x00007ffff7da1b79 in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
  #10 0x00007ffff7da1eb8 in g_signal_emit_by_name () at /lib64/libgobject-2.0.so.0
  #11 0x000000000058d41f in on_row_configured_cb (self=0x4273b40, row=0x46587b0) at ../panels/network/cc-wifi-connection-list.c:251
  #12 0x00007ffff7da1b79 in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
  #13 0x00007ffff7da1eb8 in g_signal_emit_by_name () at /lib64/libgobject-2.0.so.0
  #14 0x000000000058c4c4 in configure_clicked_cb (self=0x46587b0) at ../panels/network/cc-wifi-connection-row.c:513
  #15 0x00007ffff7da1b79 in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
  #16 0x00007ffff7da1cb3 in g_signal_emit () at /lib64/libgobject-2.0.so.0
  ...
2022-09-22 09:22:12 +00:00
Jake Dane
1ae4d99421 network: Fix 802.1x TLS file chooser filters
If on the Security tab in the connection editor one selected 802.1x
with TLS authentication, the 3 file chooser dialogs there didn't
let one select any file. This was because allowed extensions were
passed to gtk_file_filter_add_suffix () with the leading dot but that
function expects them without the leading dot.

This could be fixed in the code by skipping over the dot but as per
discussion on !1433 it is preferable to use mime types instead. The
code is changed to use mime types for the file chooser dialog filter
and for checking a file is of the right type.

Fixes #2022.
2022-08-23 10:28:19 +00:00
Athul Iddya
43b61571c1 network: Show VPN empty state by default
The network panel used to show an empty box under the VPN header at
start up if no VPNs were present instead of the empty state. This was
because the GtkListBox containing VPN connections was visible by
default instead of the empty state widget.

To fix this, the empty state widget has been moved to the top in the
GtkStack to show it by default. If any VPN connections are found during
initialization, `cc-network-panel` already handles setting the
visibility of the appropriate widget correctly.

Fixes: #1634
2022-08-12 01:32:15 +00:00
Hendrik Müller
48497080b3 wifi: Fix bug in Known Wi-Fi Networks dialog
The "Forget" button would only update it's sensitivity after the first
select and deselect, when selecting and deselecting rows in the
"Known Wi-Fi Networks" dialog.
When selecting the first row, it would go from disabled to enabled.
Then deselecting that row would cause the button to go from enabled to
disabled.
Selecting any rows after that would no longer update the sensitivity and
make the dialog essentially useless.

The issue was, that the signals "add" and "remove" where being
expected to be emitted when the connection list updates its rows.
However, neither CcWifiConnectionList nor GtkListBox emit these signals.
The fix was, to emit these two signals at the appropriate locations.
The signals have also been renamed to "add-row" and "remove-row" to
make their purpose more clear.

Closes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1824
2022-08-03 11:05:16 +00:00
Hendrik Müller
c44ee6fa80 wifi: Add padding to Known Wi-Fi Networks dialog
The "Known Wi-Fi Networks" dialog is missing some padding to really
make it look polished.

By switching from a normal dialog to an AdwPreferencesWindow, we can
take advantage of libadwaita's automatic padding.
This will make sure the dialog is more in line with the rest of the
GNOME ecosystem.

Closes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1956
2022-08-03 09:18:39 +00:00
David King
590351051f network: Fix VPN with unescaped ampersand
Much like in commit 47c586a82e for the
wifi panel, fix escaping of titles for VPNs.

https://bugzilla.redhat.com/show_bug.cgi?id=2090996
2022-07-20 17:53:11 +00:00
Hendrik Müller
f0890ca1b6 wifi: Allow accessing settings of known wifi networks
Currently it is only possible to access the settings for the currently
connected wifi network.
Being able to configure a wifi network, even though it is not connected,
would be useful for example to share the password for a network that is
not in range.

To achieve this, a new property was added to CcWifiConnectionRow.
The new property "known_connection" signals whether this connection is
known and thus whether the options button for configuring it should be
displayed.

The property "known_connections" will be set to TRUE in two cases:
- when the list of connections is shown in the "Known Networks" dialog
- when the connection is known, but not the active connection

Closes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1906
2022-07-06 19:34:56 +00:00
Christian Glombek
0fbe2ada5a network/ce: Provide error tooltip in connection editor
Pass through localized libnm error messages as tooltips
to the apply button. That way, users can easily identify
configuration errors.
2022-06-20 23:37:44 +00:00
Maximiliano Sandoval R
96e0db8ba0 wifi-panel: Have all widgets with the same margins
As it was, the two listboxes had different sizes. Unfortunately, the different
panels have different sizes now.
2022-06-20 23:16:19 +00:00
Robert Ancell
4159a5ca68 network: Replace deprecated nm_client_wireless_set_enabled 2022-06-20 02:29:39 +00:00
Robert Ancell
6911110111 network: Replace deprecated nm_client_deactivate_connection 2022-06-20 02:29:39 +00:00
Robert Ancell
c23c56a0a1 network: Replace deprecated nm_device_disconnect 2022-06-20 02:29:39 +00:00
Amy
0f60cad6bd network: fix line break issues
Commit 5e0fc5c1 ("network: prevent crash by disconnecting device")
introduced two new line breaks after the final call of
remove_wifi_device. Those line breaks are unnecessary, as pointed out by
Robert (@robert.ancell). They should be removed for the MR to be merged.

This patch removes those line breaks, which should allow for !1359 to be
properly merged.
2022-06-20 01:24:25 +00:00
Amy
fd76bfb71e network: prevent crash by disconnecting device
When a device is registered with add_wifi_device, a corresponding signal
is registered for events. The associated remove_wifi_device clears the
associated pages, but does not disconnect the signal. This causes the
assertion NET_IS_DEVICE_WIFI to fail.

This patch corrects this error, resolving #1889 as per the suggested fix
from Benjamin (@bberg).
2022-06-20 01:24:25 +00:00
Maximiliano Sandoval R
2252ee27b4 connection-editor: Set default height to 600
If the dialog cannot be resized might as well be big enough to not
require scrolling on a big enough screen.
2022-06-20 00:30:58 +00:00
David Bauer
533b698f60 network: implement handling for OWE TM
Implement handling for OWE-TM networks.

 * Correctly display encryption type when connected to a OWE-TM network
   with an open profile (Previously showed as WPA2
 * Mask out hidden transition SSID when connected to the OWE-TM network
 * Don't display OWE-TM network with lock icon

Signed-off-by: David Bauer <mail@david-bauer.net>
2022-06-19 23:53:24 +00:00
Maximiliano Sandoval R
3a96f428ca ce-page-details: Do not set children for CheckBtn
This widget does not support adding arbitrary children, a warning was
issued when it was disposed for still having children.
2022-06-19 22:17:18 +00:00
Christian Glombek
1e06a0e0dd network/ce: Fix address label ids on ip4-page
In 861d762ce5,
the address labels on the IPv4 page were renamed, however the corresponding
change was not made in the respective .ui file, which results in a crash upon
construction of the page. This change fixes that.
2022-06-19 21:50:23 +00:00
Bastien Nocera
47c586a82e network: Fix Wi-Fi network with "&" in name not appearing
My neighbours' Wi-Fi makes the Wi-Fi panel throw an error:
(gnome-control-center:346639): Gtk-WARNING **: 15:16:21.993: Failed to set text 'Bbox Hugo & Laura' from markup due to error parsing markup: Error on line 1: Entity did not end with a semicolon; most likely you used an ampersand character without intending to start an entity — escape ampersand as &amp;

Escape the SSID before using it to set the label.
2022-06-09 20:54:57 +00:00
Maximiliano Sandoval R
9327bbe759 wifi-connection-list: Add margins and align 2022-06-01 02:17:13 +00:00
Maximiliano Sandoval R
7cb4dc4ff0 network-wifi: Use ListBox in popover
This gives us the correct style on the popover.
2022-06-01 02:17:13 +00:00
Maximiliano Sandoval R
42f64f197f Make buttons in actions rows and header flat 2022-06-01 02:17:13 +00:00
Lukáš Tyrychtr
861d762ce5 Address review feedback 2022-05-10 21:26:05 +00:00
Lukáš Tyrychtr
3151598aef Make the network settings panel more screen reader friendly 2022-05-10 21:26:05 +00:00
Felipe Borges
340ee1dc4a connection-editor: Unparent child widget on dispose
WirelessSecurityWPAEAP is a GtkWidget owned by the CEPage8021xSecurity
widget, which is supposed to "unparent" it on "dispose" (since parents
hold a reference to child widgets). Instead we were calling
g_clear_object on it.

Fixes #1671
2022-05-03 17:45:14 +02:00
Jonathan Kang
ce93dbb3a0 network/connection-editor: always load all available VPN plugins
Previously, when a list of VPN plugins was loaded once, it will not load
again the next time you try to add a VPN connnection. This causes an
issue that if you keep gnome-control-center open and install a new VPN
plugin, the new VPN plugin won't show up in the VPN plugin list.

Fix that by always load all avilable VPN plugins when showing the
"Add VPN" dialog.
2022-03-18 21:37:48 +00:00
Jonathan Kang
6f1567f236 network/connection-editor: destroy the editor when closing
If an user opens an connection editor and then closes it, repeat this
multiple times causes lots of unused hidden editor windows.

Fix that by destroying the connection editor instead of hiding them
when closing.
2022-03-18 21:37:48 +00:00
Ana Cabral
43bb1d9200 network: Fix OWE settings
Enhanced Open (OWE) is not being saved properly from connection-editor.
When we create a Wi-Fi connection using Enhanced Open (OWE) Security
from nm-connection-editor and save it, it was not being saved and the
security was being set as "None", with Wireless Security Setting
being discarded. This is fixed by this commit. The fix is also being
done in libnma (implementing OWE in libnma,
https://gitlab.gnome.org/GNOME/libnma/-/issues/9), but this commit
fixes meanwhile it gets ready.

It was solved by adding treatment for the case in which owe was set.
OWE is not treated anymore in the same case as None.

https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1521
2022-02-24 12:56:43 +01:00
Alessandro Bono
10489fb208 net-vpn: Don't append VPN in the title of the editor dialog
We don't do anything similar for other connections editors (wired and WiFi).
We alredy know that we are modifying a VPN, no need to repeat ourself.
2022-02-15 14:42:13 +00:00
Alessandro Bono
ce1c00be5d net-vpn: Don't append VPN to each row
We don't do anything similar for other connections rows (wired and WiFi).
All the rows are VPNs. No need to repeat ourself.
2022-02-15 14:42:13 +00:00
Mohammed Sadiq
0452e9eb4d network: Fix a possible memory leak in QR code
It's possible that the QR code for the same text has been requested,
but for a different size.  Fix a memory leak that would happen
in those cases.
2022-02-12 21:47:07 +00:00
Mohammed Sadiq
15df3bc494 network: Fix QR code with dark theme
Explicitly set white background for the image so that white border
is shown around the QR code in dark themes too.
2022-02-11 17:24:52 +00:00
Felipe Borges
37ee555c44 network: Show configuration button only for active/connecting connections
In commit c7bd442839 we started to
show the configuration button for all rows, which fixes the original
issue of not being able to tweak a connection during association but
also introduces a regression of not having connection data to show
for other connections in the list. This way, the configuration
button will fail to create a net_connection_editor interface for
rows that aren't associated with an active connection.

Let's only show the configuration button when the NMActiveConnectionState
is either NM_ACTIVE_CONNECTION_STATE_ACTIVATING or
NM_ACTIVE_CONNECTION_STATE_ACTIVATED.

Fixes #1494
2022-02-10 15:05:08 +00:00
Christopher Davis
fc8817380d network: Center connection-editor spinner
Prevents the spinner from taking up a large amount
of space.
2022-02-05 00:11:21 +00:00
Christopher Davis
41cc608721 network: Use AdwPreferences{Page,Group} for network panel
Uses AdwPreferences{Page,Group} where possible.
net-device-ethernet has been changed into an
AdwPreferencesGroup subclass itself.
2022-02-04 17:54:25 +00:00
Christopher Davis
e7f89a49d5 network: Clean up ethernet details row
* Remove placeholder text
* Remove redundant haligns
* Remove redundant `selectable=False`
* Set activatable widget
2022-02-04 17:54:25 +00:00
Christopher Davis
fcc1cb9da7 network: Adjust list styling and use GtkStack for ethernet
Previously we used an unstyled list for the network
connections, and we switched lists by using
GtkWidget:visbile.

This commit makes the connection list use boxed-list
styling, and adds a GtkStack.
2022-02-04 17:54:25 +00:00
Christopher Davis
ffeec81f0e network: Use AdwActionRow for NetDeviceBluetooth
Similar to the last commit, we can use a regular
GtkListBox and make the device widget an AdwActionRow.
2022-02-04 17:54:25 +00:00
Christopher Davis
de16d7bb39 network: Use AdwActionRow and GtkListBox for vpn list
Previously the widget was using a hack to show
separators and had a row nested in a listbox,
nested in a box. Instead of having a custom setup
to work around not haveing a listbox, we can use a
listbox.

See: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1587
2022-02-04 17:54:25 +00:00
Mohammed Sadiq
5855b661fe wifi: Fix to use the updated details to create hotspot
Let the callback to "response" signal run after the default
so that we use the updated details to create hotspot.
Otherwise, the changes made won't be used.

This is required as the default handler updates the connection
details in cc-wifi-hotspot-dialog.
2022-02-01 17:29:54 +00:00
Mohammed Sadiq
ebab3214ca wifi: Avoid padding in hotspot QR code
The padding is now handled by CSS, so we no longer have to set padding
in expense of QR pixel quality
2022-02-01 18:25:23 +05:30
Jakub Steiner
13376ecb8b Add individual app icons 2022-01-31 14:08:22 +00:00
Sam Hewitt
b0bc4f4a76 network: Minimize small symbolic icons 2022-01-24 20:07:52 +00:00
Georges Basile Stavracas Neto
acd59aec65 Rename app-id to org.gnome.Settings
Rename the app-id to org.gnome.Settings since this is what
we've been calling it for many years now. Adjust all files
that derive from the app-id, such as the desktop file, D-Bus
service file names, search providers, GSettings schemas, to
match that.

Closes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/344
2022-01-21 13:08:50 +00:00
Mohammed Sadiq
99d4947c63 wifi: Use Paintables for QR code
This fixes showing qr code when the window is scaled.
2022-01-20 19:06:22 +05:30
Georges Basile Stavracas Neto
82c87578cd window: Install action to navigate main leaflet
This allows implementing the back button of panel titlebars
trivially, which is also done in this commit.
2022-01-20 02:23:42 +00:00
Georges Basile Stavracas Neto
4300a4a290 panels: Use new CcPanel helpers for title widgets
This should significantly simplify these panels, by not forcing
them to override GObject.constructed all the time. Most panels
were quite straightfoward.
2022-01-20 02:23:42 +00:00