apply James Hoo 's other original mod

This commit is contained in:
shunf4
2024-04-20 19:09:23 +08:00
parent d5255dec84
commit b085993aae
10 changed files with 86 additions and 27 deletions

View File

@@ -25,3 +25,18 @@
#define MY_COPYRIGHT_DATE MY_COPYRIGHT " : " MY_DATE
#define MY_VERSION_COPYRIGHT_DATE MY_VERSION_CPU " : " MY_COPYRIGHT " : " MY_DATE
#define MY_EASY7ZIP_VER_MAJOR 0
#define MY_EASY7ZIP_VER_MINOR 1
#define MY_EASY7ZIP_7ZIP "Easy 7-Zip"
#define MY_EASY7ZIP_VERSION "0.1.6-shunf4"
#define MY_EASY7ZIP_7ZIP_VERSION "Easy 7-Zip v0.1.6-shunf4"
#define MY_EASY7ZIP_COPYRIGHT "Portions Copyright (C) 2013-2016 James Hoo"
#define MY_EASY7ZIP_AUTHOR "James Hoo"
#define MY_EASY7ZIP_HOMEPAGE "e7z.org"
#define MY_EASY7ZIP_SPECIAL_BUILD MY_EASY7ZIP_7ZIP_VERSION " (www." MY_EASY7ZIP_HOMEPAGE ") made by " MY_EASY7ZIP_AUTHOR

View File

