diff --git a/main.py b/main.py index 71e2c4ce..c4770f22 100644 --- a/main.py +++ b/main.py @@ -2,9 +2,29 @@ from vrct_gui import vrct_gui from config import config from model import model -class VRCT(): - def __init__(self): - pass +# func print textbox +def logTranslationStatusChange(): + textbox_all = getattr(vrct_gui, "textbox_all") + textbox_system = getattr(vrct_gui, "textbox_system") + if config.ENABLE_TRANSLATION: + vrct_gui.printToTextbox(textbox_all, "翻訳機能をONにしました", "", "INFO") + vrct_gui.printToTextbox(textbox_system, "翻訳機能をONにしました", "", "INFO") + else: + vrct_gui.printToTextbox(textbox_all, "翻訳機能をOFFにしました", "", "INFO") + vrct_gui.printToTextbox(textbox_system, "翻訳機能をOFFにしました", "", "INFO") + +# command func +def toggleTranslationFeature(): + config.ENABLE_TRANSLATION = getattr(vrct_gui, "translation_switch_box").get() + logTranslationStatusChange() + +# create GUI +vrct_gui.createGUI() + +# set commands +widget = getattr(vrct_gui, "translation_switch_box") +widget.configure(command=toggleTranslationFeature) + + if __name__ == "__main__": - vrct_gui.createUI() vrct_gui.startMainLoop() \ No newline at end of file diff --git a/vrct_gui/vrct_gui.py b/vrct_gui/vrct_gui.py index 07cede7d..6bcb7198 100644 --- a/vrct_gui/vrct_gui.py +++ b/vrct_gui/vrct_gui.py @@ -53,7 +53,7 @@ class VRCT_GUI(CTk): # self.information_window = ToplevelWindowInformation(self) - def createUI(self): + def createGUI(self): createMainWindowWidgets(vrct_gui=self, settings=self.settings.main) def startMainLoop(self):