Repeat the tweak menu after each choice path is completed

Former-commit-id: 4b49d43f13fbb006c5315e9be677bcc33dd2ac20
Former-commit-id: ac447b63ec5cb5e85dc9133466a434be0786c30d
This commit is contained in:
2023-05-25 13:59:22 -04:00
parent 709db8f6de
commit 97bce0cec7
2 changed files with 17 additions and 6 deletions
+2 -2
View File
@@ -825,8 +825,8 @@ if __name__ == "__main__":
rmtree(f"{tmp_dir}{_shm_folder}") rmtree(f"{tmp_dir}{_shm_folder}")
elif arguments[0] == 'tweak': elif arguments[0] == 'tweak':
success_flag = True success_flag = True
from stweak import global_menu from stweak import menu_repeat
global_menu(False) menu_repeat(False)
# PORT START ARGS-SERVER # PORT START ARGS-SERVER
# server arguments # server arguments
+15 -4
View File
@@ -231,6 +231,16 @@ def quick_unlock_config(_default):
return _enabled return _enabled
# continually shows the tweak menu after each change until the user manually exits
def menu_repeat(_post_setup):
try:
while True:
if global_menu(_post_setup):
break
except KeyboardInterrup:
s_exit(0)
# runs secondary configuration menu # runs secondary configuration menu
def global_menu(_post_setup): def global_menu(_post_setup):
# curses initialization # curses initialization
@@ -238,7 +248,7 @@ def global_menu(_post_setup):
cbreak() cbreak()
stdscr.keypad(True) stdscr.keypad(True)
_options, _choice, _term_message = [], 4, False _options, _choice, _term_message, _return_val = [], 4, False, False
try: try:
if not _post_setup: if not _post_setup:
_options.extend(['change device/synchronization types', 'change gpg key', 're-configure ssh(ync)', _options.extend(['change device/synchronization types', 'change gpg key', 're-configure ssh(ync)',
@@ -277,11 +287,12 @@ def global_menu(_post_setup):
"\nyou must first log in to the sshyp server and run:\n\nsshyp whitelist setup (if not" "\nyou must first log in to the sshyp server and run:\n\nsshyp whitelist setup (if not"
" already done)\nsshyp whitelist add " " already done)\nsshyp whitelist add "
f"'{listdir(f'{home}/.config/sshyp/devices')[0].rstrip()}'\n") f"'{listdir(f'{home}/.config/sshyp/devices')[0].rstrip()}'\n")
else: elif _choice == 8:
pass _return_val = True
curses_terminate(_term_message) curses_terminate(_term_message)
except KeyboardInterrupt: except KeyboardInterrupt:
curses_terminate(False) curses_terminate(False)
return _return_val
# runs initial configuration wizard # runs initial configuration wizard
@@ -356,7 +367,7 @@ def initial_setup():
f'"{_clipboard_package}" is installed\u001b[0m') f'"{_clipboard_package}" is installed\u001b[0m')
# PORT END CLIPTOOL # PORT END CLIPTOOL
global_menu(True) menu_repeat(True)
except KeyboardInterrupt: except KeyboardInterrupt:
# cleanly exit curses # cleanly exit curses