Add history tracking and selectable hash formatting

Re-add clearing of various history tracking within registry
- see issue #113 for comments on this
- you can re-enable this via tools->options->settings

Re-add: selectable uppercase / lowercase hash formatting
- see issue #177 for more info about this

Signed-off-by: Tino Reichardt <milky-7zip@mcmilk.de>
This commit is contained in:
Tino Reichardt
2023-02-12 17:14:19 +01:00
parent edeaf1339f
commit 650fba0328
6 changed files with 56 additions and 7 deletions

View File

@@ -21,6 +21,10 @@
#include "../FileManager/RegistryUtils.h"
#endif
#ifdef WANT_OPTIONAL_LOWERCASE
#include "../FileManager/RegistryUtils.h"
#endif
#include "EnumDirItems.h"
#include "HashCalc.h"

View File

@@ -11,6 +11,8 @@
#include "../../../Windows/Registry.h"
#include "../../../Windows/Synchronization.h"
#include "../FileManager/RegistryUtils.h"
#include "ZipRegistry.h"
using namespace NWindows;
@@ -103,6 +105,7 @@ void CInfo::Save() const
CS_LOCK
CKey key;
CreateMainKey(key, kKeyName);
UStringVector Empty;
if (PathMode_Force)
key.SetValue(kExtractMode, (UInt32)PathMode);
@@ -116,7 +119,10 @@ void CInfo::Save() const
Key_Set_BoolPair(key, kShowPassword, ShowPassword);
key.RecurseDeleteKey(kPathHistory);
key.SetValue_Strings(kPathHistory, Paths);
if (WantPathHistory())
key.SetValue_Strings(kPathHistory, Paths);
else
key.SetValue_Strings(kPathHistory, Empty);
}
void Save_ShowPassword(bool showPassword)
@@ -233,6 +239,7 @@ static LPCWSTR const kMemUse = L"MemUse"
void CInfo::Save() const
{
UStringVector Empty;
CS_LOCK
CKey key;
@@ -250,7 +257,11 @@ void CInfo::Save() const
key.SetValue(kShowPassword, ShowPassword);
key.SetValue(kEncryptHeaders, EncryptHeaders);
key.RecurseDeleteKey(kArcHistory);
key.SetValue_Strings(kArcHistory, ArcPaths);
if (WantArcHistory())
key.SetValue_Strings(kArcHistory, ArcPaths);
else
key.SetValue_Strings(kArcHistory, Empty);
key.RecurseDeleteKey(kOptionsKeyName);
{

View File

@@ -50,6 +50,11 @@ bool WantCopyHistory();
bool WantFolderHistory();
bool WantLowercaseHashes();
bool WantArcHistory();
bool WantPathHistory();
bool WantCopyHistory();
bool WantFolderHistory();
void SaveFlatView(UInt32 panelIndex, bool enable);
bool ReadFlatView(UInt32 panelIndex);

View File

@@ -29,7 +29,12 @@ static const UInt32 kLangIDs[] =
IDX_SETTINGS_SHOW_GRID,
IDX_SETTINGS_SINGLE_CLICK,
IDX_SETTINGS_ALTERNATIVE_SELECTION,
IDX_SETTINGS_LARGE_PAGES
IDX_SETTINGS_LARGE_PAGES,
IDX_SETTINGS_WANT_ARC_HISTORY,
IDX_SETTINGS_WANT_PATH_HISTORY,
IDX_SETTINGS_WANT_COPY_HISTORY,
IDX_SETTINGS_WANT_FOLDER_HISTORY,
IDX_SETTINGS_LOWERCASE_HASHES
// , IDT_COMPRESS_MEMORY
};
@@ -181,6 +186,11 @@ bool CSettingsPage::OnInit()
}
*/
CheckButton(IDX_SETTINGS_WANT_ARC_HISTORY, st.ArcHistory);
CheckButton(IDX_SETTINGS_WANT_PATH_HISTORY, st.PathHistory);
CheckButton(IDX_SETTINGS_WANT_COPY_HISTORY, st.CopyHistory);
CheckButton(IDX_SETTINGS_WANT_FOLDER_HISTORY, st.FolderHistory);
CheckButton(IDX_SETTINGS_LOWERCASE_HASHES, st.LowercaseHashes);
// EnableSubItems();
return CPropertyPage::OnInit();
@@ -212,6 +222,11 @@ LONG CSettingsPage::OnApply()
st.ShowGrid = IsButtonCheckedBool(IDX_SETTINGS_SHOW_GRID);
st.SingleClick = IsButtonCheckedBool(IDX_SETTINGS_SINGLE_CLICK);
st.AlternativeSelection = IsButtonCheckedBool(IDX_SETTINGS_ALTERNATIVE_SELECTION);
st.ArcHistory = IsButtonCheckedBool(IDX_SETTINGS_WANT_ARC_HISTORY);
st.PathHistory = IsButtonCheckedBool(IDX_SETTINGS_WANT_PATH_HISTORY);
st.CopyHistory = IsButtonCheckedBool(IDX_SETTINGS_WANT_COPY_HISTORY);
st.FolderHistory = IsButtonCheckedBool(IDX_SETTINGS_WANT_FOLDER_HISTORY);
st.LowercaseHashes = IsButtonCheckedBool(IDX_SETTINGS_LOWERCASE_HASHES);
// st.Underline = IsButtonCheckedBool(IDX_SETTINGS_UNDERLINE);
st.ShowSystemMenu = IsButtonCheckedBool(IDX_SETTINGS_SHOW_SYSTEM_MENU);
@@ -334,6 +349,11 @@ bool CSettingsPage::OnButtonClicked(int buttonID, HWND buttonHWND)
case IDX_SETTINGS_FULL_ROW:
case IDX_SETTINGS_SHOW_GRID:
case IDX_SETTINGS_ALTERNATIVE_SELECTION:
case IDX_SETTINGS_WANT_ARC_HISTORY:
case IDX_SETTINGS_WANT_PATH_HISTORY:
case IDX_SETTINGS_WANT_COPY_HISTORY:
case IDX_SETTINGS_WANT_FOLDER_HISTORY:
case IDX_SETTINGS_LOWERCASE_HASHES:
_wasChanged = true;
break;

