Browse Source

Applying #317 .patch - HenrykHaniewicz

pull/473/head
Chris 6 years ago
parent
commit
58f60d4213
4 changed files with 21 additions and 2 deletions
  1. 5
      gooey/gui/components/widgets/choosers.py
  2. 2
      gooey/gui/components/widgets/core/__init__.py
  3. 12
      gooey/gui/components/widgets/core/chooser.py
  4. 4
      gooey/languages/english.json

5
gooey/gui/components/widgets/choosers.py

@ -6,6 +6,7 @@ __ALL__ = [
'FileChooser',
'FileSaver',
'DirChooser',
'MultiDirChooser',
'DateChooser'
]
@ -28,6 +29,10 @@ class DirChooser(BaseChooser):
# todo: allow wildcard
widget_class = core.DirChooser
class MultiDirChooser(BaseChooser):
# todo: allow wildcard
widget_class = core.MultiDirChooser
class DateChooser(BaseChooser):
# todo: allow wildcard

2
gooey/gui/components/widgets/core/__init__.py

@ -1,2 +1,2 @@
from . chooser import Chooser, FileChooser, FileSaver, DirChooser, DateChooser, MultiFileChooser
from . chooser import Chooser, FileChooser, FileSaver, DirChooser, DateChooser, MultiFileChooser, MultiDirChooser
from . text_input import PasswordInput, MultilineTextInput, TextInput

12
gooey/gui/components/widgets/core/chooser.py

@ -1,4 +1,5 @@
import wx
import wx.lib.agw.multidirdialog as MDD
import os
from gooey.gui.components.widgets.core.text_input import TextInput
@ -89,6 +90,17 @@ class DirChooser(Chooser):
""" Retrieve a path to the supplied directory """
def getDialog(self):
return wx.DirDialog(self, message=_('choose_folder'))
class MultiDirChooser(Chooser):
""" Retrieve an multiple directories from the system """
def getDialog(self):
return MDD.MultiDirDialog(self,
message=_('choose_folders_msg'),
title=_('choose_folders_title'),
defaultPath=os.getcwd(),
agwStyle=MDD.DD_MULTIPLE | MDD.DD_DIR_MUST_EXIST)
def getResult(self, dialog):
return os.pathsep.join(dialog.GetPaths())
class DateChooser(Chooser):

4
gooey/languages/english.json

@ -5,7 +5,9 @@
"choose_date": "Choose Date",
"choose_file": "Choose File",
"choose_folder": "Choose Folder",
"choose_one": "Choose One",
"choose_folders_msg": "Choose one or more folders:",
"choose_folders_title": "Browse For Folders",
"choose one": "Choose One",
"close": "Close",
"close_program": "Close program?",
"edit": "Edit",

Loading…
Cancel
Save