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

16
view.py
View File

@@ -509,15 +509,15 @@ class View():
# Config Window # Config Window
@staticmethod @staticmethod
def setConfigWindowCompactModeSwitchStatusToDisabled(): def setWidgetsStatus_ConfigWindowCompactModeSwitch_Disabled():
vrct_gui.config_window.setting_box_compact_mode_switch_box.configure(state="disabled") vrct_gui.config_window.setting_box_compact_mode_switch_box.configure(state="disabled")
@staticmethod @staticmethod
def setConfigWindowCompactModeSwitchStatusToNormal(): def setWidgetsStatus_ConfigWindowCompactModeSwitch_Normal():
vrct_gui.config_window.setting_box_compact_mode_switch_box.configure(state="normal") vrct_gui.config_window.setting_box_compact_mode_switch_box.configure(state="normal")
@staticmethod @staticmethod
def setConfigWindowThresholdCheckWidgetsStatusToDisabled(): def setWidgetsStatus_ThresholdCheckButton_Disabled():
vrct_gui.changeConfigWindowWidgetsStatus( vrct_gui.changeConfigWindowWidgetsStatus(
status="disabled", status="disabled",
target_names=[ target_names=[
@@ -527,7 +527,7 @@ class View():
) )
@staticmethod @staticmethod
def setConfigWindowThresholdCheckWidgetsStatusToNormal(): def setWidgetsStatus_ThresholdCheckButton_Normal():
vrct_gui.changeConfigWindowWidgetsStatus( vrct_gui.changeConfigWindowWidgetsStatus(
status="normal", status="normal",
target_names=[ target_names=[
@@ -537,24 +537,24 @@ class View():
) )
@staticmethod @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__passive_button_mic_energy_threshold.grid_remove()
vrct_gui.config_window.sb__progressbar_x_slider__active_button_mic_energy_threshold.grid() vrct_gui.config_window.sb__progressbar_x_slider__active_button_mic_energy_threshold.grid()
@staticmethod @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__active_button_mic_energy_threshold.grid_remove()
vrct_gui.config_window.sb__progressbar_x_slider__passive_button_mic_energy_threshold.grid() vrct_gui.config_window.sb__progressbar_x_slider__passive_button_mic_energy_threshold.grid()
@staticmethod @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__passive_button_speaker_energy_threshold.grid_remove()
vrct_gui.config_window.sb__progressbar_x_slider__active_button_speaker_energy_threshold.grid() vrct_gui.config_window.sb__progressbar_x_slider__active_button_speaker_energy_threshold.grid()
@staticmethod @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__active_button_speaker_energy_threshold.grid_remove()
vrct_gui.config_window.sb__progressbar_x_slider__passive_button_speaker_energy_threshold.grid() vrct_gui.config_window.sb__progressbar_x_slider__passive_button_speaker_energy_threshold.grid()