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 701954 - More cleanups and fixes for the network menu
More cleanups and fixes for the network menu
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2013-06-10 18:15 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2013-06-14 18:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
network: Rename a variable for consistency (1.63 KB, patch)
2013-06-10 18:15 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
network: Remove setActiveConnection/clearActiveConnection (4.22 KB, patch)
2013-06-10 18:15 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
network: Fix a bad signal name (1.42 KB, patch)
2013-06-10 18:15 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
network: Move indicator icon selection to individual devices (10.62 KB, patch)
2013-06-10 18:15 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
network: Always show the VPN indicator when connected to VPN (2.15 KB, patch)
2013-06-10 18:15 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
network: Move indicator icon selection to individual devices (10.97 KB, patch)
2013-06-10 22:02 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
network: Always show the VPN indicator when connected to VPN (2.15 KB, patch)
2013-06-10 22:02 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
network: Move the VPN indicator to getIndicatorIcon as well (4.21 KB, patch)
2013-06-10 22:02 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
network: Remove overflow of VPN configurations (1.39 KB, patch)
2013-06-10 22:02 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
network: Rewrite VPN section to be independent of NMConnectionBased (10.15 KB, patch)
2013-06-10 22:02 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
network: Merge NMConnectionBased back into NMDevice (3.43 KB, patch)
2013-06-10 22:21 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
network: Remove dead code (2.63 KB, patch)
2013-06-14 17:32 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
network: "Remove" support for dial-up modems (3.07 KB, patch)
2013-06-14 17:32 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
network: Move indicator icon selection to individual devices (10.97 KB, patch)
2013-06-14 17:32 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
network: Always show the VPN indicator when connected to VPN (2.15 KB, patch)
2013-06-14 17:33 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
network: Move the VPN indicator to getIndicatorIcon as well (4.21 KB, patch)
2013-06-14 17:33 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
network: Remove overflow of VPN configurations (1.39 KB, patch)
2013-06-14 17:33 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
network: Rewrite VPN section to be independent of NMConnectionBased (10.22 KB, patch)
2013-06-14 17:33 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
network: Merge NMConnectionBased back into NMDevice (3.43 KB, patch)
2013-06-14 17:33 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
network: Make the device field private (15.09 KB, patch)
2013-06-14 17:33 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
network: Simplify connections to the firmware signal (2.75 KB, patch)
2013-06-14 17:33 UTC, Jasper St. Pierre (not reading bugmail)
needs-work Details | Review
network: Remove support for virtual networking (8.97 KB, patch)
2013-06-14 17:33 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
network: Simplify connections to the firmware signal (2.46 KB, patch)
2013-06-14 17:49 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review

Description Jasper St. Pierre (not reading bugmail) 2013-06-10 18:15:38 UTC
It seems that every time I work on it, I manage to remove another
100 lines of code.
Comment 1 Jasper St. Pierre (not reading bugmail) 2013-06-10 18:15:42 UTC
Created attachment 246426 [details] [review]
network: Rename a variable for consistency

We tend to use the name "a" in this method. This matches consistency
with the rest of the code.
Comment 2 Jasper St. Pierre (not reading bugmail) 2013-06-10 18:15:46 UTC
Created attachment 246427 [details] [review]
network: Remove setActiveConnection/clearActiveConnection

This can be more easily achieved by listening for changes to the
device's active-connection property. VPN will still need support to
track active connections, as it does not have an associated
device. But as VPN can track multiple active connections, the names
"set" and "clear" don't quite fit. Rename them to the more-standard
"add" and "remove".
Comment 3 Jasper St. Pierre (not reading bugmail) 2013-06-10 18:15:49 UTC
Created attachment 246428 [details] [review]
network: Fix a bad signal name

We try to disconnect from firmwareChangedId, not firmwareMissingId.
Comment 4 Jasper St. Pierre (not reading bugmail) 2013-06-10 18:15:53 UTC
Created attachment 246429 [details] [review]
network: Move indicator icon selection to individual devices

