Skip to content

Commit

Permalink
Open folder support for nanazip classic
Browse files Browse the repository at this point in the history
  • Loading branch information
DaxDupont committed Jan 5, 2025
1 parent 2bd0075 commit 6cfe847
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ static LPCTSTR const kFullRow = TEXT("FullRow");
static LPCTSTR const kShowGrid = TEXT("ShowGrid");
static LPCTSTR const kSingleClick = TEXT("SingleClick");
static LPCTSTR const kAlternativeSelection = TEXT("AlternativeSelection");
static LPCTSTR const kOpenFolderAfterExtract = TEXT("OpenFolderAfterExtract");
// static LPCTSTR const kUnderline = TEXT("Underline");

static LPCTSTR const kShowSystemMenu = TEXT("ShowSystemMenu");
Expand Down Expand Up @@ -152,6 +153,7 @@ void CFmSettings::Save() const
SaveOption(kCopyHistory, CopyHistory);
SaveOption(kFolderHistory, FolderHistory);
SaveOption(kLowercaseHashes, LowercaseHashes);
SaveOption(kOpenFolderAfterExtract, OpenFolderAfterExtract);
// SaveOption(kUnderline, Underline);

SaveOption(kShowSystemMenu, ShowSystemMenu);
Expand All @@ -170,6 +172,7 @@ void CFmSettings::Load()
CopyHistory = false;
FolderHistory = false;
LowercaseHashes = false;
OpenFolderAfterExtract = false;
// Underline = false;

ShowSystemMenu = false;
Expand All @@ -188,6 +191,7 @@ void CFmSettings::Load()
ReadOption(key, kCopyHistory, CopyHistory);
ReadOption(key, kFolderHistory, FolderHistory);
ReadOption(key, kLowercaseHashes, LowercaseHashes);
ReadOption(key, kOpenFolderAfterExtract, OpenFolderAfterExtract);
// ReadOption(key, kUnderline, Underline);

ReadOption(key, kShowSystemMenu, ShowSystemMenu );
Expand All @@ -206,6 +210,7 @@ bool WantPathHistory() { return ReadFMOption(kPathHistory); }
bool WantCopyHistory() { return ReadFMOption(kCopyHistory); }
bool WantFolderHistory() { return ReadFMOption(kFolderHistory); }
bool WantLowercaseHashes() { return ReadFMOption(kLowercaseHashes); }
bool WantOpenFolderAfterExtract() { return ReadFMOption(kOpenFolderAfterExtract); }

