diff --git a/ou_dedetai/gui.py b/ou_dedetai/gui.py index a370744c..97c3b337 100644 --- a/ou_dedetai/gui.py +++ b/ou_dedetai/gui.py @@ -346,24 +346,6 @@ def hide_tooltip(self, event=None): self.tooltip_visible = False -class PromptGui(Frame): - def __init__(self, root, title="", prompt="", **kwargs): - super(PromptGui, self).__init__(root, **kwargs) - self.options = {"title": title, "prompt": prompt} - if title is not None: - self.options['title'] = title - if prompt is not None: - self.options['prompt'] = prompt - - def draw_prompt(self): - store_button = Button( - self.root, - text="Store Password", - command=lambda: input_prompt(self.root, self.options) - ) - store_button.pack(pady=20) - - def show_error(message, fatal=True, detail=None, app=None, parent=None): # noqa: E501 title = "Error" if fatal: @@ -382,8 +364,3 @@ def show_error(message, fatal=True, detail=None, app=None, parent=None): # noqa def ask_question(question, secondary): return messagebox.askquestion(question, secondary) - -def input_prompt(root, title, prompt): - # Prompt for the password - input = simpledialog.askstring(title, prompt, show='*', parent=root) - return input diff --git a/ou_dedetai/tui_app.py b/ou_dedetai/tui_app.py index 6a118ba4..1c324011 100644 --- a/ou_dedetai/tui_app.py +++ b/ou_dedetai/tui_app.py @@ -364,8 +364,6 @@ def task_processor(self, evt=None, task=None): utils.start_thread(self.get_winetricksbin, config.use_python_dialog) elif task == 'INSTALL' or task == 'INSTALLING': utils.start_thread(self.get_waiting, config.use_python_dialog) - elif task == 'INSTALLING_PW': - utils.start_thread(self.get_waiting, config.use_python_dialog, screen_id=15) elif task == 'CONFIG': utils.start_thread(self.get_config, config.use_python_dialog) elif task == 'DONE': @@ -840,11 +838,6 @@ def get_config(self, dialog): #TODO: Switch to msg.logos_continue_message self.screen_q.put(self.stack_menu(9, self.config_q, self.config_e, question, options, dialog=dialog)) - # def get_password(self, dialog): - # question = (f"Logos Linux Installer needs to run a command as root. " - # f"Please provide your password to provide escalation privileges.") - # self.screen_q.put(self.stack_password(15, self.password_q, self.password_e, question, dialog=dialog)) - def get_backup_path(self, mode): self.tmp = mode if config.BACKUPDIR is None or not Path(config.BACKUPDIR).is_dir(): diff --git a/ou_dedetai/tui_curses.py b/ou_dedetai/tui_curses.py index 26fdf00e..d7a66ce3 100644 --- a/ou_dedetai/tui_curses.py +++ b/ou_dedetai/tui_curses.py @@ -151,42 +151,6 @@ def run(self): return self.user_input -class PasswordDialog(UserInputDialog): - def __init__(self, app, question_text, default_text): - super().__init__(app, question_text, default_text) - - self.obfuscation = "" - - def run(self): - if not self.submit: - self.draw() - return "Processing" - else: - if self.user_input is None or self.user_input == "": - self.user_input = self.default_text - return self.user_input - - def input(self): - write_line(self.app, self.stdscr, self.question_start_y + len(self.question_lines) + 2, 10, self.obfuscation, - self.app.window_width) - key = self.stdscr.getch(self.question_start_y + len(self.question_lines) + 2, 10 + len(self.obfuscation)) - - try: - if key == -1: # If key not found, keep processing. - pass - elif key == ord('\n'): # Enter key - self.submit = True - elif key == curses.KEY_BACKSPACE or key == 127: - if len(self.user_input) > 0: - self.user_input = self.user_input[:-1] - self.obfuscation = '*' * len(self.user_input[:-1]) - else: - self.user_input += chr(key) - self.obfuscation = '*' * (len(self.obfuscation) + 1) - except KeyboardInterrupt: - signal.signal(signal.SIGINT, self.app.end) - - class MenuDialog(CursesDialog): def __init__(self, app, question_text, options): super().__init__(app) diff --git a/ou_dedetai/tui_dialog.py b/ou_dedetai/tui_dialog.py index 44a838dc..9e9af6df 100644 --- a/ou_dedetai/tui_dialog.py +++ b/ou_dedetai/tui_dialog.py @@ -89,22 +89,6 @@ def input(screen, question_text, height=None, width=None, init="", title=None, return code, input -def password(screen, question_text, height=None, width=None, init="", title=None, backtitle=None, colors=True): - dialog = Dialog() - dialog.autowidgetsize = True - options = {'colors': colors} - if height is not None: - options['height'] = height - if width is not None: - options['width'] = width - if title is not None: - options['title'] = title - if backtitle is not None: - options['backtitle'] = backtitle - code, password = dialog.passwordbox(question_text, init=init, insecure=True, **options) - return code, password - - def confirm(screen, question_text, yes_label="Yes", no_label="No", height=None, width=None, title=None, backtitle=None, colors=True): dialog = Dialog() diff --git a/ou_dedetai/tui_screen.py b/ou_dedetai/tui_screen.py index b9b3b1a7..8b686cd2 100644 --- a/ou_dedetai/tui_screen.py +++ b/ou_dedetai/tui_screen.py @@ -189,28 +189,6 @@ def get_default(self): return self.default -class PasswordScreen(InputScreen): - def __init__(self, app, screen_id, queue, event, question, default): - super().__init__(app, screen_id, queue, event, question, default) - self.dialog = tui_curses.PasswordDialog( - self.app, - self.question, - self.default - ) - - def __str__(self): - return f"Curses Password Screen" - - def display(self): - self.stdscr.erase() - self.choice = self.dialog.run() - if not self.choice == "Processing": - self.submit_choice_to_queue() - utils.send_task(self.app, "INSTALLING_PW") - self.stdscr.noutrefresh() - curses.doupdate() - - class TextScreen(CursesScreen): def __init__(self, app, screen_id, queue, event, text, wait): super().__init__(app, screen_id, queue, event) @@ -287,21 +265,6 @@ def get_default(self): return self.default -class PasswordDialog(InputDialog): - def __init__(self, app, screen_id, queue, event, question, default): - super().__init__(app, screen_id, queue, event, question, default) - - def __str__(self): - return f"PyDialog Password Screen" - - def display(self): - if self.running == 0: - self.running = 1 - _, self.choice = tui_dialog.password(self.app, self.question, init=self.default) - self.submit_choice_to_queue() - utils.send_task(self.app, "INSTALLING_PW") - - class ConfirmDialog(DialogScreen): def __init__(self, app, screen_id, queue, event, question, no_text, secondary, yes_label="Yes", no_label="No"): super().__init__(app, screen_id, queue, event)