| 73 | } |
| 74 | |
| 75 | bool CClientDetailDialog::OnInitDialog() { |
| 76 | // Username, Userhash |
| 77 | if (!m_client.GetUserName().IsEmpty()) { |
| 78 | CastChild(ID_DNAME, wxStaticText)->SetLabel( |
| 79 | m_client.GetUserName()); |
| 80 | // if we have client name we have userhash |
| 81 | wxASSERT(!m_client.GetUserHash().IsEmpty()); |
| 82 | CastChild(ID_DHASH, wxStaticText)->SetLabel( |
| 83 | m_client.GetUserHash().Encode()); |
| 84 | } else { |
| 85 | CastChild(ID_DNAME, wxStaticText)->SetLabel(_("Unknown")); |
| 86 | CastChild(ID_DHASH, wxStaticText)->SetLabel(_("Unknown")); |
| 87 | } |
| 88 | |
| 89 | // Client Software |
| 90 | wxString OSInfo = m_client.GetClientOSInfo(); |
| 91 | if (!OSInfo.IsEmpty()) { |
| 92 | CastChild(ID_DSOFT, wxStaticText)->SetLabel( |
| 93 | m_client.GetSoftStr()+" ("+OSInfo+")"); |
| 94 | } else { |
| 95 | CastChild(ID_DSOFT, wxStaticText)->SetLabel( |
| 96 | m_client.GetSoftStr()); |
| 97 | } |
| 98 | |
| 99 | // Client Version |
| 100 | CastChild(ID_DVERSION, wxStaticText)->SetLabel( |
| 101 | m_client.GetSoftVerStr()); |
| 102 | |
| 103 | // User ID |
| 104 | CastChild(ID_DID, wxStaticText)->SetLabel( |
| 105 | CFormat("%u (%s)") % m_client.GetUserIDHybrid() % (m_client.HasLowID() ? _("LowID") : _("HighID"))); |
| 106 | |
| 107 | // Client IP/Port |
| 108 | CastChild(ID_DIP, wxStaticText)->SetLabel( |
| 109 | CFormat("%s:%i") % m_client.GetFullIP() % m_client.GetUserPort()); |
| 110 | |
| 111 | // Server IP/Port/Name |
| 112 | if (m_client.GetServerIP()) { |
| 113 | wxString srvaddr = Uint32toStringIP(m_client.GetServerIP()); |
| 114 | CastChild(ID_DSIP, wxStaticText)->SetLabel( |
| 115 | CFormat("%s:%i") % srvaddr % m_client.GetServerPort()); |
| 116 | CastChild(ID_DSNAME, wxStaticText)->SetLabel( |
| 117 | m_client.GetServerName()); |
| 118 | } else { |
| 119 | CastChild(ID_DSIP, wxStaticText)->SetLabel(_("Unknown")); |
| 120 | CastChild(ID_DSNAME, wxStaticText)->SetLabel(_("Unknown")); |
| 121 | } |
| 122 | |
| 123 | // Obfuscation |
| 124 | wxString buffer; |
| 125 | switch (m_client.GetObfuscationStatus()) { |
| 126 | case OBST_ENABLED: buffer = _("Enabled"); break; |
| 127 | case OBST_SUPPORTED: buffer = _("Supported"); break; |
| 128 | case OBST_NOT_SUPPORTED: buffer = _("Not supported"); break; |
| 129 | case OBST_DISABLED: buffer = _("Disabled"); break; |
| 130 | default: buffer = _("Unknown"); break; |
| 131 | } |
| 132 | CastChild(IDT_OBFUSCATION, wxStaticText)->SetLabel(buffer); |
nothing calls this directly
no test coverage detected