Commit graph

45 commits

Author SHA1 Message Date
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
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
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
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
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
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
fe5ab55ec4 wifi: fix typo in device_removed_cb()
https://bugzilla.gnome.org/show_bug.cgi?id=789872
2017-11-08 15:34:02 +01:00
Rui Matos
cb4a7e1773 network: Avoid crashing if NM reports no devices or no connections
Seems like NM changed behavior recently but, in any case, better safe
than sorry.

https://bugzilla.gnome.org/show_bug.cgi?id=788716
2017-11-01 16:47:36 +01:00
Jeremy Bicha
c9c1ba5f11 wifi: Fix help link
https://bugzilla.gnome.org/show_bug.cgi?id=789321
2017-10-24 11:42:31 -04:00
Georges Basile Stavracas Neto
fcf4e44ebd wifi: Don't access potentially invalid pointer
When the user launches Settings with a panel passed
as argument, the following things happen:

 1. The Wi-Fi panel starts loading.
 2. The command line arguments are passed and the given
    panel is activated.
 3. The Wi-Fi panel cancels the loading routine, and
    rfkill_proxy_acquired_cb() is called with the GError
    set as G_IO_ERROR_CANCELLED.
 4. Crash in rfkill_proxy_acquired_cb().

The crash is caused because, when rfkill_proxy_acquired_cb()
is called, the CcWifiPanel instance isn't valid anymore. And
yet, the code tries to cast 'gpointer user_data' to a
CcWifiPanel pointer.

Fix that by only trying to cast anything after parsing the
GError set by the callback.
2017-08-12 18:58:10 -03:00
Georges Basile Stavracas Neto
016efdfac8 wifi: Introduce Wi-Fi panel
The glory moment has come. The new Wi-Fi panel is finally
introduced using a different code style from the rest of
the Network panel, since Control Center itself is written
using the GTK+ C code style.

The Wi-Fi panel uses modern GTK+ features like template
classes and new widgets. The files are stored together
with the Network panel so that we can reuse the abstraction
layer that the Network panel has to manage devices.

https://bugzilla.gnome.org/show_bug.cgi?id=784818
2017-07-18 13:30:46 -03:00