~ubuntu-branches/ubuntu/precise/p7zip/precise-updates

« back to all changes in this revision

Viewing changes to CPP/7zip/UI/FileManager/PasswordDialog.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Mohammed Adnène Trojette
  • Date: 2009-02-14 20:12:27 UTC
  • mfrom: (1.1.11 upstream) (2.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090214201227-go63qxm9ozfdma60
Tags: 4.65~dfsg.1-1
* New upstream release.
* Remove wx2.8 Build-Depends added by mistakes (7zG is not yet
  intended to be built).
* Use dh_clean without -k.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// PasswordDialog.cpp
 
2
 
 
3
#include "StdAfx.h"
 
4
#include "PasswordDialog.h"
 
5
 
 
6
#ifdef LANG
 
7
#include "LangUtils.h"
 
8
#endif
 
9
 
 
10
#ifdef LANG
 
11
static CIDLangPair kIDLangPairs[] =
 
12
{
 
13
  { IDC_STATIC_PASSWORD_HEADER, 0x02000B01 },
 
14
  { IDC_CHECK_PASSWORD_SHOW, 0x02000B02 },
 
15
    
 
16
};
 
17
#endif
 
18
 
 
19
 
 
20
bool CPasswordDialog::OnInit()
 
21
{
 
22
  #ifdef LANG
 
23
  LangSetWindowText(HWND(*this), 0x02000B00);
 
24
  LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0]));
 
25
  #endif
 
26
  _passwordControl.Attach(GetItem(IDC_EDIT_PASSWORD));
 
27
  _passwordControl.SetText(Password);
 
28
  _passwordControl.SetPasswordChar(TEXT('*'));
 
29
  return CModalDialog::OnInit();
 
30
}
 
31
 
 
32
bool CPasswordDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
 
33
{
 
34
  if (buttonID == IDC_CHECK_PASSWORD_SHOW)
 
35
  {
 
36
    _passwordControl.SetPasswordChar((IsButtonChecked(
 
37
        IDC_CHECK_PASSWORD_SHOW) == BST_CHECKED) ? 0: TEXT('*'));
 
38
    UString password;
 
39
    _passwordControl.GetText(password);
 
40
    _passwordControl.SetText(password);
 
41
    return true;
 
42
  }
 
43
  return CDialog::OnButtonClicked(buttonID, buttonHWND);
 
44
}
 
45
 
 
46
void CPasswordDialog::OnOK()
 
47
{
 
48
  _passwordControl.GetText(Password);
 
49
  CModalDialog::OnOK();
 
50
}