Page 1 of 2

Context Menus

Posted: 02 Aug 2007 10:28
by Twisted_Daemon
The context menus seem to work when I'm selecting a folder, I get the usual play with VLC player and add to VLC playlist etc.

However I don't get this when I'm selecting a media file.

Anyone know how to fix this?

Re: Context Menus

Posted: 02 Aug 2007 18:34
by CloudStalker
"Open with..."? :P

Re: Context Menus

Posted: 03 Aug 2007 18:00
by Twisted_Daemon
There is the open with command but there should really be be a play with VLC context menu for the media files themselves and not just folders. Is there a file I can alter to get that or something?

Re: Context Menus

Posted: 07 Aug 2007 11:59
by 3breadt
In Explorer go to Extras>Folder preferences(Dunno if that's the correct english name)>Filetypes. There you can edit how all files are handled. If you want it the easy way, just reinstall VLC and select the file types you want to be opened by default with vlc and then you'll have what you want.

Re: Context Menus

Posted: 20 Sep 2007 21:47
by Twisted_Daemon
It's not a question of file association, that's all fine.

When a FOLDER is right clicked the following options are given:
Add to VLC's Media Player's Playlist (Whacks the directory to the back of the playlist)
Play VLC Media Player (Plays the directory right away)

When single or multiple media files are right clicked there is just the 'Play' option is available. This will play one of the files automatically, but there is no option to just add it to the end of the playlist.

Re: Context Menus

Posted: 20 Sep 2007 22:00
by CloudStalker
Twisted_Daemon would you like me to move this to the Feature Request topic? I think that it would be best there.

Re: Context Menus

Posted: 20 Sep 2007 22:07
by Twisted_Daemon
Yis please : )

Re: Context Menus

Posted: 21 Sep 2007 00:04
by funman
or you can enable 'one instance' mode, and that way when you open a file it'll be added to the playlist of the first instance of vlc.

you can choose wether or not it will start playing immediately, or if the file previously playing will continue

Re: Context Menus

Posted: 21 Sep 2007 00:19
by Twisted_Daemon
I have the one instance option enabled already.

I am aware that in VLC's preferences there is the option to play the file immediately or just add it to the playlist, however I would prefer to choose when I right click the file from a context menu.

It just seems odd to me that the option is available for a directory but not single media files.

Re: Context Menus

Posted: 21 Sep 2007 01:32
by funman
The code used for context menus is at:
http://trac.videolan.org/vlc/browser/tr ... si.in#L224

if you understand how to fix it, please tell it here

Re: Context Menus

Posted: 21 Sep 2007 04:14
by CloudStalker
Yis please : )
Let it be written, let it be done.

Re: Context Menus

Posted: 21 Sep 2007 08:37
by 3breadt
I think the problem is that VLC writes the shell commands like "Add to playlist" directly into HKCR/{.EXT}/shell
Instead they should go to HKCR/VLC{.EXT}/shell. Shell commands that are directly written into the extensions's key are not interpreted. Only those in the key associated by the default value of the extension's key. And this key does only contain the "Play" command atm.

Fix:

Code: Select all

228 !macro AddContextMenu EXT 229 WriteRegStr HKCR VLC${EXT}\shell\PlayWithVLC "" "Play with VLC media player" 230 WriteRegStr HKCR VLC${EXT}\shell\PlayWithVLC\command "" '$INSTDIR\vlc.exe --started-from-file --no-playlist-enqueue "%1"' 231 232 WriteRegStr HKCR VLC${EXT}\shell\AddToPlaylistVLC "" "Add to VLC media player's Playlist" 233 WriteRegStr HKCR VLC${EXT}\shell\AddToPlaylistVLC\command "" '$INSTDIR\vlc.exe --started-from-file --playlist-enqueue "%1"' 234 !macroend 235 236 !macro DeleteContextMenu EXT 237 DeleteRegKey HKCR VLC${EXT} 238 DeleteRegKey HKCR VLC${EXT} 239 !macroend
I haven't looked at the other parts of the code were the actual VLC.ext entries are written but this fix for the macros should work.

Re: Context Menus

Posted: 21 Sep 2007 08:43
by ssbssa
the problem is, VLC{.EXT} only exists when the file type associations are chosen.

Re: Context Menus

Posted: 21 Sep 2007 09:13
by 3breadt
Why is that a problem? The other code is also executed only when file type associations are chosen in the setup. But the setup doesn't write the associations correctly.

Re: Context Menus

Posted: 21 Sep 2007 09:50
by ssbssa
they are written when Context Menus are chosen, not file type associations

Re: Context Menus

Posted: 21 Sep 2007 15:23
by 3breadt
Oh. But anyway I don't see the point in separating contextmenu-entries and file assocations.
If at all you could make contextmenu-entries only chooseable when file associations are selected.

Re: Context Menus

Posted: 21 Sep 2007 15:53
by ssbssa
i will send a patch for this over the weekend (i will keep it seperated thou)

Re: Context Menus

Posted: 23 Sep 2007 02:12
by Jean-Baptiste Kempf
Is this the patch you just sent to the mailing list?

Re: Context Menus

Posted: 24 Sep 2007 09:05
by ssbssa
yes it is

Re: Context Menus

Posted: 24 Sep 2007 09:28
by Jean-Baptiste Kempf
applied :D

Re: Context Menus

Posted: 25 Sep 2007 12:26
by Twisted_Daemon
Thanks for applying the features to the single / multiple file context menu. It's great :)

However now the context menus don't appear when you select a directory. I was hoping that the context menus were being applied to both.

Re: Context Menus

Posted: 25 Sep 2007 12:50
by ssbssa
forgot to test the directories too.
i found the problem, will send the patch tomorrow.

Re: Context Menus

Posted: 25 Sep 2007 12:56
by Twisted_Daemon
Awesome.

Many thanks :D

Re: Context Menus

Posted: 25 Sep 2007 17:03
by CloudStalker
Thank you. :)

Re: Context Menus

Posted: 26 Sep 2007 12:56
by Jean-Baptiste Kempf
Applied for tomorrow's installer.