From 50bea120a611ade7486a1b2ca283736a00e878dc Mon Sep 17 00:00:00 2001 From: "T. H. Wright" Date: Tue, 2 Jan 2024 13:58:14 -0500 Subject: [PATCH] Move quick launch code to GUI only --- LogosLinuxInstaller.py | 138 ++++++++++++++++++++--------------------- 1 file changed, 69 insertions(+), 69 deletions(-) diff --git a/LogosLinuxInstaller.py b/LogosLinuxInstaller.py index 2476c9fa..3988832d 100755 --- a/LogosLinuxInstaller.py +++ b/LogosLinuxInstaller.py @@ -150,21 +150,6 @@ def main(): # Set terminal log level based on current config. update_log_level(config.LOG_LEVEL) - # If Logos app is installed, run the desired Logos action. - if config.LOGOS_EXE is not None and os.access(config.LOGOS_EXE, os.X_OK): - if config.ACTION == 'control': - run_control_panel() - sys.exit(0) - elif config.ACTION == 'indexing': - run_indexing() - sys.exit(0) - elif config.ACTION == 'logging': - switch_logging() - sys.exit(0) - elif config.ACTION == 'app': - run_logos() - sys.exit(0) - # Check for environment variables. if config.DIALOG is None: getDialog() @@ -179,61 +164,76 @@ def main(): if config.GUI is True: setDebug() - - while True: - options_default = ["Install Logos Bible Software"] - options_exit = ["Exit"] - if file_exists(config.CONFIG_FILE): - options_installed = [f"Run {config.FLPRODUCT}", "Run Indexing", "Remove Library Catalog", "Remove All Index Files", "Edit Config", "Reinstall Dependencies", "Back up Data", "Restore Data", "Set AppImage", "Control Panel", "Download or Update Winetricks", "Run Winetricks"] - if config.LOGS == "DISABLED": - options_installed.append("Enable Logging") + # If Logos app is installed, run the desired Logos action. + if config.LOGOS_EXE is not None and os.access(config.LOGOS_EXE, os.X_OK): + if config.ACTION == 'control': + run_control_panel() + sys.exit(0) + elif config.ACTION == 'indexing': + run_indexing() + sys.exit(0) + elif config.ACTION == 'logging': + switch_logging() + sys.exit(0) + elif config.ACTION == 'app': + run_logos() + sys.exit(0) + + if config.GUI is False: + while True: + options_default = ["Install Logos Bible Software"] + options_exit = ["Exit"] + if file_exists(config.CONFIG_FILE): + options_installed = [f"Run {config.FLPRODUCT}", "Run Indexing", "Remove Library Catalog", "Remove All Index Files", "Edit Config", "Reinstall Dependencies", "Back up Data", "Restore Data", "Set AppImage", "Control Panel", "Download or Update Winetricks", "Run Winetricks"] + if config.LOGS == "DISABLED": + options_installed.append("Enable Logging") + else: + options_installed.append("Disable Logging") + options = options_default + options_installed + options_exit else: - options_installed.append("Disable Logging") - options = options_default + options_installed + options_exit - else: - options = options_default + options_exit - - choice = None - if config.DIALOG is None or config.DIALOG == 'tk': - classname = "LogosLinuxInstaller" - installer_app = App(className=classname) - InstallerWindow(installer_app, class_=classname) - installer_app.mainloop() - elif config.DIALOG == 'curses': - choice = curses_menu(options, "Welcome to Logos on Linux", "What would you like to do?") - - if choice is None or choice == "Exit": - sys.exit(0) - elif choice.startswith("Install"): - install() - elif choice == f"Run {config.FLPRODUCT}": - run_logos() - elif choice == "Run Indexing": - run_indexing() - elif choice == "Remove Library Catalog": - remove_library_catalog() - elif choice == "Remove All Index Files": - remove_all_index_files() - elif choice == "Edit Config": - edit_config() - elif choice == "Reinstall Dependencies": - checkDependencies() - elif choice == "Back up Data": - backup() - elif choice == "Restore Data": - restore() - elif choice == "Set AppImage": - set_appimage() - elif choice == "Control Panel": - run_control_panel() - elif choice == "Download or Update Winetricks": - setWinetricks() - elif choice == "Run Winetricks": - run_winetricks() - elif choice.endswith("Logging"): - switch_logging() - else: - logos_error("Unknown menu choice.") + options = options_default + options_exit + + choice = None + if config.DIALOG is None or config.DIALOG == 'tk': + classname = "LogosLinuxInstaller" + installer_app = App(className=classname) + InstallerWindow(installer_app, class_=classname) + installer_app.mainloop() + elif config.DIALOG == 'curses': + choice = curses_menu(options, "Welcome to Logos on Linux", "What would you like to do?") + + if choice is None or choice == "Exit": + sys.exit(0) + elif choice.startswith("Install"): + install() + elif choice == f"Run {config.FLPRODUCT}": + run_logos() + elif choice == "Run Indexing": + run_indexing() + elif choice == "Remove Library Catalog": + remove_library_catalog() + elif choice == "Remove All Index Files": + remove_all_index_files() + elif choice == "Edit Config": + edit_config() + elif choice == "Reinstall Dependencies": + checkDependencies() + elif choice == "Back up Data": + backup() + elif choice == "Restore Data": + restore() + elif choice == "Set AppImage": + set_appimage() + elif choice == "Control Panel": + run_control_panel() + elif choice == "Download or Update Winetricks": + setWinetricks() + elif choice == "Run Winetricks": + run_winetricks() + elif choice.endswith("Logging"): + switch_logging() + else: + logos_error("Unknown menu choice.") sys.exit(0) # END FUNCTION DECLARATIONS