dePAPization continues to pave the road for seamless MSCHAPv2 integration
This commit is contained in:
@@ -81,6 +81,7 @@
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\include\EAP_UI.h" />
|
||||
<ClInclude Include="..\include\Module.h" />
|
||||
<ClInclude Include="..\include\wxEAP_UIBase.h" />
|
||||
<ClInclude Include="..\res\wxEAP_UI.h" />
|
||||
<ClInclude Include="..\src\StdAfx.h" />
|
||||
</ItemGroup>
|
||||
|
@@ -27,6 +27,9 @@
|
||||
<ClInclude Include="..\include\Module.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\include\wxEAP_UIBase.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\StdAfx.cpp">
|
||||
|
@@ -81,9 +81,9 @@ class wxEAPConfigProvider;
|
||||
template <class _Tcred, class _wxT> class wxEAPCredentialsConfigPanel;
|
||||
|
||||
///
|
||||
/// Base template for all credential entry panels
|
||||
/// Helper template for all credential entry panels
|
||||
///
|
||||
template <class _Tcred, class _Tbase> class wxEAPCredentialsPanelBase;
|
||||
template <class _Tcred, class _Tbase> class wxEAPCredentialsPanel;
|
||||
|
||||
///
|
||||
/// Generic password credential entry panel
|
||||
@@ -637,11 +637,11 @@ private:
|
||||
|
||||
|
||||
template <class _Tcred, class _Tbase>
|
||||
class wxEAPCredentialsPanelBase : public _Tbase
|
||||
class wxEAPCredentialsPanel : public _Tbase
|
||||
{
|
||||
private:
|
||||
/// \cond internal
|
||||
typedef wxEAPCredentialsPanelBase<_Tcred, _Tbase> _Tthis;
|
||||
typedef wxEAPCredentialsPanel<_Tcred, _Tbase> _Tthis;
|
||||
/// \endcond
|
||||
|
||||
public:
|
||||
@@ -655,7 +655,7 @@ public:
|
||||
/// \param[in] parent Parent window
|
||||
/// \param[in] is_config Is this panel used to pre-enter credentials? When \c true, the "Remember" checkbox is always selected and disabled.
|
||||
///
|
||||
wxEAPCredentialsPanelBase(const eap::config_provider &prov, const eap::config_method_with_cred &cfg, _Tcred &cred, LPCTSTR pszCredTarget, wxWindow* parent, bool is_config = false) :
|
||||
wxEAPCredentialsPanel(const eap::config_provider &prov, const eap::config_method_with_cred &cfg, _Tcred &cred, LPCTSTR pszCredTarget, wxWindow* parent, bool is_config = false) :
|
||||
m_prov(prov),
|
||||
m_cfg(cfg),
|
||||
m_cred(cred),
|
||||
@@ -666,17 +666,17 @@ public:
|
||||
this->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(_Tthis::OnUpdateUI));
|
||||
}
|
||||
|
||||
virtual ~wxEAPCredentialsPanelBase()
|
||||
virtual ~wxEAPCredentialsPanel()
|
||||
{
|
||||
this->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(_Tthis::OnUpdateUI));
|
||||
}
|
||||
|
||||
inline void SetRememberValue(bool val)
|
||||
virtual void SetRemember(bool val)
|
||||
{
|
||||
return m_remember->SetValue(val);
|
||||
}
|
||||
|
||||
inline bool GetRememberValue() const
|
||||
virtual bool GetRemember() const
|
||||
{
|
||||
return m_remember->GetValue();
|
||||
}
|
||||
@@ -716,7 +716,7 @@ protected:
|
||||
|
||||
|
||||
template <class _Tcred, class _Tbase>
|
||||
class wxPasswordCredentialsPanel : public wxEAPCredentialsPanelBase<_Tcred, _Tbase>
|
||||
class wxPasswordCredentialsPanel : public wxEAPCredentialsPanel<_Tcred, _Tbase>
|
||||
{
|
||||
public:
|
||||
///
|
||||
@@ -730,7 +730,7 @@ public:
|
||||
/// \param[in] is_config Is this panel used to pre-enter credentials? When \c true, the "Remember" checkbox is always selected and disabled.
|
||||
///
|
||||
wxPasswordCredentialsPanel(const eap::config_provider &prov, const eap::config_method_with_cred &cfg, _Tcred &cred, LPCTSTR pszCredTarget, wxWindow* parent, bool is_config = false) :
|
||||
wxEAPCredentialsPanelBase<_Tcred, _Tbase>(prov, cfg, cred, pszCredTarget, parent, is_config)
|
||||
wxEAPCredentialsPanel<_Tcred, _Tbase>(prov, cfg, cred, pszCredTarget, parent, is_config)
|
||||
{
|
||||
// Load and set icon.
|
||||
winstd::library lib_shell32;
|
||||
@@ -767,12 +767,12 @@ protected:
|
||||
m_identity->SetSelection(0, -1);
|
||||
m_password->SetValue(m_cred.m_password.empty() ? wxEmptyString : s_dummy_password);
|
||||
|
||||
return wxEAPCredentialsPanelBase<_Tcred, wxEAPCredentialsPassPanelBase>::TransferDataToWindow();
|
||||
return wxEAPCredentialsPanel<_Tcred, wxEAPCredentialsPassPanelBase>::TransferDataToWindow();
|
||||
}
|
||||
|
||||
virtual bool TransferDataFromWindow()
|
||||
{
|
||||
if (!wxEAPCredentialsPanelBase<_Tcred, wxEAPCredentialsPassPanelBase>::TransferDataFromWindow())
|
||||
if (!wxEAPCredentialsPanel<_Tcred, wxEAPCredentialsPassPanelBase>::TransferDataFromWindow())
|
||||
return false;
|
||||
|
||||
m_cred.m_identity = m_identity->GetValue();
|
||||
@@ -795,7 +795,7 @@ protected:
|
||||
m_password ->Enable(false);
|
||||
}
|
||||
|
||||
wxEAPCredentialsPanelBase<_Tcred, wxEAPCredentialsPassPanelBase>::OnUpdateUI(event);
|
||||
wxEAPCredentialsPanel<_Tcred, wxEAPCredentialsPassPanelBase>::OnUpdateUI(event);
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
48
lib/EAPBase_UI/include/wxEAP_UIBase.h
Normal file
48
lib/EAPBase_UI/include/wxEAP_UIBase.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
Copyright 2015-2016 Amebis
|
||||
Copyright 2016 G<>ANT
|
||||
|
||||
This file is part of G<>ANTLink.
|
||||
|
||||
G<>ANTLink is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
G<>ANTLink is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with G<>ANTLink. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
///
|
||||
/// Base class for all credential entry panel that must provide "Remember" credentials checkbox
|
||||
///
|
||||
class wxEAPCredentialsPanelBase;
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <wx/panel.h>
|
||||
|
||||
|
||||
class wxEAPCredentialsPanelBase : public wxPanel
|
||||
{
|
||||
public:
|
||||
///
|
||||
/// Constructs a wxPanel with "Remember" credentials checkbox
|
||||
///
|
||||
wxEAPCredentialsPanelBase(wxWindow *parent,
|
||||
wxWindowID winid = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTAB_TRAVERSAL | wxNO_BORDER,
|
||||
const wxString& name = wxPanelNameStr) : wxPanel(parent, winid, pos, size, style, name)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void SetRemember(bool val) = 0;
|
||||
virtual bool GetRemember() const = 0;
|
||||
};
|
@@ -290,7 +290,7 @@ wxEAPCredentialsConfigPanelBase::~wxEAPCredentialsConfigPanelBase()
|
||||
|
||||
}
|
||||
|
||||
wxEAPCredentialsPassPanelBase::wxEAPCredentialsPassPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
|
||||
wxEAPCredentialsPassPanelBase::wxEAPCredentialsPassPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxEAPCredentialsPanelBase( parent, id, pos, size, style )
|
||||
{
|
||||
wxStaticBoxSizer* sb_credentials;
|
||||
sb_credentials = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Client Credentials") ), wxVERTICAL );
|
||||
|
@@ -1931,7 +1931,7 @@
|
||||
<property name="name">wxEAPCredentialsPassPanelBase</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size">500,-1</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="subclass">wxEAPCredentialsPanelBase; ../include/wxEAP_UIBase.h</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
|
@@ -11,6 +11,9 @@
|
||||
#include <wx/artprov.h>
|
||||
#include <wx/xrc/xmlres.h>
|
||||
#include <wx/intl.h>
|
||||
class wxEAPCredentialsPanelBase;
|
||||
|
||||
#include "../include/wxEAP_UIBase.h"
|
||||
class wxEAPBannerPanel;
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/font.h>
|
||||
@@ -158,7 +161,7 @@ class wxEAPCredentialsConfigPanelBase : public wxPanel
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class wxEAPCredentialsPassPanelBase
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class wxEAPCredentialsPassPanelBase : public wxPanel
|
||||
class wxEAPCredentialsPassPanelBase : public wxEAPCredentialsPanelBase
|
||||
{
|
||||
private:
|
||||
|
||||
|
Reference in New Issue
Block a user