[Refactor] リファクタリング コメントアウトしていた[deprecated](起動時OSCチェック)のコード削除や、コメント追加、改行調整など。
This commit is contained in:
13
config.py
13
config.py
@@ -491,18 +491,6 @@ class Config:
|
|||||||
self._ENABLE_SEND_MESSAGE_TO_VRC = value
|
self._ENABLE_SEND_MESSAGE_TO_VRC = value
|
||||||
saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value)
|
saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value)
|
||||||
|
|
||||||
# [deprecated]
|
|
||||||
# @property
|
|
||||||
# @json_serializable('STARTUP_OSC_ENABLED_CHECK')
|
|
||||||
# def STARTUP_OSC_ENABLED_CHECK(self):
|
|
||||||
# return self._STARTUP_OSC_ENABLED_CHECK
|
|
||||||
|
|
||||||
# @STARTUP_OSC_ENABLED_CHECK.setter
|
|
||||||
# def STARTUP_OSC_ENABLED_CHECK(self, value):
|
|
||||||
# if isinstance(value, bool):
|
|
||||||
# self._STARTUP_OSC_ENABLED_CHECK = value
|
|
||||||
# saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@json_serializable('SEND_MESSAGE_FORMAT')
|
@json_serializable('SEND_MESSAGE_FORMAT')
|
||||||
def SEND_MESSAGE_FORMAT(self):
|
def SEND_MESSAGE_FORMAT(self):
|
||||||
@@ -670,7 +658,6 @@ class Config:
|
|||||||
self._ENABLE_NOTICE_XSOVERLAY = False
|
self._ENABLE_NOTICE_XSOVERLAY = False
|
||||||
self._ENABLE_SEND_MESSAGE_TO_VRC = True
|
self._ENABLE_SEND_MESSAGE_TO_VRC = True
|
||||||
self._ENABLE_SEND_RECEIVED_MESSAGE_TO_VRC = False # speaker2Chatbox
|
self._ENABLE_SEND_RECEIVED_MESSAGE_TO_VRC = False # speaker2Chatbox
|
||||||
# self._STARTUP_OSC_ENABLED_CHECK = True # [deprecated]
|
|
||||||
self._ENABLE_LOGGER = False
|
self._ENABLE_LOGGER = False
|
||||||
self._IS_CONFIG_WINDOW_COMPACT_MODE = False
|
self._IS_CONFIG_WINDOW_COMPACT_MODE = False
|
||||||
|
|
||||||
|
|||||||
@@ -345,9 +345,7 @@ def callbackCloseConfigWindow():
|
|||||||
model.stopCheckMicEnergy()
|
model.stopCheckMicEnergy()
|
||||||
model.stopCheckSpeakerEnergy()
|
model.stopCheckSpeakerEnergy()
|
||||||
view.initMicThresholdCheckButton()
|
view.initMicThresholdCheckButton()
|
||||||
# view.initProgressBar_MicEnergy() # ProgressBarに0をセットしたい
|
|
||||||
view.initSpeakerThresholdCheckButton()
|
view.initSpeakerThresholdCheckButton()
|
||||||
# view.initProgressBar_SpeakerEnergy() # ProgressBarに0をセットしたい
|
|
||||||
|
|
||||||
if config.ENABLE_TRANSCRIPTION_SEND is True:
|
if config.ENABLE_TRANSCRIPTION_SEND is True:
|
||||||
startThreadingTranscriptionSendMessageOnCloseConfigWindow()
|
startThreadingTranscriptionSendMessageOnCloseConfigWindow()
|
||||||
@@ -413,6 +411,7 @@ def callbackSetUiLanguage(value):
|
|||||||
config.UI_LANGUAGE = value
|
config.UI_LANGUAGE = value
|
||||||
view.showRestartButtonIfRequired(locale=config.UI_LANGUAGE)
|
view.showRestartButtonIfRequired(locale=config.UI_LANGUAGE)
|
||||||
|
|
||||||
|
|
||||||
# Translation Tab
|
# Translation Tab
|
||||||
def callbackSetDeeplAuthkey(value):
|
def callbackSetDeeplAuthkey(value):
|
||||||
print("callbackSetDeeplAuthkey", str(value))
|
print("callbackSetDeeplAuthkey", str(value))
|
||||||
@@ -434,7 +433,8 @@ def callbackSetDeeplAuthkey(value):
|
|||||||
config.AUTH_KEYS = auth_keys
|
config.AUTH_KEYS = auth_keys
|
||||||
config.CHOICE_TRANSLATOR = model.findTranslationEngine(config.SOURCE_LANGUAGE, config.TARGET_LANGUAGE)
|
config.CHOICE_TRANSLATOR = model.findTranslationEngine(config.SOURCE_LANGUAGE, config.TARGET_LANGUAGE)
|
||||||
|
|
||||||
# Transcription Tab (Mic)
|
# Transcription Tab
|
||||||
|
# Transcription (Mic)
|
||||||
def callbackSetMicHost(value):
|
def callbackSetMicHost(value):
|
||||||
print("callbackSetMicHost", value)
|
print("callbackSetMicHost", value)
|
||||||
config.CHOICE_MIC_HOST = value
|
config.CHOICE_MIC_HOST = value
|
||||||
@@ -568,7 +568,7 @@ def callbackDeleteMicWordFilter(value):
|
|||||||
except Exception:
|
except Exception:
|
||||||
print("There was no the target word in config.INPUT_MIC_WORD_FILTER")
|
print("There was no the target word in config.INPUT_MIC_WORD_FILTER")
|
||||||
|
|
||||||
|
# Transcription (Speaker)
|
||||||
def callbackSetSpeakerEnergyThreshold(value):
|
def callbackSetSpeakerEnergyThreshold(value):
|
||||||
print("callbackSetSpeakerEnergyThreshold", value)
|
print("callbackSetSpeakerEnergyThreshold", value)
|
||||||
if value == "":
|
if value == "":
|
||||||
@@ -592,7 +592,6 @@ def callbackSetSpeakerDynamicEnergyThreshold(value):
|
|||||||
else:
|
else:
|
||||||
view.openSpeakerEnergyThresholdWidget()
|
view.openSpeakerEnergyThresholdWidget()
|
||||||
|
|
||||||
|
|
||||||
def setProgressBarSpeakerEnergy(energy):
|
def setProgressBarSpeakerEnergy(energy):
|
||||||
view.updateSetProgressBar_SpeakerEnergy(energy)
|
view.updateSetProgressBar_SpeakerEnergy(energy)
|
||||||
|
|
||||||
@@ -680,6 +679,11 @@ def callbackSetEnableAutoExportMessageLogs(value):
|
|||||||
else:
|
else:
|
||||||
model.stopLogger()
|
model.stopLogger()
|
||||||
|
|
||||||
|
def callbackSetEnableSendMessageToVrc(value):
|
||||||
|
print("callbackSetEnableSendMessageToVrc", value)
|
||||||
|
config.ENABLE_SEND_MESSAGE_TO_VRC = value
|
||||||
|
|
||||||
|
# Others (Message Formats(Send)
|
||||||
def callbackSetSendMessageFormat(value):
|
def callbackSetSendMessageFormat(value):
|
||||||
print("callbackSetSendMessageFormat", value)
|
print("callbackSetSendMessageFormat", value)
|
||||||
if isUniqueStrings(["[message]"], value) is True:
|
if isUniqueStrings(["[message]"], value) is True:
|
||||||
@@ -701,17 +705,7 @@ def callbackSetSendMessageFormatWithT(value):
|
|||||||
view.showErrorMessage_SendMessageFormatWithT()
|
view.showErrorMessage_SendMessageFormatWithT()
|
||||||
view.setSendMessageFormatWithT_EntryWidgets(config.SEND_MESSAGE_FORMAT_WITH_T)
|
view.setSendMessageFormatWithT_EntryWidgets(config.SEND_MESSAGE_FORMAT_WITH_T)
|
||||||
|
|
||||||
|
# Others (Message Formats(Received)
|
||||||
def callbackSetEnableSendMessageToVrc(value):
|
|
||||||
print("callbackSetEnableSendMessageToVrc", value)
|
|
||||||
config.ENABLE_SEND_MESSAGE_TO_VRC = value
|
|
||||||
|
|
||||||
# [deprecated]
|
|
||||||
# def callbackSetStartupOscEnabledCheck(value):
|
|
||||||
# print("callbackSetStartupOscEnabledCheck", value)
|
|
||||||
# config.STARTUP_OSC_ENABLED_CHECK = value
|
|
||||||
|
|
||||||
|
|
||||||
def callbackSetReceivedMessageFormat(value):
|
def callbackSetReceivedMessageFormat(value):
|
||||||
print("callbackSetReceivedMessageFormat", value)
|
print("callbackSetReceivedMessageFormat", value)
|
||||||
if isUniqueStrings(["[message]"], value) is True:
|
if isUniqueStrings(["[message]"], value) is True:
|
||||||
@@ -722,7 +716,6 @@ def callbackSetReceivedMessageFormat(value):
|
|||||||
view.showErrorMessage_ReceivedMessageFormat()
|
view.showErrorMessage_ReceivedMessageFormat()
|
||||||
view.setReceivedMessageFormat_EntryWidgets(config.RECEIVED_MESSAGE_FORMAT)
|
view.setReceivedMessageFormat_EntryWidgets(config.RECEIVED_MESSAGE_FORMAT)
|
||||||
|
|
||||||
|
|
||||||
def callbackSetReceivedMessageFormatWithT(value):
|
def callbackSetReceivedMessageFormatWithT(value):
|
||||||
print("callbackSetReceivedMessageFormatWithT", value)
|
print("callbackSetReceivedMessageFormatWithT", value)
|
||||||
if len(value) > 0:
|
if len(value) > 0:
|
||||||
@@ -734,7 +727,6 @@ def callbackSetReceivedMessageFormatWithT(value):
|
|||||||
view.showErrorMessage_ReceivedMessageFormatWithT()
|
view.showErrorMessage_ReceivedMessageFormatWithT()
|
||||||
view.setReceivedMessageFormatWithT_EntryWidgets(config.RECEIVED_MESSAGE_FORMAT_WITH_T)
|
view.setReceivedMessageFormatWithT_EntryWidgets(config.RECEIVED_MESSAGE_FORMAT_WITH_T)
|
||||||
|
|
||||||
|
|
||||||
# ---------------------Speaker2Chatbox---------------------
|
# ---------------------Speaker2Chatbox---------------------
|
||||||
def callbackSetEnableSendReceivedMessageToVrc(value):
|
def callbackSetEnableSendReceivedMessageToVrc(value):
|
||||||
print("callbackSetEnableSendReceivedMessageToVrc", value)
|
print("callbackSetEnableSendReceivedMessageToVrc", value)
|
||||||
@@ -755,6 +747,7 @@ def callbackSetOscPort(value):
|
|||||||
print("callbackSetOscPort", int(value))
|
print("callbackSetOscPort", int(value))
|
||||||
config.OSC_PORT = int(value)
|
config.OSC_PORT = int(value)
|
||||||
|
|
||||||
|
|
||||||
def initSetConfigByExeArguments():
|
def initSetConfigByExeArguments():
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("--ip")
|
parser.add_argument("--ip")
|
||||||
@@ -786,10 +779,6 @@ def createMainWindow():
|
|||||||
# set word filter
|
# set word filter
|
||||||
model.addKeywords()
|
model.addKeywords()
|
||||||
|
|
||||||
# check OSC started [deprecated]
|
|
||||||
# if config.STARTUP_OSC_ENABLED_CHECK is True and config.ENABLE_SEND_MESSAGE_TO_VRC is True:
|
|
||||||
# model.checkOSCStarted(view.printToTextbox_OSCError)
|
|
||||||
|
|
||||||
# check Software Updated
|
# check Software Updated
|
||||||
if model.checkSoftwareUpdated() is True:
|
if model.checkSoftwareUpdated() is True:
|
||||||
view.showUpdateAvailableButton()
|
view.showUpdateAvailableButton()
|
||||||
@@ -877,9 +866,10 @@ def createMainWindow():
|
|||||||
"callback_set_enable_notice_xsoverlay": callbackSetEnableNoticeXsoverlay,
|
"callback_set_enable_notice_xsoverlay": callbackSetEnableNoticeXsoverlay,
|
||||||
"callback_set_enable_auto_export_message_logs": callbackSetEnableAutoExportMessageLogs,
|
"callback_set_enable_auto_export_message_logs": callbackSetEnableAutoExportMessageLogs,
|
||||||
"callback_set_enable_send_message_to_vrc": callbackSetEnableSendMessageToVrc,
|
"callback_set_enable_send_message_to_vrc": callbackSetEnableSendMessageToVrc,
|
||||||
# "callback_set_startup_osc_enabled_check": callbackSetStartupOscEnabledCheck, # [deprecated]
|
# Others(Message Formats(Send)
|
||||||
"callback_set_send_message_format": callbackSetSendMessageFormat,
|
"callback_set_send_message_format": callbackSetSendMessageFormat,
|
||||||
"callback_set_send_message_format_with_t": callbackSetSendMessageFormatWithT,
|
"callback_set_send_message_format_with_t": callbackSetSendMessageFormatWithT,
|
||||||
|
# Others(Message Formats(Received)
|
||||||
"callback_set_received_message_format": callbackSetReceivedMessageFormat,
|
"callback_set_received_message_format": callbackSetReceivedMessageFormat,
|
||||||
"callback_set_received_message_format_with_t": callbackSetReceivedMessageFormatWithT,
|
"callback_set_received_message_format_with_t": callbackSetReceivedMessageFormatWithT,
|
||||||
|
|
||||||
|
|||||||
7
view.py
7
view.py
@@ -355,12 +355,6 @@ class View():
|
|||||||
CALLBACK_SET_ENABLE_SEND_MESSAGE_TO_VRC=None,
|
CALLBACK_SET_ENABLE_SEND_MESSAGE_TO_VRC=None,
|
||||||
VAR_ENABLE_SEND_MESSAGE_TO_VRC=BooleanVar(value=config.ENABLE_SEND_MESSAGE_TO_VRC),
|
VAR_ENABLE_SEND_MESSAGE_TO_VRC=BooleanVar(value=config.ENABLE_SEND_MESSAGE_TO_VRC),
|
||||||
|
|
||||||
# [deprecated]
|
|
||||||
# VAR_LABEL_STARTUP_OSC_ENABLED_CHECK=StringVar(value=i18n.t("config_window.startup_osc_enabled_check.label")),
|
|
||||||
# VAR_DESC_STARTUP_OSC_ENABLED_CHECK=StringVar(value=i18n.t("config_window.startup_osc_enabled_check.desc")),
|
|
||||||
# CALLBACK_SET_STARTUP_OSC_ENABLED_CHECK=None,
|
|
||||||
# VAR_STARTUP_OSC_ENABLED_CHECK=BooleanVar(value=config.STARTUP_OSC_ENABLED_CHECK),
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
VAR_SECOND_TITLE_OTHERS_SEND_MESSAGE_FORMATS=StringVar(value=i18n.t("config_window.side_menu_labels.others_send_message_formats")),
|
VAR_SECOND_TITLE_OTHERS_SEND_MESSAGE_FORMATS=StringVar(value=i18n.t("config_window.side_menu_labels.others_send_message_formats")),
|
||||||
@@ -556,7 +550,6 @@ class View():
|
|||||||
self.view_variable.CALLBACK_SET_ENABLE_AUTO_EXPORT_MESSAGE_LOGS = config_window_registers.get("callback_set_enable_auto_export_message_logs", None)
|
self.view_variable.CALLBACK_SET_ENABLE_AUTO_EXPORT_MESSAGE_LOGS = config_window_registers.get("callback_set_enable_auto_export_message_logs", None)
|
||||||
|
|
||||||
self.view_variable.CALLBACK_SET_ENABLE_SEND_MESSAGE_TO_VRC = config_window_registers.get("callback_set_enable_send_message_to_vrc", None)
|
self.view_variable.CALLBACK_SET_ENABLE_SEND_MESSAGE_TO_VRC = config_window_registers.get("callback_set_enable_send_message_to_vrc", None)
|
||||||
# self.view_variable.CALLBACK_SET_STARTUP_OSC_ENABLED_CHECK = config_window_registers.get("callback_set_startup_osc_enabled_check", None) #[deprecated]
|
|
||||||
|
|
||||||
self.view_variable.CALLBACK_SET_SEND_MESSAGE_FORMAT = config_window_registers.get("callback_set_send_message_format", None)
|
self.view_variable.CALLBACK_SET_SEND_MESSAGE_FORMAT = config_window_registers.get("callback_set_send_message_format", None)
|
||||||
self.view_variable.CALLBACK_SET_SEND_MESSAGE_FORMAT_WITH_T = config_window_registers.get("callback_set_send_message_format_with_t", None)
|
self.view_variable.CALLBACK_SET_SEND_MESSAGE_FORMAT_WITH_T = config_window_registers.get("callback_set_send_message_format_with_t", None)
|
||||||
|
|||||||
@@ -6,11 +6,8 @@ def createSettingBox_Others(setting_box_wrapper, config_window, settings, view_v
|
|||||||
sbg = _SettingBoxGenerator(setting_box_wrapper, config_window, settings, view_variable)
|
sbg = _SettingBoxGenerator(setting_box_wrapper, config_window, settings, view_variable)
|
||||||
createSettingBoxCheckbox = sbg.createSettingBoxCheckbox
|
createSettingBoxCheckbox = sbg.createSettingBoxCheckbox
|
||||||
createSettingBoxAutoExportMessageLogs = sbg.createSettingBoxAutoExportMessageLogs
|
createSettingBoxAutoExportMessageLogs = sbg.createSettingBoxAutoExportMessageLogs
|
||||||
createSettingBox_Labels = sbg.createSettingBox_Labels
|
|
||||||
createSettingBoxMessageFormatEntries_WithTranslation = sbg.createSettingBoxMessageFormatEntries_WithTranslation
|
|
||||||
|
|
||||||
|
|
||||||
# 元 checkbox_auto_clear_chatbox_callback
|
|
||||||
def checkbox_auto_clear_message_box_callback(checkbox_box_widget):
|
def checkbox_auto_clear_message_box_callback(checkbox_box_widget):
|
||||||
callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_AUTO_CLEAR_MESSAGE_BOX, checkbox_box_widget.get())
|
callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_AUTO_CLEAR_MESSAGE_BOX, checkbox_box_widget.get())
|
||||||
|
|
||||||
@@ -29,9 +26,6 @@ def createSettingBox_Others(setting_box_wrapper, config_window, settings, view_v
|
|||||||
def checkbox_enable_send_message_to_vrc_callback(checkbox_box_widget):
|
def checkbox_enable_send_message_to_vrc_callback(checkbox_box_widget):
|
||||||
callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_SEND_MESSAGE_TO_VRC, checkbox_box_widget.get())
|
callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_SEND_MESSAGE_TO_VRC, checkbox_box_widget.get())
|
||||||
|
|
||||||
# [deprecated]
|
|
||||||
# def checkbox_startup_osc_enabled_check_callback(checkbox_box_widget):
|
|
||||||
# callFunctionIfCallable(view_variable.CALLBACK_SET_STARTUP_OSC_ENABLED_CHECK, checkbox_box_widget.get())
|
|
||||||
|
|
||||||
row=0
|
row=0
|
||||||
config_window.sb__auto_clear_message_box = createSettingBoxCheckbox(
|
config_window.sb__auto_clear_message_box = createSettingBoxCheckbox(
|
||||||
@@ -87,15 +81,3 @@ def createSettingBox_Others(setting_box_wrapper, config_window, settings, view_v
|
|||||||
)
|
)
|
||||||
config_window.sb__enable_send_message_to_vrc.grid(row=row, pady=0)
|
config_window.sb__enable_send_message_to_vrc.grid(row=row, pady=0)
|
||||||
row+=1
|
row+=1
|
||||||
|
|
||||||
# [deprecated]
|
|
||||||
# config_window.sb__startup_osc_enabled_check = createSettingBoxCheckbox(
|
|
||||||
# for_var_label_text=view_variable.VAR_LABEL_STARTUP_OSC_ENABLED_CHECK,
|
|
||||||
# for_var_desc_text=view_variable.VAR_DESC_STARTUP_OSC_ENABLED_CHECK,
|
|
||||||
# checkbox_attr_name="sb__checkbox_startup_osc_enabled_check",
|
|
||||||
# command=lambda: checkbox_startup_osc_enabled_check_callback(config_window.sb__checkbox_startup_osc_enabled_check),
|
|
||||||
# variable=view_variable.VAR_STARTUP_OSC_ENABLED_CHECK,
|
|
||||||
# )
|
|
||||||
# config_window.sb__startup_osc_enabled_check.grid(row=row, pady=0)
|
|
||||||
# row+=1
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user