[Refactor] view.py系の関数名変更

This commit is contained in:
Sakamoto Shiina
2023-09-15 13:33:44 +09:00
parent 34cd261128
commit 41d8e9ca87
2 changed files with 27 additions and 35 deletions

46
main.py
View File

@@ -248,18 +248,18 @@ def callbackCloseConfigWindow():
def callbackEnableConfigWindowCompactMode():
config.IS_CONFIG_WINDOW_COMPACT_MODE = True
model.stopCheckMicEnergy()
view.replaceConfigWindowMicThresholdCheckButtonToPassive()
view.replaceMicThresholdCheckButton_Passive()
model.stopCheckSpeakerEnergy()
view.replaceConfigWindowSpeakerThresholdCheckButtonToPassive()
view.replaceSpeakerThresholdCheckButton_Passive()
view.reloadConfigWindowSettingBoxContainer()
def callbackDisableConfigWindowCompactMode():
config.IS_CONFIG_WINDOW_COMPACT_MODE = False
model.stopCheckMicEnergy()
view.replaceConfigWindowMicThresholdCheckButtonToPassive()
view.replaceMicThresholdCheckButton_Passive()
model.stopCheckSpeakerEnergy()
view.replaceConfigWindowSpeakerThresholdCheckButtonToPassive()
view.replaceSpeakerThresholdCheckButton_Passive()
view.reloadConfigWindowSettingBoxContainer()
@@ -308,14 +308,14 @@ def callbackSetMicHost(value):
view.updateList_MicDevice(model.getListInputDevice())
model.stopCheckMicEnergy()
view.replaceConfigWindowMicThresholdCheckButtonToPassive()
view.replaceMicThresholdCheckButton_Passive()
def callbackSetMicDevice(value):
print("callbackSetMicDevice", value)
config.CHOICE_MIC_DEVICE = value
model.stopCheckMicEnergy()
view.replaceConfigWindowMicThresholdCheckButtonToPassive()
view.replaceMicThresholdCheckButton_Passive()
def callbackSetMicEnergyThreshold(value):
print("callbackSetMicEnergyThreshold", value)
@@ -344,19 +344,15 @@ def setProgressBarMicEnergy(energy):
def callbackCheckMicThreshold(is_turned_on):
print("callbackCheckMicThreshold", is_turned_on)
if is_turned_on is True:
# view.setConfigWindowCompactModeSwitchStatusToDisabled()
view.setConfigWindowThresholdCheckWidgetsStatusToDisabled()
view.setWidgetsStatus_ThresholdCheckButton_Disabled()
model.startCheckMicEnergy(setProgressBarMicEnergy)
view.replaceConfigWindowMicThresholdCheckButtonToActive()
view.setConfigWindowThresholdCheckWidgetsStatusToNormal()
view.replaceMicThresholdCheckButton_Active()
view.setWidgetsStatus_ThresholdCheckButton_Normal()
else:
view.setConfigWindowThresholdCheckWidgetsStatusToDisabled()
view.setWidgetsStatus_ThresholdCheckButton_Disabled()
model.stopCheckMicEnergy()
view.replaceConfigWindowMicThresholdCheckButtonToPassive()
view.setConfigWindowThresholdCheckWidgetsStatusToNormal()
# view.setConfigWindowCompactModeSwitchStatusToNormal()
view.replaceMicThresholdCheckButton_Passive()
view.setWidgetsStatus_ThresholdCheckButton_Normal()
def callbackSetMicRecordTimeout(value):
print("callbackSetMicRecordTimeout", value)
@@ -407,7 +403,7 @@ def callbackSetSpeakerDevice(value):
config.CHOICE_SPEAKER_DEVICE = value
model.stopCheckSpeakerEnergy()
view.replaceConfigWindowSpeakerThresholdCheckButtonToPassive()
view.replaceSpeakerThresholdCheckButton_Passive()
def callbackSetSpeakerEnergyThreshold(value):
print("callbackSetSpeakerEnergyThreshold", value)
@@ -436,20 +432,16 @@ def setProgressBarSpeakerEnergy(energy):
def callbackCheckSpeakerThreshold(is_turned_on):
print("callbackCheckSpeakerThreshold", is_turned_on)
if is_turned_on is True:
# view.setConfigWindowCompactModeSwitchStatusToDisabled()
view.setConfigWindowThresholdCheckWidgetsStatusToDisabled()
view.setWidgetsStatus_ThresholdCheckButton_Disabled()
model.startCheckSpeakerEnergy(setProgressBarSpeakerEnergy)
view.replaceConfigWindowSpeakerThresholdCheckButtonToActive()
view.setConfigWindowThresholdCheckWidgetsStatusToNormal()
view.replaceSpeakerThresholdCheckButton_Active()
view.setWidgetsStatus_ThresholdCheckButton_Normal()
else:
view.setConfigWindowThresholdCheckWidgetsStatusToDisabled()
view.setWidgetsStatus_ThresholdCheckButton_Disabled()
model.stopCheckSpeakerEnergy()
view.replaceConfigWindowSpeakerThresholdCheckButtonToPassive()
view.setConfigWindowThresholdCheckWidgetsStatusToNormal()
# view.setConfigWindowCompactModeSwitchStatusToNormal()
view.replaceSpeakerThresholdCheckButton_Passive()
view.setWidgetsStatus_ThresholdCheckButton_Normal()
def callbackSetSpeakerRecordTimeout(value):
print("callbackSetSpeakerRecordTimeout", value)