@@ -21,8 +21,10 @@ static NSynchronization::CCriticalSection g_CS;
#define CS_LOCK NSynchronization::CCriticalSectionLock lock(g_CS);
static LPCTSTR const kCuPrefix = TEXT("Software") TEXT(STRING_PATH_SEPARATOR) TEXT("7-Zip") TEXT(STRING_PATH_SEPARATOR);
static LPCTSTR const kCuFMPrefix = TEXT("Software") TEXT(STRING_PATH_SEPARATOR) TEXT("7-Zip") TEXT(STRING_PATH_SEPARATOR) TEXT("FM");
static CSysString GetKeyPath(LPCTSTR path) { return kCuPrefix + (CSysString)path; }
static CSysString GetFMKeyPath() { return kCuFMPrefix; }
static LONG OpenMainKey(CKey &key, LPCTSTR keyName)
{
@@ -34,6 +36,16 @@ static LONG CreateMainKey(CKey &key, LPCTSTR keyName)
return key.Create(HKEY_CURRENT_USER, GetKeyPath(keyName));
}
static LONG OpenFMKey(CKey &key)
{
return key.Open(HKEY_CURRENT_USER, GetFMKeyPath(), KEY_READ);
}
static LONG CreateFMKey(CKey &key)
{
return key.Create(HKEY_CURRENT_USER, GetFMKeyPath());
}
static void Key_Set_UInt32(CKey &key, LPCTSTR name, UInt32 value)
{
if (value == (UInt32)(Int32)-1)
@@ -99,6 +111,8 @@ static LPCTSTR const kElimDup = TEXT("ElimDup");
// static LPCTSTR const kAltStreams = TEXT("AltStreams");
static LPCTSTR const kNtSecur = TEXT("Security");
static LPCTSTR const kFMCopyHistoryValueName = TEXT("CopyHistory");
void CInfo::Save() const
{
CS_LOCK
@@ -116,8 +130,15 @@ void CInfo::Save() const
Key_Set_BoolPair(key, kNtSecur, NtSecurity);
Key_Set_BoolPair(key, kShowPassword, ShowPassword);
key.RecurseDeleteKey(kPathHistory);
key.SetValue_Strings(kPathHistory, Paths);
// key.RecurseDeleteKey(kPathHistory);
// key.SetValue_Strings(kPathHistory, Paths);
key.Close();
if (CreateFMKey(key) == ERROR_SUCCESS)
{
key.SetValue_Strings(kFMCopyHistoryValueName, Paths);
key.Close();
}
}
void Save_ShowPassword(bool showPassword)
@@ -141,10 +162,12 @@ void CInfo::Load()
CS_LOCK
CKey key;
if (OpenMainKey(key, kKeyName) != ERROR_SUCCESS)
return;
// if (OpenMainKey(key, kKeyName) != ERROR_SUCCESS)
// return;
key.GetValue_Strings(kPathHistory, Paths);
if (OpenMainKey(key, kKeyName) == ERROR_SUCCESS)
{
// key.GetValue_Strings(kPathHistory, Paths);
UInt32 v;
if (key.QueryValue(kExtractMode, v) == ERROR_SUCCESS && v <= NPathMode::kAbsPaths)
{
@@ -163,6 +186,13 @@ void CInfo::Load()
// Key_Get_BoolPair(key, kAltStreams, AltStreams);
Key_Get_BoolPair(key, kNtSecur, NtSecurity);
Key_Get_BoolPair(key, kShowPassword, ShowPassword);
key.Close();
}
if (OpenFMKey(key) == ERROR_SUCCESS)
{
key.GetValue_Strings(kFMCopyHistoryValueName, Paths);
key.Close();
}
}
bool Read_ShowPassword()
@@ -542,11 +572,11 @@ void CContextMenuInfo::Save() const
void CContextMenuInfo::Load()
{
Cascaded.Val = true;
Cascaded.Val = false;
Cascaded.Def = false;
MenuIcons.Val = false;
MenuIcons.Def = false;
MenuIcons.Val = true;
MenuIcons.Def = true;
ElimDup.Val = true;
ElimDup.Def = false;

View File

@@ -43,6 +43,9 @@ namespace NExtract
void Save_ShowPassword(bool showPassword);
bool Read_ShowPassword();
void SaveOptShowPassword(bool bShow);
bool ReadOptShowPassword();
}
namespace NCompression

View File

@@ -18,7 +18,7 @@ void CAboutEasy7ZipDialog::OnHelp()
ShowHelpWindow(kHelpTopic);
}
bool CAboutEasy7ZipDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
bool CAboutEasy7ZipDialog::OnButtonClicked(unsigned buttonID, HWND buttonHWND)
{
LPCTSTR url;
switch(buttonID)

View File

@@ -9,9 +9,9 @@
class CAboutEasy7ZipDialog: public NWindows::NControl::CModalDialog
{
public:
virtual bool OnInit();
virtual void OnHelp();
virtual bool OnButtonClicked(int buttonID, HWND buttonHWND);
virtual bool OnInit() Z7_override;
virtual void OnHelp() Z7_override;
virtual bool OnButtonClicked(unsigned buttonID, HWND buttonHWND) Z7_override;
INT_PTR Create(HWND wndParent = 0) { return CModalDialog::Create(IDD_ABOUT_EASY_7ZIP, wndParent); }
};

View File

@@ -55,6 +55,7 @@ FM_OBJS = \
$O\UpdateCallback100.obj \
$O\ViewSettings.obj \
$O\AboutDialog.obj \
$O\AboutEasy7ZipDialog.obj \
$O\ComboDialog.obj \
$O\CopyDialog.obj \
$O\EditDialog.obj \

View File

@@ -11,6 +11,7 @@
#include "../Common/CompressCall.h"
#include "AboutDialog.h"
#include "AboutEasy7ZipDialog.h"
#include "App.h"
#include "HelpUtils.h"
#include "LangUtils.h"
@@ -894,6 +895,12 @@ bool OnMenuCommand(HWND hWnd, unsigned id)
dialog.Create(hWnd);
break;
}
case IDM_ABOUT_EASY_7ZIP:
{
CAboutEasy7ZipDialog dialog;
dialog.Create(hWnd);
break;
}
default:
{
if (id >= k_MenuID_OpenBookmark && id <= k_MenuID_OpenBookmark + 9)

View File

@@ -971,7 +971,7 @@ public:
void RefreshTitle(bool always = false) { _panelCallback->RefreshTitle(always); }
void RefreshTitleAlways() { RefreshTitle(true); }
UString GetItemsInfoString(const CRecordVector<UInt32> &indices);
UString GetItemsInfoString(const CRecordVector<UInt32> &indices, int *soleDir);
};
class CMyBuffer

View File

@@ -110,6 +110,7 @@
#define IDM_HELP_CONTENTS 960
#define IDM_ABOUT 961
#define IDM_ABOUT_EASY_7ZIP 962
#define IDS_OPTIONS 2100

View File

@@ -149,6 +149,7 @@ BEGIN
#endif
MY_MENUITEM_SEPARATOR
MENUITEM "&About 7-Zip...", IDM_ABOUT
MENUITEM "&About Easy 7-Zip...", IDM_ABOUT_EASY_7ZIP
END
END
@@ -262,6 +263,7 @@ BEGIN
END
#include "AboutDialog.rc"
#include "AboutEasy7ZipDialog.rc"
#include "BrowseDialog.rc"
#include "ComboDialog.rc"
#include "CopyDialog.rc"