Previously, when editing a connection that doesn't have native editor
support, nm-connection-editor is spawned to do the work. But after
closing nm-connection-editor, an empty editor dialog still exists.
Fix that in this commit.
When entering the network panel without the network daemon,
the window decoration buttons do not appear because the whole panel
content was overwritten by an AdwStatusPage.
Now only the content of the AdwToolbarView is changed, preserving
the AdwHeaderBar and buttons.
Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2695
The SpinBox value returned by get_value and friends gets definitely
updated only when the control loses focus. That is unfortunately too late
for the validation machinery, so force the updates at the right time.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1983>
When the IP method is "disabled" or "shared" then everything else is
supposed to be insensitive. This currently fails if you toggle between
the two, because it's implemented using property bindings that are just
not smart enough to handle this task. Handle sensitivity only in
method_changed() to avoid this.
Additionally, not all of the widgets are being consistently
disabled/enabled when appropriate. E.g. when the method is "local" then
only the DNS entry, route entries, and default route checkboxes become
insensitive, leaving the other widgets, including notably the Automatic
switches, sensitive. They should all become insensitive, as when the
method is "disabled" or "shared." Fix this by organizing all the related
widgets into boxes and setting the sensitivity of the entire box. (Note
the strategy followed here does not exactly match nm-connection-editor,
which always allows editing addresses. We only allow that in Manual
mode. I'm not sure if this is advisable or not, so won't touch that.)
Finally, the Automatic DNS and Automatic Routes toggles should only be
sensitive when the method is "Automatic".
When the entry is initially empty, there is no error. If you enter
anything and then delete it, the entry is left in the error state. Empty
should not be an error.
This reverts commit 8a4a80b7b2.
This is a manual revert, because the code changed considerably in
a2b9620b1b. Anyway, although this seemed
like a good idea, problem is it clobbers the original state of the
connection without any explicit user action if the connection is
configured to use both manual and auto DNS. And this happens in practice
for imported Wireguard connections, which uselessly have auto DNS
enabled due to this NetworkManager bug:
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1399
Additional discussion:
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1745#note_2112420
The simplest solution is to not try to prevent the user from configuring
both manual and auto DNS. Instead, let's just warn the user that this
configuration may not be intended in a follow-up commit.
Fixes#2617
Even though the routes_metric_label is in a GtkSizeGroup with the
GtkEntry for the metric, its size was set too big after adding the entry
to the size group. To fix this, add all the other labels and
corresponding entries to size groups as well. The hexpand can then be
removed as well on the labels.
Fixes#1235
For example, fix adding new VPN connections.
In 60b4956c05 I correctly observed that we
need to not run code that requires a device when there is no device.
NetConnectionEditor is a multipurpose dialog and self->device is
optional when creating the dialog. E.g. when modifying VPN
configuration, we update just the configuration, not an NMDevice.
However, I added this check too soon, before updating the connection
configuration. We need to update the configuration first, then only bail
before proceeding to update the device, not sooner.
Fix#2668
If the NMDevice is not active (i.e. if we are editing a connection that
is not active) then don't warn when failing to reapply changes to the
device. That's expected and not something we should warn about.
We could perhaps not even try, but the device could become inactive
between the time of our check and this error, so better ignore the error
regardless.
All of the following code assumes that self->device is valid, so we need
to skip over it. It's confusing, but this is a multipurpose dialog and
self->device is optional when creating the dialog. E.g. when modifying
VPN configuration, we update just the configuration, not an NMDevice.
If the operation is cancelled (because the dialog was closed, because
the Apply button was pressed), then trying to make further use of the
source_object is a use after free, which is bad. At first I tried to fix
this by simply avoiding the use after free when the operation is
canceled, but then I realized it is ridiculous to always try committing
connection changes when closing the dialog, then immediately cancel the
operation by destroying the dialog.
So instead I've decided to not pass the cancellable along to these
operations, and instead ref the dialog to keep it alive until the
operations complete. Instead, let's just hide the window.
This commit also removes an inaccurate comment /* Leave the editor open
*/ placed right before the call to the function that hides the editor.
There's no need to leave the editor open when updating the device fails.
The connection properties at least are still saved.
Fixes#2618
QR codes for Wi-Fi networks can only be generated for Wi-Fi networks
that have one of these security settings:
- no security
- WEP security
- WPA security
This is why the button to show these QR codes should only be visible
if the Wi-Fi network in question has one of these security settings.