Commit graph

1314 commits

Author SHA1 Message Date
Automeris naranja
1f0da3ca65 network: Use a placeholder widget in the VPN list box
Using a GtkStack isn't necessary to display the "Not set up"
row. Instead, use a GtkListBox placeholder widget in the main
VPN list box.

This improves consistency with the placeholders from "Privacy >
Location/Camera/Microphone" when there are no apps; same thing
in "Search > Search Locations > Custom Locations" when no custom
locations were added.

https://docs.gtk.org/gtk4/class.ListBox.html#gtklistbox-as-gtkbuildable
2024-04-15 13:06:21 +00:00
Automeris naranja
2ed2407af7 network: Remove redundant a11y labels
AdwActionRow, CcListRow, AdwSwitchRow and AdwSpinRow are already
accessible by default, so using a11y labels on these widgets is
redundant.
2024-04-14 22:38:13 -03:00
Felipe Borges
9d24aed45a network: Set adw_dialog_present as handler for saved_networks_row 2024-04-09 11:36:51 +02:00
Matthijs Velsink
5fedb30a08 network: Add stable-ssid support for cloned-mac
NetworkManager 1.46.0 added support for "stable-ssid" for cloned mac,
which generates a stable MAC address based on SSID for each network.

This got accepted as the new default for Fedora 40, see
https://fedoraproject.org/wiki/Changes/StableSSIDMACAddress and
https://pagure.io/fesco/issue/3135.

However, there is no support for the connection editor for this value,
meaning if "stable-ssid" is set, changes to a WiFi network can't be
applied.

Fix this by adding support for "stable-ssid". Essentially based on
network-manager-applet!143
(network-manager-applet@202149c0843510a944afe2257cf56fbb7b4d2ef9).

Closes #2852
2024-04-04 11:53:43 +00:00
Automeris naranja
08ea9efe77 wifi: Port "Saved Wi-Fi Networks" dialog to AdwDialog 2024-04-02 16:25:46 +00:00
Automeris naranja
fef18e73b6 qr-code-dialog: Port to AdwDialog 2024-04-02 16:03:43 +00:00
Felipe Borges
d1c3711fe6 network: Add CcWifiConnectionList.set_placeholder_text
This allows for CcWifiConnectionList to be reused in different locations
where the placeholder might differ.

For example, the main wifi connections list vs. the saved network
connections (forget dialog).

See !2384, !2397, and !2418

Fixes #2574
2024-04-02 12:09:57 +02:00
Automeris naranja
1578ebefc7 wifi: Don't show "No Wi-Fi Adapter Found" when Wi-Fi is off
Use "nm_client_wireless_hardware_get_enabled" to check if
Wi-Fi is enabled or not at the hardware level. Then, show
a different AdwStatusPage when the Wi-Fi adapter is absent
and when Wi-Fi is off.

Reference:
cfb7cae4a9

Closes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1514
2024-03-27 22:46:01 +00:00
Automeris naranja
beaa14ecdf wifi-connection-list: Add a placeholder widget to the list box
Doing so, the Wi-Fi list box won't appear broken when
it's empty.

Closes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2574
2024-03-20 09:14:35 +00:00
Automeris naranja
e31dd03fdc network-vpn: Add tooltip to the VPN options button
Also, remove the a11y label because Orca also reads tooltips.
2024-03-12 12:40:45 +00:00
Automeris naranja
cb8819657b general: Rename "computer" strings to "device"
"Computer" isn't a suitable term for other device
form factors. Also, there are several strings in
Settings that already use "device", and cc-color-panel.ui
uses a mix of "computer" and "device" strings, which is
weird.
2024-03-11 15:19:55 +00:00
Automeris naranja
e261d51617 network: Use "secondary-label" property in the Proxy row
The Proxy row shows its value as subtitle, which is
inconsistent with other rows where the subtitle describes
the row title/what the row is.

Show the proxy value as a CcListRow secondary-label to fix
such issue.

Reference:
cfb7cae4a9
2024-02-29 13:53:34 +00:00
Automeris naranja
31927efeac wifi-connection-row: Minor tweaks
- Make all buttons as suffix widgets,
which makes unnecessary to wrap them in
a GtkBox that is set as a suffix widget

- Don't set a margin end to the Wi-Fi
icon[1]

- Remove halign from the buttons, because
it isn't necessary

- Remove halign from the buttons, as it
isn't necessary because halign works only
if hexpand is set to TRUE

- Add margin end to the spinner so it
doesn't appear misaligned with the other
widgets at the end of the row

[1] In latest mockups, the margin between
the Wi-Fi icon and network name is also
shorter: cfb7cae4a9
2024-02-26 16:02:23 +00:00
Automeris naranja
af55df0194 network-wifi: Remove "activatable" property from some CcListRows
The CcListRow template already sets the row
as activatable[1].

