PDA

View Full Version : Select any folder of a Linux-system with dialog


linuxluemmel
2009-08-01, 14:49
Hello to all ...)

I have a little problem with a dialog-function to select any folder of a linux-system

My codes looks like this :



if (choice == 1):
dialog = xbmcgui.Dialog()
directory_1 = dialog.browse(0,__language__(33063), 'files', '', False, False, '//')
if (directory_1 != '//'):
directory_2 = directory_1[1:-1]
configuration[1] = directory_2
changed = True



I can select any folder of the system I like. The dialog is looking like this

http://luemmels-dvd-ripper.googlecode.com/files/dialog-01.png

All is working fine ... the code

directory_2 = directory_1[1:-1]

makes the directory path looking right...

As long the user dont use .. in the list everything is ok and my paths are saved
correct .... If a user selects .. and then select home folder the functions returns as
example home/user witch would produce a error ....

Can I remove this entry from the list .... ? To prevent the user to select this entry ..


For the next release for my dvd-ripper script this is essential ..

Regards
Hans

Dan Dare
2009-09-23, 01:52
How about if the user selects the home dir, just popup a message saying home is not allowed and get the user back into the select dialog...