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 637681 - Bluetooth menu items are in the wrong order
Bluetooth menu items are in the wrong order
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Dan Winship
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2010-12-20 18:09 UTC by Giovanni Campagna
Modified: 2011-01-06 18:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
StBoxLayout: add insert_before (3.83 KB, patch)
2010-12-20 18:10 UTC, Giovanni Campagna
reviewed Details | Review
PopupMenu: fix addMenuItem with explicit position (1.74 KB, patch)
2010-12-20 18:11 UTC, Giovanni Campagna
committed Details | Review
StBoxLayout: add insert_before (3.62 KB, patch)
2010-12-23 18:14 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2010-12-20 18:09:17 UTC
As discussed on IRC, due to the interpretation of position in PopupMenu.
Filing a bug because I'm taking advantage of this to improve StBoxLayout, so that the fixing looks clean.
Comment 1 Giovanni Campagna 2010-12-20 18:10:23 UTC
Created attachment 176773 [details] [review]
StBoxLayout: add insert_before

Add st_container_move_before internal API, and
st_box_layout_insert_before, that inserts an actor before another
in the container.
Comment 2 Giovanni Campagna 2010-12-20 18:11:36 UTC
Created attachment 176774 [details] [review]
PopupMenu: fix addMenuItem with explicit position

Only real menu items should be considered, fix this using the new
API in StBoxLayout.
Comment 3 Dan Winship 2010-12-21 22:00:48 UTC
Comment on attachment 176773 [details] [review]
StBoxLayout: add insert_before

>+  clutter_container_add_actor((ClutterContainer*) self, actor);
>+  st_container_move_before ((StContainer*) self, actor, sibling);

Use CLUTTER_CONTAINER()-style casts. (Even if the other methods don't; they're wrong.)

>+  if (actor_item == NULL || sibling_item == NULL)
>+    {
>+      g_critical ("Invoking st_container_move_before on object of type %s with "
>+                  "arguments that are not children of the container",
>+                  g_type_name (G_OBJECT_TYPE (container)));
>+      return;
>+    }

Just

    g_return_if_fail (actor_item != NULL);
    g_return_if_fail (sibling_item != NULL);

is fine.

Oh, I see, you copied that from st_container_move_child(). Well, move_child is wrong. :)
Comment 4 Giovanni Campagna 2010-12-23 18:14:25 UTC
Created attachment 176959 [details] [review]
StBoxLayout: add insert_before

Add st_container_move_before internal API, and
st_box_layout_insert_before, that inserts an actor before another
in the container.