From: Diego Z. <za...@ce...> - 2001-01-26 19:21:34
|
Hi, As the last pending item in my "patches to ROX-Filer" queue that I had to clean up and submit, I have uploaded an update to the application-specific patch. Please see patch #103115 in the sourceforge patches page. This patch (against CVS as of 01/26/2001) adds application-specific menus to ROX-Filer. If an application has a menu defined, its entries appear above the standard menu when the application is right-clicked, whether on the pinboard, panels, or on a filer window. The menu is defined in a file called AppMenu in the application directory. Its format is: entryid Menu text Each line defines one menu entry. When an entry from the application menu is selected, the corresponding AppRun is invoked with the option "--entryid", where "entryid" is the one corresponding to the item selected. It is up to AppRun to correctly interpret the option and do something. The application menus are re-read automatically when they change, so the application can potentially modify the menu file, and the changes will be seen by ROX-Filer. For examples of ROX applications that use this feature, see my Trashcan, XEmacs and LaTeX applications at http://www.cerias.purdue.edu/homes/zamboni/rox/. In particular, the XEmacs wrapper is an example of an AppRun that modifies its menu on the fly, to keep a list of recently-opened files. Some notes: - In contrast to the first version of this patch, copies of the menus are not cached for each application that has a menu defined. Instead, only the app-specific items are stored, and the corresponding menu (filer, pinboard or panel) is modified on the fly. The AppMenu items are cached in appmenu_cache (see appmenu.h) - I'm not sure about the usefulness of showing applicaton-specific items on filer windows. In my experience, app-specific menus are more useful on the pinboard and panels only. I was thinking of having an additional option for toggling showing app-specific menus on filer windows. Any thoughts? - Sub-menus and separators cannot be defined for now in app-specific menus, although it shouldn't be too hard to add. - Note that the name of the menu file has changed from AppMenuStatic.txt (in the first version of this patch) to AppMenu. - In the first version of this patch, the application directory itself was used as the key to the appmenu_cache. Now the menu file is used, so it detects changed to the menu more reliably. - Thomas mentioned the possibility of migrating ROX configuration files to XML format. If and when that happens all across ROX-Filer, I will modify the format of AppMenu to XML. ABOUT DYNAMIC MENUS I initially thought that dynamic menus would be a good idea. Now I'm not so sure for a number of reasons. If they are found to be useful, they could be implemented using some special syntax in the AppMenu file (instead of a different file, as I had initially suggested). Thoughts on this issue are welcome. I will welcome all feedback on the usefulness and implementation of this patch. Enjoy, --Diego Zamboni za...@pu... |