Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GTK 4 support for NetworkManager plug-in #961

Closed
jtojnar opened this issue Mar 17, 2022 · 4 comments
Closed

GTK 4 support for NetworkManager plug-in #961

jtojnar opened this issue Mar 17, 2022 · 4 comments

Comments

@jtojnar
Copy link

jtojnar commented Mar 17, 2022

Is your feature request related to a problem? Please describe.
Upcoming GNOME 42 ported Control Center to GTK 4. To be able to configure strongSwan VPNs there, the NetworkManager plug-in needs to be ported to GTK 4 as well.

Describe the solution you'd like
Apparently there needs to be both GTK4 and GTK 3 variants of the client.

Describe alternatives you've considered

🤷‍♀️

Additional context

Other plug-in ports:

cc @lkundrak

@tobiasbrunner
Copy link
Member

I've pushed some changes to the 961-nm-gtk4 branch that address this. I took some inspiration from the existing plugins (like dynamically loading the GTK3/4 editors as modules or how @lkundrak replaced the GtkFileChooserButton widgets). Would be great if someone could try this in their environment (I tested it in a Fedora 36 VM) or maybe even give it a review.

@jtojnar
Copy link
Author

jtojnar commented Apr 26, 2022

Can confirm the editor can be displayed on NixOS in GNOME Control Center 42.0 with networkmanager-strongswan built from that branch:

Adding StrongSwan VPN in Control Center

Have not tested actual connection as I do not have the VPN server but clicking through the UI I have not noticed any warnings in terminal or issues other than the dialogue being too tall to fit on the 1280×800 screen of my virtual machine, and the input fields not having any visible outline. But those issues are present in other VPN providers (e.g. OpenConnect) too so perhaps it is a bug in GNOME Control Center.

@tobiasbrunner
Copy link
Member

Thanks for testing.

the dialogue being too tall to fit on the 1280×800 screen of my virtual machine

You luckily don't miss much because the server port is the last field. Some VPN plugins use an additional dialog with advanced options to reduce the height, which I always avoided to not further complicate the implementation (I don't really know GTK though, so I've no idea how much more complicated it would be, but I've generally tried to keep things simple), which lead to the tabs at the bottom (see here).

If really necessary, one quick option to reduce the height a bit more would be to move the two "Identity" fields to a new tab at the bottom (would reduce the height by about 80 pixels as each text field apparently requires 34 pixels plus 6 for spacing). They both have default values and might not get used that often (don't have any empirical data on that, though), so a less prominent location could be fine.

and the input fields not having any visible outline.

On Fedora 36, I actually get visible outlines around the text fields. So that might depend on the GTK/GNOME/? version.

@tobiasbrunner
Copy link
Member

I've pushed these changes to master and released version 1.6.0 of the plugin as tarball.

A possible refactoring to reduce the height can be found in the 961-nm-identity-tab branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants