GUI: Select directory

Discuss your Lua playlist, album art and interface scripts.
147852369
Blank Cone
Blank Cone
Posts: 55
Joined: 01 Mar 2013 12:18

GUI: Select directory

Postby 147852369 » 04 Oct 2014 23:25

Hello people,

is there a possibility to choose a directory?

I want to implement a function in my extension GUI which can select a directory on my OS.

Like in HTML:
<input type="file" />

Thanks.

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: GUI: Select directory

Postby mederi » 06 Oct 2014 16:56

File/folder open dialog is not available, but it is possible to create a custom dialog:
net.opendir( path ): List a directory's contents.
The net module is again available in VLC-2.2, not in current VLC-2.1.x.

147852369
Blank Cone
Blank Cone
Posts: 55
Joined: 01 Mar 2013 12:18

Re: GUI: Select directory

Postby 147852369 » 07 Oct 2014 20:19

That's sadly not what I'm searching for. My extension already opens a dialog. I want to click on a button in this dialog and be able to select a directory. I believe there's no alternative for my reason.

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: GUI: Select directory

Postby mederi » 08 Oct 2014 10:46

As a workaround you could create your own dialog to browse for files/folders. You have 2 options - add/delete widgets in your current dialog box or delete the current dialog box and open a new one:
https://forum.videolan.org/viewtopic.ph ... 14#p408965
Just use a list widget, where you can list a directory's contents. Then you have to parse the selected item and differentiate file or folder. Then just relist a new contets of another folder (subfolder) in the list widget.

147852369
Blank Cone
Blank Cone
Posts: 55
Joined: 01 Mar 2013 12:18

Re: GUI: Select directory

Postby 147852369 » 10 Oct 2014 14:45

Thanks you, mederi! You are very helpful.


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 6 guests