Commit graph

61 commits

Author SHA1 Message Date
Automeris naranja
d014202c3e wifi: Port "Turn Off Wi-Fi Hotspot?" to AdwAlertDialog
Also:
- Move the dialog to the .ui file, as this dialog is UI-related
- Don't destroy/force close the dialog, as it will be closed
automatically after the responses are triggered
2024-05-17 00:20:26 +00: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
Marco Melorio
b75bb10bb6 misc: Replace usage of CcListRow + switch with AdwSwitchRow
That feature will be removed in the next commit.
2023-06-30 09:06:56 +00:00
Fareed
1b70d766d6 wi-fi: Move controls out of headerbar
Enable switch and dropdown taken out of header bar.
Follow order of Network mockups for row order. Wifi hotspot
remains here until full network panel redesign completed.

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2413
2023-06-12 19:40:04 -04:00
Robert Ancell
a01e179830 network: Connect signal handlers in swapped form 2023-06-07 09:12:54 +12:00
Robert Ancell
89c054a31b network: Do signal handlers in swapped form 2023-05-30 08:36:22 +00:00
Maksym Hazevych
e00f773b2f Remove unnecessary visibility change 2023-03-29 14:26:55 +13:00
Maksym Hazevych
d831e5cb48 Replace all occurrences of 'gtk_widget_show'
Replace all occurrences of 'gtk_widget_show(smth)' with
'gtk_widget_set_visible(smth, TRUE)'.
2023-03-29 14:26:55 +13:00
Hendrik Müller
add2f0d2f7 wifi: Add QR code to share Wi-Fi networks
Many devices are able to scan a specifically formatted QR code to
connect to a wifi network.
To make sharing of wifi connections easier, it would be helpful to
display such a QR code in the wifi settings.

A button is added to the wifi connection row. This row is shown in
the general wifi settings panel, as well as in the "Known Wi-Fi Network"
dialog. Clicking the button opens an additional dialog, which shows the
QR code.
2023-02-14 19:11:07 -03:00
Georges Basile Stavracas Neto
284ff9fa0d network: Cosmetics 2023-02-06 10:38:43 -03:00
Gotam Gorabh
820a204853 wi-fi: updated stop hotspot dialog
This changes update the UI of current outdated stop hotspot dialog.
Using AdwMessageDialog instead of GtkMessageDialog to update it.

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2291
2023-02-06 13:34:23 +00:00
Mohammed Sadiq
3b121805ed log: Improve logging
The 'tracing' build option is no longer needed.  And the verbosity
of logs can be set by providing '-v' multiple times.
2022-12-01 11:44:17 +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
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
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
Georges Basile Stavracas Neto
efbad6eb50 network: Port to GTK4
Boy this was hard.

To ease the pain of porting wireless-security to GTK4, add
a new WsFileChooserButton class that mimics the behavior of
a button that triggers a filechooser, as per the migration
guide suggests.

There were lots of GtkGrids, so the diff is particularly
horrendous. Sorry.

This needs serious testing before landing.
2021-12-14 22:34:21 -03:00
Mohammed Sadiq
452439a036 wifi: Simplify airplane mode switch 2021-01-08 02:54:15 +00:00
Mohammed Sadiq
cc7662e24b wifi: Add HotSpot QR code support
When wifi hotspots are created generate a QR code
so that supported devices can connect to the hotspot
by simply scanning the QR code image
2020-08-05 14:25:51 +05:30
Jamison Lofthouse
f103ca3d04 Disconnect wifi device changed callback 2020-06-30 03:56:31 +00:00
Jamison Lofthouse
a2e494f418 Clean up wifi panel widgets in correct order 2020-06-30 03:56:31 +00:00
Jamison Lofthouse
f4d2eeb7f7 Add wifi device change callback
Add any wifi devices that have become managed or remove ones that have
become unmanaged. Since a device could have been added or removed
previously, we also have to handle multiple calls to add or remove a
device.
2020-06-30 03:56:31 +00:00
Jamison Lofthouse
6c63c3980e Split wifi device handling conditions 2020-06-30 03:56:31 +00:00
Jamison Lofthouse
0e26087a01 Split device removed into separate functions 2020-06-30 03:56:31 +00:00
Robert Ancell
93b14a4339 panel: Move shared GCancellable code into panel class
Make the panel class provide a cancellable that will be cancelled when the panel
is destroyed. Panel implementations can use this and not have to mangage the
cancellable themselves. Consolidate cases where panels had multiple cancellables
that were all being used for this behaviour.
2020-02-03 09:36:24 +13:00
Robert Ancell
ff042560d6 network: Remove unused sizegroup 2019-11-06 10:40:23 +13:00
Robert Ancell
7b01c11840 network: Convert NetDeviceWifi to GtkTemplate 2019-11-06 10:40:23 +13:00
Robert Ancell
a39ebd5bda network: Remove net_object_get/set_title 2019-11-06 10:40:23 +13:00
Robert Ancell
577762b60c network: Remove NetDevice class
We don't need the NetObject/NetDevice class separation anymore
2019-11-06 10:16:40 +13:00
Robert Ancell
1c92cf4844 network: Remove net_device_get_nm_device 2019-11-06 10:16:40 +13:00
Robert Ancell
966cb97d45 network: Remove net_object_get_cancellable
Only a few objects need it
2019-11-06 10:16:39 +13:00
Robert Ancell
5e4ca84c4c network: Use correct type iterating over list
The list only contains one type of object.
2019-11-06 10:16:39 +13:00
Robert Ancell
c74d26bf3a network: Remove NetObject id property
This is better handled by comparing objects.
2019-11-06 10:16:39 +13:00
Robert Ancell
76de0ce408 network: Simplify net_object_add_to_stack function
Except in the WiFi case it was creating a stack with one child.
All the non-WiFi cases had the same logic.
2019-11-06 10:16:39 +13:00
Robert Ancell
0c92c7b461 network: Replace g_object_new with constructors 2019-11-06 10:16:20 +13:00
Robert Ancell
926063acb3 network: Remove unused GObject property 2019-10-22 20:11:45 +00:00
Robert Ancell
54f8fce47f network: Connect signals in swapped form 2019-10-22 20:11:44 +00:00
Robert Ancell
9a2e821fe5 Initialize autoptr values to NULL.
These cases were safe, but if the code changed this risked freeing uninitialized
memory.
2019-10-03 10:58:38 +13:00
Robert Ancell
e70610fe74 network: Use g_autoptr for unref code 2019-09-13 14:20:50 +12:00
Robert Ancell
01190db349 network: Use g_autoptr for GError handling 2019-09-13 14:20:50 +12:00
Georges Basile Stavracas Neto
c4e8464818 wifi: Show a spinner when scanning for new access points
The spinner was already present in the UI file! It just needs
minor cleanups (such as moving the bottom margin from the label
to the parent box) and binding the widget to the structure.

We need to monitor which device is visible since the Wi-Fi panel
deals with multiple Wi-Fi devices as well.

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/issues/551
2019-06-16 01:01:36 +00:00
Georges Basile Stavracas Neto
0d9aa40cf0 wifi: Add device widgets after caching in the array
This will be required to bind the "scanning" property of
the NetDeviceWifi to the GtkSpinner.
2019-06-16 01:01:36 +00:00
Georges Basile Stavracas Neto
75f150d5a2 shell: Add position to cc_shell_embed_widget_in_header()
So we can control where the widget should be added to. The
main window only supports left and right positions.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/528
2019-05-21 12:59:36 -03: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
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
Georges Basile Stavracas Neto
90e7f05057 wi-fi: Remove unused header 2018-05-29 16:09:51 -03:00