Skip to content

Commit

Permalink
- Added a "case insensitive" check box to the color rule dialog.
Browse files Browse the repository at this point in the history
- Updated the ignore property on several folders.

git-svn-id: https://explorerplus.svn.sourceforge.net/svnroot/explorerplus/trunk@512 a26bab42-55fb-42b1-bc7e-414d9f4e121a
  • Loading branch information
derceg committed Aug 11, 2012
1 parent 11abb80 commit 7571334
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Explorer++/Explorer++/ColorRuleDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ INT_PTR CColorRuleDialog::OnInitDialog()

m_cfCurrentColor = m_pColorRule->rgbColour;

if(m_pColorRule->caseInsensitive)
CheckDlgButton(m_hDlg,IDC_CHECK_CASE_INSENSITIVE,BST_CHECKED);

if(m_pColorRule->dwFilterAttributes & FILE_ATTRIBUTE_COMPRESSED)
CheckDlgButton(m_hDlg,IDC_CHECK_COMPRESSED,BST_CHECKED);

Expand Down Expand Up @@ -134,6 +137,8 @@ void CColorRuleDialog::OnOk()

m_pColorRule->rgbColour = m_cfCurrentColor;

m_pColorRule->caseInsensitive = (IsDlgButtonChecked(m_hDlg,IDC_CHECK_CASE_INSENSITIVE) == BST_CHECKED);

m_pColorRule->dwFilterAttributes = 0;

if(IsDlgButtonChecked(m_hDlg,IDC_CHECK_COMPRESSED) == BST_CHECKED)
Expand Down
13 changes: 13 additions & 0 deletions Explorer++/Explorer++/ColorRuleHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ std::vector<NColorRuleHelper::ColorRule_t> NColorRuleHelper::GetDefaultColorRule

LoadString(hLanguageModule,IDS_GENERAL_COLOR_RULE_COMPRESSED,szTemp,SIZEOF_ARRAY(szTemp));
ColorRule.strDescription = szTemp;
ColorRule.caseInsensitive = FALSE;
ColorRule.rgbColour = CF_COMPRESSED;
ColorRule.dwFilterAttributes = FILE_ATTRIBUTE_COMPRESSED;
ColorRules.push_back(ColorRule);

LoadString(hLanguageModule,IDS_GENERAL_COLOR_RULE_ENCRYPTED,szTemp,SIZEOF_ARRAY(szTemp));
ColorRule.strDescription = szTemp;
ColorRule.caseInsensitive = FALSE;
ColorRule.rgbColour = CF_ENCRYPTED;
ColorRule.dwFilterAttributes = FILE_ATTRIBUTE_ENCRYPTED;
ColorRules.push_back(ColorRule);
Expand Down Expand Up @@ -88,10 +90,13 @@ namespace
{
NColorRuleHelper::ColorRule_t ColorRule;

ColorRule.caseInsensitive = FALSE;

LONG lDescriptionStatus = NRegistrySettings::ReadStringFromRegistry(hKeyChild,
_T("Description"),ColorRule.strDescription);
LONG lFilenamePatternStatus = NRegistrySettings::ReadStringFromRegistry(hKeyChild,
_T("FilenamePattern"),ColorRule.strFilterPattern);
NRegistrySettings::ReadDwordFromRegistry(hKeyChild,_T("CaseInsensitive"),(LPDWORD)&ColorRule.caseInsensitive);
NRegistrySettings::ReadDwordFromRegistry(hKeyChild,_T("Attributes"),&ColorRule.dwFilterAttributes);

DWORD dwType = REG_BINARY;
Expand Down Expand Up @@ -147,6 +152,7 @@ namespace
{
NRegistrySettings::SaveStringToRegistry(hKeyChild,_T("Description"),ColorRule.strDescription.c_str());
NRegistrySettings::SaveStringToRegistry(hKeyChild,_T("FilenamePattern"),ColorRule.strFilterPattern.c_str());
NRegistrySettings::SaveDwordToRegistry(hKeyChild,_T("CaseInsensitive"),ColorRule.caseInsensitive);
NRegistrySettings::SaveDwordToRegistry(hKeyChild,_T("Attributes"),ColorRule.dwFilterAttributes);
RegSetValueEx(hKeyChild,_T("Color"),0,REG_BINARY,reinterpret_cast<const BYTE *>(&ColorRule.rgbColour),sizeof(ColorRule.rgbColour));

Expand Down Expand Up @@ -205,6 +211,8 @@ namespace

am->get_length(&nAttributeNodes);

ColorRule.caseInsensitive = FALSE;

for(long i = 0;i < nAttributeNodes;i++)
{
am->get_item(i, &pAttributeNode);
Expand All @@ -224,6 +232,10 @@ namespace

bFilenamePatternFound = TRUE;
}
else if(lstrcmpi(bstrName,L"CaseInsensitive") == 0)
{
ColorRule.caseInsensitive = NXMLSettings::DecodeBoolValue(bstrValue);
}
else if(lstrcmpi(bstrName,L"Attributes") == 0)
{
ColorRule.dwFilterAttributes = NXMLSettings::DecodeIntValue(bstrValue);
Expand Down Expand Up @@ -315,6 +327,7 @@ namespace

NXMLSettings::CreateElementNode(pXMLDom,&pParentNode,pe,_T("ColorRule"),ColorRule.strDescription.c_str());
NXMLSettings::AddAttributeToNode(pXMLDom,pParentNode,_T("FilenamePattern"),ColorRule.strFilterPattern.c_str());
NXMLSettings::AddAttributeToNode(pXMLDom,pParentNode,_T("CaseInsensitive"),NXMLSettings::EncodeBoolValue(ColorRule.caseInsensitive));
NXMLSettings::AddAttributeToNode(pXMLDom,pParentNode,_T("Attributes"),NXMLSettings::EncodeIntValue(ColorRule.dwFilterAttributes));
NXMLSettings::AddAttributeToNode(pXMLDom,pParentNode,_T("r"),NXMLSettings::EncodeIntValue(GetRValue(ColorRule.rgbColour)));
NXMLSettings::AddAttributeToNode(pXMLDom,pParentNode,_T("g"),NXMLSettings::EncodeIntValue(GetGValue(ColorRule.rgbColour)));
Expand Down
1 change: 1 addition & 0 deletions Explorer++/Explorer++/ColorRuleHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace NColorRuleHelper

/* Filename and attribute filtering. */
std::wstring strFilterPattern;
BOOL caseInsensitive;
DWORD dwFilterAttributes;

COLORREF rgbColour;
Expand Down
Binary file modified Explorer++/Explorer++/Explorer++.rc
Binary file not shown.
2 changes: 1 addition & 1 deletion Explorer++/Explorer++/MsgHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2525,7 +2525,7 @@ LRESULT Explorerplusplus::OnCustomDraw(LPARAM lParam)
/* Only match against the filename if it's not empty. */
if(ColorRule.strFilterPattern.size() > 0)
{
if(CheckWildcardMatch(ColorRule.strFilterPattern.c_str(),szFileName,TRUE) == 1)
if(CheckWildcardMatch(ColorRule.strFilterPattern.c_str(),szFileName,!ColorRule.caseInsensitive) == 1)
{
bMatchFileName = TRUE;
}
Expand Down
Binary file modified Explorer++/Explorer++/resource.h
Binary file not shown.

0 comments on commit 7571334

Please sign in to comment.