zerodivisi0n / FinderMenu

Adding items to Finder's contextual menu
MIT License
84 stars 17 forks source link

Seems not working in TIconViewController #1

Closed kencool closed 11 years ago

kencool commented 12 years ago

Hi zerodivisi0n,

First I have to say you have really done a good job. It works neatly!

However, it seems like not working while browsing Finder in icon browser mode.

Was it happened only to me? Or you're encountering the same issue?

zerodivisi0n commented 12 years ago

Yes, that's right. I have not tested it with Icon View. And it did not work.

It seems that in the case of Icon View method configureWithNodes:browserController:container: is not called. I'll try to find another solution, in my spare time. I think it will be within a month.

Thanks for your feedback!

kencool commented 12 years ago

I'm also working on this and here are some of my findings.

Icon View is implemented by TIconViewController which using a IKImageBrowserView. By searching TIconViewController's header, I find a protocol method imageBrowser:cellWasRightClickedAtIndex:withEvent: which is called when I right click on an item. It seems that TIconViewController uses another way to implement context menu other than TContextMenu. But for now I have no idea how it's working.

Let's try more. So fun!

kencool commented 12 years ago

Sorry, I was wrong.....

After more researching, I found that IconView still uses TContextMenu to perform a context menu. I think it perhaps use those class methods to accomplish it.

I'll try more.

zerodivisi0n commented 12 years ago

I have found no other suitable methods in TContextMenu. Yesterday I checked the method initWithObject:nodes:event: and it does not work. I think, we need to check other init... methods of this class.

kencool commented 12 years ago

Finally I got the point. While under Icon View mode, all things are done by class methods.

Here are the class methods it goes through in order,

  1. contextMenuClickedOnNodes:event:view:windowController:
  2. handleContextMenuCommon:nodes:event:view:windowController:addPlugIns:
  3. buildContextMenu:forContext:target:maxItems:addServices:
  4. addViewSpecificStuffToMenu:browserViewController:context:

and we can insert our menu items in step 4. The first argument is an instance of TContextMenu with all items added by Finder.

I have tried it and succeed. You may have a try. :)

zerodivisi0n commented 12 years ago

I already tried this earlier.

The main problem is that in this case it's not clear how to get the context items.

zerodivisi0n commented 11 years ago

Hi, Ken!

I finally totally reworked the project. Now it supports Icon View and Desktop View modes, should work with all OS X versions since 10.6 and have more clear code.

RudyAramayo commented 11 years ago

THANK YOU SO MUCH!!!!

kencool commented 11 years ago

Sorry for a while time not checking my github messages. Just busy on working. I've check out the latest version. Thanks for your hard work on this project. Now it's more completed and easily to use. Great!!