FIX: optimize liveview long error text
Change-Id: I81ec9a3135985bd47005dd04d49b94a7831c1e41 Jira: none
This commit is contained in:
parent
3b440aed25
commit
a9fea1096f
|
@ -121,11 +121,15 @@ MediaPlayCtrl::~MediaPlayCtrl()
|
||||||
|
|
||||||
wxString hide_id_middle_string(wxString const &str, size_t offset = 0, size_t length = -1)
|
wxString hide_id_middle_string(wxString const &str, size_t offset = 0, size_t length = -1)
|
||||||
{
|
{
|
||||||
|
#if BBL_RELEASE_TO_PUBLIC
|
||||||
if (length == size_t(-1))
|
if (length == size_t(-1))
|
||||||
length = str.Length() - offset;
|
length = str.Length() - offset;
|
||||||
if (length <= 8)
|
if (length <= 8)
|
||||||
return str;
|
return str;
|
||||||
return str.Left(offset + 4) + wxString(length - 8, '*') + str.Mid(offset + length - 4);
|
return str.Left(offset + 4) + wxString(length - 8, '*') + str.Mid(offset + length - 4);
|
||||||
|
#else
|
||||||
|
return str;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void MediaPlayCtrl::SetMachineObject(MachineObject* obj)
|
void MediaPlayCtrl::SetMachineObject(MachineObject* obj)
|
||||||
|
@ -185,6 +189,7 @@ void MediaPlayCtrl::SetAutoRetry(bool b)
|
||||||
|
|
||||||
wxString hide_passwd(wxString url, std::vector<wxString> const &passwords)
|
wxString hide_passwd(wxString url, std::vector<wxString> const &passwords)
|
||||||
{
|
{
|
||||||
|
#if BBL_RELEASE_TO_PUBLIC
|
||||||
for (auto &p : passwords) {
|
for (auto &p : passwords) {
|
||||||
auto i = url.find(p);
|
auto i = url.find(p);
|
||||||
if (i == wxString::npos)
|
if (i == wxString::npos)
|
||||||
|
@ -199,6 +204,7 @@ wxString hide_passwd(wxString url, std::vector<wxString> const &passwords)
|
||||||
if (j == url.length() || url[j] == '@' || url[j] == '&')
|
if (j == url.length() || url[j] == '@' || url[j] == '&')
|
||||||
url.replace(i, l, l, wxUniChar('*'));
|
url.replace(i, l, l, wxUniChar('*'));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,6 +276,7 @@ void MediaPlayCtrl::Play()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_label_stat->SetLabel({});
|
||||||
SetStatus(_L("Initializing..."));
|
SetStatus(_L("Initializing..."));
|
||||||
|
|
||||||
if (agent) {
|
if (agent) {
|
||||||
|
@ -279,7 +286,7 @@ void MediaPlayCtrl::Play()
|
||||||
url += "&version=" + v;
|
url += "&version=" + v;
|
||||||
url += "&dev_ver=" + dv;
|
url += "&dev_ver=" + dv;
|
||||||
}
|
}
|
||||||
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl: " << hide_id_middle_string(hide_passwd(url, {"authkey=", "passwd="}), 9, 20);
|
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl: " << hide_id_middle_string(hide_passwd(url, {"authkey=", "passwd="}), 9, 20) << "tutk_state: " << m_tutk_state;
|
||||||
CallAfter([this, m, url] {
|
CallAfter([this, m, url] {
|
||||||
if (m != m_machine) {
|
if (m != m_machine) {
|
||||||
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl drop late ttcode for machine: " << m;
|
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl drop late ttcode for machine: " << m;
|
||||||
|
@ -348,8 +355,11 @@ void MediaPlayCtrl::Stop(wxString const &msg)
|
||||||
j["failed_retry"] = m_failed_retry;
|
j["failed_retry"] = m_failed_retry;
|
||||||
j["tunnel"] = remote ? "remote" : "local";
|
j["tunnel"] = remote ? "remote" : "local";
|
||||||
j["code"] = m_failed_code;
|
j["code"] = m_failed_code;
|
||||||
if (remote)
|
if (remote) {
|
||||||
|
if (m_url.size() > 30)
|
||||||
|
j["tutk_id"] = m_url.substr(9, 20).c_str();
|
||||||
j["tutk_state"] = m_tutk_state;
|
j["tutk_state"] = m_tutk_state;
|
||||||
|
}
|
||||||
j["msg"] = into_u8(msg);
|
j["msg"] = into_u8(msg);
|
||||||
NetworkAgent *agent = wxGetApp().getAgent();
|
NetworkAgent *agent = wxGetApp().getAgent();
|
||||||
if (agent)
|
if (agent)
|
||||||
|
@ -563,13 +573,14 @@ void MediaPlayCtrl::SetStatus(wxString const &msg2, bool hyperlink)
|
||||||
m_last_state + MEDIASTATE_BUFFERING - MEDIASTATE_IDLE;
|
m_last_state + MEDIASTATE_BUFFERING - MEDIASTATE_IDLE;
|
||||||
msg += wxString::Format(" [%d:%d]", state2, m_failed_code);
|
msg += wxString::Format(" [%d:%d]", state2, m_failed_code);
|
||||||
}
|
}
|
||||||
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl::SetStatus: " << msg.ToUTF8().data();
|
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl::SetStatus: " << msg.ToUTF8().data() << m_tutk_state;
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
OutputDebugStringA("MediaPlayCtrl::SetStatus: ");
|
OutputDebugStringA("MediaPlayCtrl::SetStatus: ");
|
||||||
OutputDebugStringA(msg.ToUTF8().data());
|
OutputDebugStringA(msg.ToUTF8().data());
|
||||||
OutputDebugStringA("\n");
|
OutputDebugStringA("\n");
|
||||||
#endif // __WXMSW__
|
#endif // __WXMSW__
|
||||||
m_label_status->SetLabel(msg);
|
m_label_status->SetLabel(msg);
|
||||||
|
m_label_status->Wrap(GetSize().GetWidth() - 120);
|
||||||
long style = m_label_status->GetWindowStyle() & ~LB_HYPERLINK;
|
long style = m_label_status->GetWindowStyle() & ~LB_HYPERLINK;
|
||||||
if (hyperlink) {
|
if (hyperlink) {
|
||||||
style |= LB_HYPERLINK;
|
style |= LB_HYPERLINK;
|
||||||
|
|
Loading…
Reference in New Issue