Credential identities are more carefully prepared for display now

This commit is contained in:
Simon Rozman 2016-08-31 16:50:12 +02:00
parent 60f1b4ccfb
commit d9bfcc3e49
3 changed files with 16 additions and 19 deletions

View File

@ -2,7 +2,7 @@
msgid ""
msgstr ""
"Project-Id-Version: EAPMethods\n"
"POT-Creation-Date: 2016-08-31 14:32+0200\n"
"POT-Creation-Date: 2016-08-31 16:49+0200\n"
"PO-Revision-Date: 2016-06-02 12:27+0200\n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
@ -463,15 +463,15 @@ msgstr ""
msgid "<error>"
msgstr ""
#: lib/EAPBase_UI/include/EAP_UI.h:724 lib/EAPBase_UI/include/EAP_UI.h:735
#: lib/EAPBase_UI/include/EAP_UI.h:726 lib/EAPBase_UI/include/EAP_UI.h:735
msgid "<empty>"
msgstr ""
#: lib/EAPBase_UI/include/EAP_UI.h:727 lib/EAPBase_UI/include/EAP_UI.h:738
msgid "<blank>"
#: lib/EAPBase_UI/include/EAP_UI.h:726 lib/EAPBase_UI/include/EAP_UI.h:735
msgid "<blank ID>"
msgstr ""
#: lib/EAPBase_UI/include/EAP_UI.h:944
#: lib/EAPBase_UI/include/EAP_UI.h:940
msgid "<Your Organization>"
msgstr ""

View File

@ -144,9 +144,10 @@ wstring eap::credentials::get_identity() const
tstring eap::credentials::get_name() const
{
if (empty()) return _T("<empty>");
tstring identity(std::move(get_identity()));
return !identity.empty() ? identity : _T("<blank>");
return
!identity.empty() ? identity :
empty() ? _T("<empty>") : _T("<blank ID>");
}

View File

@ -720,23 +720,19 @@ protected:
inline void UpdateOwnIdentity()
{
if (m_cred_own.empty())
m_own_identity->SetValue(_("<empty>"));
else {
wxString identity(m_cred_own.get_name());
m_own_identity->SetValue(!identity.empty() ? identity : _("<blank>"));
}
wxString identity(m_cred_own.get_identity());
m_own_identity->SetValue(
!identity.empty() ? identity :
m_cred_own.empty() ? _("<empty>") : _("<blank ID>"));
}
inline void UpdatePresharedIdentity()
{
if (m_cred_preshared.empty())
m_preshared_identity->SetValue(_("<empty>"));
else {
wxString identity(m_cred_preshared.get_name());
m_preshared_identity->SetValue(!identity.empty() ? identity : _("<blank>"));
}
wxString identity(m_cred_preshared.get_identity());
m_preshared_identity->SetValue(
!identity.empty() ? identity :
m_cred_preshared.empty() ? _("<empty>") : _("<blank ID>"));
}
/// \endcond