Add menu item to Nautilus context menu on selected packages?
Hi, i have a tool that works on packages. So far i added a wizard to the world menu, but i would rather add a menu item to the Nautilus context menu on selected packages - is this possible? Best regards, Martin. -- View this message in context: http://forum.world.st/Add-menu-item-to-Nautilus-context-menu-on-selected-pac... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
It is :) And I would even say it is not complicated :P Here is an example from Nautilus AbstractNautilusUI class>>packagesMenu: aBuilder <contextMenu> <nautilusGlobalPackageMenu> | package target | target := aBuilder model. (package := target selectedPackage) ifNil: [ ^ target ]. (aBuilder item: #'Browse scoped') keyText: 'b, s' if: Nautilus useOldStyleKeys not; action: [ target restrictedBrowsePackage ]; order: 1000; help: 'Open a browser on a restricted view'; withSeparatorAfter. :) Ben On 12 Nov 2013, at 15:41, MartinW <wm@fastmail.fm> wrote:
Hi, i have a tool that works on packages. So far i added a wizard to the world menu, but i would rather add a menu item to the Nautilus context menu on selected packages - is this possible?
Best regards, Martin.
-- View this message in context: http://forum.world.st/Add-menu-item-to-Nautilus-context-menu-on-selected-pac... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Quite easy indeed. Thank you. Is there any system behing the ordering of menu entries? Martin. Benjamin Van Ryseghem-2 wrote
It is :) And I would even say it is not complicated :P
So far i added a wizard to the world menu, but i would rather add a menu item to the Nautilus context menu on selected packages - is this possible?
-- View this message in context: http://forum.world.st/Add-menu-item-to-Nautilus-context-menu-on-selected-pac... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
You can give them a priority, then it depends of the other items :) Ben On 13 Nov 2013, at 17:31, MartinW <wm@fastmail.fm> wrote:
Quite easy indeed. Thank you. Is there any system behing the ordering of menu entries?
Martin.
Benjamin Van Ryseghem-2 wrote
It is :) And I would even say it is not complicated :P
So far i added a wizard to the world menu, but i would rather add a menu item to the Nautilus context menu on selected packages - is this possible?
-- View this message in context: http://forum.world.st/Add-menu-item-to-Nautilus-context-menu-on-selected-pac... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
I have one follow-up question trying to understand how this works: I see that <nautilusXXXMenu> is used in AbstractNautilusUI to build the menus â but why is <contextMenu> here? Also the code seems to work all the same without <contextMenu>? Martin. Benjamin Van Ryseghem-2 wrote
Here is an example from Nautilus
AbstractNautilusUI class>>packagesMenu: aBuilder
<contextMenu>
<nautilusGlobalPackageMenu> | package target | target := aBuilder model.
(package := target selectedPackage) ifNil: [ ^ target ].
(aBuilder item: #'Browse scoped') keyText: 'b, s' if: Nautilus useOldStyleKeys not; action: [ target restrictedBrowsePackage ]; order: 1000; help: 'Open a browser on a restricted view'; withSeparatorAfter.
-- View this message in context: http://forum.world.st/Add-menu-item-to-Nautilus-context-menu-on-selected-pac... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
No idea ⦠I do not added it, so I can not tell Ben On 02 Dec 2013, at 15:25, MartinW <wm@fastmail.fm> wrote:
I have one follow-up question trying to understand how this works: I see that <nautilusXXXMenu> is used in AbstractNautilusUI to build the menus â but why is <contextMenu> here? Also the code seems to work all the same without <contextMenu>?
Martin.
Benjamin Van Ryseghem-2 wrote
Here is an example from Nautilus
AbstractNautilusUI class>>packagesMenu: aBuilder
<contextMenu>
<nautilusGlobalPackageMenu> | package target | target := aBuilder model.
(package := target selectedPackage) ifNil: [ ^ target ].
(aBuilder item: #'Browse scoped') keyText: 'b, s' if: Nautilus useOldStyleKeys not; action: [ target restrictedBrowsePackage ]; order: 1000; help: 'Open a browser on a restricted view'; withSeparatorAfter.
-- View this message in context: http://forum.world.st/Add-menu-item-to-Nautilus-context-menu-on-selected-pac... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
participants (2)
-
Benjamin -
MartinW