Page MenuHomePhabricator

DataManager does not sort its custom context menu entries
Closed, ResolvedPublic

Description

Context menu entries from DataManager's extension point "org.mitk.gui.qt.datamanager.contextMenuActions" are added in their (random) order of service listing. This can be confusing when there is more than one entry and the order changes with every application start.

(Though I know that the current mechanism is debated and could use a rewrite) I added a simple alphabetical sorting to the code. This improves the current situation for users.

Event Timeline

goch added a subscriber: goch.

This seems reasonable to me, although it might result in separating thematically similar actions, which might have been closer together when registered the previous way. In general that should probably not be a problem.

There are still a couple of entries that will not be sorted, as they are specifically added by the datamanager itself.

after-menu.png (460×434 px, 21 KB)

But the suggested solution is better than the current way.

In T23292#109426, @goch wrote:

There are still a couple of entries that will not be sorted, as they are specifically added by the datamanager itself.

after-menu.png (460×434 px, 21 KB)

But the suggested solution is better than the current way.

Right, sorting _all_ entries was not my goal - because I also think that per-topic grouping as done by DataManager's own entries makes a lot of sense. My only goal was to get a _consistent_ and reproducible order with plugin-provided menu entries.

Thanks for integrating this