mirror of
https://github.com/netinvent/npbackup.git
synced 2025-10-11 22:16:34 +08:00
Update variable names
This commit is contained in:
parent
ca2602e60b
commit
dfdf04c691
1 changed files with 12 additions and 12 deletions
|
@ -24,9 +24,9 @@ from ofunctions.misc import BytesConverter
|
||||||
from npbackup.customization import (
|
from npbackup.customization import (
|
||||||
OEM_STRING,
|
OEM_STRING,
|
||||||
OEM_LOGO,
|
OEM_LOGO,
|
||||||
loader_animation,
|
LOADER_ANIMATION,
|
||||||
folder_icon,
|
FOLDER_ICON,
|
||||||
file_icon,
|
FILE_ICON,
|
||||||
LICENSE_TEXT,
|
LICENSE_TEXT,
|
||||||
LICENSE_FILE,
|
LICENSE_FILE,
|
||||||
)
|
)
|
||||||
|
@ -112,7 +112,7 @@ def get_gui_data(config_dict: dict) -> Future:
|
||||||
thread = _get_gui_data(config_dict)
|
thread = _get_gui_data(config_dict)
|
||||||
while not thread.done() and not thread.cancelled():
|
while not thread.done() and not thread.cancelled():
|
||||||
sg.PopupAnimated(
|
sg.PopupAnimated(
|
||||||
loader_animation,
|
LOADER_ANIMATION,
|
||||||
message=_t("main_gui.loading_data_from_repo"),
|
message=_t("main_gui.loading_data_from_repo"),
|
||||||
time_between_frames=50,
|
time_between_frames=50,
|
||||||
background_color="darkgreen",
|
background_color="darkgreen",
|
||||||
|
@ -173,7 +173,7 @@ def _make_treedata_from_json(ls_result: List[dict]) -> sg.TreeData:
|
||||||
key=entry["path"],
|
key=entry["path"],
|
||||||
text=entry["name"],
|
text=entry["name"],
|
||||||
values=["", mtime],
|
values=["", mtime],
|
||||||
icon=folder_icon,
|
icon=FOLDER_ICON,
|
||||||
)
|
)
|
||||||
elif entry["type"] == "file":
|
elif entry["type"] == "file":
|
||||||
size = BytesConverter(entry["size"]).human
|
size = BytesConverter(entry["size"]).human
|
||||||
|
@ -182,7 +182,7 @@ def _make_treedata_from_json(ls_result: List[dict]) -> sg.TreeData:
|
||||||
key=entry["path"],
|
key=entry["path"],
|
||||||
text=entry["name"],
|
text=entry["name"],
|
||||||
values=[size, mtime],
|
values=[size, mtime],
|
||||||
icon=file_icon,
|
icon=FILE_ICON,
|
||||||
)
|
)
|
||||||
return treedata
|
return treedata
|
||||||
|
|
||||||
|
@ -231,7 +231,7 @@ def ls_window(config: dict, snapshot: str) -> bool:
|
||||||
|
|
||||||
while not thread.done() and not thread.cancelled():
|
while not thread.done() and not thread.cancelled():
|
||||||
sg.PopupAnimated(
|
sg.PopupAnimated(
|
||||||
loader_animation,
|
LOADER_ANIMATION,
|
||||||
message="{}. {}".format(
|
message="{}. {}".format(
|
||||||
_t("main_gui.loading_data_from_repo"),
|
_t("main_gui.loading_data_from_repo"),
|
||||||
_t("main_gui.this_will_take_a_while"),
|
_t("main_gui.this_will_take_a_while"),
|
||||||
|
@ -248,14 +248,14 @@ def ls_window(config: dict, snapshot: str) -> bool:
|
||||||
# Preload animation before thread so we don't have to deal with slow initial drawing due to cpu usage of thread
|
# Preload animation before thread so we don't have to deal with slow initial drawing due to cpu usage of thread
|
||||||
# This is an arbitrary way to make sure we get to see the popup
|
# This is an arbitrary way to make sure we get to see the popup
|
||||||
sg.PopupAnimated(
|
sg.PopupAnimated(
|
||||||
loader_animation,
|
LOADER_ANIMATION,
|
||||||
message="{}...".format(_t("main_gui.creating_tree")),
|
message="{}...".format(_t("main_gui.creating_tree")),
|
||||||
time_between_frames=1,
|
time_between_frames=1,
|
||||||
background_color="darkgreen",
|
background_color="darkgreen",
|
||||||
)
|
)
|
||||||
sleep(0.01)
|
sleep(0.01)
|
||||||
sg.PopupAnimated(
|
sg.PopupAnimated(
|
||||||
loader_animation,
|
LOADER_ANIMATION,
|
||||||
message="{}...".format(_t("main_gui.creating_tree")),
|
message="{}...".format(_t("main_gui.creating_tree")),
|
||||||
time_between_frames=1,
|
time_between_frames=1,
|
||||||
background_color="darkgreen",
|
background_color="darkgreen",
|
||||||
|
@ -264,7 +264,7 @@ def ls_window(config: dict, snapshot: str) -> bool:
|
||||||
|
|
||||||
while not thread.done() and not thread.cancelled():
|
while not thread.done() and not thread.cancelled():
|
||||||
sg.PopupAnimated(
|
sg.PopupAnimated(
|
||||||
loader_animation,
|
LOADER_ANIMATION,
|
||||||
message="{}...".format(_t("main_gui.creating_tree")),
|
message="{}...".format(_t("main_gui.creating_tree")),
|
||||||
time_between_frames=150,
|
time_between_frames=150,
|
||||||
background_color="darkgreen",
|
background_color="darkgreen",
|
||||||
|
@ -363,7 +363,7 @@ def restore_window(
|
||||||
)
|
)
|
||||||
while not thread.done() and not thread.cancelled():
|
while not thread.done() and not thread.cancelled():
|
||||||
sg.PopupAnimated(
|
sg.PopupAnimated(
|
||||||
loader_animation,
|
LOADER_ANIMATION,
|
||||||
message="{}...".format(_t("main_gui.restore_in_progress")),
|
message="{}...".format(_t("main_gui.restore_in_progress")),
|
||||||
time_between_frames=50,
|
time_between_frames=50,
|
||||||
background_color="darkgreen",
|
background_color="darkgreen",
|
||||||
|
@ -520,7 +520,7 @@ def main_gui(config_dict: dict, config_file: str, version_string: str):
|
||||||
if stdout_line:
|
if stdout_line:
|
||||||
progress_window["progress"].Update(stdout_line)
|
progress_window["progress"].Update(stdout_line)
|
||||||
sg.PopupAnimated(
|
sg.PopupAnimated(
|
||||||
loader_animation,
|
LOADER_ANIMATION,
|
||||||
message="{}...".format(_t("main_gui.backup_in_progress")),
|
message="{}...".format(_t("main_gui.backup_in_progress")),
|
||||||
time_between_frames=50,
|
time_between_frames=50,
|
||||||
background_color="darkgreen",
|
background_color="darkgreen",
|
||||||
|
|
Loading…
Add table
Reference in a new issue