After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 699275 - VPN switch on/off button not updated dynamically
VPN switch on/off button not updated dynamically
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Network
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-04-29 23:10 UTC by Lionel Landwerlin
Modified: 2013-05-15 13:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
network: update on/off switch button when vpn becomes active/inactive (3.95 KB, patch)
2013-04-29 23:11 UTC, Lionel Landwerlin
reviewed Details | Review
network: update on/off switch button when vpn becomes active/inactive (4.36 KB, patch)
2013-05-14 11:00 UTC, Lionel Landwerlin
reviewed Details | Review
network: update on/off switch button when vpn becomes active/inactive (3.78 KB, patch)
2013-05-15 11:20 UTC, Lionel Landwerlin
committed Details | Review

Description Lionel Landwerlin 2013-04-29 23:10:12 UTC
When switching the VPN on/off from the shell, the control center does not update its state dynamically.
Comment 1 Lionel Landwerlin 2013-04-29 23:11:07 UTC
Created attachment 242871 [details] [review]
network: update on/off switch button when vpn becomes active/inactive
Comment 2 Bastien Nocera 2013-05-13 12:29:42 UTC
Dan?
Comment 3 Dan Winship 2013-05-13 14:28:09 UTC
Comment on attachment 242871 [details] [review]
network: update on/off switch button when vpn becomes active/inactive

The general idea is correct.

However, there were already a few places in net-vpn.c that scanned the active connections list looking for the VPN's connection, and they can be simplified to use priv->active_connection now, as long as you also call nm_active_connections_changed() at construct time to initialize it.

>+                g_object_add_weak_pointer (G_OBJECT (conn),
>+                                           (gpointer *) &vpn->priv->active_connection);

Any reason you don't just take a ref on it?
Comment 4 Lionel Landwerlin 2013-05-14 11:00:06 UTC
Created attachment 244151 [details] [review]
network: update on/off switch button when vpn becomes active/inactive

Updated the patch. Removed the iteration through active-connections.
Also disconnect so more signals in the finalize()
Comment 5 Bastien Nocera 2013-05-15 10:47:51 UTC
Review of attachment 244151 [details] [review]:

::: panels/network/net-vpn.c
@@ +39,3 @@
 {
         GtkBuilder              *builder;
+

Whitespace change.

@@ +527,3 @@
+                                              vpn);
+        g_signal_handlers_disconnect_by_func (priv->connection,
+                                              connection_removed_cb,

Those 3 signal disconnections should probably be in a separate bug fix commit, no?
Comment 6 Lionel Landwerlin 2013-05-15 11:20:14 UTC
Created attachment 244303 [details] [review]
network: update on/off switch button when vpn becomes active/inactive
Comment 7 Bastien Nocera 2013-05-15 11:25:04 UTC
Review of attachment 244303 [details] [review]:

Looks good.
Comment 8 Lionel Landwerlin 2013-05-15 13:33:00 UTC
Comment on attachment 244303 [details] [review]
network: update on/off switch button when vpn becomes active/inactive

Committed to 3.8 and master.