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 647175 - need to promote a wifi network out of More if a non-More one goes away
need to promote a wifi network out of More if a non-More one goes away
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: network-indicator
3.0.x
Other Linux
: Normal normal
: ---
Assigned To: Dan Winship
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-04-08 14:22 UTC by Dan Winship
Modified: 2011-07-12 23:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
NetworkMenu: take out an item from More... when another is destroyed (2.64 KB, patch)
2011-06-27 15:47 UTC, Giovanni Campagna
reviewed Details | Review
NetworkMenu: take out an item from More... when another is destroyed (3.35 KB, patch)
2011-07-09 13:40 UTC, Giovanni Campagna
committed Details | Review

Description Dan Winship 2011-04-08 14:22:38 UTC
If one of your "top 5" wifi networks disappears, its menuitem will be removed, and then you'll only have 4 networks and a More item
Comment 1 Giovanni Campagna 2011-04-10 17:36:44 UTC
Is this urgent?
Because I'd like to avoid stacking fixes-over-fixes-over-fixes, when half of them are not yet in master.
Comment 2 Dan Winship 2011-04-11 13:03:29 UTC
(In reply to comment #1)
> Is this urgent?

no, i just noticed it and so filed the bug

> Because I'd like to avoid stacking fixes-over-fixes-over-fixes, when half of
> them are not yet in master.

yeah, I poked Owen twice on Friday. I'll poke him again this morning.
Comment 3 Giovanni Campagna 2011-06-27 15:47:24 UTC
Created attachment 190765 [details] [review]
NetworkMenu: take out an item from More... when another is destroyed

When one of the networks in the main menu is removed and we have
a More... submenu, we can take the first out from the submenu and
show it in the main menu.

They say late is better than never...
Comment 4 Dan Winship 2011-07-05 21:13:59 UTC
Comment on attachment 190765 [details] [review]
NetworkMenu: take out an item from More... when another is destroyed

>+                    let apObj = this._overflowItem.menu._getMenuItems()[0]._apObj;

gah. there's no nicer way to get that?

>+                    if (apObj.item) {
>+                        apObj.item.destroy();

apObj might be the last item in the overflow menu, in which case you'd have to destroy that, right?

>+            apObj.isMore = true;

you could also just check apObj.item.get_parent()
Comment 5 Giovanni Campagna 2011-07-09 13:09:25 UTC
(In reply to comment #4)
> (From update of attachment 190765 [details] [review])
> >+                    let apObj = this._overflowItem.menu._getMenuItems()[0]._apObj;
> 
> gah. there's no nicer way to get that?

I could have a firstMenuItem property in PopupMenuBase, but then you would end replicating the whole item list to accomodate item destruction. Maybe an accessor property?

> >+                    if (apObj.item) {
> >+                        apObj.item.destroy();
> 
> apObj might be the last item in the overflow menu, in which case you'd have to
> destroy that, right?

Right.

> >+            apObj.isMore = true;
> 
> you could also just check apObj.item.get_parent()

Except that the parent of a menu item is (or should be) an implementation detail of the various PopupMenuBase subclasses.
Comment 6 Giovanni Campagna 2011-07-09 13:40:18 UTC
Created attachment 191577 [details] [review]
NetworkMenu: take out an item from More... when another is destroyed

When one of the networks in the main menu is removed and we have
a More... submenu, we can take the first out from the submenu and
show it in the main menu.
Comment 7 Giovanni Campagna 2011-07-12 23:34:13 UTC
Attachment 191577 [details] pushed as 5819dd3 - NetworkMenu: take out an item from More... when another is destroyed