16
view.py
View File

@@ -509,15 +509,15 @@ class View():
# Config Window
@staticmethod
def setConfigWindowCompactModeSwitchStatusToDisabled():
def setWidgetsStatus_ConfigWindowCompactModeSwitch_Disabled():
vrct_gui.config_window.setting_box_compact_mode_switch_box.configure(state="disabled")
@staticmethod
def setConfigWindowCompactModeSwitchStatusToNormal():
def setWidgetsStatus_ConfigWindowCompactModeSwitch_Normal():
vrct_gui.config_window.setting_box_compact_mode_switch_box.configure(state="normal")
@staticmethod
def setConfigWindowThresholdCheckWidgetsStatusToDisabled():
def setWidgetsStatus_ThresholdCheckButton_Disabled():
vrct_gui.changeConfigWindowWidgetsStatus(
status="disabled",
target_names=[
@@ -527,7 +527,7 @@ class View():
)
@staticmethod
def setConfigWindowThresholdCheckWidgetsStatusToNormal():
def setWidgetsStatus_ThresholdCheckButton_Normal():
vrct_gui.changeConfigWindowWidgetsStatus(
status="normal",
target_names=[
@@ -537,24 +537,24 @@ class View():
)
@staticmethod
def replaceConfigWindowMicThresholdCheckButtonToActive():
def replaceMicThresholdCheckButton_Active():
vrct_gui.config_window.sb__progressbar_x_slider__passive_button_mic_energy_threshold.grid_remove()
vrct_gui.config_window.sb__progressbar_x_slider__active_button_mic_energy_threshold.grid()
@staticmethod
def replaceConfigWindowMicThresholdCheckButtonToPassive():
def replaceMicThresholdCheckButton_Passive():
vrct_gui.config_window.sb__progressbar_x_slider__active_button_mic_energy_threshold.grid_remove()
vrct_gui.config_window.sb__progressbar_x_slider__passive_button_mic_energy_threshold.grid()
@staticmethod
def replaceConfigWindowSpeakerThresholdCheckButtonToActive():
def replaceSpeakerThresholdCheckButton_Active():
vrct_gui.config_window.sb__progressbar_x_slider__passive_button_speaker_energy_threshold.grid_remove()
vrct_gui.config_window.sb__progressbar_x_slider__active_button_speaker_energy_threshold.grid()
@staticmethod
def replaceConfigWindowSpeakerThresholdCheckButtonToPassive():
def replaceSpeakerThresholdCheckButton_Passive():
vrct_gui.config_window.sb__progressbar_x_slider__active_button_speaker_energy_threshold.grid_remove()
vrct_gui.config_window.sb__progressbar_x_slider__passive_button_speaker_energy_threshold.grid()