Merge branch 'checkbox_translate' into UI_2.0
This commit is contained in:
32
main.py
32
main.py
@@ -1,8 +1,30 @@
|
|||||||
from vrct_gui import vrct_gui
|
from vrct_gui import vrct_gui
|
||||||
|
from config import config
|
||||||
|
from model import model
|
||||||
|
|
||||||
|
# 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)
|
||||||
|
|
||||||
|
|
||||||
class VRCT():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
# vrct_gui = VRCT_GUI()
|
vrct_gui.startMainLoop()
|
||||||
vrct_gui.start()
|
|
||||||
@@ -21,7 +21,6 @@ def createSidebar(settings, main_window):
|
|||||||
is_turned_on = getattr(main_window, "translation_switch_box").get()
|
is_turned_on = getattr(main_window, "translation_switch_box").get()
|
||||||
print(is_turned_on)
|
print(is_turned_on)
|
||||||
toggleSidebarFeatureSelectedMarkIfTurnedOn(is_turned_on, main_window.translation_selected_mark)
|
toggleSidebarFeatureSelectedMarkIfTurnedOn(is_turned_on, main_window.translation_selected_mark)
|
||||||
toggleTranslationFeatures = [toggleTranslationFeature]
|
|
||||||
|
|
||||||
def toggleTranscriptionSendFeature():
|
def toggleTranscriptionSendFeature():
|
||||||
is_turned_on = getattr(main_window, "transcription_send_switch_box").get()
|
is_turned_on = getattr(main_window, "transcription_send_switch_box").get()
|
||||||
@@ -254,7 +253,7 @@ def createSidebar(settings, main_window):
|
|||||||
sidebar_features_settings = [
|
sidebar_features_settings = [
|
||||||
{
|
{
|
||||||
"frame_attr_name": "translation_frame",
|
"frame_attr_name": "translation_frame",
|
||||||
"command": lambda:[func() for func in toggleTranslationFeatures],
|
"command": toggleTranslationFeature,
|
||||||
"switch_box_attr_name": "translation_switch_box",
|
"switch_box_attr_name": "translation_switch_box",
|
||||||
"toggle_switch_box_command": toggleTranslationSwitchBox,
|
"toggle_switch_box_command": toggleTranslationSwitchBox,
|
||||||
"label_attr_name": "label_translation",
|
"label_attr_name": "label_translation",
|
||||||
|
|||||||
@@ -53,14 +53,10 @@ class VRCT_GUI(CTk):
|
|||||||
|
|
||||||
# self.information_window = ToplevelWindowInformation(self)
|
# self.information_window = ToplevelWindowInformation(self)
|
||||||
|
|
||||||
|
def createGUI(self):
|
||||||
|
|
||||||
def start(self):
|
|
||||||
createMainWindowWidgets(vrct_gui=self, settings=self.settings.main)
|
createMainWindowWidgets(vrct_gui=self, settings=self.settings.main)
|
||||||
# self.printToTextbox(self.textbox_all, "Translation started. You: Japanese (japan). Target: English (American english)", "", "INFO")
|
|
||||||
# self.printToTextbox(self.textbox_all, "テキスト送信テスト", "Test send text", "SEND")
|
def startMainLoop(self):
|
||||||
# self.printToTextbox(self.textbox_all, "こんにちは、こんにちは。", "Hi hi hello.", "SEND")
|
|
||||||
# self.printToTextbox(self.textbox_all, "Hi~ how are you doing.", "やあ~、元気かい?", "RECEIVE")
|
|
||||||
self.mainloop()
|
self.mainloop()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user