Allow multiple menu items from plugin.

• Jan 18, 2013 - 07:59
Type
Plugins
Severity
S5 - Suggestion
Status
won't fix
Regression
No
Workaround
Yes
Project

So that same plugin could be ran with different options. E.g.:

var mscorePlugin = {
menu: ['Plugins.My Plugin.Option1', Plugins.My Plugin.Option2'],
init: init,
run: run
};

or simply

var mscorePlugin = {
menu: 'Plugins.My Plugin.Option1|Plugins.My Plugin.Option2',
init: init,
run: run
};

Also the run function should be passed the menu name as it's argument. E.g. when Option 1 is clicked the plugin should run with "Plugins.My Plugin.Option1" being passed as an argument to run function.


Comments

Status active won't fix
Regression No
Workaround Yes

This would also affect setting plugin shortcuts etc.

While it is fairly trivial to dump your common code into a separate file and have two qml plugins in your "plugin" that then each can have their own menu item. Having them call the common function with the correct parameters.