[1] https://gitlab.gnome.org/GNOME/gnome-control-center/-/blob/gnome-45/panels/common/cc-list-row.ui?ref_type=heads#L4
2024-02-20 19:04:26 -03:00
Felipe Borges
f54558d58e wifi: Add translator comment to "Saved Networks" dialog 2024-02-16 09:50:20 +00:00
shruti2522
e289a8b3b6 wifi: pluralize string using ngettext 2024-02-16 09:50:20 +00:00
Sam Hewitt
a5f6efaddb Update and clean up symbolic icon assets
- refresh the symbolic icons to sync some style changes and update the source sheet
- rename assets for the privacy subpanel's symbolic icons
- delete deprecated/unused symbolic icons
- add new icon for system panel
- add new icon for remote desktop so it isn't using displays icons
2024-02-10 16:17:35 +00:00
velsinki
9309b65f3d wifi: Change existing toast at each forget network
Merge request !2093 fixed 3 crashes in the Saved Networks Dialog, but
unfortunately added another one. Upon undoing an AdwToast after deleting
a network, Settings crashes.

Furthermore, the title of the toast is quite verbose, meaning it often
gets ellipsized. Also, deleting many networks is somewhat annoying
because many toasts get generated. Since only the latest toast is saved
in the NetDeviceWifi, mixed dismissing and undoing of multiple toasts
doesn't work properly either.

We fix all these issues by having only one toast, that either says
"Network deleted" or "%d networks deleted". The networks are kept in a
GPtrArray, for which the free function is set to either really forget
the networks or to undo forgetting them.
2024-02-06 12:35:46 +00:00
velsinki
cbd2b7b988 wifi: Start using saved_networks_list more
Commit 99b42130 introduced the `saved_networks_list` struct member, so
we do not need to set and get a "list" variable on the rows anymore
since they already contain the NetDeviceWifi.
2024-02-06 12:35:46 +00:00
Ondřej Pohořelský
e6978a4801 wifi: show password when sharing QR code
Added plain text Wi-Fi password when sharing Wi-Fi connection
Resolves: #2757
2024-02-06 10:02:50 +00:00
Matthijs Velsink
3a253bc4b1 general: Use g_clear_handle_id to remove GSources
Using `g_clear_handle_id()` in combination with `g_source_remove()` can
save a lot of boiler plate code.

This removes about 110 lines of code for free.
2024-02-06 09:22:07 +00:00
velsinki
9716575162 network: Fix missing VPN entries
This required some archeology: 52d28579 introduced virtual device
support. This was done by getting the virtual device name and testing if
that was `NULL`. Then came 8861d440, which removed virtual devices, but
did not revert fully to the behavior before 52d28579. Combined with
9183d349, this meant that any VPN that has an interface name set, will
never be displayed.

Fix this by reverting to the behavior before 52d28579, while keeping
wireguard support. The added check from ddc35609 is left in, although it
is not clear to me if that is still needed.

Fixes #2822
2024-01-30 17:02:00 +00:00
Felipe Borges
69a6abd0fa network: Make NetDeviceWifi use CcHostname to obtain the display name 2024-01-30 13:34:10 +00:00
Automeris naranja
b1d1302053 general: Remove a11y labels from buttons that have tooltips
Orca also reads tooltips, so having both a11y labels
and tooltips is redundant.

See https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/2023#note_1915854
2024-01-30 13:28:48 +00:00
Automeris naranja
58b0d7392a net-proxy-page: Add mnemonic to the "Configuration URL" entry 2024-01-23 11:09:19 +00:00
Automeris naranja
547b4542be network-ethernet: Tweak network options button tooltip
- Change "Options" to "Network Options" to
provide more context

- Remove the a11y label, which is redundant,
because this button already have a tooltip (the
screen reader also reads tooltips)
2024-01-23 10:55:23 +00:00
Automeris naranja
7fd77c339d wifi-connection-row: Tweak tooltips
- Rename "Show QR Code" to "Share Network",
since the latter is is the proper name of
this action

- Change "Options" to "Network Options" to
provide more context

- Add tooltip to the forget network button

- Removes a11y labels from buttons that already
have tooltips, since the former is redundant
due to the fact that the screen reader reads
tooltips
2024-01-23 10:55:23 +00:00
Automeris naranja
d12a7713d5 qr-code-dialog: Port to AdwWindow/AdwToolbarView
See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2624
2024-01-18 11:58:34 +00:00
velsinki
b76d6d0d00 ethernet: Add thousands separator to speed
Increases readability for speeds >= 1000 Mb/s.

Fixes #2804
2024-01-08 12:52:59 +00:00
velsinki
0b3c670ed4 wifi: Avoid critical warning for hotspot dialog
The CcWifiHotspotDialog is derived from GtkDialog, which is floating.
The floating reference is destroyed on closing the main window, before
the NetDeviceWifi is disposed. This causes a critical warning when the
NetDeviceWifi dispose does run, since it tries to destroy a now
non-existent window.

Fix this by sinking the floating reference, and unreffing it in the
NetDeviceWifi dispose function.

Fixes #2823
2024-01-08 09:38:55 +00:00
Bart Gravendeel
cacc2b5bef Remove use-underline property from all CCListRows 2024-01-04 10:11:35 +00:00
velsinki
99b42130b0 wifi: Fix crash when switching to other panel after forget network
Similar to the previous crashes, if you switch panels after forgetting a
network while the toast is still alive, Settings crashes. This is
because the AdwToastOverlay is not properly disposed because the Saved
Networks dialog is also not destroyed.

