From 6ad24e68ed6f8917322057137e5abd34a4bcf58f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 27 Feb 2023 21:08:08 +0300 Subject: =?UTF-8?q?fixes=20#3350=20(VoiceService:=20=D0=BD=D0=B5=20=D0=BF?= =?UTF-8?q?=D0=B5=D1=80=D0=B5=D0=B2=D0=BE=D0=B4=D1=8F=D1=82=D1=81=D1=8F=20?= =?UTF-8?q?=D1=81=D1=82=D1=80=D0=BE=D0=BA=D0=B8=20=D0=B2=20=D0=BE=D0=BA?= =?UTF-8?q?=D0=BD=D0=B5=20=D0=B7=D0=B2=D0=BE=D0=BD=D0=BA=D0=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/VoiceService/src/VoiceCall.cpp | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'plugins/VoiceService/src') 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(); } -- cgit v1.2.3