Merge branch 'develop'
This commit is contained in:
61
config.py
61
config.py
@@ -7,6 +7,7 @@ import tkinter as tk
|
|||||||
from tkinter import font
|
from tkinter import font
|
||||||
from models.translation.translation_languages import translation_lang
|
from models.translation.translation_languages import translation_lang
|
||||||
from models.transcription.transcription_utils import getInputDevices, getDefaultInputDevice
|
from models.transcription.transcription_utils import getInputDevices, getDefaultInputDevice
|
||||||
|
from models.transcription.transcription_languages import transcription_lang
|
||||||
from utils import generatePercentageStringsList, isUniqueStrings
|
from utils import generatePercentageStringsList, isUniqueStrings
|
||||||
|
|
||||||
json_serializable_vars = {}
|
json_serializable_vars = {}
|
||||||
@@ -288,9 +289,18 @@ class Config:
|
|||||||
|
|
||||||
@SELECTED_TAB_YOUR_LANGUAGES.setter
|
@SELECTED_TAB_YOUR_LANGUAGES.setter
|
||||||
def SELECTED_TAB_YOUR_LANGUAGES(self, value):
|
def SELECTED_TAB_YOUR_LANGUAGES(self, value):
|
||||||
if isinstance(value, dict):
|
try:
|
||||||
self._SELECTED_TAB_YOUR_LANGUAGES = value
|
if isinstance(value, dict):
|
||||||
saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value)
|
value_old = self.SELECTED_TAB_YOUR_LANGUAGES
|
||||||
|
for k, v in value.items():
|
||||||
|
language = v["language"]
|
||||||
|
country = v["country"]
|
||||||
|
if language not in list(transcription_lang.keys()) or country not in list(transcription_lang[language].keys()):
|
||||||
|
value[k] = value_old[k]
|
||||||
|
self._SELECTED_TAB_YOUR_LANGUAGES = value
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@json_serializable('SELECTED_TAB_TARGET_LANGUAGES')
|
@json_serializable('SELECTED_TAB_TARGET_LANGUAGES')
|
||||||
@@ -299,9 +309,18 @@ class Config:
|
|||||||
|
|
||||||
@SELECTED_TAB_TARGET_LANGUAGES.setter
|
@SELECTED_TAB_TARGET_LANGUAGES.setter
|
||||||
def SELECTED_TAB_TARGET_LANGUAGES(self, value):
|
def SELECTED_TAB_TARGET_LANGUAGES(self, value):
|
||||||
if isinstance(value, dict):
|
try:
|
||||||
self._SELECTED_TAB_TARGET_LANGUAGES = value
|
if isinstance(value, dict):
|
||||||
saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value)
|
value_old = self.SELECTED_TAB_TARGET_LANGUAGES
|
||||||
|
for k, v in value.items():
|
||||||
|
language = v["language"]
|
||||||
|
country = v["country"]
|
||||||
|
if language not in list(transcription_lang.keys()) or country not in list(transcription_lang[language].keys()):
|
||||||
|
value[k] = value_old[k]
|
||||||
|
self._SELECTED_TAB_TARGET_LANGUAGES = value
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@json_serializable('SELECTED_TRANSCRIPTION_ENGINE')
|
@json_serializable('SELECTED_TRANSCRIPTION_ENGINE')
|
||||||
@@ -885,14 +904,32 @@ class Config:
|
|||||||
"3":"CTranslate2",
|
"3":"CTranslate2",
|
||||||
}
|
}
|
||||||
self._SELECTED_TAB_YOUR_LANGUAGES = {
|
self._SELECTED_TAB_YOUR_LANGUAGES = {
|
||||||
"1":"Japanese\n(Japan)",
|
"1":{
|
||||||
"2":"Japanese\n(Japan)",
|
"language":"Japanese",
|
||||||
"3":"Japanese\n(Japan)",
|
"country":"Japan"
|
||||||
|
},
|
||||||
|
"2":{
|
||||||
|
"language":"Japanese",
|
||||||
|
"country":"Japan"
|
||||||
|
},
|
||||||
|
"3":{
|
||||||
|
"language":"Japanese",
|
||||||
|
"country":"Japan"
|
||||||
|
},
|
||||||
}
|
}
|
||||||
self._SELECTED_TAB_TARGET_LANGUAGES = {
|
self._SELECTED_TAB_TARGET_LANGUAGES = {
|
||||||
"1":"English\n(United States)",
|
"1":{
|
||||||
"2":"English\n(United States)",
|
"language":"English",
|
||||||
"3":"English\n(United States)",
|
"country":"United States"
|
||||||
|
},
|
||||||
|
"2":{
|
||||||
|
"language":"English",
|
||||||
|
"country":"United States"
|
||||||
|
},
|
||||||
|
"3":{
|
||||||
|
"language":"English",
|
||||||
|
"country":"United States"
|
||||||
|
},
|
||||||
}
|
}
|
||||||
self._SELECTED_TRANSCRIPTION_ENGINE = "Google"
|
self._SELECTED_TRANSCRIPTION_ENGINE = "Google"
|
||||||
self._IS_MAIN_WINDOW_SIDEBAR_COMPACT_MODE = False
|
self._IS_MAIN_WINDOW_SIDEBAR_COMPACT_MODE = False
|
||||||
|
|||||||
@@ -292,13 +292,11 @@ def initSetTranslateEngine():
|
|||||||
|
|
||||||
def initSetLanguageAndCountry():
|
def initSetLanguageAndCountry():
|
||||||
select = config.SELECTED_TAB_YOUR_LANGUAGES[config.SELECTED_TAB_NO]
|
select = config.SELECTED_TAB_YOUR_LANGUAGES[config.SELECTED_TAB_NO]
|
||||||
language, country = model.getLanguageAndCountry(select)
|
config.SOURCE_LANGUAGE = select["language"]
|
||||||
config.SOURCE_LANGUAGE = language
|
config.SOURCE_COUNTRY = select["country"]
|
||||||
config.SOURCE_COUNTRY = country
|
|
||||||
select = config.SELECTED_TAB_TARGET_LANGUAGES[config.SELECTED_TAB_NO]
|
select = config.SELECTED_TAB_TARGET_LANGUAGES[config.SELECTED_TAB_NO]
|
||||||
language, country = model.getLanguageAndCountry(select)
|
config.TARGET_LANGUAGE = select["language"]
|
||||||
config.TARGET_LANGUAGE = language
|
config.TARGET_COUNTRY = select["country"]
|
||||||
config.TARGET_COUNTRY = country
|
|
||||||
|
|
||||||
def setYourTranslateEngine(select):
|
def setYourTranslateEngine(select):
|
||||||
engines = config.SELECTED_TAB_YOUR_TRANSLATOR_ENGINES
|
engines = config.SELECTED_TAB_YOUR_TRANSLATOR_ENGINES
|
||||||
@@ -316,9 +314,8 @@ def setYourLanguageAndCountry(select):
|
|||||||
languages = config.SELECTED_TAB_YOUR_LANGUAGES
|
languages = config.SELECTED_TAB_YOUR_LANGUAGES
|
||||||
languages[config.SELECTED_TAB_NO] = select
|
languages[config.SELECTED_TAB_NO] = select
|
||||||
config.SELECTED_TAB_YOUR_LANGUAGES = languages
|
config.SELECTED_TAB_YOUR_LANGUAGES = languages
|
||||||
language, country = model.getLanguageAndCountry(select)
|
config.SOURCE_LANGUAGE = select["language"]
|
||||||
config.SOURCE_LANGUAGE = language
|
config.SOURCE_COUNTRY = select["country"]
|
||||||
config.SOURCE_COUNTRY = country
|
|
||||||
updateTranslationEngineAndEngineList()
|
updateTranslationEngineAndEngineList()
|
||||||
view.printToTextbox_selectedYourLanguages(select)
|
view.printToTextbox_selectedYourLanguages(select)
|
||||||
|
|
||||||
@@ -326,9 +323,8 @@ def setTargetLanguageAndCountry(select):
|
|||||||
languages = config.SELECTED_TAB_TARGET_LANGUAGES
|
languages = config.SELECTED_TAB_TARGET_LANGUAGES
|
||||||
languages[config.SELECTED_TAB_NO] = select
|
languages[config.SELECTED_TAB_NO] = select
|
||||||
config.SELECTED_TAB_TARGET_LANGUAGES = languages
|
config.SELECTED_TAB_TARGET_LANGUAGES = languages
|
||||||
language, country = model.getLanguageAndCountry(select)
|
config.TARGET_LANGUAGE = select["language"]
|
||||||
config.TARGET_LANGUAGE = language
|
config.TARGET_COUNTRY = select["country"]
|
||||||
config.TARGET_COUNTRY = country
|
|
||||||
updateTranslationEngineAndEngineList()
|
updateTranslationEngineAndEngineList()
|
||||||
view.printToTextbox_selectedTargetLanguages(select)
|
view.printToTextbox_selectedTargetLanguages(select)
|
||||||
|
|
||||||
@@ -355,15 +351,13 @@ def callbackSelectedLanguagePresetTab(selected_tab_no):
|
|||||||
|
|
||||||
languages = config.SELECTED_TAB_YOUR_LANGUAGES
|
languages = config.SELECTED_TAB_YOUR_LANGUAGES
|
||||||
select = languages[config.SELECTED_TAB_NO]
|
select = languages[config.SELECTED_TAB_NO]
|
||||||
language, country = model.getLanguageAndCountry(select)
|
config.SOURCE_LANGUAGE = select["language"]
|
||||||
config.SOURCE_LANGUAGE = language
|
config.SOURCE_COUNTRY = select["country"]
|
||||||
config.SOURCE_COUNTRY = country
|
|
||||||
|
|
||||||
languages = config.SELECTED_TAB_TARGET_LANGUAGES
|
languages = config.SELECTED_TAB_TARGET_LANGUAGES
|
||||||
select = languages[config.SELECTED_TAB_NO]
|
select = languages[config.SELECTED_TAB_NO]
|
||||||
language, country = model.getLanguageAndCountry(select)
|
config.TARGET_LANGUAGE = select["language"]
|
||||||
config.TARGET_LANGUAGE = language
|
config.TARGET_COUNTRY = select["country"]
|
||||||
config.TARGET_COUNTRY = country
|
|
||||||
view.printToTextbox_changedLanguagePresetTab(config.SELECTED_TAB_NO)
|
view.printToTextbox_changedLanguagePresetTab(config.SELECTED_TAB_NO)
|
||||||
updateTranslationEngineAndEngineList()
|
updateTranslationEngineAndEngineList()
|
||||||
|
|
||||||
@@ -552,14 +546,17 @@ def callbackSetCtranslate2WeightType(value):
|
|||||||
|
|
||||||
def callbackSetDeeplAuthKey(value):
|
def callbackSetDeeplAuthKey(value):
|
||||||
print("callbackSetDeeplAuthKey", str(value))
|
print("callbackSetDeeplAuthKey", str(value))
|
||||||
|
view.clearNotificationMessage()
|
||||||
if len(value) == 39:
|
if len(value) == 39:
|
||||||
result = model.authenticationTranslatorDeepLAuthKey(auth_key=value)
|
result = model.authenticationTranslatorDeepLAuthKey(auth_key=value)
|
||||||
if result is True:
|
if result is True:
|
||||||
key = value
|
key = value
|
||||||
view.printToTextbox_AuthenticationSuccess()
|
view.printToTextbox_AuthenticationSuccess()
|
||||||
|
view.showSuccessMessage_DeeplAuthKey()
|
||||||
else:
|
else:
|
||||||
key = None
|
key = None
|
||||||
view.printToTextbox_AuthenticationError()
|
view.printToTextbox_AuthenticationError()
|
||||||
|
view.showErrorMessage_DeeplAuthKey()
|
||||||
auth_keys = config.AUTH_KEYS
|
auth_keys = config.AUTH_KEYS
|
||||||
auth_keys["DeepL_API"] = key
|
auth_keys["DeepL_API"] = key
|
||||||
config.AUTH_KEYS = auth_keys
|
config.AUTH_KEYS = auth_keys
|
||||||
@@ -596,7 +593,7 @@ def callbackSetMicEnergyThreshold(value):
|
|||||||
try:
|
try:
|
||||||
value = int(value)
|
value = int(value)
|
||||||
if 0 <= value and value <= config.MAX_MIC_ENERGY_THRESHOLD:
|
if 0 <= value and value <= config.MAX_MIC_ENERGY_THRESHOLD:
|
||||||
view.clearErrorMessage()
|
view.clearNotificationMessage()
|
||||||
config.INPUT_MIC_ENERGY_THRESHOLD = value
|
config.INPUT_MIC_ENERGY_THRESHOLD = value
|
||||||
view.setGuiVariable_MicEnergyThreshold(config.INPUT_MIC_ENERGY_THRESHOLD)
|
view.setGuiVariable_MicEnergyThreshold(config.INPUT_MIC_ENERGY_THRESHOLD)
|
||||||
else:
|
else:
|
||||||
@@ -633,7 +630,7 @@ def callbackSetMicRecordTimeout(value):
|
|||||||
try:
|
try:
|
||||||
value = int(value)
|
value = int(value)
|
||||||
if 0 <= value and value <= config.INPUT_MIC_PHRASE_TIMEOUT:
|
if 0 <= value and value <= config.INPUT_MIC_PHRASE_TIMEOUT:
|
||||||
view.clearErrorMessage()
|
view.clearNotificationMessage()
|
||||||
config.INPUT_MIC_RECORD_TIMEOUT = value
|
config.INPUT_MIC_RECORD_TIMEOUT = value
|
||||||
view.setGuiVariable_MicRecordTimeout(config.INPUT_MIC_RECORD_TIMEOUT)
|
view.setGuiVariable_MicRecordTimeout(config.INPUT_MIC_RECORD_TIMEOUT)
|
||||||
else:
|
else:
|
||||||
@@ -648,7 +645,7 @@ def callbackSetMicPhraseTimeout(value):
|
|||||||
try:
|
try:
|
||||||
value = int(value)
|
value = int(value)
|
||||||
if 0 <= value and value >= config.INPUT_MIC_RECORD_TIMEOUT:
|
if 0 <= value and value >= config.INPUT_MIC_RECORD_TIMEOUT:
|
||||||
view.clearErrorMessage()
|
view.clearNotificationMessage()
|
||||||
config.INPUT_MIC_PHRASE_TIMEOUT = value
|
config.INPUT_MIC_PHRASE_TIMEOUT = value
|
||||||
view.setGuiVariable_MicPhraseTimeout(config.INPUT_MIC_PHRASE_TIMEOUT)
|
view.setGuiVariable_MicPhraseTimeout(config.INPUT_MIC_PHRASE_TIMEOUT)
|
||||||
else:
|
else:
|
||||||
@@ -663,7 +660,7 @@ def callbackSetMicMaxPhrases(value):
|
|||||||
try:
|
try:
|
||||||
value = int(value)
|
value = int(value)
|
||||||
if 0 <= value:
|
if 0 <= value:
|
||||||
view.clearErrorMessage()
|
view.clearNotificationMessage()
|
||||||
config.INPUT_MIC_MAX_PHRASES = value
|
config.INPUT_MIC_MAX_PHRASES = value
|
||||||
view.setGuiVariable_MicMaxPhrases(config.INPUT_MIC_MAX_PHRASES)
|
view.setGuiVariable_MicMaxPhrases(config.INPUT_MIC_MAX_PHRASES)
|
||||||
else:
|
else:
|
||||||
@@ -714,7 +711,7 @@ def callbackSetSpeakerEnergyThreshold(value):
|
|||||||
try:
|
try:
|
||||||
value = int(value)
|
value = int(value)
|
||||||
if 0 <= value and value <= config.MAX_SPEAKER_ENERGY_THRESHOLD:
|
if 0 <= value and value <= config.MAX_SPEAKER_ENERGY_THRESHOLD:
|
||||||
view.clearErrorMessage()
|
view.clearNotificationMessage()
|
||||||
config.INPUT_SPEAKER_ENERGY_THRESHOLD = value
|
config.INPUT_SPEAKER_ENERGY_THRESHOLD = value
|
||||||
view.setGuiVariable_SpeakerEnergyThreshold(config.INPUT_SPEAKER_ENERGY_THRESHOLD)
|
view.setGuiVariable_SpeakerEnergyThreshold(config.INPUT_SPEAKER_ENERGY_THRESHOLD)
|
||||||
else:
|
else:
|
||||||
@@ -756,7 +753,7 @@ def callbackSetSpeakerRecordTimeout(value):
|
|||||||
try:
|
try:
|
||||||
value = int(value)
|
value = int(value)
|
||||||
if 0 <= value and value <= config.INPUT_SPEAKER_PHRASE_TIMEOUT:
|
if 0 <= value and value <= config.INPUT_SPEAKER_PHRASE_TIMEOUT:
|
||||||
view.clearErrorMessage()
|
view.clearNotificationMessage()
|
||||||
config.INPUT_SPEAKER_RECORD_TIMEOUT = value
|
config.INPUT_SPEAKER_RECORD_TIMEOUT = value
|
||||||
view.setGuiVariable_SpeakerRecordTimeout(config.INPUT_SPEAKER_RECORD_TIMEOUT)
|
view.setGuiVariable_SpeakerRecordTimeout(config.INPUT_SPEAKER_RECORD_TIMEOUT)
|
||||||
else:
|
else:
|
||||||
@@ -771,7 +768,7 @@ def callbackSetSpeakerPhraseTimeout(value):
|
|||||||
try:
|
try:
|
||||||
value = int(value)
|
value = int(value)
|
||||||
if 0 <= value and value >= config.INPUT_SPEAKER_RECORD_TIMEOUT:
|
if 0 <= value and value >= config.INPUT_SPEAKER_RECORD_TIMEOUT:
|
||||||
view.clearErrorMessage()
|
view.clearNotificationMessage()
|
||||||
config.INPUT_SPEAKER_PHRASE_TIMEOUT = value
|
config.INPUT_SPEAKER_PHRASE_TIMEOUT = value
|
||||||
view.setGuiVariable_SpeakerPhraseTimeout(config.INPUT_SPEAKER_PHRASE_TIMEOUT)
|
view.setGuiVariable_SpeakerPhraseTimeout(config.INPUT_SPEAKER_PHRASE_TIMEOUT)
|
||||||
else:
|
else:
|
||||||
@@ -786,7 +783,7 @@ def callbackSetSpeakerMaxPhrases(value):
|
|||||||
try:
|
try:
|
||||||
value = int(value)
|
value = int(value)
|
||||||
if 0 <= value:
|
if 0 <= value:
|
||||||
view.clearErrorMessage()
|
view.clearNotificationMessage()
|
||||||
config.INPUT_SPEAKER_MAX_PHRASES = value
|
config.INPUT_SPEAKER_MAX_PHRASES = value
|
||||||
view.setGuiVariable_SpeakerMaxPhrases(config.INPUT_SPEAKER_MAX_PHRASES)
|
view.setGuiVariable_SpeakerMaxPhrases(config.INPUT_SPEAKER_MAX_PHRASES)
|
||||||
else:
|
else:
|
||||||
@@ -860,7 +857,7 @@ def callbackSetSendMessageFormat(value):
|
|||||||
print("callbackSetSendMessageFormat", value)
|
print("callbackSetSendMessageFormat", value)
|
||||||
if isUniqueStrings(["[message]"], value) is True:
|
if isUniqueStrings(["[message]"], value) is True:
|
||||||
config.SEND_MESSAGE_FORMAT = value
|
config.SEND_MESSAGE_FORMAT = value
|
||||||
view.clearErrorMessage()
|
view.clearNotificationMessage()
|
||||||
view.setSendMessageFormat_EntryWidgets(config.SEND_MESSAGE_FORMAT)
|
view.setSendMessageFormat_EntryWidgets(config.SEND_MESSAGE_FORMAT)
|
||||||
else:
|
else:
|
||||||
view.showErrorMessage_SendMessageFormat()
|
view.showErrorMessage_SendMessageFormat()
|
||||||
@@ -871,7 +868,7 @@ def callbackSetSendMessageFormatWithT(value):
|
|||||||
if len(value) > 0:
|
if len(value) > 0:
|
||||||
if isUniqueStrings(["[message]", "[translation]"], value) is True:
|
if isUniqueStrings(["[message]", "[translation]"], value) is True:
|
||||||
config.SEND_MESSAGE_FORMAT_WITH_T = value
|
config.SEND_MESSAGE_FORMAT_WITH_T = value
|
||||||
view.clearErrorMessage()
|
view.clearNotificationMessage()
|
||||||
view.setSendMessageFormatWithT_EntryWidgets(config.SEND_MESSAGE_FORMAT_WITH_T)
|
view.setSendMessageFormatWithT_EntryWidgets(config.SEND_MESSAGE_FORMAT_WITH_T)
|
||||||
else:
|
else:
|
||||||
view.showErrorMessage_SendMessageFormatWithT()
|
view.showErrorMessage_SendMessageFormatWithT()
|
||||||
@@ -882,7 +879,7 @@ def callbackSetReceivedMessageFormat(value):
|
|||||||
print("callbackSetReceivedMessageFormat", value)
|
print("callbackSetReceivedMessageFormat", value)
|
||||||
if isUniqueStrings(["[message]"], value) is True:
|
if isUniqueStrings(["[message]"], value) is True:
|
||||||
config.RECEIVED_MESSAGE_FORMAT = value
|
config.RECEIVED_MESSAGE_FORMAT = value
|
||||||
view.clearErrorMessage()
|
view.clearNotificationMessage()
|
||||||
view.setReceivedMessageFormat_EntryWidgets(config.RECEIVED_MESSAGE_FORMAT)
|
view.setReceivedMessageFormat_EntryWidgets(config.RECEIVED_MESSAGE_FORMAT)
|
||||||
else:
|
else:
|
||||||
view.showErrorMessage_ReceivedMessageFormat()
|
view.showErrorMessage_ReceivedMessageFormat()
|
||||||
@@ -893,7 +890,7 @@ def callbackSetReceivedMessageFormatWithT(value):
|
|||||||
if len(value) > 0:
|
if len(value) > 0:
|
||||||
if isUniqueStrings(["[message]", "[translation]"], value) is True:
|
if isUniqueStrings(["[message]", "[translation]"], value) is True:
|
||||||
config.RECEIVED_MESSAGE_FORMAT_WITH_T = value
|
config.RECEIVED_MESSAGE_FORMAT_WITH_T = value
|
||||||
view.clearErrorMessage()
|
view.clearNotificationMessage()
|
||||||
view.setReceivedMessageFormatWithT_EntryWidgets(config.RECEIVED_MESSAGE_FORMAT_WITH_T)
|
view.setReceivedMessageFormatWithT_EntryWidgets(config.RECEIVED_MESSAGE_FORMAT_WITH_T)
|
||||||
else:
|
else:
|
||||||
view.showErrorMessage_ReceivedMessageFormatWithT()
|
view.showErrorMessage_ReceivedMessageFormatWithT()
|
||||||
|
|||||||
@@ -130,6 +130,8 @@ config_window:
|
|||||||
label: DeepL Auth Key
|
label: DeepL Auth Key
|
||||||
desc: Please select %{translator} on the main screen with DeepL_API when using. ※Some languages may not be supported.
|
desc: Please select %{translator} on the main screen with DeepL_API when using. ※Some languages may not be supported.
|
||||||
open_auth_key_webpage: Open DeepL Account Webpage
|
open_auth_key_webpage: Open DeepL Account Webpage
|
||||||
|
auth_key_success: Auth key update completed.
|
||||||
|
auth_key_error: Auth Key is incorrect or Usage limit reached.
|
||||||
|
|
||||||
mic_host:
|
mic_host:
|
||||||
label: Mic Host/Driver
|
label: Mic Host/Driver
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ main_window:
|
|||||||
disabled_foreground: 最前面への固定を解除しました。
|
disabled_foreground: 最前面への固定を解除しました。
|
||||||
|
|
||||||
auth_key_success: 認証キーの更新が完了しました。
|
auth_key_success: 認証キーの更新が完了しました。
|
||||||
auth_key_error: 認証キーが間違っているか、API使用制限が上限に達しています.
|
auth_key_error: 認証キーが間違っているか、API使用制限が上限に達しています。
|
||||||
|
|
||||||
no_mic_device_detected_error: マイクデバイスが検出されませんでした。
|
no_mic_device_detected_error: マイクデバイスが検出されませんでした。
|
||||||
no_speaker_device_detected_error: スピーカーデバイスが検出されませんでした。
|
no_speaker_device_detected_error: スピーカーデバイスが検出されませんでした。
|
||||||
@@ -129,6 +129,8 @@ config_window:
|
|||||||
label: DeepL 認証キー
|
label: DeepL 認証キー
|
||||||
desc: "使用の際は、メイン画面にある %{translator} をDeepL_APIに変更してください。\n※対応していない言語もあります。"
|
desc: "使用の際は、メイン画面にある %{translator} をDeepL_APIに変更してください。\n※対応していない言語もあります。"
|
||||||
open_auth_key_webpage: DeepLアカウントページを開く
|
open_auth_key_webpage: DeepLアカウントページを開く
|
||||||
|
auth_key_success: 認証キーの更新が完了しました。
|
||||||
|
auth_key_error: 認証キーが間違っているか、API使用制限が上限に達しています。
|
||||||
|
|
||||||
mic_host:
|
mic_host:
|
||||||
label: マイク(ホスト/ドライバー)
|
label: マイク(ホスト/ドライバー)
|
||||||
|
|||||||
26
model.py
26
model.py
@@ -106,26 +106,24 @@ class Model:
|
|||||||
|
|
||||||
def getListLanguageAndCountry(self):
|
def getListLanguageAndCountry(self):
|
||||||
transcription_langs = list(transcription_lang.keys())
|
transcription_langs = list(transcription_lang.keys())
|
||||||
tl_keys = translation_lang.keys()
|
|
||||||
translation_langs = []
|
translation_langs = []
|
||||||
for tl_key in tl_keys:
|
for tl_key in translation_lang.keys():
|
||||||
for lang in translation_lang[tl_key]["source"]:
|
for lang in translation_lang[tl_key]["source"]:
|
||||||
translation_langs.append(lang)
|
translation_langs.append(lang)
|
||||||
translation_langs = list(set(translation_langs))
|
translation_langs = list(set(translation_langs))
|
||||||
supported_langs = list(filter(lambda x: x in transcription_langs, translation_langs))
|
supported_langs = list(filter(lambda x: x in transcription_langs, translation_langs))
|
||||||
|
|
||||||
langs = []
|
languages = []
|
||||||
for lang in supported_langs:
|
for language in supported_langs:
|
||||||
for country in transcription_lang[lang]:
|
for country in transcription_lang[language]:
|
||||||
langs.append(f"{lang}\n({country})")
|
languages.append(
|
||||||
return sorted(langs)
|
{
|
||||||
|
"language" : language,
|
||||||
@staticmethod
|
"country" : country,
|
||||||
def getLanguageAndCountry(select):
|
}
|
||||||
parts = select.split("\n")
|
)
|
||||||
language = parts[0]
|
languages = sorted(languages, key=lambda x: x['language'])
|
||||||
country = parts[1][1:-1]
|
return languages
|
||||||
return language, country
|
|
||||||
|
|
||||||
def findTranslationEngines(self, source_lang, target_lang):
|
def findTranslationEngines(self, source_lang, target_lang):
|
||||||
compatible_engines = []
|
compatible_engines = []
|
||||||
|
|||||||
@@ -85,20 +85,22 @@ transcription_lang = {
|
|||||||
"Whisper": "ca",
|
"Whisper": "ca",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"Chinese":{
|
"Chinese Simplified":{
|
||||||
"Mandarin (Simplified, China)":{
|
"China":{
|
||||||
"Google": "cmn-Hans-CN",
|
"Google": "cmn-Hans-CN",
|
||||||
"Whisper": "zh",
|
"Whisper": "zh",
|
||||||
},
|
},
|
||||||
"Mandarin (Simplified, Hong Kong)":{
|
"Hong Kong":{
|
||||||
"Google": "cmn-Hans-HK",
|
"Google": "cmn-Hans-HK",
|
||||||
"Whisper": "zh",
|
"Whisper": "zh",
|
||||||
},
|
},
|
||||||
"Mandarin (Traditional, Taiwan)":{
|
},
|
||||||
|
"Chinese Traditional":{
|
||||||
|
"Taiwan":{
|
||||||
"Google": "cmn-Hant-TW",
|
"Google": "cmn-Hant-TW",
|
||||||
"Whisper": "zh",
|
"Whisper": "zh",
|
||||||
},
|
},
|
||||||
"Cantonese (Traditional Hong Kong)":{
|
"Hong Kong":{
|
||||||
"Google": "yue-Hant-HK",
|
"Google": "yue-Hant-HK",
|
||||||
"Whisper": "yue",
|
"Whisper": "yue",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,40 +1,41 @@
|
|||||||
translation_lang = {}
|
translation_lang = {}
|
||||||
dict_deepl_languages = {
|
dict_deepl_languages = {
|
||||||
'Arabic':'ar',
|
"Arabic":"ar",
|
||||||
'Bulgarian':'bg',
|
"Bulgarian":"bg",
|
||||||
'Czech':'cs',
|
"Czech":"cs",
|
||||||
'Danish':'da',
|
"Danish":"da",
|
||||||
'German':'de',
|
"German":"de",
|
||||||
'Greek':'el',
|
"Greek":"el",
|
||||||
'English':'en',
|
"English":"en",
|
||||||
'Spanish':'es',
|
"Spanish":"es",
|
||||||
'Estonian':'et',
|
"Estonian":"et",
|
||||||
'Finnish':'fi',
|
"Finnish":"fi",
|
||||||
'French':'fr',
|
"French":"fr",
|
||||||
'Irish':'ga',
|
"Irish":"ga",
|
||||||
'Croatian':'hr',
|
"Croatian":"hr",
|
||||||
'Hungarian':'hu',
|
"Hungarian":"hu",
|
||||||
'Indonesian':'id',
|
"Indonesian":"id",
|
||||||
'Icelandic':'is',
|
"Icelandic":"is",
|
||||||
'Italian':'it',
|
"Italian":"it",
|
||||||
'Japanese':'ja',
|
"Japanese":"ja",
|
||||||
'Korean':'ko',
|
"Korean":"ko",
|
||||||
'Lithuanian':'lt',
|
"Lithuanian":"lt",
|
||||||
'Latvian':'lv',
|
"Latvian":"lv",
|
||||||
'Maltese':'mt',
|
"Maltese":"mt",
|
||||||
'Bokmal':'nb',
|
"Bokmal":"nb",
|
||||||
'Dutch':'nl',
|
"Dutch":"nl",
|
||||||
'Norwegian':'no',
|
"Norwegian":"no",
|
||||||
'Polish':'pl',
|
"Polish":"pl",
|
||||||
'Portuguese':'pt',
|
"Portuguese":"pt",
|
||||||
'Romanian':'ro',
|
"Romanian":"ro",
|
||||||
'Russian':'ru',
|
"Russian":"ru",
|
||||||
'Slovak':'sk',
|
"Slovak":"sk",
|
||||||
'Slovenian':'sl',
|
"Slovenian":"sl",
|
||||||
'Swedish':'sv',
|
"Swedish":"sv",
|
||||||
'Turkish':'tr',
|
"Turkish":"tr",
|
||||||
'Ukrainian':'uk',
|
"Ukrainian":"uk",
|
||||||
'Chinese':'zh',
|
"Chinese Simplified":"zh",
|
||||||
|
"Chinese Traditional":"zh"
|
||||||
}
|
}
|
||||||
translation_lang["DeepL"] = {
|
translation_lang["DeepL"] = {
|
||||||
"source":dict_deepl_languages,
|
"source":dict_deepl_languages,
|
||||||
@@ -70,7 +71,8 @@ dict_deepl_api_source_languages = {
|
|||||||
"Swedish":"sv",
|
"Swedish":"sv",
|
||||||
"Turkish":"tr",
|
"Turkish":"tr",
|
||||||
"Ukrainian":"uk",
|
"Ukrainian":"uk",
|
||||||
"Chinese":"zh"
|
"Chinese Simplified":"zh",
|
||||||
|
"Chinese Traditional":"zh"
|
||||||
}
|
}
|
||||||
dict_deepl_api_target_languages = {
|
dict_deepl_api_target_languages = {
|
||||||
"Japanese":"ja",
|
"Japanese":"ja",
|
||||||
@@ -104,7 +106,8 @@ dict_deepl_api_target_languages = {
|
|||||||
"Swedish":"sv",
|
"Swedish":"sv",
|
||||||
"Turkish":"tr",
|
"Turkish":"tr",
|
||||||
"Ukrainian":"uk",
|
"Ukrainian":"uk",
|
||||||
"Chinese":"zh"
|
"Chinese Simplified":"zh",
|
||||||
|
"Chinese Traditional":"zh"
|
||||||
}
|
}
|
||||||
translation_lang["DeepL_API"] = {
|
translation_lang["DeepL_API"] = {
|
||||||
"source": dict_deepl_api_source_languages,
|
"source": dict_deepl_api_source_languages,
|
||||||
@@ -114,7 +117,8 @@ translation_lang["DeepL_API"] = {
|
|||||||
dict_google_languages = {
|
dict_google_languages = {
|
||||||
"Japanese":"ja",
|
"Japanese":"ja",
|
||||||
"English":"en",
|
"English":"en",
|
||||||
"Chinese":"zh",
|
"Chinese Simplified":"zh",
|
||||||
|
"Chinese Traditional":"zh-TW",
|
||||||
"Arabic":"ar",
|
"Arabic":"ar",
|
||||||
"Russian":"ru",
|
"Russian":"ru",
|
||||||
"French":"fr",
|
"French":"fr",
|
||||||
@@ -183,7 +187,8 @@ translation_lang["Google"] = {
|
|||||||
dict_bing_languages = {
|
dict_bing_languages = {
|
||||||
"Japanese":"ja",
|
"Japanese":"ja",
|
||||||
"English":"en",
|
"English":"en",
|
||||||
"Chinese":"zh",
|
"Chinese Simplified":"zh",
|
||||||
|
"Chinese Traditional":"zh-Hant",
|
||||||
"Arabic":"ar",
|
"Arabic":"ar",
|
||||||
"Russian":"ru",
|
"Russian":"ru",
|
||||||
"French":"fr",
|
"French":"fr",
|
||||||
@@ -248,20 +253,21 @@ translation_lang["Bing"] = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dict_papago_languages = {
|
dict_papago_languages = {
|
||||||
'German': 'de',
|
"German": "de",
|
||||||
'English': 'en',
|
"English": "en",
|
||||||
'Spanish':'es',
|
"Spanish":"es",
|
||||||
'French': 'fr',
|
"French": "fr",
|
||||||
'Hindi': 'hi',
|
"Hindi": "hi",
|
||||||
'Indonesian': 'id',
|
"Indonesian": "id",
|
||||||
'Italian': 'it',
|
"Italian": "it",
|
||||||
'Japanese': 'ja',
|
"Japanese": "ja",
|
||||||
'Korean': 'ko',
|
"Korean": "ko",
|
||||||
'Portuguese': 'pt',
|
"Portuguese": "pt",
|
||||||
'Russian': 'ru',
|
"Russian": "ru",
|
||||||
'Thai': 'th',
|
"Thai": "th",
|
||||||
'Vietnamese': 'vi',
|
"Vietnamese": "vi",
|
||||||
'Chinese':'zh-CN',
|
"Chinese Simplified":"zh-CN",
|
||||||
|
"Chinese Traditional":"zh-TW",
|
||||||
}
|
}
|
||||||
|
|
||||||
translation_lang["Papago"] = {
|
translation_lang["Papago"] = {
|
||||||
@@ -270,105 +276,106 @@ translation_lang["Papago"] = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dict_ctranslate2_languages = {
|
dict_ctranslate2_languages = {
|
||||||
'English': 'en',
|
"English": "en",
|
||||||
'Chinese': 'zh',
|
"Chinese Simplified": "zh",
|
||||||
'German': 'de',
|
"Chinese Traditional":"zh",
|
||||||
'Spanish': 'es',
|
"German": "de",
|
||||||
'Russian': 'ru',
|
"Spanish": "es",
|
||||||
'Korean': 'ko',
|
"Russian": "ru",
|
||||||
'French': 'fr',
|
"Korean": "ko",
|
||||||
'Japanese': 'ja',
|
"French": "fr",
|
||||||
'Portuguese': 'pt',
|
"Japanese": "ja",
|
||||||
'Turkish': 'tr',
|
"Portuguese": "pt",
|
||||||
'Polish': 'pl',
|
"Turkish": "tr",
|
||||||
'Catalan': 'ca',
|
"Polish": "pl",
|
||||||
'Dutch': 'nl',
|
"Catalan": "ca",
|
||||||
'Arabic': 'ar',
|
"Dutch": "nl",
|
||||||
'Swedish': 'sv',
|
"Arabic": "ar",
|
||||||
'Italian': 'it',
|
"Swedish": "sv",
|
||||||
'Indonesian': 'id',
|
"Italian": "it",
|
||||||
'Hindi': 'hi',
|
"Indonesian": "id",
|
||||||
'Finnish': 'fi',
|
"Hindi": "hi",
|
||||||
'Vietnamese': 'vi',
|
"Finnish": "fi",
|
||||||
'Hebrew': 'he',
|
"Vietnamese": "vi",
|
||||||
'Ukrainian': 'uk',
|
"Hebrew": "he",
|
||||||
'Greek': 'el',
|
"Ukrainian": "uk",
|
||||||
'Malay': 'ms',
|
"Greek": "el",
|
||||||
'Czech': 'cs',
|
"Malay": "ms",
|
||||||
'Romanian': 'ro',
|
"Czech": "cs",
|
||||||
'Danish': 'da',
|
"Romanian": "ro",
|
||||||
'Hungarian': 'hu',
|
"Danish": "da",
|
||||||
'Tamil': 'ta',
|
"Hungarian": "hu",
|
||||||
'Norwegian': 'no',
|
"Tamil": "ta",
|
||||||
'Thai': 'th',
|
"Norwegian": "no",
|
||||||
'Urdu': 'ur',
|
"Thai": "th",
|
||||||
'Croatian': 'hr',
|
"Urdu": "ur",
|
||||||
'Bulgarian': 'bg',
|
"Croatian": "hr",
|
||||||
'Lithuanian': 'lt',
|
"Bulgarian": "bg",
|
||||||
'Latin': 'la',
|
"Lithuanian": "lt",
|
||||||
'Maori': 'mi',
|
"Latin": "la",
|
||||||
'Malayalam': 'ml',
|
"Maori": "mi",
|
||||||
'Welsh': 'cy',
|
"Malayalam": "ml",
|
||||||
'Slovak': 'sk',
|
"Welsh": "cy",
|
||||||
'Telugu': 'te',
|
"Slovak": "sk",
|
||||||
'Persian': 'fa',
|
"Telugu": "te",
|
||||||
'Latvian': 'lv',
|
"Persian": "fa",
|
||||||
'Bengali': 'bn',
|
"Latvian": "lv",
|
||||||
'Serbian': 'sr',
|
"Bengali": "bn",
|
||||||
'Azerbaijani': 'az',
|
"Serbian": "sr",
|
||||||
'Slovenian': 'sl',
|
"Azerbaijani": "az",
|
||||||
'Kannada': 'kn',
|
"Slovenian": "sl",
|
||||||
'Estonian': 'et',
|
"Kannada": "kn",
|
||||||
'Macedonian': 'mk',
|
"Estonian": "et",
|
||||||
'Breton': 'br',
|
"Macedonian": "mk",
|
||||||
'Basque': 'eu',
|
"Breton": "br",
|
||||||
'Icelandic': 'is',
|
"Basque": "eu",
|
||||||
'Armenian': 'hy',
|
"Icelandic": "is",
|
||||||
'Nepali': 'ne',
|
"Armenian": "hy",
|
||||||
'Mongolian': 'mn',
|
"Nepali": "ne",
|
||||||
'Bosnian': 'bs',
|
"Mongolian": "mn",
|
||||||
'Kazakh': 'kk',
|
"Bosnian": "bs",
|
||||||
'Albanian': 'sq',
|
"Kazakh": "kk",
|
||||||
'Swahili': 'sw',
|
"Albanian": "sq",
|
||||||
'Galician': 'gl',
|
"Swahili": "sw",
|
||||||
'Marathi': 'mr',
|
"Galician": "gl",
|
||||||
'Punjabi': 'pa',
|
"Marathi": "mr",
|
||||||
'Sinhala': 'si',
|
"Punjabi": "pa",
|
||||||
'Khmer': 'km',
|
"Sinhala": "si",
|
||||||
'Shona': 'sn',
|
"Khmer": "km",
|
||||||
'Yoruba': 'yo',
|
"Shona": "sn",
|
||||||
'Somali': 'so',
|
"Yoruba": "yo",
|
||||||
'Afrikaans': 'af',
|
"Somali": "so",
|
||||||
'Occitan': 'oc',
|
"Afrikaans": "af",
|
||||||
'Georgian': 'ka',
|
"Occitan": "oc",
|
||||||
'Belarusian': 'be',
|
"Georgian": "ka",
|
||||||
'Tajik': 'tg',
|
"Belarusian": "be",
|
||||||
'Sindhi': 'sd',
|
"Tajik": "tg",
|
||||||
'Gujarati': 'gu',
|
"Sindhi": "sd",
|
||||||
'Amharic': 'am',
|
"Gujarati": "gu",
|
||||||
'Yiddish': 'yi',
|
"Amharic": "am",
|
||||||
'Lao': 'lo',
|
"Yiddish": "yi",
|
||||||
'Uzbek': 'uz',
|
"Lao": "lo",
|
||||||
'Faroese': 'fo',
|
"Uzbek": "uz",
|
||||||
'Haitian creole': 'ht',
|
"Faroese": "fo",
|
||||||
'Pashto': 'ps',
|
"Haitian creole": "ht",
|
||||||
'Turkmen': 'tk',
|
"Pashto": "ps",
|
||||||
'Nynorsk': 'nn',
|
"Turkmen": "tk",
|
||||||
'Maltese': 'mt',
|
"Nynorsk": "nn",
|
||||||
'Sanskrit': 'sa',
|
"Maltese": "mt",
|
||||||
'Luxembourgish': 'lb',
|
"Sanskrit": "sa",
|
||||||
'Myanmar': 'my',
|
"Luxembourgish": "lb",
|
||||||
'Tibetan': 'bo',
|
"Myanmar": "my",
|
||||||
'Filipino': 'tl',
|
"Tibetan": "bo",
|
||||||
'Malagasy': 'mg',
|
"Filipino": "tl",
|
||||||
'Assamese': 'as',
|
"Malagasy": "mg",
|
||||||
'Tatar': 'tt',
|
"Assamese": "as",
|
||||||
'Hawaiian': 'haw',
|
"Tatar": "tt",
|
||||||
'Lingala': 'ln',
|
"Hawaiian": "haw",
|
||||||
'Hausa': 'ha',
|
"Lingala": "ln",
|
||||||
'Bashkir': 'ba',
|
"Hausa": "ha",
|
||||||
'Javanese': 'jw',
|
"Bashkir": "ba",
|
||||||
'Sundanese': 'su'
|
"Javanese": "jw",
|
||||||
|
"Sundanese": "su"
|
||||||
}
|
}
|
||||||
|
|
||||||
translation_lang["CTranslate2"] = {
|
translation_lang["CTranslate2"] = {
|
||||||
|
|||||||
72
view.py
72
view.py
@@ -80,8 +80,8 @@ class View():
|
|||||||
**common_args
|
**common_args
|
||||||
)
|
)
|
||||||
|
|
||||||
self.settings.error_message_window = SimpleNamespace(
|
self.settings.notification_message_window = SimpleNamespace(
|
||||||
uism=all_uism.error_message_window,
|
uism=all_uism.notification_message_window,
|
||||||
**common_args
|
**common_args
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -297,6 +297,8 @@ class View():
|
|||||||
CALLBACK_SET_DEEPL_AUTH_KEY=None,
|
CALLBACK_SET_DEEPL_AUTH_KEY=None,
|
||||||
VAR_DEEPL_AUTH_KEY=StringVar(value=config.AUTH_KEYS["DeepL_API"]),
|
VAR_DEEPL_AUTH_KEY=StringVar(value=config.AUTH_KEYS["DeepL_API"]),
|
||||||
VAR_OPEN_DEEPL_WEB_PAGE=StringVar(value=i18n.t( "config_window.deepl_auth_key.open_auth_key_webpage")),
|
VAR_OPEN_DEEPL_WEB_PAGE=StringVar(value=i18n.t( "config_window.deepl_auth_key.open_auth_key_webpage")),
|
||||||
|
CALLBACK_FOCUS_OUT_DEEPL_AUTH_KEY=self.callbackBindFocusOut_DeeplAuthKey,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Transcription Tab (Mic)
|
# Transcription Tab (Mic)
|
||||||
@@ -997,8 +999,8 @@ class View():
|
|||||||
def _clearTextBox(entry_widget):
|
def _clearTextBox(entry_widget):
|
||||||
entry_widget.delete("1.0", "end")
|
entry_widget.delete("1.0", "end")
|
||||||
|
|
||||||
def clearErrorMessage(self):
|
def clearNotificationMessage(self):
|
||||||
vrct_gui._clearErrorMessage()
|
vrct_gui._clearNotificationMessage()
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -1508,8 +1510,14 @@ class View():
|
|||||||
|
|
||||||
# Update GuiVariable (view_variable)
|
# Update GuiVariable (view_variable)
|
||||||
def updateGuiVariableByPresetTabNo(self, tab_no:str):
|
def updateGuiVariableByPresetTabNo(self, tab_no:str):
|
||||||
self.view_variable.VAR_YOUR_LANGUAGE.set(config.SELECTED_TAB_YOUR_LANGUAGES[tab_no])
|
select = config.SELECTED_TAB_YOUR_LANGUAGES[tab_no]
|
||||||
self.view_variable.VAR_TARGET_LANGUAGE.set(config.SELECTED_TAB_TARGET_LANGUAGES[tab_no])
|
your_language = select["language"]
|
||||||
|
your_country = select["country"]
|
||||||
|
self.view_variable.VAR_YOUR_LANGUAGE.set(f"{your_language}\n({your_country})")
|
||||||
|
select = config.SELECTED_TAB_TARGET_LANGUAGES[tab_no]
|
||||||
|
target_language = select["language"]
|
||||||
|
target_country = select["country"]
|
||||||
|
self.view_variable.VAR_TARGET_LANGUAGE.set(f"{target_language}\n({target_country})")
|
||||||
|
|
||||||
|
|
||||||
def updateList_selectableLanguages(self, new_selectable_language_list:list):
|
def updateList_selectableLanguages(self, new_selectable_language_list:list):
|
||||||
@@ -1651,11 +1659,15 @@ class View():
|
|||||||
|
|
||||||
|
|
||||||
def printToTextbox_selectedYourLanguages(self, selected_your_language):
|
def printToTextbox_selectedYourLanguages(self, selected_your_language):
|
||||||
your_language = selected_your_language.replace("\n", " ")
|
language = selected_your_language["language"]
|
||||||
|
country = selected_your_language["country"]
|
||||||
|
your_language = f"{language} ({country})"
|
||||||
self._printToTextbox_Info(i18n.t("main_window.textbox_system_message.selected_your_language", your_language=your_language))
|
self._printToTextbox_Info(i18n.t("main_window.textbox_system_message.selected_your_language", your_language=your_language))
|
||||||
|
|
||||||
def printToTextbox_selectedTargetLanguages(self, selected_target_language):
|
def printToTextbox_selectedTargetLanguages(self, selected_target_language):
|
||||||
target_language = selected_target_language.replace("\n", " ")
|
language = selected_target_language["language"]
|
||||||
|
country = selected_target_language["country"]
|
||||||
|
target_language = f"{language} ({country})"
|
||||||
self._printToTextbox_Info(i18n.t("main_window.textbox_system_message.selected_target_language", target_language=target_language))
|
self._printToTextbox_Info(i18n.t("main_window.textbox_system_message.selected_target_language", target_language=target_language))
|
||||||
|
|
||||||
def printToTextbox_changedLanguagePresetTab(self, tab_no:str):
|
def printToTextbox_changedLanguagePresetTab(self, tab_no:str):
|
||||||
@@ -1721,60 +1733,74 @@ class View():
|
|||||||
|
|
||||||
|
|
||||||
# Callback Bind FocusOut
|
# Callback Bind FocusOut
|
||||||
|
def callbackBindFocusOut_DeeplAuthKey(self, _e=None):
|
||||||
|
self.clearNotificationMessage()
|
||||||
|
|
||||||
def callbackBindFocusOut_MicEnergyThreshold(self, _e=None):
|
def callbackBindFocusOut_MicEnergyThreshold(self, _e=None):
|
||||||
self.setLatestConfigVariable("MicEnergyThreshold")
|
self.setLatestConfigVariable("MicEnergyThreshold")
|
||||||
self.clearErrorMessage()
|
self.clearNotificationMessage()
|
||||||
|
|
||||||
def callbackBindFocusOut_SpeakerEnergyThreshold(self, _e=None):
|
def callbackBindFocusOut_SpeakerEnergyThreshold(self, _e=None):
|
||||||
self.setLatestConfigVariable("SpeakerEnergyThreshold")
|
self.setLatestConfigVariable("SpeakerEnergyThreshold")
|
||||||
self.clearErrorMessage()
|
self.clearNotificationMessage()
|
||||||
|
|
||||||
|
|
||||||
def callbackBindFocusOut_MicRecordTimeout(self, _e=None):
|
def callbackBindFocusOut_MicRecordTimeout(self, _e=None):
|
||||||
self.setLatestConfigVariable("MicRecordTimeout")
|
self.setLatestConfigVariable("MicRecordTimeout")
|
||||||
self.clearErrorMessage()
|
self.clearNotificationMessage()
|
||||||
|
|
||||||
def callbackBindFocusOut_MicPhraseTimeout(self, _e=None):
|
def callbackBindFocusOut_MicPhraseTimeout(self, _e=None):
|
||||||
self.setLatestConfigVariable("MicPhraseTimeout")
|
self.setLatestConfigVariable("MicPhraseTimeout")
|
||||||
self.clearErrorMessage()
|
self.clearNotificationMessage()
|
||||||
|
|
||||||
def callbackBindFocusOut_MicMaxPhrases(self, _e=None):
|
def callbackBindFocusOut_MicMaxPhrases(self, _e=None):
|
||||||
self.setLatestConfigVariable("MicMaxPhrases")
|
self.setLatestConfigVariable("MicMaxPhrases")
|
||||||
self.clearErrorMessage()
|
self.clearNotificationMessage()
|
||||||
|
|
||||||
|
|
||||||
def callbackBindFocusOut_SpeakerRecordTimeout(self, _e=None):
|
def callbackBindFocusOut_SpeakerRecordTimeout(self, _e=None):
|
||||||
self.setLatestConfigVariable("SpeakerRecordTimeout")
|
self.setLatestConfigVariable("SpeakerRecordTimeout")
|
||||||
self.clearErrorMessage()
|
self.clearNotificationMessage()
|
||||||
|
|
||||||
def callbackBindFocusOut_SpeakerPhraseTimeout(self, _e=None):
|
def callbackBindFocusOut_SpeakerPhraseTimeout(self, _e=None):
|
||||||
self.setLatestConfigVariable("SpeakerPhraseTimeout")
|
self.setLatestConfigVariable("SpeakerPhraseTimeout")
|
||||||
self.clearErrorMessage()
|
self.clearNotificationMessage()
|
||||||
|
|
||||||
def callbackBindFocusOut_SpeakerMaxPhrases(self, _e=None):
|
def callbackBindFocusOut_SpeakerMaxPhrases(self, _e=None):
|
||||||
self.setLatestConfigVariable("SpeakerMaxPhrases")
|
self.setLatestConfigVariable("SpeakerMaxPhrases")
|
||||||
self.clearErrorMessage()
|
self.clearNotificationMessage()
|
||||||
|
|
||||||
|
|
||||||
def callbackBindFocusOut_SendMessageFormat(self, _e=None):
|
def callbackBindFocusOut_SendMessageFormat(self, _e=None):
|
||||||
self.setLatestConfigVariable("SendMessageFormat")
|
self.setLatestConfigVariable("SendMessageFormat")
|
||||||
self.clearErrorMessage()
|
self.clearNotificationMessage()
|
||||||
|
|
||||||
def callbackBindFocusOut_SendMessageFormatWithT(self, _e=None):
|
def callbackBindFocusOut_SendMessageFormatWithT(self, _e=None):
|
||||||
self.setLatestConfigVariable("SendMessageFormatWithT")
|
self.setLatestConfigVariable("SendMessageFormatWithT")
|
||||||
self.clearErrorMessage()
|
self.clearNotificationMessage()
|
||||||
|
|
||||||
def callbackBindFocusOut_ReceivedMessageFormat(self, _e=None):
|
def callbackBindFocusOut_ReceivedMessageFormat(self, _e=None):
|
||||||
self.setLatestConfigVariable("ReceivedMessageFormat")
|
self.setLatestConfigVariable("ReceivedMessageFormat")
|
||||||
self.clearErrorMessage()
|
self.clearNotificationMessage()
|
||||||
|
|
||||||
def callbackBindFocusOut_ReceivedMessageFormatWithT(self, _e=None):
|
def callbackBindFocusOut_ReceivedMessageFormatWithT(self, _e=None):
|
||||||
self.setLatestConfigVariable("ReceivedMessageFormatWithT")
|
self.setLatestConfigVariable("ReceivedMessageFormatWithT")
|
||||||
self.clearErrorMessage()
|
self.clearNotificationMessage()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Show Error Message (Config Window)
|
# Show Notification Message (Config Window)
|
||||||
|
def showSuccessMessage_DeeplAuthKey(self):
|
||||||
|
self._showSuccessMessage(
|
||||||
|
vrct_gui.config_window.sb__entry_deepl_auth_key,
|
||||||
|
i18n.t("config_window.deepl_auth_key.auth_key_success")
|
||||||
|
)
|
||||||
|
def showErrorMessage_DeeplAuthKey(self):
|
||||||
|
self._showErrorMessage(
|
||||||
|
vrct_gui.config_window.sb__entry_deepl_auth_key,
|
||||||
|
i18n.t("config_window.deepl_auth_key.auth_key_error")
|
||||||
|
)
|
||||||
|
|
||||||
def showErrorMessage_MicEnergyThreshold(self):
|
def showErrorMessage_MicEnergyThreshold(self):
|
||||||
self._showErrorMessage(
|
self._showErrorMessage(
|
||||||
vrct_gui.config_window.sb__progressbar_x_slider__entry_mic_energy_threshold,
|
vrct_gui.config_window.sb__progressbar_x_slider__entry_mic_energy_threshold,
|
||||||
@@ -1881,6 +1907,10 @@ class View():
|
|||||||
def _makeInvalidValueErrorMessage(error_message):
|
def _makeInvalidValueErrorMessage(error_message):
|
||||||
return i18n.t("config_window.common_error_message.invalid_value") + "\n" + error_message
|
return i18n.t("config_window.common_error_message.invalid_value") + "\n" + error_message
|
||||||
|
|
||||||
|
def _showSuccessMessage(self, target_widget, message):
|
||||||
|
self.view_variable.VAR_ERROR_MESSAGE.set(message)
|
||||||
|
vrct_gui._showSuccessMessage(target_widget=target_widget)
|
||||||
|
|
||||||
def _showErrorMessage(self, target_widget, message):
|
def _showErrorMessage(self, target_widget, message):
|
||||||
self.view_variable.VAR_ERROR_MESSAGE.set(message)
|
self.view_variable.VAR_ERROR_MESSAGE.set(message)
|
||||||
vrct_gui._showErrorMessage(target_widget=target_widget)
|
vrct_gui._showErrorMessage(target_widget=target_widget)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ from .ui_utils import getLatestWidth, getLatestHeight
|
|||||||
from utils import isEven
|
from utils import isEven
|
||||||
|
|
||||||
|
|
||||||
class _CreateErrorWindow(CTkToplevel):
|
class _CreateNotificationWindow(CTkToplevel):
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
settings,
|
settings,
|
||||||
@@ -16,7 +16,8 @@ class _CreateErrorWindow(CTkToplevel):
|
|||||||
message_ipady,
|
message_ipady,
|
||||||
message_font_size,
|
message_font_size,
|
||||||
|
|
||||||
message_bg_color,
|
error_message_bg_color,
|
||||||
|
success_message_bg_color,
|
||||||
message_text_color,
|
message_text_color,
|
||||||
):
|
):
|
||||||
|
|
||||||
@@ -34,7 +35,8 @@ class _CreateErrorWindow(CTkToplevel):
|
|||||||
self.message_ipady = message_ipady
|
self.message_ipady = message_ipady
|
||||||
self.message_font_size = message_font_size
|
self.message_font_size = message_font_size
|
||||||
|
|
||||||
self.message_bg_color = message_bg_color
|
self.error_message_bg_color = error_message_bg_color
|
||||||
|
self.success_message_bg_color = success_message_bg_color
|
||||||
self.message_text_color = message_text_color
|
self.message_text_color = message_text_color
|
||||||
|
|
||||||
|
|
||||||
@@ -51,20 +53,16 @@ class _CreateErrorWindow(CTkToplevel):
|
|||||||
self.wm_attributes("-alpha", 0)
|
self.wm_attributes("-alpha", 0)
|
||||||
self.wm_attributes("-toolwindow", True)
|
self.wm_attributes("-toolwindow", True)
|
||||||
|
|
||||||
self.configure(fg_color=self.message_bg_color)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
self.grid_rowconfigure(0,weight=1)
|
self.grid_rowconfigure(0,weight=1)
|
||||||
self.grid_columnconfigure(0,weight=1)
|
self.grid_columnconfigure(0,weight=1)
|
||||||
|
|
||||||
self.error_message_container = CTkFrame(self, corner_radius=0, fg_color=self.message_bg_color, width=0, height=0)
|
self.notification_message_container = CTkFrame(self, corner_radius=0, width=0, height=0)
|
||||||
self.error_message_container.grid(row=0, column=0, sticky="nsew")
|
self.notification_message_container.grid(row=0, column=0, sticky="nsew")
|
||||||
|
|
||||||
|
|
||||||
self.error_message_container_label_wrapper = CTkLabel(
|
self.notification_message_container_label_wrapper = CTkLabel(
|
||||||
self.error_message_container,
|
self.notification_message_container,
|
||||||
# text=message,
|
# text=message,
|
||||||
textvariable=self._view_variable.VAR_ERROR_MESSAGE,
|
textvariable=self._view_variable.VAR_ERROR_MESSAGE,
|
||||||
height=0,
|
height=0,
|
||||||
@@ -74,12 +72,19 @@ class _CreateErrorWindow(CTkToplevel):
|
|||||||
justify="left",
|
justify="left",
|
||||||
text_color=self.message_text_color,
|
text_color=self.message_text_color,
|
||||||
)
|
)
|
||||||
self.error_message_container_label_wrapper.grid(row=0, column=0, padx=self.message_ipadx, pady=self.message_ipady, sticky="nsew")
|
self.notification_message_container_label_wrapper.grid(row=0, column=0, padx=self.message_ipadx, pady=self.message_ipady, sticky="nsew")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def show(self, target_widget):
|
def show(self, target_widget, message_type):
|
||||||
|
if message_type == "Error":
|
||||||
|
self.notification_message_container.configure(fg_color=self.error_message_bg_color)
|
||||||
|
elif message_type == "Success":
|
||||||
|
self.notification_message_container.configure(fg_color=self.success_message_bg_color)
|
||||||
|
else:
|
||||||
|
raise ValueError("message_type is not selected")
|
||||||
|
|
||||||
if self.hide is False:
|
if self.hide is False:
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -92,22 +97,23 @@ class _CreateErrorWindow(CTkToplevel):
|
|||||||
|
|
||||||
self.hide = False
|
self.hide = False
|
||||||
|
|
||||||
label_width = getLatestWidth(self.error_message_container_label_wrapper)
|
label_width = getLatestWidth(self.notification_message_container_label_wrapper)
|
||||||
label_height = getLatestHeight(self.error_message_container_label_wrapper)
|
label_height = getLatestHeight(self.notification_message_container_label_wrapper)
|
||||||
|
|
||||||
# for fixing 1px bug
|
# for fixing 1px bug
|
||||||
if isEven(label_width) is False:
|
if isEven(label_width) is False:
|
||||||
self.error_message_container_label_wrapper.grid(padx=(self.message_ipadx[0], self.message_ipadx[1]-1))
|
self.notification_message_container_label_wrapper.grid(padx=(self.message_ipadx[0], self.message_ipadx[1]-1))
|
||||||
else:
|
else:
|
||||||
self.error_message_container_label_wrapper.grid(padx=self.message_ipadx)
|
self.notification_message_container_label_wrapper.grid(padx=self.message_ipadx)
|
||||||
|
|
||||||
# for fixing 1px bug
|
# for fixing 1px bug
|
||||||
if isEven(label_height) is False:
|
if isEven(label_height) is False:
|
||||||
self.error_message_container_label_wrapper.grid(pady=(self.message_ipady[0], self.message_ipady[1]-1))
|
self.notification_message_container_label_wrapper.grid(pady=(self.message_ipady[0], self.message_ipady[1]-1))
|
||||||
else:
|
else:
|
||||||
self.error_message_container_label_wrapper.grid(pady=self.message_ipady)
|
self.notification_message_container_label_wrapper.grid(pady=self.message_ipady)
|
||||||
|
|
||||||
|
|
||||||
|
# First show animation
|
||||||
for i in range(0,101,20):
|
for i in range(0,101,20):
|
||||||
if not self.winfo_exists():
|
if not self.winfo_exists():
|
||||||
break
|
break
|
||||||
@@ -117,12 +123,14 @@ class _CreateErrorWindow(CTkToplevel):
|
|||||||
|
|
||||||
sleep(0.1)
|
sleep(0.1)
|
||||||
|
|
||||||
for i in range(0,91,10):
|
# Blink animation
|
||||||
if not self.winfo_exists():
|
if message_type == "Error":
|
||||||
break
|
for i in range(0,91,10):
|
||||||
self.attributes("-alpha", i/100)
|
if not self.winfo_exists():
|
||||||
self.update()
|
break
|
||||||
sleep(1/80)
|
self.attributes("-alpha", i/100)
|
||||||
|
self.update()
|
||||||
|
sleep(1/80)
|
||||||
|
|
||||||
|
|
||||||
def _withdraw(self, e=None):
|
def _withdraw(self, e=None):
|
||||||
@@ -49,6 +49,14 @@ class _CreateSelectableLanguagesWindow(CTkToplevel):
|
|||||||
|
|
||||||
|
|
||||||
def callbackSelectableLanguages(self, value, _e):
|
def callbackSelectableLanguages(self, value, _e):
|
||||||
|
language = value["language"]
|
||||||
|
country = value["country"]
|
||||||
|
callback_value = {
|
||||||
|
"language" : language,
|
||||||
|
"country" : country,
|
||||||
|
}
|
||||||
|
set_value = f"{language}\n({country})"
|
||||||
|
|
||||||
if self.selectable_language_window_type == "your_language":
|
if self.selectable_language_window_type == "your_language":
|
||||||
callback = self._view_variable.CALLBACK_SELECTED_YOUR_LANGUAGE
|
callback = self._view_variable.CALLBACK_SELECTED_YOUR_LANGUAGE
|
||||||
target_variable = self._view_variable.VAR_YOUR_LANGUAGE
|
target_variable = self._view_variable.VAR_YOUR_LANGUAGE
|
||||||
@@ -56,8 +64,8 @@ class _CreateSelectableLanguagesWindow(CTkToplevel):
|
|||||||
callback = self._view_variable.CALLBACK_SELECTED_TARGET_LANGUAGE
|
callback = self._view_variable.CALLBACK_SELECTED_TARGET_LANGUAGE
|
||||||
target_variable = self._view_variable.VAR_TARGET_LANGUAGE
|
target_variable = self._view_variable.VAR_TARGET_LANGUAGE
|
||||||
|
|
||||||
target_variable.set(value)
|
target_variable.set(set_value)
|
||||||
callFunctionIfCallable(callback, value)
|
callFunctionIfCallable(callback, callback_value)
|
||||||
self.vrct_gui._closeSelectableLanguagesWindow()
|
self.vrct_gui._closeSelectableLanguagesWindow()
|
||||||
|
|
||||||
|
|
||||||
@@ -135,7 +143,7 @@ class _CreateSelectableLanguagesWindow(CTkToplevel):
|
|||||||
max_row+=1
|
max_row+=1
|
||||||
row=0
|
row=0
|
||||||
column=0
|
column=0
|
||||||
for selectable_language_name in self._view_variable.LIST_SELECTABLE_LANGUAGES:
|
for selectable_language_dict in self._view_variable.LIST_SELECTABLE_LANGUAGES:
|
||||||
|
|
||||||
self.wrapper = CTkFrame(self.container, corner_radius=0, fg_color=self.settings.ctm.LANGUAGE_BUTTON_BG_COLOR, width=0, height=0, cursor="hand2")
|
self.wrapper = CTkFrame(self.container, corner_radius=0, fg_color=self.settings.ctm.LANGUAGE_BUTTON_BG_COLOR, width=0, height=0, cursor="hand2")
|
||||||
self.wrapper.grid(row=row, column=column, sticky="nsew")
|
self.wrapper.grid(row=row, column=column, sticky="nsew")
|
||||||
@@ -144,10 +152,9 @@ class _CreateSelectableLanguagesWindow(CTkToplevel):
|
|||||||
|
|
||||||
|
|
||||||
self.wrapper.grid_rowconfigure((0,2), weight=1)
|
self.wrapper.grid_rowconfigure((0,2), weight=1)
|
||||||
selectable_language_name_for_text = selectable_language_name.replace("\n", " ")
|
|
||||||
label_widget = CTkLabel(
|
label_widget = CTkLabel(
|
||||||
self.wrapper,
|
self.wrapper,
|
||||||
text=selectable_language_name_for_text,
|
text=f"{selectable_language_dict['language']} ({selectable_language_dict['country']})",
|
||||||
height=0,
|
height=0,
|
||||||
corner_radius=0,
|
corner_radius=0,
|
||||||
font=CTkFont(family=self.settings.FONT_FAMILY, size=self.settings.uism.VALUES_TEXT_FONT_SIZE, weight="normal"),
|
font=CTkFont(family=self.settings.FONT_FAMILY, size=self.settings.uism.VALUES_TEXT_FONT_SIZE, weight="normal"),
|
||||||
@@ -164,7 +171,7 @@ class _CreateSelectableLanguagesWindow(CTkToplevel):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
callback = partial(self.callbackSelectableLanguages, selectable_language_name)
|
callback = partial(self.callbackSelectableLanguages, selectable_language_dict)
|
||||||
bindButtonReleaseFunction([self.wrapper, label_widget], callback)
|
bindButtonReleaseFunction([self.wrapper, label_widget], callback)
|
||||||
|
|
||||||
if row == max_row:
|
if row == max_row:
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ def createSettingBox_Translation(setting_box_wrapper, config_window, settings, v
|
|||||||
entry_attr_name="sb__entry_deepl_auth_key",
|
entry_attr_name="sb__entry_deepl_auth_key",
|
||||||
entry_width=settings.uism.RESPONSIVE_UI_SIZE_INT_300,
|
entry_width=settings.uism.RESPONSIVE_UI_SIZE_INT_300,
|
||||||
entry_bind__Any_KeyRelease=lambda value: deeplAuthKeyCallback(value),
|
entry_bind__Any_KeyRelease=lambda value: deeplAuthKeyCallback(value),
|
||||||
|
entry_bind__FocusOut=view_variable.CALLBACK_FOCUS_OUT_DEEPL_AUTH_KEY,
|
||||||
entry_textvariable=view_variable.VAR_DEEPL_AUTH_KEY,
|
entry_textvariable=view_variable.VAR_DEEPL_AUTH_KEY,
|
||||||
open_authkey_page_command=lambda _e: callFunctionIfCallable(view_variable.CALLBACK_OPEN_WEBPAGE_DEEPL_AUTH_KEY),
|
open_authkey_page_command=lambda _e: callFunctionIfCallable(view_variable.CALLBACK_OPEN_WEBPAGE_DEEPL_AUTH_KEY),
|
||||||
open_authkey_text_variable=view_variable.VAR_OPEN_DEEPL_WEB_PAGE,
|
open_authkey_text_variable=view_variable.VAR_OPEN_DEEPL_WEB_PAGE,
|
||||||
|
|||||||
@@ -356,7 +356,6 @@ def createSidebarLanguagesSettings(settings, main_window, view_variable):
|
|||||||
command=adjustedCommand,
|
command=adjustedCommand,
|
||||||
wrapper_widget=main_window,
|
wrapper_widget=main_window,
|
||||||
attach_widget=main_window.sls__box_translation_optionmenu_wrapper,
|
attach_widget=main_window.sls__box_translation_optionmenu_wrapper,
|
||||||
dropdown_menu_min_width=settings.uism.SIDEBAR_MIN_WIDTH,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
(sls__selected_translation_engine_box, label_button_label_widget) = createLabelButton(
|
(sls__selected_translation_engine_box, label_button_label_widget) = createLabelButton(
|
||||||
|
|||||||
@@ -294,6 +294,7 @@ def _darkTheme(base_color):
|
|||||||
# Error Message Window for Config Window
|
# Error Message Window for Config Window
|
||||||
# The color code [#bb4448] is a mixture of [#a9555c] and [#cc3333] (for a redder shade).
|
# The color code [#bb4448] is a mixture of [#a9555c] and [#cc3333] (for a redder shade).
|
||||||
SB__ERROR_MESSAGE_BG_COLOR = "#bb4448",
|
SB__ERROR_MESSAGE_BG_COLOR = "#bb4448",
|
||||||
|
SB__SUCCESS_MESSAGE_BG_COLOR = "#368777",
|
||||||
SB__ERROR_MESSAGE_TEXT_COLOR = "#fff",
|
SB__ERROR_MESSAGE_TEXT_COLOR = "#fff",
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|||||||
@@ -288,6 +288,7 @@ def _lightTheme(base_color):
|
|||||||
# Error Message Window for Config Window
|
# Error Message Window for Config Window
|
||||||
# Check DarkTheme's this part. Based on the color bb4448, used to source, and pick up the number 600 by the generator (https://m2.material.io/design/color/the-color-system.html#tools-for-picking-colors)
|
# Check DarkTheme's this part. Based on the color bb4448, used to source, and pick up the number 600 by the generator (https://m2.material.io/design/color/the-color-system.html#tools-for-picking-colors)
|
||||||
SB__ERROR_MESSAGE_BG_COLOR = "#cd4c4f",
|
SB__ERROR_MESSAGE_BG_COLOR = "#cd4c4f",
|
||||||
|
SB__SUCCESS_MESSAGE_BG_COLOR = "#cd4c4f",
|
||||||
SB__ERROR_MESSAGE_TEXT_COLOR = "#fff",
|
SB__ERROR_MESSAGE_TEXT_COLOR = "#fff",
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class UiScalingManager():
|
|||||||
self.config_window = SimpleNamespace()
|
self.config_window = SimpleNamespace()
|
||||||
self.selectable_language_window = SimpleNamespace()
|
self.selectable_language_window = SimpleNamespace()
|
||||||
self.main_window_cover = SimpleNamespace()
|
self.main_window_cover = SimpleNamespace()
|
||||||
self.error_message_window = SimpleNamespace()
|
self.notification_message_window = SimpleNamespace()
|
||||||
self.confirmation_modal = SimpleNamespace()
|
self.confirmation_modal = SimpleNamespace()
|
||||||
self.dropdown_menu_window = SimpleNamespace()
|
self.dropdown_menu_window = SimpleNamespace()
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from customtkinter import CTk, CTkImage
|
|||||||
from ._CreateSelectableLanguagesWindow import _CreateSelectableLanguagesWindow
|
from ._CreateSelectableLanguagesWindow import _CreateSelectableLanguagesWindow
|
||||||
|
|
||||||
from ._CreateWindowCover import _CreateWindowCover
|
from ._CreateWindowCover import _CreateWindowCover
|
||||||
from ._CreateErrorWindow import _CreateErrorWindow
|
from ._CreateNotificationWindow import _CreateNotificationWindow
|
||||||
from ._CreateDropdownMenuWindow import _CreateDropdownMenuWindow
|
from ._CreateDropdownMenuWindow import _CreateDropdownMenuWindow
|
||||||
from ._changeMainWindowWidgetsStatus import _changeMainWindowWidgetsStatus
|
from ._changeMainWindowWidgetsStatus import _changeMainWindowWidgetsStatus
|
||||||
from ._changeConfigWindowWidgetsStatus import _changeConfigWindowWidgetsStatus
|
from ._changeConfigWindowWidgetsStatus import _changeConfigWindowWidgetsStatus
|
||||||
@@ -140,8 +140,8 @@ class VRCT_GUI(CTk):
|
|||||||
view_variable=self._view_variable
|
view_variable=self._view_variable
|
||||||
)
|
)
|
||||||
|
|
||||||
self.error_message_window = _CreateErrorWindow(
|
self.notification_message_window = _CreateNotificationWindow(
|
||||||
settings=self.settings.error_message_window,
|
settings=self.settings.notification_message_window,
|
||||||
view_variable=self._view_variable,
|
view_variable=self._view_variable,
|
||||||
wrapper_widget=self.config_window.main_bg_container,
|
wrapper_widget=self.config_window.main_bg_container,
|
||||||
|
|
||||||
@@ -149,7 +149,8 @@ class VRCT_GUI(CTk):
|
|||||||
message_ipady=self.settings.config_window.uism.SB__ERROR_MESSAGE_IPADY,
|
message_ipady=self.settings.config_window.uism.SB__ERROR_MESSAGE_IPADY,
|
||||||
message_font_size=self.settings.config_window.uism.SB__ERROR_MESSAGE_FONT_SIZE,
|
message_font_size=self.settings.config_window.uism.SB__ERROR_MESSAGE_FONT_SIZE,
|
||||||
|
|
||||||
message_bg_color=self.settings.config_window.ctm.SB__ERROR_MESSAGE_BG_COLOR,
|
error_message_bg_color=self.settings.config_window.ctm.SB__ERROR_MESSAGE_BG_COLOR,
|
||||||
|
success_message_bg_color=self.settings.config_window.ctm.SB__SUCCESS_MESSAGE_BG_COLOR,
|
||||||
message_text_color=self.settings.config_window.ctm.SB__ERROR_MESSAGE_TEXT_COLOR,
|
message_text_color=self.settings.config_window.ctm.SB__ERROR_MESSAGE_TEXT_COLOR,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -298,11 +299,14 @@ class VRCT_GUI(CTk):
|
|||||||
|
|
||||||
|
|
||||||
def _showErrorMessage(self, target_widget):
|
def _showErrorMessage(self, target_widget):
|
||||||
self.error_message_window.show(target_widget=target_widget)
|
self.notification_message_window.show(target_widget=target_widget, message_type="Error")
|
||||||
|
|
||||||
def _clearErrorMessage(self):
|
def _showSuccessMessage(self, target_widget):
|
||||||
|
self.notification_message_window.show(target_widget=target_widget, message_type="Success")
|
||||||
|
|
||||||
|
def _clearNotificationMessage(self):
|
||||||
try:
|
try:
|
||||||
self.error_message_window._withdraw()
|
self.notification_message_window._withdraw()
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user