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 375419 - Need a "toplevel" placeholder in menubar (gedit-ui.xml) for a plugin menu
Need a "toplevel" placeholder in menubar (gedit-ui.xml) for a plugin menu
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
git master
Other Linux
: Normal enhancement
: 2.18.0
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2006-11-15 05:53 UTC by Артём Попов
Modified: 2006-11-25 17:41 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
A patch that adds placeholders for plugin menus and toolitems (596 bytes, patch)
2006-11-20 03:15 UTC, Артём Попов
none Details | Review

Description Артём Попов 2006-11-15 05:53:33 UTC
I have a plugin (http://artfwo.googlepages.com/sced) that adds its own menu to the toplevel menubar (not immediately upon startup, but when a mode is toggled).

When I merge the new ui at runtime, the menu is added into the very end, after the "Help" menu, so I suggest adding a placeholder element in gedit-ui.xml like this:

    <menu name="ToolsMenu" action="Tools">
       ...
    </menu>
    
<!-- ADD THIS -->
    <placeholder name="PluginMenu_1" />
<!-- ADD THIS -->
    
    <menu name="DocumentsMenu" action="Documents">
      ...
    </menu>

Modifying gedit-ui.xml made things look well for me. I file this bug, because I think there may be other plugins that will want to have their toplevel menus in the future.
Comment 1 Paolo Maggi 2006-11-15 09:34:37 UTC
It looks list a good idea.

Could you please provide a patch for gedit-ui-xml that adds placeholders between all the "menus"?
Comment 2 Paolo Borelli 2006-11-15 09:47:04 UTC
I don't think we need one placeholder between every menu. I think what Артём proposed is good: we should allow extensions to add toplevel menus only after the gedit core menus but before the help menu which should always be last.
Otherwise we encourage plugins to mess up the UI too much.
Comment 3 Артём Попов 2006-11-15 10:23:04 UTC
Just my 2 cents. I think that a placeholder (or maybe several of 'em in a row?) for plugin-specific menus should be placed before the Documents menu or the Tools menu, but definetly NOT after Documents (that looks great being second to the last one: Help)

So it will look either like:

    <menu name="ToolsMenu" action="Tools"> ... </menu>
    <placeholder name="PluginMenus" />
    <menu name="DocumentsMenu" action="Documents"> ... </menu>

Or:

    <menu name="ToolsMenu" action="Tools"> ... </menu>
    <placeholder name="PluginMenu_1" />
    <placeholder name="PluginMenu_2" />
    ...
    <menu name="DocumentsMenu" action="Documents"> ... </menu>

There're 5 placeholders in Tools, maybe make 5 placeholders for toplevels as well? 
Comment 4 Paolo Borelli 2006-11-15 11:05:37 UTC
having more than one placeholder doesn't help much IMHO: a placeholder can be used many times.

In the Tools menu etc we have many placeholders so that we can ensure some ordering of the menu items when more than a plugin is activated: this is possible because we are talking about internal plugins where we can assume some ordering and make them use specific placeholders. The toplevel placeholder will be used by external plugins only and I doubt that some ordering can be kept, so I don't see much point in having more placeholders.

About the position, I have no strong opinion about placing it before Documents, though I still think it makes sense to add it _after_ all the standard menus and thus after Documents. What I am convinced is that we should allow only one extension point.
Comment 5 Артём Попов 2006-11-15 11:45:50 UTC
Agreed. As for why before Documents question, it's just some common practice, I think. Unfortunately, the HIG says nothing on the subject, only recommends placing app-specific menus closer to the center of the menubar:
http://developer.gnome.org/projects/gup/hig/2.0/menus-standard.html

Note, that many IDEs, office suits, etc. have Documents (maybe named Windows or smth like that) menu just before Help, everything else goes before those 2, even those "special", specific menus.
Comment 6 Paolo Maggi 2006-11-15 12:28:00 UTC
You guys are right, I did't think too much before replying.

It is ok for me to put the placeholder between Tools and Documents.
Comment 7 Артём Попов 2006-11-20 03:15:32 UTC
Created attachment 76890 [details] [review]
A patch that adds placeholders for plugin menus and toolitems

A trivial patch that adds PluginMenus placeholder to the menubar, and PluginToolItems placeholder to the toolbar.
Comment 8 Paolo Borelli 2006-11-25 17:41:01 UTC
I fixed this in cvs, sorry for the delay.

I decided to call the placeholder ExtraMenu_1, so that it's more consistent with the other placeholders and if needed we can add _2, _3 etc.

I didn't add the toolbars placeholders: you can attach buttons at the end of the toolbar without any placeholder.