Commit graph

69 commits

Author SHA1 Message Date
Christian Glombek
475faaf26b network: Add support for WireGuard (GNOME/gnome-control-center#982)
Adds support for managing WireGuard VPN connections:

- Listing WireGuard connections as VPN connections
- Toggling connection state
- Creating, updating and deleting WireGuard connections
- Creating, updating and deleting WireGuard peers
- Importing WireGuard config files

Co-authored-by: Nathan-J. Hirschauer <nathanhi@deepserve.info>
2023-01-16 20:35:02 +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
Robert Ancell
6911110111 network: Replace deprecated nm_client_deactivate_connection 2022-06-20 02:29:39 +00: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
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
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
Robert Ancell
8ded3d956f network: Show spinner instead of delaying dialog
It's better to respond to the user immediately rather than delay the window opening.
2020-12-17 21:27:51 +00:00
Robert Ancell
a1e26cdac1 network: Set transient window from outside NetConnectionEditor constructor 2020-12-17 21:27:51 +00:00
Robert Ancell
3beaa9d158 network: Move signals handlers into .ui files 2020-11-11 20:13:46 +00:00
Robert Ancell
5b14e16e9c network: Connect signals with g_signal_connect_object in swapped form 2020-03-30 16:18:50 +13:00
Robert Ancell
c37ab4032b network: Fix warnings after removing a VPN
This is due to the object being accessed after being unreffed - connect the signal
so it is removed when the object is finalized.

This regression was introduced in 93a269f8 when switching to GtkTemplate.
2019-11-28 13:21:11 +00:00
Robert Ancell
a75dbf033c network: Make NetVpn constructor consistent with other constructors 2019-11-06 10:40:23 +13:00
Robert Ancell
93a269f8df network: Convert NetVpn to GtkTemplate 2019-11-06 10:40:23 +13:00
Robert Ancell
7e84af0d6d network: Remove net_object_emit_changed
Turns out nothing was actually listening to it.
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
2752f38a72 network: Remove net_object_emit_removed 2019-11-06 10:40:23 +13:00
Robert Ancell
2b3c6ea3e4 network: Don't use refresh virtual method for VPN objects
The refresh is only called internally
2019-11-06 10:16:40 +13:00
Robert Ancell
6207f84ba2 network: Remove unused code 2019-11-06 10:16:39 +13:00
Robert Ancell
29734b599c network: Remove net_object_get_client
Better handled inside each 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
0b3ce1e15d network: Remove net_object_get_panel
It was only being used for WiFi devices
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
6ab75da5c6 network: Use g_clear_pointer 2019-11-06 10:16:20 +13:00
Robert Ancell
a1439b32b1 network: Remove unused virtual method 2019-10-22 20:11:45 +00:00
Robert Ancell
62af171d8b network: Remove net_object_edit virtual method
It didn't need to be virtual and was only used in two cases
2019-10-22 20:11:45 +00:00
Robert Ancell
708b1fdaf7 network: Use self variable name consistently 2019-10-22 20:11:45 +00:00
Robert Ancell
8b6e3fb736 network: Store widgets inside objects
This is a step towards replacing GtkBuilder with GtkTemplate
2019-10-22 20:11:45 +00:00
Robert Ancell
b331d75df5 network: Rename widget IDs to standard names 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
ab0be62b78 network: Fix incorrect use of *_get_instance_private
These classes don't have a private structure, but the misuse didn't seem to be
causing a specific issue.
2019-10-22 20:11:44 +00:00
Robert Ancell
de84f7e344 network: Use g_autofree for strings 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
Adrien Plazas
91af270cce connection-editor: Use GtkTemplate 2019-01-27 21:03:13 +00:00
Georges Basile Stavracas Neto
0dd7a9785f
net-vpn: Remove private field
Like NetDeviceWifi, NetVpn is now a final class, and thus does not
need a private field. Remove this field and use the NetVpn struct
itself to store the previously private variables.
2018-11-05 08:31:50 -02:00
Georges Basile Stavracas Neto
e3d125860b
net-vpn: Turn into a final class
Remove the old style GObject boilerplate and replace it by
G_DECLARE_FINAL_TYPE(). Move the NetVpn structure definition
to the .c file too.
2018-11-05 08:31:50 -02:00
Georges Basile Stavracas Neto
8509270562
net-vpn: Remove macro to get private field
We can just use the standard, non-deprecated G_DEFINE_TYPE_WITH_PRIVATE
and avoid g_type_class_add_private(), which is deprecated now.
2018-11-05 08:31:50 -02: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
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
Georges Basile Stavracas Neto
aabc1621b8 network: Update VPN section
The last remaining network device to be updated is
the VPN device, and this patch is the result of this
effort.

The changes were mostly towards cleaning up and
removing unecessary code. By removing the info labels,
many getters were removed as well.

In order to achieve a listbox-like UI, a couple of
UI refactorings.

https://bugzilla.gnome.org/show_bug.cgi?id=785581
2017-08-09 19:32:43 +02:00
Georges Basile Stavracas Neto
158591a346 network: Replace the notebook with a stack
The Network panel uses a GtkNotebook internally to manage
the different setup pages of the network devices. While it
does the job, we now have a modern widget for that: GtkStack.

With GtkStack, managing the pages becomes a lot easier and
we gain almost for free the nice transition between pages,
besides of course being a widget that consumes slightly less
resources.

Besides all these gains, using a GtkStack will allow us to
implement the new Wi-Fi panel in a more cohesive manner,
sharing large portions of code and avoiding copy pasta.

This commit then turns the GtkNotebook into a GtkStack, and
renames and adapts the code to reflect that. Fortunately,
the code got actually simpler with the move.

https://bugzilla.gnome.org/show_bug.cgi?id=784818
2017-07-17 23:40:58 -03:00
Bastien Nocera
f5bcb2ed83 network: Fix crash in VPN when removing Wi-Fi connection
Wrong number of arguments to the callback.
2016-06-07 18:50:38 +02:00
Bastien Nocera
9183d34947 network: Port to libnm 1.2
We also remove support for WiMAX (now unsupported by NetworkManager),
and InfiniBand (Enterprise feature), and the use of
the deprecated NM_SETTING_WIRELESS_SEC property.

With help from network-manager-applet patches by Jiří Klimeš and
Dan Winship.

https://bugzilla.gnome.org/show_bug.cgi?id=765910
2016-05-27 18:23:33 +02:00
Rui Matos
2e7b23aa00 network: Fix a crash when clicking to forget a VPN on the editor
We need to keep a reference to the NetVpn instance or it might already
be finalized when the editor window closes.
2016-01-26 18:40:47 +01:00
Bastien Nocera
ba6da7636e network: Fix warning on panel exit
Now that the VPN object is getting finalized, make sure not to warn if
the NMClient is already gone.

https://bugzilla.gnome.org/show_bug.cgi?id=746411
2015-03-19 16:32:45 +01:00
Rui Matos
2d18798d79 network: Don't leak a builder instance
https://bugzilla.gnome.org/show_bug.cgi?id=708286
2013-10-01 10:05:03 +02:00
Rui Matos
c5b70a7876 network: Remove unused toplevel windows from .ui files
https://bugzilla.gnome.org/show_bug.cgi?id=708286
2013-10-01 10:05:02 +02:00
Kalev Lember
f8f420256b network: Fix a possible crash with no active connections
As a precaution, check the return value of get_active_connections to
avoid dereferencing a NULL pointer.

https://bugzilla.redhat.com/show_bug.cgi?id=990196
https://bugzilla.gnome.org/show_bug.cgi?id=707906
2013-09-11 16:22:01 +02:00