static CSysString GetFlatViewName(UInt32 panelIndex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ struct CFmSettings
bool CopyHistory;
bool FolderHistory;
bool LowercaseHashes;
bool OpenFolderAfterExtract;
// bool Underline;

bool ShowSystemMenu;
Expand All @@ -49,6 +50,7 @@ bool WantPathHistory();
bool WantCopyHistory();
bool WantFolderHistory();
bool WantLowercaseHashes();
bool WantOpenFolderAfterExtract();

void SaveFlatView(UInt32 panelIndex, bool enable);
bool ReadFlatView(UInt32 panelIndex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ static const UInt32 kLangIDs[] =
IDX_SETTINGS_WANT_PATH_HISTORY,
IDX_SETTINGS_WANT_COPY_HISTORY,
IDX_SETTINGS_WANT_FOLDER_HISTORY,
IDX_SETTINGS_LOWERCASE_HASHES
IDX_SETTINGS_LOWERCASE_HASHES,
IDX_SETTINGS_OPEN_FOLDER_AFTER
// , IDT_COMPRESS_MEMORY
};

Expand Down Expand Up @@ -125,6 +126,7 @@ bool CSettingsPage::OnInit()
CheckButton(IDX_SETTINGS_SHOW_GRID, st.ShowGrid);
CheckButton(IDX_SETTINGS_SINGLE_CLICK, st.SingleClick);
CheckButton(IDX_SETTINGS_ALTERNATIVE_SELECTION, st.AlternativeSelection);
CheckButton(IDX_SETTINGS_OPEN_FOLDER_AFTER, st.OpenFolderAfterExtract);
// CheckButton(IDX_SETTINGS_UNDERLINE, st.Underline);

CheckButton(IDX_SETTINGS_SHOW_SYSTEM_MENU, st.ShowSystemMenu);
Expand Down Expand Up @@ -224,6 +226,7 @@ LONG CSettingsPage::OnApply()
st.CopyHistory = IsButtonCheckedBool(IDX_SETTINGS_WANT_COPY_HISTORY);
st.FolderHistory = IsButtonCheckedBool(IDX_SETTINGS_WANT_FOLDER_HISTORY);
st.LowercaseHashes = IsButtonCheckedBool(IDX_SETTINGS_LOWERCASE_HASHES);
st.OpenFolderAfterExtract = IsButtonCheckedBool(IDX_SETTINGS_OPEN_FOLDER_AFTER);
// st.Underline = IsButtonCheckedBool(IDX_SETTINGS_UNDERLINE);

st.ShowSystemMenu = IsButtonCheckedBool(IDX_SETTINGS_SHOW_SYSTEM_MENU);
Expand Down Expand Up @@ -341,6 +344,7 @@ 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_OPEN_FOLDER_AFTER:
case IDX_SETTINGS_WANT_ARC_HISTORY:
case IDX_SETTINGS_WANT_PATH_HISTORY:
case IDX_SETTINGS_WANT_COPY_HISTORY:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@ BEGIN
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 "&Open folder after extract", IDX_SETTINGS_OPEN_FOLDER_AFTER, MY_CHECKBOX, m, 92, xc, 10

CONTROL "Show system &menu", IDX_SETTINGS_SHOW_SYSTEM_MENU, MY_CHECKBOX, m, 100, xc, 10
CONTROL "Show system &menu", IDX_SETTINGS_SHOW_SYSTEM_MENU, MY_CHECKBOX, m, 114, xc, 10

CONTROL "Use &large memory pages", IDX_SETTINGS_LARGE_PAGES, MY_CHECKBOX, m, 122, xc, 10
CONTROL "Use &large memory pages", IDX_SETTINGS_LARGE_PAGES, MY_CHECKBOX, m, 136, xc, 10

CONTROL "Want ArcHistory", IDX_SETTINGS_WANT_ARC_HISTORY, MY_CHECKBOX, m, 140, xc, 10
CONTROL "Want PathHistory", IDX_SETTINGS_WANT_PATH_HISTORY, MY_CHECKBOX, m, 154, xc, 10
CONTROL "Want CopyHistory", IDX_SETTINGS_WANT_COPY_HISTORY, MY_CHECKBOX, m, 168, xc, 10
CONTROL "Want FolderHistory", IDX_SETTINGS_WANT_FOLDER_HISTORY, MY_CHECKBOX, m, 182, xc, 10
CONTROL "Use Lowercase Hashes", IDX_SETTINGS_LOWERCASE_HASHES, MY_CHECKBOX, m, 196, xc, 10
CONTROL "Want ArcHistory", IDX_SETTINGS_WANT_ARC_HISTORY, MY_CHECKBOX, m, 154, xc, 10
CONTROL "Want PathHistory", IDX_SETTINGS_WANT_PATH_HISTORY, MY_CHECKBOX, m, 168, xc, 10
CONTROL "Want CopyHistory", IDX_SETTINGS_WANT_COPY_HISTORY, MY_CHECKBOX, m, 182, xc, 10
CONTROL "Want FolderHistory", IDX_SETTINGS_WANT_FOLDER_HISTORY, MY_CHECKBOX, m, 196, xc, 10
CONTROL "Use Lowercase Hashes", IDX_SETTINGS_LOWERCASE_HASHES, MY_CHECKBOX, m, 220, 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define IDX_SETTINGS_WANT_COPY_HISTORY 2511
#define IDX_SETTINGS_WANT_FOLDER_HISTORY 2512
#define IDX_SETTINGS_LOWERCASE_HASHES 2513
#define IDX_SETTINGS_OPEN_FOLDER_AFTER 2514


// #define IDT_SETTINGS_MEM 100
Expand Down
5 changes: 5 additions & 0 deletions NanaZip.UI.Classic/SevenZip/CPP/7zip/UI/GUI/GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include "../FileManager/StringUtils.h"
#include "../FileManager/MyWindowsNew.h"
#include "../FileManager/RegistryUtils.h"

#include "BenchmarkDialog.h"
#include "ExtractGUI.h"
Expand Down Expand Up @@ -300,8 +301,12 @@ static int Main2()
return NExitCode::kFatalError;
throw CSystemException(result);
}
else if (WantOpenFolderAfterExtract()) {
ShellExecuteW(NULL, NULL, eo.OutputDir, NULL, NULL, SW_SHOWNORMAL);
}
if (!ecs->IsOK())
return NExitCode::kFatalError;

}
else if (options.Command.IsFromUpdateGroup())
{
Expand Down

0 comments on commit 6cfe847

Please sign in to comment.