MCPcopy Create free account
hub / github.com/derceg/explorerplusplus / OnInitDialog

Method OnInitDialog

Explorer++/Explorer++/SetFileAttributesDialog.cpp:25–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25INT_PTR SetFileAttributesDialog::OnInitDialog()
26{
27 InitializeAttributesStructure();
28 InitializeDateFields();
29
30 int nItems = static_cast<int>(m_FileList.size());
31
32 int nArchived = 0;
33 int nHidden = 0;
34 int nSystem = 0;
35 int nReadOnly = 0;
36 int nIndexed = 0;
37
38 for (const auto &file : m_FileList)
39 {
40 if (file.wfd.dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE)
41 {
42 nArchived++;
43 }
44
45 if ((file.wfd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) == FILE_ATTRIBUTE_HIDDEN)
46 {
47 nHidden++;
48 }
49
50 if (file.wfd.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM)
51 {
52 nSystem++;
53 }
54
55 if (file.wfd.dwFileAttributes & FILE_ATTRIBUTE_READONLY)
56 {
57 nReadOnly++;
58 }
59
60 if (!(file.wfd.dwFileAttributes & FILE_ATTRIBUTE_NOT_CONTENT_INDEXED))
61 {
62 nIndexed++;
63 }
64 }
65
66 ResetButtonState(GetDlgItem(m_hDlg, IDC_CHECK_ARCHIVE), nArchived == 0 || nArchived == nItems);
67 ResetButtonState(GetDlgItem(m_hDlg, IDC_CHECK_HIDDEN), nHidden == 0 || nHidden == nItems);
68 ResetButtonState(GetDlgItem(m_hDlg, IDC_CHECK_SYSTEM), nSystem == 0 || nSystem == nItems);
69 ResetButtonState(GetDlgItem(m_hDlg, IDC_CHECK_READONLY), nReadOnly == 0 || nReadOnly == nItems);
70 ResetButtonState(GetDlgItem(m_hDlg, IDC_CHECK_INDEXED), nIndexed == 0 || nIndexed == nItems);
71
72 SetAttributeCheckState(GetDlgItem(m_hDlg, IDC_CHECK_ARCHIVE), nArchived, nItems);
73 SetAttributeCheckState(GetDlgItem(m_hDlg, IDC_CHECK_HIDDEN), nHidden, nItems);
74 SetAttributeCheckState(GetDlgItem(m_hDlg, IDC_CHECK_SYSTEM), nSystem, nItems);
75 SetAttributeCheckState(GetDlgItem(m_hDlg, IDC_CHECK_READONLY), nReadOnly, nItems);
76 SetAttributeCheckState(GetDlgItem(m_hDlg, IDC_CHECK_INDEXED), nIndexed, nItems);
77
78 m_bModificationDateEnabled = FALSE;
79 m_bCreationDateEnabled = FALSE;
80 m_bAccessDateEnabled = FALSE;
81
82 m_psfadps->RestoreDialogPosition(m_hDlg, false);

Callers

nothing calls this directly

Calls 2

RestoreDialogPositionMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected