Actually this isn't a feature request as much as a feedback request. If a motivated minion believes this is the wrong place or wishes to merge this with some similar requests, that is fine with me.
Many users find the drop down menu of Scripts to be too long. The workaround is to create a subdirectory and dump helper scripts and other things that are not called directly into it. The attached patch is a proposed alternative.
The patch does nothing visible to the user unless the mafia user preference scriptMRULength is set to a value greater than 0. If the value is positive then that is the number of entries that will be maintained. If enabled, using the Refresh button in the Scripts menu will (initially) replace the display generated by the directory contents, with the MRU list. Subsequent uses of the Refresh list will update the display with the current MRU list. When displayed the most recently used script is at the top and the "oldest" use at the bottom. Changes to the list are saved as a preference. Each script will only appear in the list once and the script will be trimmed so that there are no more than scriptMRULength entries. A script will appear if it was invoked from the Script menu or the gCLI but not if it was invoked by another script. Because various operating systems handle case sensitivity differently, the list is case sensitive. On Windows 7, for example, ascend and Ascend will both appear if they were both used to invoke Ascend.ash.
Patch attached. I am interested in feedback in several areas.
Is this useful or A Bad Idea (and why)?
Did I violate coding or formatting standards?
Is CallScriptCommand the best and only place to capture script filenames when they are invoked?
Because the Script menu is built before login the user is not defined and so there is some kludgyness to delay initialization until the user and associated preferences are defined. Is there an alternative that does not disrupt the code too much?
The first press of Refresh to invoke the feature seems equally kludgy but I did not see an obvious, non-disruptive alternative. Subsequent presses are acceptable because of the analogy to adding a new script file to the directory.
Thanks.
Edit: This isn't the post you are looking for. Go here also.
Many users find the drop down menu of Scripts to be too long. The workaround is to create a subdirectory and dump helper scripts and other things that are not called directly into it. The attached patch is a proposed alternative.
The patch does nothing visible to the user unless the mafia user preference scriptMRULength is set to a value greater than 0. If the value is positive then that is the number of entries that will be maintained. If enabled, using the Refresh button in the Scripts menu will (initially) replace the display generated by the directory contents, with the MRU list. Subsequent uses of the Refresh list will update the display with the current MRU list. When displayed the most recently used script is at the top and the "oldest" use at the bottom. Changes to the list are saved as a preference. Each script will only appear in the list once and the script will be trimmed so that there are no more than scriptMRULength entries. A script will appear if it was invoked from the Script menu or the gCLI but not if it was invoked by another script. Because various operating systems handle case sensitivity differently, the list is case sensitive. On Windows 7, for example, ascend and Ascend will both appear if they were both used to invoke Ascend.ash.
Patch attached. I am interested in feedback in several areas.
Is this useful or A Bad Idea (and why)?
Did I violate coding or formatting standards?
Is CallScriptCommand the best and only place to capture script filenames when they are invoked?
Because the Script menu is built before login the user is not defined and so there is some kludgyness to delay initialization until the user and associated preferences are defined. Is there an alternative that does not disrupt the code too much?
The first press of Refresh to invoke the feature seems equally kludgy but I did not see an obvious, non-disruptive alternative. Subsequent presses are acceptable because of the analogy to adding a new script file to the directory.
Thanks.
Edit: This isn't the post you are looking for. Go here also.
Attachments
Last edited: