[Refactor] Main Window: _printToTextbox. textboxへの出力関数のリファクタリング2

textbox widget指定を_printToTextbox関数内で行うように。
This commit is contained in:
Sakamoto Shiina
2023-09-14 05:13:47 +09:00
parent 6af238b754
commit f27e4985cd
2 changed files with 18 additions and 12 deletions

View File

@@ -126,26 +126,19 @@ class VRCT_GUI(CTk):
)
def printToTextbox(self, target_type, original_message=None, translated_message=None):
match (target_type):
case "INFO":
target_textbox = self.textbox_system
case "SEND":
target_textbox = self.textbox_sent
case "RECEIVE":
target_textbox = self.textbox_received
case (_):
raise ValueError(f"No matching case for target_type: {target_type}")
_printToTextbox(
vrct_gui=self,
settings=self.settings.main,
target_textbox=target_textbox,
target_type=target_type,
original_message=original_message,
translated_message=translated_message,
tags=target_type,
)
# To automatically print the same log to the textbox_all widget as well.
_printToTextbox(
vrct_gui=self,
settings=self.settings.main,
target_textbox=self.textbox_all,
target_type="ALL",
original_message=original_message,
translated_message=translated_message,
tags=target_type,