From 52c0c82979e9b458b355a0bfe8405b731569a23f Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 26 Sep 2016 11:43:40 +0200 Subject: [PATCH] wxEAPCredentials title is no longer static for easier disambiguation between outer and inner credential set in EAP-TTLS configuration dialog (closes #20) --- lib/EAPBase_UI/include/EAP_UI.h | 4 +++- lib/EAPBase_UI/res/wxEAP_UI.cpp | 27 +++++++++++++-------------- lib/EAPBase_UI/res/wxEAP_UI.fbp | 10 +++++----- lib/EAPBase_UI/res/wxEAP_UI.h | 1 + lib/MSCHAPv2_UI/src/MSCHAPv2_UI.cpp | 2 +- lib/PAP_UI/src/PAP_UI.cpp | 2 +- lib/TLS_UI/src/TLS_UI.cpp | 2 +- 7 files changed, 25 insertions(+), 23 deletions(-) diff --git a/lib/EAPBase_UI/include/EAP_UI.h b/lib/EAPBase_UI/include/EAP_UI.h index 7c6bbd3..e943b44 100644 --- a/lib/EAPBase_UI/include/EAP_UI.h +++ b/lib/EAPBase_UI/include/EAP_UI.h @@ -566,7 +566,7 @@ public: /// \param[inout] cfg Configuration data /// \param[in] parent Parent window /// - wxEAPCredentialsConfigPanel(const eap::config_provider &prov, eap::config_method_with_cred &cfg, wxWindow *parent) : + wxEAPCredentialsConfigPanel(const eap::config_provider &prov, eap::config_method_with_cred &cfg, wxWindow *parent, const wxString &method = wxEmptyString) : m_prov(prov), m_cfg(cfg), m_has_storage(false), @@ -574,6 +574,8 @@ public: m_cred_config(cfg.m_module), wxEAPCredentialsConfigPanelBase(parent) { + m_sb_credentials->GetStaticBox()->SetLabel(method.empty() ? wxString::Format(_("%s User Credentials"), cfg.get_method_str()) : method); + // Load and set icon. winstd::library lib_shell32; if (lib_shell32.load(_T("shell32.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE)) diff --git a/lib/EAPBase_UI/res/wxEAP_UI.cpp b/lib/EAPBase_UI/res/wxEAP_UI.cpp index 75dd17a..6ac6e59 100644 --- a/lib/EAPBase_UI/res/wxEAP_UI.cpp +++ b/lib/EAPBase_UI/res/wxEAP_UI.cpp @@ -226,23 +226,22 @@ wxEAPNotePanelBase::~wxEAPNotePanelBase() wxEAPCredentialsConfigPanelBase::wxEAPCredentialsConfigPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) { - wxStaticBoxSizer* sb_credentials; - sb_credentials = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Client Credentials") ), wxVERTICAL ); + m_sb_credentials = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("%s User Credentials") ), wxVERTICAL ); wxBoxSizer* sb_credentials_horiz; sb_credentials_horiz = new wxBoxSizer( wxHORIZONTAL ); - m_credentials_icon = new wxStaticBitmap( sb_credentials->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_credentials_icon = new wxStaticBitmap( m_sb_credentials->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); sb_credentials_horiz->Add( m_credentials_icon, 0, wxALL, 5 ); wxBoxSizer* sb_credentials_vert; sb_credentials_vert = new wxBoxSizer( wxVERTICAL ); - m_credentials_label = new wxStaticText( sb_credentials->GetStaticBox(), wxID_ANY, _("Select the source where your username, password, or certificate used to connect are stored."), wxDefaultPosition, wxDefaultSize, 0 ); + m_credentials_label = new wxStaticText( m_sb_credentials->GetStaticBox(), wxID_ANY, _("Select the source where your credentials used to connect are stored."), wxDefaultPosition, wxDefaultSize, 0 ); m_credentials_label->Wrap( 440 ); sb_credentials_vert->Add( m_credentials_label, 0, wxALL|wxEXPAND, 5 ); - m_storage = new wxRadioButton( sb_credentials->GetStaticBox(), wxID_ANY, _("Use credentials from Credential &Manager:"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); + m_storage = new wxRadioButton( m_sb_credentials->GetStaticBox(), wxID_ANY, _("Use credentials from Credential &Manager:"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); m_storage->SetToolTip( _("Select this option if you would like to use credentials stored in Windows Credential Manager") ); sb_credentials_vert->Add( m_storage, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); @@ -250,7 +249,7 @@ wxEAPCredentialsConfigPanelBase::wxEAPCredentialsConfigPanelBase( wxWindow* pare wxBoxSizer* sz_storage; sz_storage = new wxBoxSizer( wxVERTICAL ); - m_storage_identity = new wxTextCtrl( sb_credentials->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); + m_storage_identity = new wxTextCtrl( m_sb_credentials->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); m_storage_identity->SetToolTip( _("Your present credentials stored in Windows Credential Manager") ); sz_storage->Add( m_storage_identity, 3, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); @@ -258,12 +257,12 @@ wxEAPCredentialsConfigPanelBase::wxEAPCredentialsConfigPanelBase( wxWindow* pare wxBoxSizer* sb_buttons_storage; sb_buttons_storage = new wxBoxSizer( wxHORIZONTAL ); - m_storage_clear = new wxButton( sb_credentials->GetStaticBox(), wxID_ANY, _("&Clear Credentials"), wxDefaultPosition, wxDefaultSize, 0 ); + m_storage_clear = new wxButton( m_sb_credentials->GetStaticBox(), wxID_ANY, _("&Clear Credentials"), wxDefaultPosition, wxDefaultSize, 0 ); m_storage_clear->SetToolTip( _("Click to clear your credentials from Credential Manager.\nNote: You will be prompted to enter credentials when connecting.") ); sb_buttons_storage->Add( m_storage_clear, 0, wxRIGHT, 5 ); - m_storage_set = new wxButton( sb_credentials->GetStaticBox(), wxID_ANY, _("&Set Credentials..."), wxDefaultPosition, wxDefaultSize, 0 ); + m_storage_set = new wxButton( m_sb_credentials->GetStaticBox(), wxID_ANY, _("&Set Credentials..."), wxDefaultPosition, wxDefaultSize, 0 ); m_storage_set->SetToolTip( _("Click here to set or modify your credentials") ); sb_buttons_storage->Add( m_storage_set, 0, wxLEFT, 5 ); @@ -274,7 +273,7 @@ wxEAPCredentialsConfigPanelBase::wxEAPCredentialsConfigPanelBase( wxWindow* pare sb_credentials_vert->Add( sz_storage, 0, wxEXPAND|wxALL, 5 ); - m_config = new wxRadioButton( sb_credentials->GetStaticBox(), wxID_ANY, _("Use credentials from &profile configuration:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_config = new wxRadioButton( m_sb_credentials->GetStaticBox(), wxID_ANY, _("Use credentials from &profile configuration:"), wxDefaultPosition, wxDefaultSize, 0 ); m_config->SetToolTip( _("Select this option if you would like to store credentials as a part of profile configuration") ); sb_credentials_vert->Add( m_config, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); @@ -282,7 +281,7 @@ wxEAPCredentialsConfigPanelBase::wxEAPCredentialsConfigPanelBase( wxWindow* pare wxBoxSizer* sz_config; sz_config = new wxBoxSizer( wxVERTICAL ); - m_config_identity = new wxTextCtrl( sb_credentials->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); + m_config_identity = new wxTextCtrl( m_sb_credentials->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); m_config_identity->SetToolTip( _("Profile configuration credentials") ); sz_config->Add( m_config_identity, 3, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); @@ -290,7 +289,7 @@ wxEAPCredentialsConfigPanelBase::wxEAPCredentialsConfigPanelBase( wxWindow* pare wxBoxSizer* sb_buttons_config; sb_buttons_config = new wxBoxSizer( wxHORIZONTAL ); - m_config_set = new wxButton( sb_credentials->GetStaticBox(), wxID_ANY, _("&Set Credentials..."), wxDefaultPosition, wxDefaultSize, 0 ); + m_config_set = new wxButton( m_sb_credentials->GetStaticBox(), wxID_ANY, _("&Set Credentials..."), wxDefaultPosition, wxDefaultSize, 0 ); m_config_set->SetToolTip( _("Click here to set or modify your credentials") ); sb_buttons_config->Add( m_config_set, 0, 0, 5 ); @@ -305,10 +304,10 @@ wxEAPCredentialsConfigPanelBase::wxEAPCredentialsConfigPanelBase( wxWindow* pare sb_credentials_horiz->Add( sb_credentials_vert, 1, wxEXPAND, 5 ); - sb_credentials->Add( sb_credentials_horiz, 1, wxEXPAND, 5 ); + m_sb_credentials->Add( sb_credentials_horiz, 1, wxEXPAND, 5 ); - this->SetSizer( sb_credentials ); + this->SetSizer( m_sb_credentials ); this->Layout(); m_timer_storage.SetOwner( this, wxID_ANY ); @@ -333,7 +332,7 @@ wxEAPCredentialsConfigPanelBase::~wxEAPCredentialsConfigPanelBase() wxPasswordCredentialsPanelBase::wxPasswordCredentialsPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxEAPCredentialsPanelBase( parent, id, pos, size, style ) { - m_sb_credentials = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("User Password") ), wxVERTICAL ); + m_sb_credentials = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("User ID and Password") ), wxVERTICAL ); wxBoxSizer* sb_credentials_horiz; sb_credentials_horiz = new wxBoxSizer( wxHORIZONTAL ); diff --git a/lib/EAPBase_UI/res/wxEAP_UI.fbp b/lib/EAPBase_UI/res/wxEAP_UI.fbp index bf7c67c..cc7dff7 100644 --- a/lib/EAPBase_UI/res/wxEAP_UI.fbp +++ b/lib/EAPBase_UI/res/wxEAP_UI.fbp @@ -1461,11 +1461,11 @@ OnUpdateUI wxID_ANY - Client Credentials + %s User Credentials - sb_credentials + m_sb_credentials wxVERTICAL - none + protected 5 @@ -1598,7 +1598,7 @@ 0 0 wxID_ANY - Select the source where your username, password, or certificate used to connect are stored. + Select the source where your credentials used to connect are stored. 0 @@ -2384,7 +2384,7 @@ wxID_ANY - User Password + User ID and Password m_sb_credentials wxVERTICAL diff --git a/lib/EAPBase_UI/res/wxEAP_UI.h b/lib/EAPBase_UI/res/wxEAP_UI.h index 0c0ef58..06a001a 100644 --- a/lib/EAPBase_UI/res/wxEAP_UI.h +++ b/lib/EAPBase_UI/res/wxEAP_UI.h @@ -165,6 +165,7 @@ class wxEAPCredentialsConfigPanelBase : public wxPanel private: protected: + wxStaticBoxSizer* m_sb_credentials; wxStaticBitmap* m_credentials_icon; wxStaticText* m_credentials_label; wxRadioButton* m_storage; diff --git a/lib/MSCHAPv2_UI/src/MSCHAPv2_UI.cpp b/lib/MSCHAPv2_UI/src/MSCHAPv2_UI.cpp index 69cd00b..127788b 100644 --- a/lib/MSCHAPv2_UI/src/MSCHAPv2_UI.cpp +++ b/lib/MSCHAPv2_UI/src/MSCHAPv2_UI.cpp @@ -30,7 +30,7 @@ wxMSCHAPv2ConfigPanel::wxMSCHAPv2ConfigPanel(const eap::config_provider &prov, e wxBoxSizer* sb_content; sb_content = new wxBoxSizer( wxVERTICAL ); - m_credentials = new wxMSCHAPv2CredentialsConfigPanel(prov, cfg, this); + m_credentials = new wxMSCHAPv2CredentialsConfigPanel(prov, cfg, this, _("MSCHAPv2 User ID and Password")); sb_content->Add(m_credentials, 0, wxEXPAND, 5); this->SetSizer(sb_content); diff --git a/lib/PAP_UI/src/PAP_UI.cpp b/lib/PAP_UI/src/PAP_UI.cpp index e8a7f6a..dde9520 100644 --- a/lib/PAP_UI/src/PAP_UI.cpp +++ b/lib/PAP_UI/src/PAP_UI.cpp @@ -30,7 +30,7 @@ wxPAPConfigPanel::wxPAPConfigPanel(const eap::config_provider &prov, eap::config wxBoxSizer* sb_content; sb_content = new wxBoxSizer( wxVERTICAL ); - m_credentials = new wxPAPCredentialsConfigPanel(prov, cfg, this); + m_credentials = new wxPAPCredentialsConfigPanel(prov, cfg, this, _("PAP User ID and Password")); sb_content->Add(m_credentials, 0, wxEXPAND, 5); this->SetSizer(sb_content); diff --git a/lib/TLS_UI/src/TLS_UI.cpp b/lib/TLS_UI/src/TLS_UI.cpp index 5aa2639..7fd432d 100644 --- a/lib/TLS_UI/src/TLS_UI.cpp +++ b/lib/TLS_UI/src/TLS_UI.cpp @@ -568,7 +568,7 @@ wxTLSConfigPanel::wxTLSConfigPanel(const eap::config_provider &prov, eap::config m_server_trust = new wxTLSServerTrustPanel(prov, cfg, this); sb_content->Add(m_server_trust, 0, wxDOWN|wxEXPAND, 5); - m_credentials = new wxTLSCredentialsConfigPanel(prov, cfg, this); + m_credentials = new wxTLSCredentialsConfigPanel(prov, cfg, this, _("User Certificate")); sb_content->Add(m_credentials, 0, wxUP|wxEXPAND, 5); this->SetSizer(sb_content);