2020-03-17, 20:09
Hey,
Im currently writing a file editor / text editor script and for each option in a select box of options, a choice of what action to perform. Thats fine.
Each option opens a browse dialog where the user can then select either a file or directory, depending on the action chosen.
The browse dialog is preselected to
I want to allow creation, editing etc... of files and directories in this immediate directory. But, if cancel is chosen, the pre-selected option is returned (the home path), that tells me not to continue as a cancellation occurred.
So for the time, I cant allow this exact directory to be selected.
Is there a workaround that anyone knows of?
Thanks in advance.
In case you need to see my code:
repo: https://github.com/nazarja/script.file.editor
An example is line number 52 in default.py:
Im currently writing a file editor / text editor script and for each option in a select box of options, a choice of what action to perform. Thats fine.
Each option opens a browse dialog where the user can then select either a file or directory, depending on the action chosen.
The browse dialog is preselected to
.python:xbmc.translatePath('special://home')
I want to allow creation, editing etc... of files and directories in this immediate directory. But, if cancel is chosen, the pre-selected option is returned (the home path), that tells me not to continue as a cancellation occurred.
So for the time, I cant allow this exact directory to be selected.
Is there a workaround that anyone knows of?
Thanks in advance.
In case you need to see my code:
repo: https://github.com/nazarja/script.file.editor
An example is line number 52 in default.py: