[bugfix/refactor] weightタイプ変更処理中は、weightタイプ変更と翻訳機能オンオフwidgetをdisabledに。

理由: weightタイプ変更処理は非同期で、変更処理中に上記widgetを触れるとUIへの変更処理順が意図した順番と変わってしまうため。

その他リファクタリングあり。
This commit is contained in:
Sakamoto Shiina
2024-01-22 20:33:50 +09:00
parent 46aafa4a4d
commit edaca7edc2
7 changed files with 84 additions and 4 deletions

View File

@@ -507,17 +507,20 @@ def callbackSetCtranslate2WeightType(value):
print("callbackSetCtranslate2WeightType", value)
config.WEIGHT_TYPE = str(value)
view.updateSelectedCtranslate2WeightType(config.WEIGHT_TYPE)
view.setWidgetsStatus_changeWeightType_Pending()
if model.checkCTranslatorCTranslate2ModelWeight():
config.IS_RESET_BUTTON_DISPLAYED_FOR_TRANSLATION = False
def callback():
model.changeTranslatorCTranslate2Model()
view.useTranslationFeatureProcess("Normal")
view.setWidgetsStatus_changeWeightType_Done()
th_callback = Thread(target=callback)
th_callback.daemon = True
th_callback.start()
else:
config.IS_RESET_BUTTON_DISPLAYED_FOR_TRANSLATION = True
view.useTranslationFeatureProcess("Restart")
view.setWidgetsStatus_changeWeightType_Done()
view.showRestartButtonIfRequired()
def callbackSetDeeplAuthkey(value):