From 4139ccd5221357560f4362634de15c41bc986b19 Mon Sep 17 00:00:00 2001 From: dougollerenshaw Date: Thu, 10 Oct 2024 13:04:40 -0700 Subject: [PATCH] Fixed bug to disable submit button --- codeaide/ui/chat_window.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/codeaide/ui/chat_window.py b/codeaide/ui/chat_window.py index 1cfbba6..97d9776 100644 --- a/codeaide/ui/chat_window.py +++ b/codeaide/ui/chat_window.py @@ -136,7 +136,7 @@ def __init__(self, chat_handler): self.code_popup = None self.waiting_for_api_key = False self.chat_contents = [] - self.original_text = "" # Add this line to store the original text + self.is_recording = False # Load microphone icons self.green_mic_icon = QIcon( @@ -586,7 +586,10 @@ def show_traceback_dialog(self, traceback_text): self.logger.info("ChatWindow: User chose to ignore the traceback") def update_submit_button_state(self): - self.submit_button.setEnabled(bool(self.input_text.toPlainText().strip())) + if not self.is_recording: + self.submit_button.setEnabled(bool(self.input_text.toPlainText().strip())) + else: + self.submit_button.setEnabled(False) def toggle_recording(self): if not hasattr(self, "is_recording"):