use native select folder dialog
This commit is contained in:
parent
1d52413618
commit
b2368b9053
6 changed files with 94 additions and 46 deletions
|
|
@ -35,6 +35,8 @@ def selectFolder(data):
|
|||
cmd = ['./ctl', 'ui', 'folder']
|
||||
if sys.platform == 'win32':
|
||||
cmd = win32_ui('folder')
|
||||
if 'base' in data:
|
||||
cmd += [data['base']]
|
||||
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, close_fds=True)
|
||||
stdout, stderr = p.communicate()
|
||||
path = stdout.decode('utf-8').strip()
|
||||
|
|
@ -53,6 +55,8 @@ def selectFile(data):
|
|||
cmd = ['./ctl', 'ui', 'file']
|
||||
if sys.platform == 'win32':
|
||||
cmd = win32_ui('file')
|
||||
if 'base' in data:
|
||||
cmd += [data['base']]
|
||||
p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
|
||||
stdout, stderr = p.communicate()
|
||||
path = stdout.decode('utf-8').strip()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue