GUI updated to show "<Your Provider>" when provider ID is blank
This commit is contained in:
parent
92460c571f
commit
076c6b77d7
@ -95,6 +95,11 @@ template <class _Tcred, class _Tbase> class wxPasswordCredentialsPanel;
|
|||||||
///
|
///
|
||||||
inline bool wxSetIconFromResource(wxStaticBitmap *bmp, wxIcon &icon, HINSTANCE hinst, PCWSTR pszName);
|
inline bool wxSetIconFromResource(wxStaticBitmap *bmp, wxIcon &icon, HINSTANCE hinst, PCWSTR pszName);
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Returns GUI displayable provider name
|
||||||
|
///
|
||||||
|
inline wxString wxEAPGetProviderName(const std::wstring &id);
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <wx/msw/winundef.h> // Fixes `CreateDialog` name collision
|
#include <wx/msw/winundef.h> // Fixes `CreateDialog` name collision
|
||||||
@ -158,7 +163,9 @@ public:
|
|||||||
*method->get(),
|
*method->get(),
|
||||||
provider->m_id.c_str(),
|
provider->m_id.c_str(),
|
||||||
m_providers),
|
m_providers),
|
||||||
is_single ? provider->m_id : winstd::tstring_printf(_T("%s (%u)"), provider->m_id.c_str(), count));
|
is_single ?
|
||||||
|
wxEAPGetProviderName(provider->m_id) :
|
||||||
|
winstd::tstring_printf(_T("%s (%u)"), wxEAPGetProviderName(provider->m_id), count));
|
||||||
}
|
}
|
||||||
|
|
||||||
this->Layout();
|
this->Layout();
|
||||||
@ -794,3 +801,10 @@ inline bool wxSetIconFromResource(wxStaticBitmap *bmp, wxIcon &icon, HINSTANCE h
|
|||||||
} else
|
} else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline wxString wxEAPGetProviderName(const std::wstring &id)
|
||||||
|
{
|
||||||
|
return
|
||||||
|
!id.empty() ? id : _("<Your Organization>");
|
||||||
|
}
|
||||||
|
@ -83,7 +83,7 @@ void wxEAPGeneralDialog::OnInitDialog(wxInitDialogEvent& event)
|
|||||||
wxEAPCredentialsDialog::wxEAPCredentialsDialog(const eap::config_provider &prov, wxWindow* parent) : wxEAPGeneralDialog(parent, _("EAP Credentials"))
|
wxEAPCredentialsDialog::wxEAPCredentialsDialog(const eap::config_provider &prov, wxWindow* parent) : wxEAPGeneralDialog(parent, _("EAP Credentials"))
|
||||||
{
|
{
|
||||||
// Set banner title.
|
// Set banner title.
|
||||||
m_banner->m_title->SetLabel(wxString::Format(_("%s Credentials"), prov.m_id.c_str()));
|
m_banner->m_title->SetLabel(wxString::Format(_("%s Credentials"), wxEAPGetProviderName(prov.m_id).c_str()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -248,9 +248,9 @@ void wxEAPConfigWindow::OnUpdateUI(wxUpdateUIEvent& event)
|
|||||||
wxNotebook *notebook = (wxNotebook*)m_parent;
|
wxNotebook *notebook = (wxNotebook*)m_parent;
|
||||||
int idx = notebook->FindPage(this);
|
int idx = notebook->FindPage(this);
|
||||||
if (idx != wxNOT_FOUND)
|
if (idx != wxNOT_FOUND)
|
||||||
notebook->SetPageText(idx, m_prov.m_id);
|
notebook->SetPageText(idx, wxEAPGetProviderName(m_prov.m_id));
|
||||||
} else
|
} else
|
||||||
this->SetLabel(m_prov.m_id);
|
this->SetLabel(wxEAPGetProviderName(m_prov.m_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user