View File

@@ -7,11 +7,16 @@ BEGIN
CONTROL "&Full row select", IDX_SETTINGS_FULL_ROW, MY_CHECKBOX, m, 36, xc, 10
CONTROL "Show &grid lines", IDX_SETTINGS_SHOW_GRID, MY_CHECKBOX, m, 50, xc, 10
CONTROL "&Single-click to open an item", IDX_SETTINGS_SINGLE_CLICK, MY_CHECKBOX, m, 64, xc, 10
CONTROL "&Alternative selection mode", IDX_SETTINGS_ALTERNATIVE_SELECTION, MY_CHECKBOX, m, 78, xc, 10
CONTROL "Show system &menu", IDX_SETTINGS_SHOW_SYSTEM_MENU, MY_CHECKBOX, m, 100, xc, 10
CONTROL "&Alternative selection mode", IDX_SETTINGS_ALTERNATIVE_SELECTION, MY_CHECKBOX, m, 80, xc, 10
CONTROL "Show system &menu", IDX_SETTINGS_SHOW_SYSTEM_MENU, MY_CHECKBOX, m, 96, xc, 10
CONTROL "Use &large memory pages", IDX_SETTINGS_LARGE_PAGES, MY_CHECKBOX, m, 112, xc, 10
CONTROL "Use &large memory pages", IDX_SETTINGS_LARGE_PAGES, MY_CHECKBOX, m, 122, xc, 10
CONTROL "Want ArcHistory", IDX_SETTINGS_WANT_ARC_HISTORY, MY_CHECKBOX, m, 130, xc, 10
CONTROL "Want PathHistory", IDX_SETTINGS_WANT_PATH_HISTORY, MY_CHECKBOX, m, 144, xc, 10
CONTROL "Want CopyHistory", IDX_SETTINGS_WANT_COPY_HISTORY, MY_CHECKBOX, m, 158, xc, 10
CONTROL "Want FolderHistory", IDX_SETTINGS_WANT_FOLDER_HISTORY, MY_CHECKBOX, m, 172, xc, 10
CONTROL "Use Lowercase Hashes", IDX_SETTINGS_LOWERCASE_HASHES, MY_CHECKBOX, m, 186, xc, 10
// LTEXT "Memory usage for Compressing:", IDT_COMPRESS_MEMORY, m, 140, xc, 8
// COMBOBOX IDC_SETTINGS_MEM, m , 152, g1xs, yc - 152, MY_COMBO

View File

@@ -9,7 +9,11 @@
#define IDX_SETTINGS_SINGLE_CLICK 2506
#define IDX_SETTINGS_ALTERNATIVE_SELECTION 2507
#define IDX_SETTINGS_LARGE_PAGES 2508
#define IDX_SETTINGS_WANT_ARC_HISTORY 2509
#define IDX_SETTINGS_WANT_PATH_HISTORY 2510
#define IDX_SETTINGS_WANT_COPY_HISTORY 2511
#define IDX_SETTINGS_WANT_FOLDER_HISTORY 2512
#define IDX_SETTINGS_LOWERCASE_HASHES 2513
// #define IDT_SETTINGS_MEM 100
// #define IDC_SETTINGS_MEM 101