diff options
author | George Hazan <ghazan@miranda.im> | 2023-02-27 21:08:08 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2023-02-27 21:08:08 +0300 |
commit | 6ad24e68ed6f8917322057137e5abd34a4bcf58f (patch) | |
tree | e4669b300db73291bdefddb547539ea4eb0e712b /plugins/VoiceService/src | |
parent | e4c5a1ea23300d53ab34b14ed1ed47187f700074 (diff) |
fixes #3350 (VoiceService: не переводятся строки в окне звонка)
Diffstat (limited to 'plugins/VoiceService/src')
-rw-r--r-- | plugins/VoiceService/src/VoiceCall.cpp | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/plugins/VoiceService/src/VoiceCall.cpp b/plugins/VoiceService/src/VoiceCall.cpp index 221aebedb6..0f3e88089f 100644 --- a/plugins/VoiceService/src/VoiceCall.cpp +++ b/plugins/VoiceService/src/VoiceCall.cpp @@ -35,12 +35,12 @@ struct { wchar_t *btn2text; } static stateTexts[NUM_STATES] = { - { L"0:00", LPGENW("Hold"), LPGENW("Drop") }, + { L"0:00", LPGENW("Hold"), LPGENW("Drop") }, { LPGENW("Ringing"), LPGENW("Answer"), LPGENW("Drop") }, - { LPGENW("Calling"), nullptr, LPGENW("Drop") }, + { LPGENW("Calling"), nullptr, LPGENW("Drop") }, { LPGENW("Holded"), LPGENW("Resume"), LPGENW("Drop") }, - { nullptr, nullptr, LPGENW("Close") }, - { LPGENW("Callee is busy"), nullptr, LPGENW("Close") }, + { nullptr, nullptr, LPGENW("Close") }, + { LPGENW("Callee is busy"), nullptr, LPGENW("Close") }, { LPGENW("Ready"), LPGENW("Call"), LPGENW("Cancel") }, }; @@ -236,23 +236,21 @@ void VoiceCall::SetState(int aState) Show(); break; } - - if(stateTexts[state].status) - m_lblStatus.SetText(stateTexts[state].status); - if(stateTexts[state].btn1text) - m_btnAnswer.SetText(stateTexts[state].btn1text); - m_btnDrop.SetText(stateTexts[state].btn2text); - m_btnAnswer.Enable(state == VOICE_STATE_TALKING ? CanHold() : (bool)stateTexts[state].btn1text); + auto &ST = stateTexts[state]; + if (ST.status) + m_lblStatus.SetText(TranslateW(ST.status)); + if (ST.btn1text) + m_btnAnswer.SetText(TranslateW(ST.btn1text)); + m_btnDrop.SetText(TranslateW(ST.btn2text)); + + m_btnAnswer.Enable(state == VOICE_STATE_TALKING ? CanHold() : (bool)ST.btn1text); if (state != VOICE_STATE_ON_HOLD) m_nsec = 0; - if (IsFinished()) { - // Remove id because providers can re-use them - mir_free(id); - id = NULL; - } + if (IsFinished()) // Remove id because providers can re-use them + replaceStr(id, 0); Notify(); } |