From 6d949858b8c9a633c6d6e2154ff3d34d2539bccf Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Thu, 1 Feb 2024 16:16:09 +0900 Subject: [PATCH] =?UTF-8?q?[Update/Refactor]=20Main=20Window:=20=E9=80=81?= =?UTF-8?q?=E4=BF=A1=E6=B8=88=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=81=AE=E3=83=AD=E3=83=BC=E3=83=AB=E3=83=90=E3=83=83=E3=82=AF?= =?UTF-8?q?=E6=A9=9F=E8=83=BD=E8=AA=BF=E6=95=B4(=E3=83=AD=E3=83=BC?= =?UTF-8?q?=E3=83=AB=E3=83=90=E3=83=83=E3=82=AF=E5=8F=AF=E8=83=BD=E3=81=AA?= =?UTF-8?q?=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8=E3=81=AB=E3=80=81?= =?UTF-8?q?=E3=83=9E=E3=82=A4=E3=82=AF=E3=81=8B=E3=82=89=E3=81=AE=E5=85=A5?= =?UTF-8?q?=E5=8A=9B=E6=99=82=E3=82=92=E8=BF=BD=E5=8A=A0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Redo Undoの履歴保存サイズを設定。理由は、上記の機能使用時もRedo Undoの保存タイミングになるので、使用の際膨大な数になる可能性があるため上限を設定。設定値は今後変更する可能性は全然ある。 --- controller.py | 8 ++++++-- vrct_gui/main_window/widgets/create_entry_message_box.py | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/controller.py b/controller.py index f7b3f635..5a80c98f 100644 --- a/controller.py +++ b/controller.py @@ -64,6 +64,7 @@ def changeToCTranslate2Process(): # func transcription send message def sendMicMessage(message): if len(message) > 0: + addSentMessageLog(message) translation = "" if model.checkKeywords(message): view.printToTextbox_DetectedByWordFilter(detected_message=message) @@ -200,8 +201,7 @@ def stopThreadingTranscriptionReceiveMessageOnOpenConfigWindow(): # func message box def sendChatMessage(message): if len(message) > 0: - config.SENT_MESSAGES_LOG.append(view.getTextFromMessageBox()) - config.CURRENT_SENT_MESSAGES_LOG_INDEX = len(config.SENT_MESSAGES_LOG) + addSentMessageLog(message) translation = "" if config.ENABLE_TRANSLATION is False: pass @@ -251,6 +251,10 @@ def messageBoxFocusOut(e): if config.ENABLE_SEND_MESSAGE_TO_VRC is True: model.oscStopSendTyping() +def addSentMessageLog(sent_message): + config.SENT_MESSAGES_LOG.append(sent_message) + config.CURRENT_SENT_MESSAGES_LOG_INDEX = len(config.SENT_MESSAGES_LOG) + def updateMessageBox(index_offset): if len(config.SENT_MESSAGES_LOG) == 0: return diff --git a/vrct_gui/main_window/widgets/create_entry_message_box.py b/vrct_gui/main_window/widgets/create_entry_message_box.py index 0d01d030..d153749e 100644 --- a/vrct_gui/main_window/widgets/create_entry_message_box.py +++ b/vrct_gui/main_window/widgets/create_entry_message_box.py @@ -21,7 +21,7 @@ def createEntryMessageBox(settings, main_window, view_variable): font=CTkFont(family=settings.FONT_FAMILY, size=settings.uism.TEXTBOX_ENTRY_FONT_SIZE, weight="normal"), undo=True, autoseparators=True, - maxundo=0, + maxundo=64, ) main_window.entry_message_box.grid(row=0, column=0, padx=settings.uism.TEXTBOX_ENTRY_PADX, pady=settings.uism.TEXTBOX_ENTRY_PADY, sticky="nsew")