Browse Source

Bug fix: MultiFileChooser returning single results

pull/90/merge
chriskiehl 9 years ago
parent
commit
7add1bdce9
1 changed files with 8 additions and 1 deletions
  1. 9
      gooey/gui/widgets/widget_pack.py

9
gooey/gui/widgets/widget_pack.py

@ -78,7 +78,7 @@ class BaseFileChooser(BaseChooser):
def onButton(self, evt):
dlg = self.dialog(self.parent)
result = (dlg.GetPath()
result = (self.get_path(dlg)
if dlg.ShowModal() == wx.ID_OK
else None)
if result:
@ -86,6 +86,13 @@ class BaseFileChooser(BaseChooser):
# kinda hacky, but avoided a buncha boilerplate
self.text_box.SetValue(result)
def get_path(self, dlg):
if isinstance(dlg, wx.DirDialog):
return dlg.GetPath()
else:
paths = dlg.GetPaths()
return paths[0] if len(paths) < 2 else ' '.join(paths)
def build_dialog(style, exist_constraint=True, **kwargs):
if exist_constraint:

Loading…
Cancel
Save