[Refactor] Main Window: _printToTextbox. textboxへの出力関数のリファクタリング2
textbox widget指定を_printToTextbox関数内で行うように。
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user