diff --git a/easymacro.py b/easymacro.py index 16563ad..88dfe6a 100644 --- a/easymacro.py +++ b/easymacro.py @@ -4248,7 +4248,7 @@ class Paths(object): return path @classmethod - def get_file(cls, init_dir='', filters=(), multiple=False): + def get_file(cls, init_dir: str='', filters=(), multiple: bool=False): """ init_folder: folder default open multiple: True for multiple selected diff --git a/files/ZAZPip_v0.6.0.oxt b/files/ZAZPip_v0.6.0.oxt index c62bcdb..da50cd5 100644 Binary files a/files/ZAZPip_v0.6.0.oxt and b/files/ZAZPip_v0.6.0.oxt differ diff --git a/source/pythonpath/main.py b/source/pythonpath/main.py index 47e167c..cd46fb8 100644 --- a/source/pythonpath/main.py +++ b/source/pythonpath/main.py @@ -268,8 +268,7 @@ class Controllers(object): self._uninstall(name) return - @app.catch_exception - def cmd_shell_action(self, name): + def cmd_shell_action(self, event): if app.IS_WIN: cmd = '"{}"'.format(self.path_python) app.open_file(cmd) @@ -284,6 +283,13 @@ class Controllers(object): app.run(cmd) return + @app.catch_exception + def cmd_explore_action(self, event): + file_name = app.paths.get_file(filters=(('TXT', '*.txt'),)) + self.d.txt_search.value = file_name + app.debug(file_name) + return + @app.catch_exception def _create_dialog(): @@ -421,13 +427,25 @@ def _create_dialog(): args = { 'Type': 'Text', 'Name': 'txt_search', - 'Width': 180, + 'Width': 165, 'Height': 12, 'Step': 1, 'Border': 0, } dialog.add_control(args) + args = { + 'Type': 'Button', + 'Name': 'cmd_explore', + 'Label': '...', + 'Width': 12, + 'Height': 12, + 'Step': 1, + # ~ 'ImageURL': 'close.svg', + # ~ 'ImagePosition': 1, + } + dialog.add_control(args) + args = { 'Type': 'Listbox', 'Name': 'lst_package', @@ -515,11 +533,13 @@ def _create_dialog(): dialog.cmd_install, dialog.cmd_uninstall, dialog.cmd_shell) dialog.lbl_package.move(dialog.cmd_home) dialog.txt_search.move(dialog.lbl_package) + dialog.cmd_explore.move(dialog.txt_search, x=0, y=0) dialog.lst_package.move(dialog.txt_search) dialog.lbl_package.center() dialog.lst_package.center() dialog.txt_search.center() dialog.center(controls) + dialog.center((dialog.txt_search, dialog.cmd_explore)) dialog.step = 10