However, destroying the saved networks dialog still leaves a crash,
because the overlay disposal first unreferences its child, but we still
need that for the dismissal of the waiting toasts. Therefore, we keep an
extra reference to the saved networks list.

To prevent further crashing, we cannot set "list" to NULL, because there
may be multiple async calls. Also, we have to keep a reference to self
in the async call, otherwise it does not work when you remove many
networks and then switch panels.

As an added bonus, we can now use the saved networks list inside the UI
refresh function.
2023-12-19 09:33:26 +00:00
velsinki
794d8f5135 wifi: Move Saved Network mostly to .ui and clean up
It is cleaner to define the dialog in a .ui file. Moreover, since we are
initializing the main Visible Networks list in the code, we can
initialize the Saved Networks list in the same location, in the same
style.
2023-12-19 09:33:26 +00:00
velsinki
74279db43f wifi: Clean up net-device-wifi
There is a lot of unused code for the saved networks dialog. We can
remove all of that.

We furthermore format the code a litte better.
2023-12-19 09:33:26 +00:00
velsinki
91771c4c31 wifi: Avoid casting of Adw and GTK types
This reduces some of the casting noise in the code.
2023-12-19 09:33:26 +00:00
velsinki
218adbd306 wifi: Fix crash on reopen of Saved Networks after forget
When a network is forgotten from the Saved Networks dialog and the
dialog is closed, the toast remains active. However, when you then
quickly reopen the dialog, a new CcWifiConnectionList gets made, which
causes a crash when the toast expires or is dismissed, as the row for
the toast has now become invalid.

Fix this by only setting up the CcWifiConnectionList for saved networks
once.
2023-12-19 09:33:26 +00:00
velsinki
7a4869017e wifi: Fix "forget multiple networks" crash
When forgetting more than one network from the Saved Networks dialog,
there are multiple overlapping toasts. When the first toast expires or
is dismissed, the underlying CcWifiConnectionList is already thawed,
meaning previous rows get cleaned up and new ones generated. When the
next toast then expires or is dismissed, this results in a crash, as the
row belonging to that toast is now invalid.

Fix this by freezing the connection list earlier.

Fixes #2793
2023-12-19 09:33:26 +00:00
velsinki
1e8ce56887 ce-vpn-page: Fix layout of Identity page
b291e98c introduced a scrolled window, but forgot to update the C code
to use the new box instead. Now we use it correctly again.

Fixes #2795
2023-12-15 10:49:22 +00:00
velsinki
0427e160bd network: Hexpand connection editor routes labels
Commit ef644deb made the routes labels for the IPv4 and IPv6 center
properly. However, when stretching the dialog, this centering is lost
because the labels do not horizontally expand.

So let's make all of them horizontally expand.
2023-11-30 09:41:49 +00:00
Maximiliano Sandoval R.
200cac0970 connection-editor: Remove default size
In the previous commits we added scrolled windows on all pages, these
scrolled windows propagate their natural size and hence the dialog will
try to present itself with that size.

By having all pages inside of a scrolled window we can now use the
connection editor on mobile devices.

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2764
2023-11-29 17:35:16 +00:00
Maximiliano Sandoval R.
b291e98c00 ce-vpn-page: Add a scrolled window
We wrap the contents of the page in a scrolled window.
2023-11-29 17:35:16 +00:00
Maximiliano Sandoval R.
f37e284ae4 ce-ip6-page: Remove comments 2023-11-29 17:35:16 +00:00
Maximiliano Sandoval R.
e85f094184 ce-ip6-page: Propagate natural size of content
We remove hscrollbar-policy=never. This can only work if the view is
adaptive. This has to be restored once the page is adaptive.
2023-11-29 17:35:16 +00:00
Maximiliano Sandoval R.
4fade06a02 ce-ip4-page: Propagate natural size of content
We remove hscrollbar-policy=never. This can only work if the view is
adaptive. This has to be restored once the page is adaptive.
2023-11-29 17:35:16 +00:00
Maximiliano Sandoval R.
3b3ca34a57 ce-wireguard: Propagate natural size of content
We remove hscrollbar-policy=never. This can only work if the view is
adaptive. This has to be restored once the page is adaptive.
2023-11-29 17:35:16 +00:00
Maximiliano Sandoval R
15844ddefe ce-page-details: Port to AdwBin
We add a scrolled window.
2023-11-29 17:35:16 +00:00
Maximiliano Sandoval R.
f374c62b81 ce-page-ethernet: Port to AdwBin
We add a scrolled window.
2023-11-29 17:35:16 +00:00
Maximiliano Sandoval R.
665288a47c ce-page-wifi: Port to AdwBin
We add a scrolled window.
2023-11-29 17:35:16 +00:00
Maximiliano Sandoval R.
4f8789c466 ce-page-security: Port to AdwBin
We add a scrolled window.
2023-11-29 17:35:16 +00:00
Maximiliano Sandoval R.
15694399dd ce-8021x-security-page: Port to AdwBin
We add a scrolled window.
2023-11-29 17:35:16 +00:00