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 676987 - 0.13.3: failed to rearrange menuitems
0.13.3: failed to rearrange menuitems
Status: RESOLVED FIXED
Product: alacarte
Classification: Applications
Component: general
0.13.x
Other Linux
: Normal critical
: ---
Assigned To: Alacarte Maintainer(s)
Alacarte Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-05-28 19:32 UTC by Balló György
Modified: 2012-11-02 05:04 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Balló György 2012-05-28 19:32:02 UTC
When I try to move up or down a menuitem, the item is disappear, and I get the following error:

Traceback (most recent call last):
  • File "/usr/lib/python2.7/site-packages/Alacarte/MainWindow.py", line 578 in on_move_up_button_clicked
    self.editor.moveItem(item, item.get_parent(), before=before)
  • File "/usr/lib/python2.7/site-packages/Alacarte/MenuEditor.py", line 335 in moveItem
    file_id = self.copyItem(item, new_parent)
  • File "/usr/lib/python2.7/site-packages/Alacarte/MenuEditor.py", line 311 in copyItem
    util.fillKeyFile(keyfile, dict(Categories=[], Hidden=False))
  • File "/usr/lib/python2.7/site-packages/Alacarte/util.py", line 35 in fillKeyFile
    keyfile.set_string_list(DESKTOP_GROUP, key, item)
  • File "/usr/lib/python2.7/site-packages/gi/types.py", line 43 in function
    return info.invoke(*args, **kwargs)
TypeError: set_string_list() takes exactly 5 arguments (4 given)

Comment 1 Jasper St. Pierre (not reading bugmail) 2012-05-29 20:06:41 UTC
You need a newer version of glib/gobject-introspection.
Comment 2 Balló György 2012-05-29 20:29:22 UTC
I'm using the latest stable releases on Arch Linux:
glib2 2.32.3
gobject-introspection 1.32.1
python2-gobject 3.2.2

So are you say that the latest alacarte release depends on a development/unstable library?
Comment 3 Jasper St. Pierre (not reading bugmail) 2012-05-29 20:33:56 UTC
Hm, that should be recent enough. Can you check /usr/share/gir-1.0/GLib-2.0.gir? grep for g_key_file_set_string_list, and make sure that you see something that looks like this:

          <parameter name="list" transfer-ownership="none">
            <doc xml:whitespace="preserve">an array of string values</doc>
            <array length="3" zero-terminated="1" c:type="gchar*">
              <type name="utf8"/>
            </array>
          </parameter>
Comment 4 Jasper St. Pierre (not reading bugmail) 2012-05-30 20:52:24 UTC
This seems to be a pygobject bug: https://bugzilla.gnome.org/show_bug.cgi?id=677124
Comment 5 Balló György 2012-05-30 22:39:34 UTC
I have g_key_file_set_string_list in /usr/share/gir-1.0/GLib-2.0.gir and it looks exactly the same what you posted.

I applied you patch to pygobject and I sill get a bit different error:

Traceback (most recent call last):
  • File "/usr/lib/python2.7/site-packages/Alacarte/MainWindow.py", line 578 in on_move_up_button_clicked
    self.editor.moveItem(item, item.get_parent(), before=before)
  • File "/usr/lib/python2.7/site-packages/Alacarte/MenuEditor.py", line 335 in moveItem
    file_id = self.copyItem(item, new_parent)
  • File "/usr/lib/python2.7/site-packages/Alacarte/MenuEditor.py", line 313 in copyItem
    app_info = item.get_info()
AttributeError: 'TreeEntry' object has no attribute 'get_info'

Comment 6 Jasper St. Pierre (not reading bugmail) 2012-05-31 02:20:29 UTC
I'll look into it tomorrow. I'm still learning the codebase, and it's quite messy.
Comment 7 Jasper St. Pierre (not reading bugmail) 2012-06-01 04:20:02 UTC
http://git.gnome.org/browse/alacarte/commit/?id=b299638ee9347084f161732f7a0205fdbd51b327

Does it work with this patch?
Comment 8 Jasper St. Pierre (not reading bugmail) 2012-06-01 07:31:22 UTC
Sigh. Another pygobject bug prevented Move Up/Move Down from working correctly:

https://bugzilla.gnome.org/show_bug.cgi?id=677249
Comment 9 Balló György 2012-06-02 12:46:39 UTC
I applied the patches for alacarte and pygobject, and now Move Up/Move Down works correctly. Thanks! However it's a bit slow, one step takes one or two seconds.
Comment 10 Jasper St. Pierre (not reading bugmail) 2012-06-02 17:19:44 UTC
The slowness is waiting for gnome-menus to re-parse the menu and send us a signal with the new stuff.
Comment 11 Balló György 2012-11-02 05:04:27 UTC
I marked this bug as fixed, because rearranging menuitems works in alacarte 3.6.1, even it's very slow.