nathan-osman / NitroShare-Mac

Mac OS X project files and source code for building NitroShare.
3 stars 2 forks source link

Adding menu items to right click on mac dock "launcher" icon. #7

Closed mateosalta closed 12 years ago

mateosalta commented 12 years ago

I'm looking into adding some of the menu items to the mac dock icon, mostly the functionality of "send files" and "send directory", for quick accesses, maybe some others that you would think would be important, I think I might be close, but am having a hard time figuring it out.

So from http://qt-project.org/doc/qt-4.8/exportedfunctions.html , It looks like I need to use void qt_mac_set_dock_menu(QMenu *menu)

Just need a bit of help on the how and where...

nathan-osman commented 12 years ago

Hmmm... if you don't mind adding everything that the AppIndicator contains on Ubuntu (there will also be "settings", "about", etc.) then you could open up CTrayIcon.cpp:236

...and add the following at the end of the function body:

qt_mac_set_dock_menu(menu);

It's worth a try.

mateosalta commented 12 years ago

Awesome, That did the trick, I kept trying to add it in all kinds of other places. That even made it easy because it just added everything over.

Here is a screen shot

http://farm9.staticflickr.com/8177/8027230856_653e55f189_o.png

mateosalta commented 12 years ago

although "Exit" and "Quit" are there...

mateosalta commented 12 years ago

Oh, and the dock does not update the "Send Files To" and "Send Directory To" machine list, It only updates once you click on the other menu with the CTrayIcon, So... I think I need to create a new menu with just some of the other Items. Then maybe some kind of workaround for the send files (like a select computer dialog, or leave them off the menu?)

Good news is that "Add Share Box" "Settings" and "About" work like expected.

mateosalta commented 12 years ago

ok, done, It seems using OnSendFiles() and OnSendDirectory() works fine for this purpose.