Bugzilla – Bug 17409
Third party menus ordered incorrectly
Last modified: 2011-08-18 15:01:45 UTC
Created attachment 7381 [details] Patch that corrects menu ordering. Third party menus added dynamically is currently ordered incorrectly, they all show up on top above all the other standard menus. The issue is that the quick sort algorithm currently doesn't work because it assumes all compared menu pairs either: - both is the main plugin menu or - both is not a main plugin menu The attached patch solves the issues.
== Auto-comment from SVN commit #33008 to the slim repo by mherger == == http://svn.slimdevices.com/slim?view=revision&revision=33008 == Fixed Bug: 17409 Fixed Bug: 17410 Description: fix menu ordering in the web UI
Erland, Is it possible to do this by adding plugin weight values? When I updated the code to get the ordering right for SMD I noticed that the rank preferences are not used in the command interface. This patch also makes the button and web interface logic different. So it would seem to me to be preferable to depreciate the rank prefs for entries and try to do by plugin weights if we can. If this needs adding a method to set the weight of a dynamically generated web page then we should do this?
(In reply to comment #2) > Erland, > > Is it possible to do this by adding plugin weight values? > I've one plugin that needs to be able to provide multiple menus with different weight values, but if you are talking about making it possible to register a weight for a specific menu key I like that idea, the current "rank-xxx" preferences feels a bit dirty.
As a hack today you can probably add entries to the plugin $WEIGHTS hash by: $pluginclass->getWeights->{ $token } = $weight; This will add entries to the hash stored in Slim::Plugin::Base. We should probably expose this more formally by creating a setWeight method in the base class which does this? Would this provide what you need?
== Auto-comment from SVN commit #33029 to the slim repo by mherger == == http://svn.slimdevices.com/slim?view=revision&revision=33029 == Bug: 17409 Description: improve change to make MusicIP use weights instead of legacy rank values. Unfortunately MIP isn't based on Slim::Plugin::Base, therefore we need a helper method to add the weight.
(In reply to comment #5) > == Auto-comment from SVN commit #33029 to the slim repo by mherger == > == http://svn.slimdevices.com/slim?view=revision&revision=33029 == > > Bug: 17409 > Description: improve change to make MusicIP use weights instead of legacy rank > values. Unfortunately MIP isn't based on Slim::Plugin::Base, therefore we need > a helper method to add the weight. Just for information, I've switched Custom Browse to use the new Slim::Plugin::Base->addWeight method you just added. There still seems to be standard SBS code that uses rank-xxx, I'm not sure if that could be changed too or if it will cause other problems. Run a grep for "rank" in the code and you will find it in a few places. I'm guessing it's probably not urgent to change this as it probably doesn't cause any issues.
I wouldn't say it's fixed. SugarCube is still listed on top. http://forums.slimdevices.com/showpost.php?p=650042&postcount=8 7.6.1 - r33110
> I wouldn't say it's fixed. SugarCube is still listed on top. Please tell its author to update his plugin by adding a weight function: sub weight { 99 }