From f7dcdc2dce72bdb0e135c8e8e6e10ade88888f2f Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 7 Dec 2016 13:18:31 +0100 Subject: [PATCH] Identity read-only text box in credential selection configuration panel has been replaced by static text not to confuse users they can edit it there --- lib/EAPBase_UI/include/EAP_UI.h | 12 +- lib/EAPBase_UI/res/wxEAP_UI.cpp | 54 +++- lib/EAPBase_UI/res/wxEAP_UI.fbp | 526 +++++++++++++++++++++----------- lib/EAPBase_UI/res/wxEAP_UI.h | 8 +- 4 files changed, 398 insertions(+), 202 deletions(-) diff --git a/lib/EAPBase_UI/include/EAP_UI.h b/lib/EAPBase_UI/include/EAP_UI.h index 318d7ee..2e46b17 100644 --- a/lib/EAPBase_UI/include/EAP_UI.h +++ b/lib/EAPBase_UI/include/EAP_UI.h @@ -800,7 +800,7 @@ protected: m_timer_storage.Stop(); if (CredDelete(m_cred_storage.target_name(m_prov.get_id().c_str(), m_cfg.m_level).c_str(), CRED_TYPE_GENERIC, 0)) { - m_storage_identity->Clear(); + m_storage_identity->SetLabel(wxEmptyString); m_cred_storage.clear(); m_has_storage = false; } else @@ -839,15 +839,15 @@ protected: UpdateStorageIdentity(); } catch (winstd::win_runtime_error &err) { if (err.number() == ERROR_NOT_FOUND) { - m_storage_identity->Clear(); + m_storage_identity->SetLabel(wxEmptyString); m_cred_storage.clear(); m_has_storage = false; } else { - m_storage_identity->SetValue(wxString::Format(_(""), err.number())); + m_storage_identity->SetLabel(wxString::Format(_(""), err.number())); m_has_storage = true; } } catch (...) { - m_storage_identity->SetValue(_("")); + m_storage_identity->SetLabel(_("")); m_has_storage = true; } } @@ -856,7 +856,7 @@ protected: inline void UpdateStorageIdentity() { wxString identity(m_cred_storage.get_identity()); - m_storage_identity->SetValue( + m_storage_identity->SetLabel( !identity.empty() ? identity : m_cred_storage.empty() ? _("") : _("")); } @@ -865,7 +865,7 @@ protected: inline void UpdateConfigIdentity() { wxString identity(m_cred_config.get_identity()); - m_config_identity->SetValue( + m_config_identity->SetLabel( !identity.empty() ? identity : m_cred_config.empty() ? _("") : _("")); } diff --git a/lib/EAPBase_UI/res/wxEAP_UI.cpp b/lib/EAPBase_UI/res/wxEAP_UI.cpp index a6f8dbe..a007f0d 100644 --- a/lib/EAPBase_UI/res/wxEAP_UI.cpp +++ b/lib/EAPBase_UI/res/wxEAP_UI.cpp @@ -241,18 +241,29 @@ wxEAPCredentialsConfigPanelBase::wxEAPCredentialsConfigPanelBase( wxWindow* pare m_credentials_label->Wrap( 440 ); sb_credentials_vert->Add( m_credentials_label, 0, wxALL|wxEXPAND, 5 ); - m_storage = new wxRadioButton( m_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 ); - wxBoxSizer* sz_storage; - sz_storage = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* sb_storage; + sb_storage = new wxBoxSizer( wxVERTICAL ); - 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") ); + wxBoxSizer* sb_storage_identity; + sb_storage_identity = new wxBoxSizer( wxHORIZONTAL ); - sz_storage->Add( m_storage_identity, 3, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + m_storage_identity_label = new wxStaticText( m_sb_credentials->GetStaticBox(), wxID_ANY, _("Identity:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_storage_identity_label->Wrap( -1 ); + sb_storage_identity->Add( m_storage_identity_label, 0, 0, 5 ); + + m_storage_identity = new wxStaticText( m_sb_credentials->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_storage_identity->Wrap( -1 ); + m_storage_identity->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + sb_storage_identity->Add( m_storage_identity, 1, wxEXPAND|wxLEFT, 5 ); + + + sb_storage->Add( sb_storage_identity, 1, wxEXPAND, 5 ); wxBoxSizer* sb_buttons_storage; sb_buttons_storage = new wxBoxSizer( wxHORIZONTAL ); @@ -268,23 +279,34 @@ wxEAPCredentialsConfigPanelBase::wxEAPCredentialsConfigPanelBase( wxWindow* pare sb_buttons_storage->Add( m_storage_set, 0, wxLEFT, 5 ); - sz_storage->Add( sb_buttons_storage, 0, wxALIGN_RIGHT|wxTOP, 5 ); + sb_storage->Add( sb_buttons_storage, 0, wxALIGN_RIGHT|wxTOP, 5 ); - sb_credentials_vert->Add( sz_storage, 0, wxEXPAND|wxALL, 5 ); + sb_credentials_vert->Add( sb_storage, 0, wxEXPAND|wxALL, 5 ); - m_config = new wxRadioButton( m_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 ); - wxBoxSizer* sz_config; - sz_config = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* sb_config; + sb_config = new wxBoxSizer( wxVERTICAL ); - m_config_identity = new wxTextCtrl( m_sb_credentials->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); - m_config_identity->SetToolTip( _("Profile configuration credentials") ); + wxBoxSizer* sb_config_identity; + sb_config_identity = new wxBoxSizer( wxHORIZONTAL ); - sz_config->Add( m_config_identity, 3, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + m_config_identity_label = new wxStaticText( m_sb_credentials->GetStaticBox(), wxID_ANY, _("Identity:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_config_identity_label->Wrap( -1 ); + sb_config_identity->Add( m_config_identity_label, 0, 0, 5 ); + + m_config_identity = new wxStaticText( m_sb_credentials->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_config_identity->Wrap( -1 ); + m_config_identity->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + sb_config_identity->Add( m_config_identity, 1, wxEXPAND|wxLEFT, 5 ); + + + sb_config->Add( sb_config_identity, 1, wxEXPAND, 5 ); wxBoxSizer* sb_buttons_config; sb_buttons_config = new wxBoxSizer( wxHORIZONTAL ); @@ -295,10 +317,10 @@ wxEAPCredentialsConfigPanelBase::wxEAPCredentialsConfigPanelBase( wxWindow* pare sb_buttons_config->Add( m_config_set, 0, 0, 5 ); - sz_config->Add( sb_buttons_config, 0, wxALIGN_RIGHT|wxTOP, 5 ); + sb_config->Add( sb_buttons_config, 0, wxALIGN_RIGHT|wxTOP, 5 ); - sb_credentials_vert->Add( sz_config, 0, wxEXPAND|wxALL, 5 ); + sb_credentials_vert->Add( sb_config, 0, wxEXPAND|wxALL, 5 ); sb_credentials_horiz->Add( sb_credentials_vert, 1, wxEXPAND, 5 ); diff --git a/lib/EAPBase_UI/res/wxEAP_UI.fbp b/lib/EAPBase_UI/res/wxEAP_UI.fbp index 38a3761..546e73a 100644 --- a/lib/EAPBase_UI/res/wxEAP_UI.fbp +++ b/lib/EAPBase_UI/res/wxEAP_UI.fbp @@ -1681,7 +1681,7 @@ 0 0 wxID_ANY - Use credentials from Credential &Manager: + Use credentials from Credential &Manager 0 @@ -1743,98 +1743,184 @@ 0 - sz_storage + sb_storage wxVERTICAL none 5 - wxEXPAND|wxALIGN_CENTER_VERTICAL - 3 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 + wxEXPAND + 1 + - 1 - m_storage_identity - 1 - - - protected - 1 - - Resizable - 1 - - wxTE_READONLY - - 0 - Your present credentials stored in Windows Credential Manager - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + sb_storage_identity + wxHORIZONTAL + none + + 5 + + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Identity: + + 0 + + + 0 + + 1 + m_storage_identity_label + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxLEFT + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + ,90,92,-1,70,0 + 0 + 0 + wxID_ANY + + + 0 + + + 0 + + 1 + m_storage_identity + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2058,7 +2144,7 @@ 0 0 wxID_ANY - Use credentials from &profile configuration: + Use credentials from &profile configuration 0 @@ -2120,98 +2206,184 @@ 0 - sz_config + sb_config wxVERTICAL none - + 5 - wxEXPAND|wxALIGN_CENTER_VERTICAL - 3 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 + wxEXPAND + 1 + - 1 - m_config_identity - 1 - - - protected - 1 - - Resizable - 1 - - wxTE_READONLY - - 0 - Profile configuration credentials - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + sb_config_identity + wxHORIZONTAL + none + + 5 + + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Identity: + + 0 + + + 0 + + 1 + m_config_identity_label + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxLEFT + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + ,90,92,-1,70,0 + 0 + 0 + wxID_ANY + + + 0 + + + 0 + + 1 + m_config_identity + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/EAPBase_UI/res/wxEAP_UI.h b/lib/EAPBase_UI/res/wxEAP_UI.h index f549a75..183ebdc 100644 --- a/lib/EAPBase_UI/res/wxEAP_UI.h +++ b/lib/EAPBase_UI/res/wxEAP_UI.h @@ -31,9 +31,9 @@ class wxEAPBannerPanel; #include #include #include -#include #include #include +#include #include #include @@ -169,11 +169,13 @@ class wxEAPCredentialsConfigPanelBase : public wxPanel wxStaticBitmap* m_credentials_icon; wxStaticText* m_credentials_label; wxRadioButton* m_storage; - wxTextCtrl* m_storage_identity; + wxStaticText* m_storage_identity_label; + wxStaticText* m_storage_identity; wxButton* m_storage_clear; wxButton* m_storage_set; wxRadioButton* m_config; - wxTextCtrl* m_config_identity; + wxStaticText* m_config_identity_label; + wxStaticText* m_config_identity; wxButton* m_config_set; wxTimer m_timer_storage;