diff options
author | tetsuo55 <tetsuo55@users.sourceforge.net> | 2010-04-19 00:29:12 +0400 |
---|---|---|
committer | tetsuo55 <tetsuo55@users.sourceforge.net> | 2010-04-19 00:29:12 +0400 |
commit | b072e90c262fef233872e34f93bf298ce0d1fa03 (patch) | |
tree | ee8fd84e6d0e594d6e884e8be7e31d2c24be47fe /src/apps/mplayerc/AuthDlg.cpp | |
parent | 5215e9e5c05dcfc26b4314a2b52966cbcea5306f (diff) |
Style patch part1. based on newly released astyle 1.24.
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1790 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc/AuthDlg.cpp')
-rw-r--r-- | src/apps/mplayerc/AuthDlg.cpp | 196 |
1 files changed, 98 insertions, 98 deletions
diff --git a/src/apps/mplayerc/AuthDlg.cpp b/src/apps/mplayerc/AuthDlg.cpp index 607adc2b2..6c22b078b 100644 --- a/src/apps/mplayerc/AuthDlg.cpp +++ b/src/apps/mplayerc/AuthDlg.cpp @@ -31,10 +31,10 @@ IMPLEMENT_DYNAMIC(CAuthDlg, CDialog)
CAuthDlg::CAuthDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CAuthDlg::IDD, pParent)
- , m_username(_T(""))
- , m_password(_T(""))
- , m_remember(FALSE)
+ : CDialog(CAuthDlg::IDD, pParent)
+ , m_username(_T(""))
+ , m_password(_T(""))
+ , m_remember(FALSE)
{
}
@@ -44,25 +44,25 @@ CAuthDlg::~CAuthDlg() void CAuthDlg::DoDataExchange(CDataExchange* pDX)
{
- CDialog::DoDataExchange(pDX);
- DDX_Control(pDX, IDC_COMBO1, m_usernamectrl);
- DDX_Text(pDX, IDC_COMBO1, m_username);
- DDX_Text(pDX, IDC_EDIT3, m_password);
- DDX_Check(pDX, IDC_CHECK1, m_remember);
+ CDialog::DoDataExchange(pDX);
+ DDX_Control(pDX, IDC_COMBO1, m_usernamectrl);
+ DDX_Text(pDX, IDC_COMBO1, m_username);
+ DDX_Text(pDX, IDC_EDIT3, m_password);
+ DDX_Check(pDX, IDC_CHECK1, m_remember);
}
CString CAuthDlg::DEncrypt(CString str)
{
- for(int i = 0; i < str.GetLength(); i++)
- str.SetAt(i, str[i]^5);
- return str;
+ for(int i = 0; i < str.GetLength(); i++)
+ str.SetAt(i, str[i]^5);
+ return str;
}
BEGIN_MESSAGE_MAP(CAuthDlg, CDialog)
- ON_BN_CLICKED(IDOK, OnBnClickedOk)
- ON_CBN_SELCHANGE(IDC_COMBO1, OnCbnSelchangeCombo1)
- ON_EN_SETFOCUS(IDC_EDIT3, OnEnSetfocusEdit3)
+ ON_BN_CLICKED(IDOK, OnBnClickedOk)
+ ON_CBN_SELCHANGE(IDC_COMBO1, OnCbnSelchangeCombo1)
+ ON_EN_SETFOCUS(IDC_EDIT3, OnEnSetfocusEdit3)
END_MESSAGE_MAP()
@@ -70,102 +70,102 @@ END_MESSAGE_MAP() BOOL CAuthDlg::OnInitDialog()
{
- CDialog::OnInitDialog();
-
- CWinApp* pApp = AfxGetApp();
-
- if(pApp->m_pszRegistryKey)
- {
- CRegKey hSecKey(pApp->GetSectionKey(IDS_R_LOGINS));
- if(hSecKey)
- {
- int i = 0;
- TCHAR username[256], password[256];
- while(1)
- {
- DWORD unlen = countof(username);
- DWORD pwlen = sizeof(password);
- DWORD type = REG_SZ;
- if(ERROR_SUCCESS == RegEnumValue(
- hSecKey, i++, username, &unlen, 0, &type, (BYTE*)password, &pwlen))
- {
- m_logins[username] = DEncrypt(password);
- m_usernamectrl.AddString(username);
- }
- else
- {
- break;
- }
- }
- }
- }
- else
- {
- CAutoVectorPtr<TCHAR> buff;
- buff.Allocate(32767/sizeof(TCHAR));
-
- DWORD len = GetPrivateProfileSection(
- IDS_R_LOGINS, buff, 32767/sizeof(TCHAR), pApp->m_pszProfileName);
-
- TCHAR* p = buff;
- while(*p && len > 0)
- {
- CString str = p;
- p += str.GetLength()+1;
- len -= str.GetLength()+1;
- CAtlList<CString> sl;
- Explode(str, sl, '=', 2);
- if(sl.GetCount() == 2)
- {
- m_logins[sl.GetHead()] = DEncrypt(sl.GetTail());
- m_usernamectrl.AddString(sl.GetHead());
- }
- }
- }
-
- m_usernamectrl.SetFocus();
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
+ CDialog::OnInitDialog();
+
+ CWinApp* pApp = AfxGetApp();
+
+ if(pApp->m_pszRegistryKey)
+ {
+ CRegKey hSecKey(pApp->GetSectionKey(IDS_R_LOGINS));
+ if(hSecKey)
+ {
+ int i = 0;
+ TCHAR username[256], password[256];
+ while(1)
+ {
+ DWORD unlen = countof(username);
+ DWORD pwlen = sizeof(password);
+ DWORD type = REG_SZ;
+ if(ERROR_SUCCESS == RegEnumValue(
+ hSecKey, i++, username, &unlen, 0, &type, (BYTE*)password, &pwlen))
+ {
+ m_logins[username] = DEncrypt(password);
+ m_usernamectrl.AddString(username);
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+ }
+ else
+ {
+ CAutoVectorPtr<TCHAR> buff;
+ buff.Allocate(32767/sizeof(TCHAR));
+
+ DWORD len = GetPrivateProfileSection(
+ IDS_R_LOGINS, buff, 32767/sizeof(TCHAR), pApp->m_pszProfileName);
+
+ TCHAR* p = buff;
+ while(*p && len > 0)
+ {
+ CString str = p;
+ p += str.GetLength()+1;
+ len -= str.GetLength()+1;
+ CAtlList<CString> sl;
+ Explode(str, sl, '=', 2);
+ if(sl.GetCount() == 2)
+ {
+ m_logins[sl.GetHead()] = DEncrypt(sl.GetTail());
+ m_usernamectrl.AddString(sl.GetHead());
+ }
+ }
+ }
+
+ m_usernamectrl.SetFocus();
+
+ return TRUE; // return TRUE unless you set the focus to a control
+ // EXCEPTION: OCX Property Pages should return FALSE
}
void CAuthDlg::OnBnClickedOk()
{
- UpdateData();
+ UpdateData();
- if(!m_username.IsEmpty())
- {
- CWinApp* pApp = AfxGetApp();
- pApp->WriteProfileString(IDS_R_LOGINS, m_username, m_remember ? DEncrypt(m_password) : _T(""));
- }
+ if(!m_username.IsEmpty())
+ {
+ CWinApp* pApp = AfxGetApp();
+ pApp->WriteProfileString(IDS_R_LOGINS, m_username, m_remember ? DEncrypt(m_password) : _T(""));
+ }
- OnOK();
+ OnOK();
}
void CAuthDlg::OnCbnSelchangeCombo1()
{
- CString username;
- m_usernamectrl.GetLBText(m_usernamectrl.GetCurSel(), username);
-
- CString password;
- if(m_logins.Lookup(username, password))
- {
- m_password = password;
- m_remember = TRUE;
- UpdateData(FALSE);
- }
+ CString username;
+ m_usernamectrl.GetLBText(m_usernamectrl.GetCurSel(), username);
+
+ CString password;
+ if(m_logins.Lookup(username, password))
+ {
+ m_password = password;
+ m_remember = TRUE;
+ UpdateData(FALSE);
+ }
}
void CAuthDlg::OnEnSetfocusEdit3()
{
- UpdateData();
-
- CString password;
- if(m_logins.Lookup(m_username, password))
- {
- m_password = password;
- m_remember = TRUE;
- UpdateData(FALSE);
- }
+ UpdateData();
+
+ CString password;
+ if(m_logins.Lookup(m_username, password))
+ {
+ m_password = password;
+ m_remember = TRUE;
+ UpdateData(FALSE);
+ }
}
|