This cuts down on the number of cross-connected "public" API between
the devices, hopefully allowing us to reduce it further.
Comment 5 Jasper St. Pierre (not reading bugmail) 2013-06-10 18:15:57 UTC
Created attachment 246430 [details] [review]
network: Always show the VPN indicator when connected to VPN

The new designs ask for an indicator per connected device. For now,
limit ourselves to two icons, but we'll soon change this.
Comment 6 Giovanni Campagna 2013-06-10 18:51:51 UTC
Review of attachment 246426 [details] [review]:

Heh... consistency works the other way too, and "a" is quite small for ActiveConnection...
Comment 7 Giovanni Campagna 2013-06-10 18:51:52 UTC
Review of attachment 246426 [details] [review]:

Heh... consistency works the other way too, and "a" is quite small for ActiveConnection...
Comment 8 Giovanni Campagna 2013-06-10 18:55:58 UTC
Review of attachment 246427 [details] [review]:

Ok
Comment 9 Giovanni Campagna 2013-06-10 18:55:59 UTC
Review of attachment 246427 [details] [review]:

Ok
Comment 10 Jasper St. Pierre (not reading bugmail) 2013-06-10 18:56:17 UTC
Review of attachment 246426 [details] [review]:

We tended to use "a" everywhere else, but I can switch it around if you want. I don't really like "active" though.
Comment 11 Giovanni Campagna 2013-06-10 18:56:52 UTC
Review of attachment 246428 [details] [review]:

The signal is named firmware-missing, not firmware-changed, so the one to correct is the disconnect.
Comment 12 Giovanni Campagna 2013-06-10 18:59:08 UTC
Review of attachment 246429 [details] [review]:

Do we need the mc parameter? Devices already have the .active_connection property
Also, I don't see a getIndicatorIcon() in the vpn section.
Comment 13 Giovanni Campagna 2013-06-10 19:05:04 UTC
Review of attachment 246430 [details] [review]:

Bug 687853 had something similar to the final design (one indicator per device kind), if you want.
Also, I think with this patch it's possible to have two vpn icons, if for example vpn is the default route.
Comment 14 Jasper St. Pierre (not reading bugmail) 2013-06-10 19:18:50 UTC
(In reply to comment #11)
> Review of attachment 246428 [details] [review]:
> 
> The signal is named firmware-missing, not firmware-changed, so the one to
> correct is the disconnect.

Well, for notify::carrier we have carrierChangedId, so technically it would need to be firmwareMissingChangedId, but I figured that firmwareChangedId would be close enough.

(In reply to comment #12)
> Review of attachment 246429 [details] [review]:
> Also, I don't see a getIndicatorIcon() in the vpn section.

It was easier to simply keep the VPN indicator separate for now (it's the one special case as it doesn't have an associated device) but I suppose I can make a code cleanup...
Comment 15 Giovanni Campagna 2013-06-10 19:38:02 UTC
(In reply to comment #14)
> (In reply to comment #11)
> > Review of attachment 246428 [details] [review] [details]:
> > 
> > The signal is named firmware-missing, not firmware-changed, so the one to
> > correct is the disconnect.
> 
> Well, for notify::carrier we have carrierChangedId, so technically it would
> need to be firmwareMissingChangedId, but I figured that firmwareChangedId would
> be close enough.
> 
> (In reply to comment #12)
> > Review of attachment 246429 [details] [review] [details]:
> > Also, I don't see a getIndicatorIcon() in the vpn section.
> 
> It was easier to simply keep the VPN indicator separate for now (it's the one
> special case as it doesn't have an associated device) but I suppose I can make
> a code cleanup...

(In reply to comment #14)
> (In reply to comment #11)
> > Review of attachment 246428 [details] [review] [details]:
> > 
> > The signal is named firmware-missing, not firmware-changed, so the one to
> > correct is the disconnect.
> 
> Well, for notify::carrier we have carrierChangedId, so technically it would
> need to be firmwareMissingChangedId, but I figured that firmwareChangedId would
> be close enough.

Bah... Ok with firmwareChangedId then.

> (In reply to comment #12)
> > Review of attachment 246429 [details] [review] [details]:
> > Also, I don't see a getIndicatorIcon() in the vpn section.
> 
> It was easier to simply keep the VPN indicator separate for now (it's the one
> special case as it doesn't have an associated device) but I suppose I can make
> a code cleanup...

No, the problem is you can get the vpn to be a mainConnection, in which case you unconditonally call getIndicatorIcon() on it and that crashes.
Comment 16 Giovanni Campagna 2013-06-10 19:39:04 UTC
(In reply to comment #10)
> Review of attachment 246426 [details] [review]:
> 
> We tended to use "a" everywhere else, but I can switch it around if you want. I
> don't really like "active" though.

Do we really? I think "a" comes from older code, newer uses "active", but ok, it's clear from the context anyway.
Comment 17 Jasper St. Pierre (not reading bugmail) 2013-06-10 22:02:01 UTC
Created attachment 246445 [details] [review]
network: Move indicator icon selection to individual devices

This cuts down on the number of cross-connected "public" API between
the devices, hopefully allowing us to reduce it further.
Comment 18 Jasper St. Pierre (not reading bugmail) 2013-06-10 22:02:05 UTC
Created attachment 246446 [details] [review]
network: Always show the VPN indicator when connected to VPN

The new designs ask for an indicator per connected device. For now,
limit ourselves to two icons, but we'll soon change this.
Comment 19 Jasper St. Pierre (not reading bugmail) 2013-06-10 22:02:08 UTC
Created attachment 246447 [details] [review]
network: Move the VPN indicator to getIndicatorIcon as well

This removes the need to track the VPN connection in the main
applet.
Comment 20 Jasper St. Pierre (not reading bugmail) 2013-06-10 22:02:12 UTC
Created attachment 246448 [details] [review]
network: Remove overflow of VPN configurations

It's unlikely that somebody has more than five VPN connections
configured, and the code is
Comment 21 Jasper St. Pierre (not reading bugmail) 2013-06-10 22:02:16 UTC
Created attachment 246449 [details] [review]
network: Rewrite VPN section to be independent of NMConnectionBased
Comment 22 Jasper St. Pierre (not reading bugmail) 2013-06-10 22:21:30 UTC
Created attachment 246451 [details] [review]
network: Merge NMConnectionBased back into NMDevice
Comment 23 Jasper St. Pierre (not reading bugmail) 2013-06-12 20:12:09 UTC
Comment on attachment 246426 [details] [review]
network: Rename a variable for consistency

Attachment 246426 [details] pushed as 4cd832c - network: Rename a variable for consistency


Let's push this one for now.
Comment 24 Giovanni Campagna 2013-06-12 20:28:27 UTC
Review of attachment 246445 [details] [review]:

I don't see any change in this, compared to the previous one.
Comment 25 Jasper St. Pierre (not reading bugmail) 2013-06-12 20:42:12 UTC
Besides the "mc" removal, and using this.device.active_connection instead, you mean?
Comment 26 Jasper St. Pierre (not reading bugmail) 2013-06-12 20:59:26 UTC
Attachment 246427 [details] pushed as 2cbee05 - network: Remove setActiveConnection/clearActiveConnection
Attachment 246428 [details] pushed as c6fe6eb - network: Fix a bad signal name
Comment 27 Jasper St. Pierre (not reading bugmail) 2013-06-14 17:32:49 UTC
Created attachment 246831 [details] [review]
network: Remove dead code

No class in here has this.carrier as a property. Presumably, this was
meant to be this.device.carrier, but since this code is going to be
rewritten soon anyway, might as well just junk the never-working
code for now.
Comment 28 Jasper St. Pierre (not reading bugmail) 2013-06-14 17:32:54 UTC
Created attachment 246832 [details] [review]
network: "Remove" support for dial-up modems

NetworkManager has never supported dial-up modems, which are the
only case we have a modem device without any of these capabilities.
Comment 29 Jasper St. Pierre (not reading bugmail) 2013-06-14 17:32:57 UTC
Created attachment 246833 [details] [review]
network: Move indicator icon selection to individual devices

This cuts down on the number of cross-connected "public" API between
the devices, hopefully allowing us to reduce it further.
Comment 30 Jasper St. Pierre (not reading bugmail) 2013-06-14 17:33:01 UTC
Created attachment 246834 [details] [review]
network: Always show the VPN indicator when connected to VPN

The new designs ask for an indicator per connected device. For now,
limit ourselves to two icons, but we'll soon change this.
Comment 31 Jasper St. Pierre (not reading bugmail) 2013-06-14 17:33:05 UTC
Created attachment 246835 [details] [review]
network: Move the VPN indicator to getIndicatorIcon as well

This removes the need to track the VPN connection in the main
applet.
Comment 32 Jasper St. Pierre (not reading bugmail) 2013-06-14 17:33:09 UTC
Created attachment 246836 [details] [review]
network: Remove overflow of VPN configurations

It's unlikely that somebody has more than five VPN connections
configured, and the code is
Comment 33 Jasper St. Pierre (not reading bugmail) 2013-06-14 17:33:13 UTC
Created attachment 246837 [details] [review]
network: Rewrite VPN section to be independent of NMConnectionBased
Comment 34 Jasper St. Pierre (not reading bugmail) 2013-06-14 17:33:17 UTC
Created attachment 246838 [details] [review]
network: Merge NMConnectionBased back into NMDevice
Comment 35 Jasper St. Pierre (not reading bugmail) 2013-06-14 17:33:20 UTC
Created attachment 246839 [details] [review]
network: Make the device field private

With getIndicatorIcon() replacing the main use of the .device
field, we can make this a private API.
Comment 36 Jasper St. Pierre (not reading bugmail) 2013-06-14 17:33:25 UTC
Created attachment 246840 [details] [review]
network: Simplify connections to the firmware signal

The status item will go away soon, so make sure the one-time
fire is given its own function. At the same time, only connect
to the signal when the situation actually matters.
Comment 37 Jasper St. Pierre (not reading bugmail) 2013-06-14 17:33:28 UTC
Created attachment 246841 [details] [review]
network: Remove support for virtual networking

This isn't in the new design, and no good can come from this.
Just allow people to use the control center to configure virtual
networking.
Comment 38 Giovanni Campagna 2013-06-14 17:37:29 UTC
Review of attachment 246831 [details] [review]:

So you're positive we're never seeing wired in the menu again heh?
Comment 39 Giovanni Campagna 2013-06-14 17:38:28 UTC
Review of attachment 246832 [details] [review]:

Yes.
Comment 40 Giovanni Campagna 2013-06-14 17:39:30 UTC
Review of attachment 246833 [details] [review]:

Ok
Comment 41 Giovanni Campagna 2013-06-14 17:39:31 UTC
Review of attachment 246833 [details] [review]:

Ok
Comment 42 Giovanni Campagna 2013-06-14 17:40:04 UTC
Review of attachment 246834 [details] [review]:

Ok
Comment 43 Giovanni Campagna 2013-06-14 17:40:04 UTC
Review of attachment 246834 [details] [review]:

Ok
Comment 44 Giovanni Campagna 2013-06-14 17:40:48 UTC
Review of attachment 246835 [details] [review]:

Please squash this with the previous patch on getIndicatorIcon()
Comment 45 Giovanni Campagna 2013-06-14 17:40:48 UTC
Review of attachment 246835 [details] [review]:

Please squash this with the previous patch on getIndicatorIcon()
Comment 46 Giovanni Campagna 2013-06-14 17:41:08 UTC
Review of attachment 246836 [details] [review]:

Ok
Comment 47 Giovanni Campagna 2013-06-14 17:41:08 UTC
Review of attachment 246836 [details] [review]:

Ok
Comment 48 Giovanni Campagna 2013-06-14 17:42:38 UTC
Review of attachment 246837 [details] [review]:

Oh, very nice cleanup!
Comment 49 Giovanni Campagna 2013-06-14 17:43:03 UTC
Review of attachment 246838 [details] [review]:

Yes
Comment 50 Giovanni Campagna 2013-06-14 17:43:58 UTC
Review of attachment 246839 [details] [review]:

Is this really needed?
Comment 51 Jasper St. Pierre (not reading bugmail) 2013-06-14 17:46:01 UTC
Review of attachment 246839 [details] [review]:

It was to make sure that the NMClient doesn't access wrapper.device for any device. It did when there was the _updateIcon mess beforehand, and I want to make sure that that doesn't come back.
Comment 52 Giovanni Campagna 2013-06-14 17:46:24 UTC
Review of attachment 246840 [details] [review]:

::: js/ui/status/network.js
@@ +416,3 @@
             if (this._device.firmware_missing) {
+                if (!this._firmwareChangedId)
+                    this._firmwareChangedId = this._device.connect('notify::firmware-missing', Lang.bind(this, this._firmwareChanged));

Uhm... We connect to firmware-missing two lines above this...
Comment 53 Giovanni Campagna 2013-06-14 17:47:52 UTC
Review of attachment 246841 [details] [review]:

Definitely.

I just hope nothing breaks when we see devices or connections we don't understand.
Comment 54 Giovanni Campagna 2013-06-14 17:47:52 UTC
Review of attachment 246841 [details] [review]:

Definitely.

I just hope nothing breaks when we see devices or connections we don't understand.
Comment 55 Jasper St. Pierre (not reading bugmail) 2013-06-14 17:47:56 UTC
Review of attachment 246840 [details] [review]:

gah, rebase issue
Comment 56 Jasper St. Pierre (not reading bugmail) 2013-06-14 17:49:36 UTC
Created attachment 246842 [details] [review]
network: Simplify connections to the firmware signal

The status item will go away soon, so make sure the one-time
fire is given its own function. At the same time, only connect
to the signal when the situation actually matters.
Comment 57 Giovanni Campagna 2013-06-14 17:49:59 UTC
(In reply to comment #51)
> Review of attachment 246839 [details] [review]:
> 
> It was to make sure that the NMClient doesn't access wrapper.device for any
> device. It did when there was the _updateIcon mess beforehand, and I want to
> make sure that that doesn't come back.

Heh, it's you, me and maybe Dan editing this code, we can remember it's private, without the "_" in front of it.
And if someone else, in the future, will need it public, it won't need a patch just to rename it.
Comment 58 Giovanni Campagna 2013-06-14 17:50:40 UTC
Review of attachment 246842 [details] [review]:

Ok
Comment 59 Jasper St. Pierre (not reading bugmail) 2013-06-14 18:01:17 UTC
(In reply to comment #57)
> Heh, it's you, me and maybe Dan editing this code, we can remember it's
> private, without the "_" in front of it.

$ git log --format="%an" status/network.js | sort | uniq
Alejandro Piñeiro
Aleksander Morgado
Colin Walters
Cosimo Cecchi
Dan Williams
Dan Winship
Diego Escalante Urrelo
Florian Müllner
Giovanni Campagna
Jasper St. Pierre
Jeremy Bicha
Owen W. Taylor
Ray Strode
Rui Matos
Wouter Bolsterlee

> And if someone else, in the future, will need it public, it won't need a patch
> just to rename it.

That day should never come. If we need something on the device, write an accessor method, like I did with getIndicatorIcon(). The NMClient should not poke into the wrapper's internals, ever.
Comment 60 Jasper St. Pierre (not reading bugmail) 2013-06-14 18:21:46 UTC
Forgot to use git bz push when pushing.

We agreed on IRC that we could push this.