mirror of
https://github.com/netinvent/npbackup.git
synced 2025-09-13 00:16:21 +08:00
GUI: Autoload config file when selected
This commit is contained in:
parent
802e6517c6
commit
1fa2554996
1 changed files with 2 additions and 2 deletions
|
@ -551,7 +551,7 @@ def _main_gui(viewer_mode: bool):
|
||||||
layout = [
|
layout = [
|
||||||
[
|
[
|
||||||
sg.Text(_t("main_gui.select_config_file")),
|
sg.Text(_t("main_gui.select_config_file")),
|
||||||
sg.Input(config_file, key="-config_file-"),
|
sg.Input(config_file, key="-config_file-", enable_events=True),
|
||||||
sg.FileBrowse(_t("generic.select_file")),
|
sg.FileBrowse(_t("generic.select_file")),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
@ -572,7 +572,7 @@ def _main_gui(viewer_mode: bool):
|
||||||
action = event
|
action = event
|
||||||
config_file = Path(values["-config_file-"])
|
config_file = Path(values["-config_file-"])
|
||||||
break
|
break
|
||||||
if event == "--LOAD--":
|
if event == "--LOAD--" or event == "-config_file-":
|
||||||
config_file = Path(values["-config_file-"])
|
config_file = Path(values["-config_file-"])
|
||||||
if not values["-config_file-"] or not config_file.exists():
|
if not values["-config_file-"] or not config_file.exists():
|
||||||
sg.PopupError(_t("generic.file_does_not_exist"), keep_on_top=True)
|
sg.PopupError(_t("generic.file_does_not_exist"), keep_on_top=True)
|
||||||
|
|
Loading…
Add table
Reference in a new issue