mirror of
https://github.com/ip7z/7zip.git
synced 2026-04-21 06:03:40 +00:00
English This patch addresses the review feedback around Windows installer metadata and update-path handling, and removes a partially implemented UI surface that duplicated the existing multi-output path controls. Installer / ARP metadata - The installer previously wrote fork-specific hardcoded values into the Windows Uninstall registry entry (`DisplayName`, `DisplayVersion`, `Publisher`). - That created drift between the installed product metadata and the actual upstream 7-Zip version/author macros used elsewhere in the tree. - The patch removes the hardcoded fork values and derives the registry values from the existing 7-Zip definitions: - `DisplayName` now uses the existing versioned product string (`7-Zip 26.00 (x64)` on 64-bit builds). - `DisplayVersion` now comes from `MY_VERSION`. - `Publisher` now comes from `MY_AUTHOR_NAME`. - This makes the Add/Remove Programs entry consistent with the rest of the build metadata and removes the need for manual source edits on each branch-specific release. Compression dialog cleanup - The `Paths...` button and its dedicated dialog were not part of the stable workflow. - At this point the main compression dialog already exposes the supported multi-output behavior through the output-count selector plus the existing archive path rows and browse buttons. - Keeping a second path-editing dialog in parallel would add maintenance overhead and duplicate UI/state management without providing new functionality. - For that reason, this patch removes the incomplete/duplicate surface entirely: - the `Paths...` button was removed from the dialog resource, - the handler declaration/definition was removed, - the auxiliary `COutputArcPathsDialog` class was removed, - the associated resource IDs and helper parsing/serialization code were removed. - Functional capability is unchanged: users still configure multiple output targets through the existing archive path controls already present in the compression dialog. Update path deduplication - In `UpdateGUI.cpp`, `AddUniquePath()` previously compared paths with a case-sensitive equality check. - On Windows, this could fail to deduplicate logically identical paths that differ only by casing. - The comparison is now case-insensitive (`IsEqualTo_NoCase()`), which matches expected Windows path behavior more closely and prevents duplicate item entries in the update/compression path collection stage. - This is intentionally a minimal fix: it addresses case-only duplication without changing the broader path normalization rules. Working directory safety - `PrepareWorkingDirForArchivePath()` previously ignored the return value of `MyGetFullPathName()`. - If full-path resolution failed, the code could continue with an invalid or empty path and derive an incorrect working directory. - The function now exits early when `MyGetFullPathName()` fails, leaving `options.WorkingDir` empty. - This is a conservative change: the downstream update flow already has fallback behavior for an empty working directory, so the patch avoids propagating bad path state without altering the existing fallback model. Header consistency / non-functional cleanup - `LangUtils.h` now provides a non-`Z7_LANG` fallback declaration for `LangString_OnlyFromLangFile()`. - This is not a functional runtime change for normal localized builds, but it keeps the header interface consistent across configurations and avoids IDE/static-analysis mismatches where `Z7_LANG` is not visible to the parser. Behavioral impact - No archive format logic was changed. - No codec behavior was changed. - No new persistence format was introduced. - The only runtime behavior changes are: - correct Windows ARP metadata, - removal of dead/duplicate UI, - case-insensitive deduplication of update input paths, - safer handling of full-path resolution failure before working directory derivation. Validation - The change set was validated with targeted code search and diff review to ensure the removed dialog/button plumbing no longer has remaining references. - `git diff --check` was also run on the touched files. - A full build/test pass has not yet been run in this environment. Portuguese Este patch responde ao feedback de revisão relacionado aos metadados do instalador no Windows e ao tratamento de caminhos no fluxo de atualização, além de remover uma superfície de UI parcialmente implementada que duplicava os controles já existentes para múltiplos caminhos de saída. Instalador / metadados do item no Windows - O instalador estava gravando valores hardcoded e específicos do fork na chave de desinstalação do Windows (`DisplayName`, `DisplayVersion`, `Publisher`). - Isso criava divergência entre os metadados exibidos em “Aplicativos instalados / Programas e Recursos” e as macros oficiais de versão/autoria já utilizadas no restante do código-fonte. - O patch remove esses valores fixos do fork e passa a derivar os valores diretamente das definições já existentes do 7-Zip: - `DisplayName` agora usa a string versionada já existente do produto (`7-Zip 26.00 (x64)` em builds 64-bit). - `DisplayVersion` agora vem de `MY_VERSION`. - `Publisher` agora vem de `MY_AUTHOR_NAME`. - Com isso, a entrada instalada no Windows fica consistente com os demais metadados do build e deixa de exigir edição manual do código a cada release da branch. Limpeza do diálogo de compressão - O botão `Paths...` e a dialog auxiliar associada não faziam parte de um fluxo estável/finalizado. - Neste momento, a janela principal de compressão já expõe o comportamento suportado de múltiplas saídas por meio do seletor de quantidade de saídas, dos campos de caminho de arquivo e dos botões de browse já existentes. - Manter uma segunda dialog para edição textual desses caminhos aumentaria o custo de manutenção e duplicaria a lógica de estado/UI sem adicionar capacidade funcional nova. - Por esse motivo, este patch remove completamente essa superfície incompleta/duplicada: - o botão `Paths...` foi removido do recurso da dialog, - a declaração e a implementação do handler foram removidas, - a classe auxiliar `COutputArcPathsDialog` foi removida, - os IDs de recurso associados e os helpers internos de parsing/serialização dessa dialog também foram removidos. - A capacidade funcional permanece a mesma: o usuário continua podendo configurar múltiplos destinos pelos controles de caminhos de saída já existentes na própria janela de compressão. Deduplicação de caminhos no fluxo de atualização - Em `UpdateGUI.cpp`, a função `AddUniquePath()` comparava caminhos usando igualdade case-sensitive. - Em Windows, isso podia falhar em deduplicar caminhos logicamente idênticos que diferiam apenas por maiúsculas/minúsculas. - A comparação agora é case-insensitive (`IsEqualTo_NoCase()`), o que se alinha melhor ao comportamento esperado para caminhos no Windows e evita entradas duplicadas durante a coleta dos caminhos de itens no fluxo de atualização/compressão. - A alteração foi mantida propositalmente mínima: ela corrige a duplicação por diferença de casing sem alterar as regras mais amplas de normalização de caminhos. Segurança na preparação do diretório de trabalho - `PrepareWorkingDirForArchivePath()` ignorava o valor de retorno de `MyGetFullPathName()`. - Se a resolução para caminho absoluto falhasse, o código poderia continuar com um caminho inválido ou vazio e, a partir disso, derivar um diretório de trabalho incorreto. - Agora a função retorna imediatamente quando `MyGetFullPathName()` falha, deixando `options.WorkingDir` vazio. - Essa mudança é conservadora: o fluxo subsequente de atualização já possui fallback quando o diretório de trabalho está vazio, então o patch evita propagar um estado inconsistente sem alterar o modelo de fallback já existente. Consistência de headers / limpeza não funcional - `LangUtils.h` agora fornece um fallback para `LangString_OnlyFromLangFile()` também quando `Z7_LANG` não está definido. - Isso não altera o comportamento funcional em builds localizados normais, mas mantém a interface do header consistente entre configurações e evita divergências em IDEs/analisadores estáticos quando `Z7_LANG` não está visível para o parser. Impacto comportamental - Nenhuma lógica de formato de arquivo foi alterada. - Nenhum comportamento de codec foi alterado. - Nenhum novo formato de persistência foi introduzido. - As únicas mudanças observáveis em runtime são: - correção dos metadados exibidos pelo Windows para a instalação, - remoção de uma UI morta/duplicada, - deduplicação case-insensitive de caminhos no fluxo de atualização, - tratamento mais seguro de falha ao resolver caminho absoluto antes de derivar o diretório de trabalho. Validação - O conjunto de alterações foi validado com buscas direcionadas no código e revisão de diff para garantir que a plumbing removida da dialog/botão não deixou referências residuais. - Também foi executado `git diff --check` nos arquivos alterados. - Ainda não foi executado um ciclo completo de build/testes neste ambiente.
555 lines
14 KiB
C++
555 lines
14 KiB
C++
// CompressDialog.h
|
|
|
|
#ifndef ZIP7_INC_COMPRESS_DIALOG_H
|
|
#define ZIP7_INC_COMPRESS_DIALOG_H
|
|
|
|
#include "../../../Common/Wildcard.h"
|
|
|
|
#include "../../../Windows/Control/ComboBox.h"
|
|
#include "../../../Windows/Control/Edit.h"
|
|
|
|
#include "../Common/LoadCodecs.h"
|
|
#include "../Common/ZipRegistry.h"
|
|
|
|
#include "../FileManager/DialogSize.h"
|
|
|
|
#include "CompressDialogRes.h"
|
|
|
|
namespace NCompressDialog
|
|
{
|
|
namespace NUpdateMode
|
|
{
|
|
enum EEnum
|
|
{
|
|
kAdd,
|
|
kUpdate,
|
|
kFresh,
|
|
kSync
|
|
};
|
|
}
|
|
|
|
struct CInfo
|
|
{
|
|
NUpdateMode::EEnum UpdateMode;
|
|
NWildcard::ECensorPathMode PathMode;
|
|
|
|
bool SolidIsSpecified;
|
|
// bool MultiThreadIsAllowed;
|
|
UInt64 SolidBlockSize;
|
|
UInt32 NumThreads;
|
|
|
|
NCompression::CMemUse MemUsage;
|
|
|
|
CRecordVector<UInt64> VolumeSizes;
|
|
|
|
UInt32 Level;
|
|
UString Method;
|
|
UInt64 Dict64;
|
|
// UInt64 Dict64_Chain;
|
|
bool OrderMode;
|
|
UInt32 Order;
|
|
UString Options;
|
|
|
|
UString EncryptionMethod;
|
|
|
|
bool SFXMode;
|
|
bool OpenShareForWrite;
|
|
bool DeleteAfterCompressing;
|
|
|
|
CBoolPair SymLinks;
|
|
CBoolPair HardLinks;
|
|
CBoolPair AltStreams;
|
|
CBoolPair NtSecurity;
|
|
|
|
CBoolPair PreserveATime;
|
|
|
|
UInt32 TimePrec;
|
|
CBoolPair MTime;
|
|
CBoolPair CTime;
|
|
CBoolPair ATime;
|
|
CBoolPair SetArcMTime;
|
|
|
|
UString ArcPath; // in: Relative or abs ; out: Relative or abs
|
|
UStringVector ArcPaths;
|
|
UStringVector ItemPaths;
|
|
UStringVector ItemOutputItemPaths;
|
|
UStringVector ItemArcPaths;
|
|
bool SeparateItemArchives;
|
|
|
|
// FString CurrentDirPrefix;
|
|
bool KeepName;
|
|
|
|
bool GetFullPathName(UString &result) const;
|
|
|
|
int FormatIndex;
|
|
|
|
UString Password;
|
|
bool EncryptHeadersIsAllowed;
|
|
bool EncryptHeaders;
|
|
|
|
CInfo():
|
|
UpdateMode(NCompressDialog::NUpdateMode::kAdd),
|
|
PathMode(NWildcard::k_RelatPath),
|
|
SFXMode(false),
|
|
OpenShareForWrite(false),
|
|
DeleteAfterCompressing(false),
|
|
SeparateItemArchives(false),
|
|
FormatIndex(-1)
|
|
{
|
|
Level = Order = (UInt32)(Int32)-1;
|
|
NumThreads = (UInt32)(Int32)-1;
|
|
SolidIsSpecified = false;
|
|
Dict64 = (UInt64)(Int64)(-1);
|
|
// Dict64_Chain = (UInt64)(Int64)(-1);
|
|
OrderMode = false;
|
|
Method.Empty();
|
|
Options.Empty();
|
|
EncryptionMethod.Empty();
|
|
TimePrec = (UInt32)(Int32)(-1);
|
|
}
|
|
};
|
|
}
|
|
|
|
|
|
struct CBool1
|
|
{
|
|
bool Val;
|
|
bool Supported;
|
|
|
|
CBool1(): Val(false), Supported(false) {}
|
|
|
|
void Init()
|
|
{
|
|
Val = false;
|
|
Supported = false;
|
|
}
|
|
|
|
void SetTrueTrue()
|
|
{
|
|
Val = true;
|
|
Supported = true;
|
|
}
|
|
|
|
void SetVal_as_Supported(bool val)
|
|
{
|
|
Val = val;
|
|
Supported = true;
|
|
}
|
|
|
|
/*
|
|
bool IsVal_True_and_Defined() const
|
|
{
|
|
return Def && Val;
|
|
}
|
|
*/
|
|
};
|
|
|
|
|
|
class CCompressDialog: public NWindows::NControl::CModalDialog
|
|
{
|
|
public:
|
|
CBool1 SymLinks;
|
|
CBool1 HardLinks;
|
|
CBool1 AltStreams;
|
|
CBool1 NtSecurity;
|
|
CBool1 PreserveATime;
|
|
private:
|
|
struct CLayoutItem
|
|
{
|
|
unsigned Id;
|
|
RECT Rect;
|
|
};
|
|
|
|
struct CItemOutputGroup
|
|
{
|
|
UString ItemPath;
|
|
UStringVector ArcPaths;
|
|
};
|
|
|
|
static const unsigned kNumOutputPathRows = 5;
|
|
|
|
bool _ramSize_Defined;
|
|
bool _outputLayout_Inited;
|
|
UStringVector _outputArcPaths;
|
|
CObjectVector<CItemOutputGroup> _itemOutputGroups;
|
|
CRecordVector<CLayoutItem> _outputLayout_Items;
|
|
unsigned _outputPathCount;
|
|
int _outputPathRowStep;
|
|
int _outputLayout_BaseWindowX;
|
|
int _outputLayout_BaseWindowY;
|
|
int _outputLayout_BaseControlsTop;
|
|
int _outputGroupGapY;
|
|
RECT _outputTemplate_ItemLabelRect;
|
|
RECT _outputTemplate_CountLabelRect;
|
|
RECT _outputTemplate_CountComboRect;
|
|
RECT _outputTemplate_ArchiveLabelRect;
|
|
RECT _outputTemplate_ArchiveComboRects[kNumOutputPathRows];
|
|
RECT _outputTemplate_ArchiveButtonRects[kNumOutputPathRows];
|
|
|
|
NWindows::NControl::CComboBox m_ArchivePath;
|
|
NWindows::NControl::CComboBox m_OutputPathCount;
|
|
NWindows::NControl::CComboBox m_ExtraArchivePaths[kNumOutputPathRows - 1];
|
|
NWindows::NControl::CComboBox m_Format;
|
|
NWindows::NControl::CComboBox m_Level;
|
|
NWindows::NControl::CComboBox m_Method;
|
|
NWindows::NControl::CComboBox m_Dictionary;
|
|
// NWindows::NControl::CComboBox m_Dictionary_Chain;
|
|
NWindows::NControl::CComboBox m_Order;
|
|
NWindows::NControl::CComboBox m_Solid;
|
|
NWindows::NControl::CComboBox m_NumThreads;
|
|
NWindows::NControl::CComboBox m_MemUse;
|
|
NWindows::NControl::CComboBox m_Volume;
|
|
|
|
int _dictionaryCombo_left;
|
|
|
|
UStringVector _memUse_Strings;
|
|
|
|
NWindows::NControl::CDialogChildControl m_Params;
|
|
|
|
NWindows::NControl::CComboBox m_UpdateMode;
|
|
NWindows::NControl::CComboBox m_PathMode;
|
|
|
|
NWindows::NControl::CEdit _password1Control;
|
|
NWindows::NControl::CEdit _password2Control;
|
|
NWindows::NControl::CComboBox _encryptionMethod;
|
|
|
|
int _auto_MethodId;
|
|
UInt32 _auto_Dict; // (UInt32)(Int32)-1 means unknown
|
|
UInt32 _auto_Dict_Chain; // (UInt32)(Int32)-1 means unknown
|
|
UInt32 _auto_Order;
|
|
UInt64 _auto_Solid;
|
|
UInt32 _auto_NumThreads;
|
|
|
|
int _default_encryptionMethod_Index;
|
|
|
|
int m_PrevFormat;
|
|
UString DirPrefix;
|
|
UString StartDirPrefix;
|
|
|
|
size_t _ramSize; // full RAM size avail
|
|
size_t _ramSize_Reduced; // full for 64-bit and reduced for 32-bit
|
|
UInt64 _ramUsage_Auto;
|
|
|
|
public:
|
|
NCompression::CInfo m_RegistryInfo;
|
|
|
|
void SetArchiveName(const UString &name);
|
|
int FindRegistryFormat(const UString &name);
|
|
unsigned FindRegistryFormat_Always(const UString &name);
|
|
|
|
const CArcInfoEx &Get_ArcInfoEx()
|
|
{
|
|
return (*ArcFormats)[GetFormatIndex()];
|
|
}
|
|
|
|
NCompression::CFormatOptions &Get_FormatOptions();
|
|
|
|
void CheckSFXNameChange();
|
|
void SetArchiveName2(bool prevWasSFX);
|
|
|
|
unsigned GetStaticFormatIndex();
|
|
|
|
void SetNearestSelectComboBox(NWindows::NControl::CComboBox &comboBox, UInt32 value);
|
|
|
|
void SetLevel2();
|
|
void SetLevel()
|
|
{
|
|
SetLevel2();
|
|
EnableMultiCombo(IDC_COMPRESS_LEVEL);
|
|
SetMethod();
|
|
}
|
|
|
|
void SetMethod2(int keepMethodId);
|
|
void SetMethod(int keepMethodId = -1)
|
|
{
|
|
SetMethod2(keepMethodId);
|
|
EnableMultiCombo(IDC_COMPRESS_METHOD);
|
|
}
|
|
|
|
void MethodChanged()
|
|
{
|
|
SetDictionary2();
|
|
EnableMultiCombo(IDC_COMPRESS_DICTIONARY);
|
|
// EnableMultiCombo(IDC_COMPRESS_DICTIONARY2);
|
|
SetOrder2();
|
|
EnableMultiCombo(IDC_COMPRESS_ORDER);
|
|
}
|
|
|
|
int GetMethodID_RAW();
|
|
int GetMethodID();
|
|
|
|
UString GetMethodSpec(UString &estimatedName);
|
|
UString GetMethodSpec();
|
|
bool IsMethodEqualTo(const UString &s);
|
|
UString GetEncryptionMethodSpec();
|
|
|
|
bool IsZipFormat();
|
|
bool IsXzFormat();
|
|
|
|
void SetEncryptionMethod();
|
|
|
|
int AddDict2(size_t sizeReal, size_t sizeShow);
|
|
int AddDict(size_t size);
|
|
// int AddDict_Chain(size_t size);
|
|
|
|
void SetDictionary2();
|
|
|
|
UInt32 GetComboValue(NWindows::NControl::CComboBox &c, int defMax = 0);
|
|
UInt64 GetComboValue_64(NWindows::NControl::CComboBox &c, int defMax = 0);
|
|
|
|
UInt32 GetLevel() { return GetComboValue(m_Level); }
|
|
UInt32 GetLevelSpec() { return GetComboValue(m_Level, 1); }
|
|
UInt32 GetLevel2();
|
|
|
|
UInt64 GetDictSpec() { return GetComboValue_64(m_Dictionary, 1); }
|
|
// UInt64 GetDictChainSpec() { return GetComboValue_64(m_Dictionary_Chain, 1); }
|
|
|
|
UInt64 GetDict2()
|
|
{
|
|
UInt64 num = GetDictSpec();
|
|
if (num == (UInt64)(Int64)-1)
|
|
{
|
|
if (_auto_Dict == (UInt32)(Int32)-1)
|
|
return (UInt64)(Int64)-1; // unknown
|
|
num = _auto_Dict;
|
|
}
|
|
return num;
|
|
}
|
|
|
|
// UInt32 GetOrder() { return GetComboValue(m_Order); }
|
|
UInt32 GetOrderSpec() { return GetComboValue(m_Order, 1); }
|
|
UInt32 GetNumThreadsSpec() { return GetComboValue(m_NumThreads, 1); }
|
|
|
|
UInt32 GetNumThreads2()
|
|
{
|
|
UInt32 num = GetNumThreadsSpec();
|
|
if (num == (UInt32)(Int32)-1)
|
|
num = _auto_NumThreads;
|
|
return num;
|
|
}
|
|
|
|
UInt32 GetBlockSizeSpec() { return GetComboValue(m_Solid, 1); }
|
|
|
|
/*
|
|
UInt32 GetPrecSpec() { return GetComboValue(m_Prec, 1); }
|
|
UInt32 GetPrec() { return GetComboValue(m_Prec, 0); }
|
|
*/
|
|
|
|
|
|
int AddOrder(UInt32 size);
|
|
int AddOrder_Auto();
|
|
|
|
void SetOrder2();
|
|
|
|
bool GetOrderMode();
|
|
|
|
void SetSolidBlockSize2();
|
|
void SetSolidBlockSize(/* bool useDictionary = false */)
|
|
{
|
|
SetSolidBlockSize2();
|
|
EnableMultiCombo(IDC_COMPRESS_SOLID);
|
|
}
|
|
|
|
void SetNumThreads2();
|
|
void SetNumThreads()
|
|
{
|
|
SetNumThreads2();
|
|
EnableMultiCombo(IDC_COMPRESS_THREADS);
|
|
}
|
|
|
|
int AddMemComboItem(UInt64 val, bool isPercent = false, bool isDefault = false);
|
|
void SetMemUseCombo();
|
|
UString Get_MemUse_Spec();
|
|
UInt64 Get_MemUse_Bytes();
|
|
|
|
UInt64 GetMemoryUsage_Dict_DecompMem(UInt64 dict, UInt64 &decompressMemory);
|
|
UInt64 GetMemoryUsage_Threads_Dict_DecompMem(UInt32 numThreads, UInt64 dict, UInt64 &decompressMemory);
|
|
UInt64 GetMemoryUsage_DecompMem(UInt64 &decompressMemory);
|
|
UInt64 GetMemoryUsageComp_Threads_Dict(UInt32 numThreads, UInt64 dict64);
|
|
|
|
void PrintMemUsage(UINT res, UInt64 value);
|
|
void SetMemoryUsage();
|
|
void Print_Params();
|
|
|
|
void SetParams();
|
|
|
|
void SaveOptionsInMem();
|
|
|
|
void UpdatePasswordControl();
|
|
bool IsShowPasswordChecked() const { return IsButtonCheckedBool(IDX_PASSWORD_SHOW); }
|
|
bool IsMultiItemMode() const { return Info.ItemPaths.Size() > 1; }
|
|
|
|
unsigned GetFormatIndex();
|
|
void InitOutputPathLayout();
|
|
void UpdateOutputPathLayout();
|
|
void UpdateOutputPathControls();
|
|
void RefreshArchivePathInfo();
|
|
void SyncPrimaryArcPathFromControl();
|
|
void SyncExtraArcPathsFromControls();
|
|
void SetOutputPathCount(unsigned count, bool syncFromControls = true);
|
|
void SetOutputArcPaths(const UStringVector &paths);
|
|
bool GetOutputArcPaths(UStringVector &paths) const;
|
|
void InitItemOutputGroups();
|
|
void CreateDynamicItemOutputControls();
|
|
void LayoutItemOutputGroups();
|
|
void UpdateItemOutputGroupControls(unsigned groupIndex);
|
|
void SyncItemOutputGroupFromControls(unsigned groupIndex);
|
|
void SyncAllItemOutputGroupsFromControls();
|
|
void SetItemOutputGroupCount(unsigned groupIndex, unsigned count, bool syncFromControls = true);
|
|
bool GetItemOutputGroupPaths(UStringVector &itemPaths, UStringVector &paths) const;
|
|
bool BrowseItemOutputPath(unsigned groupIndex, unsigned pathIndex);
|
|
void UpdateSeparateItemModeControls();
|
|
bool GetItemArcPaths(UStringVector &itemPaths, UStringVector &paths) const;
|
|
void BuildItemArcPath(const UString &inputPath, UString &path);
|
|
void UpdateItemArcPathToCurrentFormat(UString &path, int prevFormat, bool prevWasSFX);
|
|
void UpdateArcPathToCurrentFormat(UString &path, int prevFormat, bool prevWasSFX);
|
|
void UpdateExtraArcPathsForFormatChange(int prevFormat, bool prevWasSFX);
|
|
bool BrowseArchivePath(UString &path, bool allowFormatChange, bool &formatWasChanged);
|
|
bool SetArcPathFields(const UString &path, UString &name, bool always);
|
|
bool SetArcPathFields(const UString &path);
|
|
bool GetFinalPath_Smart(UString &resPath) const;
|
|
void ArcPath_WasChanged(const UString &newPath);
|
|
|
|
void CheckSFXControlsEnable();
|
|
// void CheckVolumeEnable();
|
|
void EnableMultiCombo(unsigned id);
|
|
void FormatChanged(bool isChanged);
|
|
|
|
void OnButtonSetArchivePath(unsigned index);
|
|
void OnButtonSetArchive();
|
|
bool IsSFX();
|
|
void OnButtonSFX();
|
|
|
|
virtual bool OnInit() Z7_override;
|
|
virtual bool OnMessage(UINT message, WPARAM wParam, LPARAM lParam) Z7_override;
|
|
virtual bool OnCommand(unsigned code, unsigned itemID, LPARAM lParam) Z7_override;
|
|
virtual bool OnButtonClicked(unsigned buttonID, HWND buttonHWND) Z7_override;
|
|
virtual void OnOK() Z7_override;
|
|
virtual void OnHelp() Z7_override;
|
|
|
|
void MessageBoxError(LPCWSTR message)
|
|
{
|
|
MessageBoxW(*this, message, L"7-Zip", MB_ICONERROR);
|
|
}
|
|
|
|
void ShowOptionsString();
|
|
|
|
public:
|
|
const CObjectVector<CArcInfoEx> *ArcFormats;
|
|
CUIntVector ArcIndices; // can not be empty, must contain Info.FormatIndex, if Info.FormatIndex >= 0
|
|
AStringVector ExternalMethods;
|
|
|
|
void SetMethods(const CObjectVector<CCodecInfoUser> &userCodecs);
|
|
|
|
NCompressDialog::CInfo Info;
|
|
UString OriginalFileName; // for bzip2, gzip2
|
|
|
|
INT_PTR Create(HWND wndParent = NULL)
|
|
{
|
|
BIG_DIALOG_SIZE(400, 430);
|
|
return CModalDialog::Create(SIZED_DIALOG(IDD_COMPRESS), wndParent);
|
|
}
|
|
|
|
CCompressDialog():
|
|
_ramSize_Defined(false),
|
|
_outputLayout_Inited(false),
|
|
_outputPathCount(1),
|
|
_outputPathRowStep(0),
|
|
_outputLayout_BaseWindowX(0),
|
|
_outputLayout_BaseWindowY(0)
|
|
{}
|
|
};
|
|
|
|
|
|
|
|
|
|
class COptionsDialog: public NWindows::NControl::CModalDialog
|
|
{
|
|
struct CBoolBox
|
|
{
|
|
bool IsSupported;
|
|
bool DefaultVal;
|
|
CBoolPair BoolPair;
|
|
|
|
unsigned Id;
|
|
unsigned Set_Id;
|
|
|
|
void SetIDs(unsigned id, unsigned set_Id)
|
|
{
|
|
Id = id;
|
|
Set_Id = set_Id;
|
|
}
|
|
|
|
CBoolBox():
|
|
IsSupported(false),
|
|
DefaultVal(false)
|
|
{}
|
|
};
|
|
|
|
CCompressDialog *cd;
|
|
|
|
NWindows::NControl::CComboBox m_Prec;
|
|
|
|
UInt32 _auto_Prec;
|
|
UInt32 TimePrec;
|
|
|
|
void Reset_TimePrec() { TimePrec = (UInt32)(Int32)-1; }
|
|
bool IsSet_TimePrec() const { return TimePrec != (UInt32)(Int32)-1; }
|
|
|
|
CBoolBox MTime;
|
|
CBoolBox CTime;
|
|
CBoolBox ATime;
|
|
CBoolBox ZTime;
|
|
|
|
UString SecString;
|
|
UString NsString;
|
|
|
|
|
|
void CheckButton_Bool1(UINT id, const CBool1 &b1);
|
|
void GetButton_Bool1(UINT id, CBool1 &b1);
|
|
void CheckButton_BoolBox(bool supported, const CBoolPair &b2, CBoolBox &bb);
|
|
void GetButton_BoolBox(CBoolBox &bb);
|
|
|
|
void Store_TimeBoxes();
|
|
|
|
UInt32 GetComboValue(NWindows::NControl::CComboBox &c, int defMax = 0);
|
|
UInt32 GetPrecSpec()
|
|
{
|
|
UInt32 prec = GetComboValue(m_Prec, 1);
|
|
if (prec == _auto_Prec)
|
|
prec = (UInt32)(Int32)-1;
|
|
return prec;
|
|
}
|
|
UInt32 GetPrec() { return GetComboValue(m_Prec, 0); }
|
|
|
|
// void OnButton_TimeDefault();
|
|
int AddPrec(unsigned prec, bool isDefault);
|
|
void SetPrec();
|
|
void SetTimeMAC();
|
|
|
|
void On_CheckBoxSet_Prec_Clicked();
|
|
void On_CheckBoxSet_Clicked(const CBoolBox &bb);
|
|
|
|
virtual bool OnInit() Z7_override;
|
|
virtual bool OnCommand(unsigned code, unsigned itemID, LPARAM lParam) Z7_override;
|
|
virtual bool OnButtonClicked(unsigned buttonID, HWND buttonHWND) Z7_override;
|
|
virtual void OnOK() Z7_override;
|
|
virtual void OnHelp() Z7_override;
|
|
|
|
public:
|
|
|
|
INT_PTR Create(HWND wndParent = NULL)
|
|
{
|
|
BIG_DIALOG_SIZE(240, 232);
|
|
return CModalDialog::Create(SIZED_DIALOG(IDD_COMPRESS_OPTIONS), wndParent);
|
|
}
|
|
|
|
COptionsDialog(CCompressDialog *cdLoc):
|
|
cd(cdLoc)
|
|
// , TimePrec(0)
|
|
{
|
|
Reset_TimePrec();
|
|
}
|
|
};
|
|
|
|
#endif
|