Menu spec: sorting

Waldo Bastian bastian at kde.org
Thu Jul 31 14:00:15 EEST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

There was a nice thread about menu-sorting and menu-inlining a while ago, see
https://www.redhat.com/archives/xdg-list/2003-January/msg00157.html

I don't think it resulted in any actual changes to the spec though.

I think the idea that a sub-menu can be marked as "inline" is a good idea. For 
that we need a single bool entry in the .directory file. Is "showInline" ok 
with everyone? I think the semantics should be "suggestion to inline the 
menu".

For the actual sorting we agreed that it was good to have it defined as part 
of the XML file. For that I propose a <Order> element that can be a child of 
<Menu>

Something like:

====begin====

<Order>
  <Filename>kde-kate.desktop</Filename>
  <Separator/>
  <Menuname>More</Menuname>
  <Separator/>
  <Filename>kde-KEdit.desktop</Filename>
  <Filename>kde-kwrite.desktop</Filename>
  <Separator/>
  <Merge type="menus"/>
  <Separator/>
  <Merge type="files"/>
</Order>   

There can be only one <Order> element per <Menu>, the last one takes 
precendence.

Fillenames or Menunames referring to items that are not part of this menu 
should be ignored. 

<Separator> acts as a hint but should not be taken literally. In particular, 
multiple separators in a row should be treated as one and leading or trailing 
separators should be ignored.

The <Merge> type represents the items of this menu that are not explicitly 
mentioned in the <Order> element already and alphabetically sorted on their 
visual title. A <Merge> element can have three types: "menus", "files" or 
"all". An <Order> element must have either:
* exactly one <Merge type="all"> element, or 
* exactly one <Merge type="menus"> and exactly one <Merge type="files">

If no <Order> element is specified for a menu the following default order is 
used:

<Order>
  <Merge type="menus"/>
  <Merge type="files"/>
</Order>

====end====

Maybe it's nice to be able to specify the default order as well? Something 
like:

<DefaultOrder>
  <Merge type="menus"/>
  <Merge type="files"/>
</DefaultOrder>

but that also allows for friskyness such as:

<DefaultOrder>
  <Merge type="all"/>
   <Separator/>
   <Menuname>More</Menuname>
</DefaultOrder>

Which would make sense if you had a menu-structure like

/
/Editors
/Editors/More
/Graphics
/Graphics/More

Cheers,
Waldo
- -- 
bastian at kde.org -=|[ SuSE, The Linux Desktop Experts ]|=- bastian at suse.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE/KPa/N4pvrENfboIRAnrLAKCUKu2m4mPoMV4qwcsY7f4CwejuLwCgmNMH
9ieLGkWl9eRuVHRcQaw2ezs=
=wKf7
-----END PGP SIGNATURE-----



More information about the xdg mailing list