mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-07 22:06:59 -06:00
21.02
This commit is contained in:
@@ -167,6 +167,7 @@ STDMETHODIMP CExtractCallbackImp::MessageError(const wchar_t *message)
|
||||
return CheckBreak2();
|
||||
}
|
||||
|
||||
void SetExtractErrorMessage(Int32 opRes, Int32 encrypted, AString &s);
|
||||
void SetExtractErrorMessage(Int32 opRes, Int32 encrypted, AString &s)
|
||||
{
|
||||
s.Empty();
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic ignored "-Wmissing-prototypes"
|
||||
#endif
|
||||
|
||||
#include "../../../Common/MyWindows.h"
|
||||
|
||||
#include "../../../Common/MyInitGuid.h"
|
||||
@@ -39,7 +43,9 @@ const char *g_PluginName_for_Error = "7-Zip";
|
||||
|
||||
}
|
||||
|
||||
#if defined(_UNICODE) && !defined(_WIN64) && !defined(UNDER_CE)
|
||||
#define NT_CHECK_FAIL_ACTION return FALSE;
|
||||
#endif
|
||||
|
||||
BOOL WINAPI DllMain(
|
||||
#ifdef UNDER_CE
|
||||
|
||||
@@ -53,7 +53,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"C:\Program Files\Far\Plugins\7-Zip\7-ZipFar.dll" /opt:NOWIN98
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"C:\Progs\Far\Plugins\7-Zip\7-ZipFar.dll" /opt:NOWIN98
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "Far - Win32 Debug"
|
||||
@@ -80,7 +80,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"C:\Program Files\Far\Plugins\7-Zip\7-ZipFar.dll" /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"C:\Progs\Far\Plugins\7-Zip\7-ZipFar.dll" /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ struct CFileInfoStrings
|
||||
AString Time;
|
||||
};
|
||||
|
||||
void SetFileInfoStrings(const CFileInfo &fileInfo,
|
||||
static void SetFileInfoStrings(const CFileInfo &fileInfo,
|
||||
CFileInfoStrings &fileInfoStrings)
|
||||
{
|
||||
char buffer[256];
|
||||
|
||||
@@ -197,10 +197,12 @@ void CPlugin::EnterToDirectory(const UString &dirName)
|
||||
s = "..";
|
||||
_folder->BindToFolder(s, &newFolder);
|
||||
if (!newFolder)
|
||||
{
|
||||
if (dirName.IsEmpty())
|
||||
return;
|
||||
else
|
||||
throw 40325;
|
||||
}
|
||||
_folder = newFolder;
|
||||
}
|
||||
|
||||
@@ -457,7 +459,7 @@ static AString PropToString2(const NCOM::CPropVariant &prop, PROPID propID)
|
||||
return s;
|
||||
}
|
||||
|
||||
static void AddPropertyString(InfoPanelLine *lines, int &numItems, PROPID propID, const wchar_t *name,
|
||||
static void AddPropertyString(InfoPanelLine *lines, unsigned &numItems, PROPID propID, const wchar_t *name,
|
||||
const NCOM::CPropVariant &prop)
|
||||
{
|
||||
if (prop.vt != VT_EMPTY)
|
||||
@@ -472,7 +474,7 @@ static void AddPropertyString(InfoPanelLine *lines, int &numItems, PROPID propID
|
||||
}
|
||||
}
|
||||
|
||||
static void InsertSeparator(InfoPanelLine *lines, int &numItems)
|
||||
static void InsertSeparator(InfoPanelLine *lines, unsigned &numItems)
|
||||
{
|
||||
if (numItems < kNumInfoLinesMax)
|
||||
{
|
||||
@@ -528,7 +530,7 @@ void CPlugin::GetOpenPluginInfo(struct OpenPluginInfo *info)
|
||||
MyStringCopy(m_InfoLines[1].Text, g_StartupInfo.GetMsgString(NMessageID::kArchiveType));
|
||||
MyStringCopy(m_InfoLines[1].Data, (const char *)UnicodeStringToMultiByte(_archiveTypeName, CP_OEMCP));
|
||||
|
||||
int numItems = 2;
|
||||
unsigned numItems = 2;
|
||||
|
||||
{
|
||||
CMyComPtr<IFolderProperties> folderProperties;
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "../../../Common/StringConvert.h"
|
||||
#include "FarUtils.h"
|
||||
|
||||
#include "Messages.h"
|
||||
#include "Plugin.h"
|
||||
#include "UpdateCallbackFar.h"
|
||||
@@ -28,16 +31,37 @@ int CPlugin::DeleteFiles(PluginPanelItem *panelItems, int numItems, int opMode)
|
||||
g_StartupInfo.GetMsgString(NMessageID::kDeleteDelete),
|
||||
g_StartupInfo.GetMsgString(NMessageID::kDeleteCancel)
|
||||
};
|
||||
char msg[1024];
|
||||
|
||||
// char msg[1024];
|
||||
AString str1;
|
||||
|
||||
if (numItems == 1)
|
||||
{
|
||||
sprintf(msg, g_StartupInfo.GetMsgString(NMessageID::kDeleteFile), panelItems[0].FindData.cFileName);
|
||||
msgItems[1] = msg;
|
||||
str1 = g_StartupInfo.GetMsgString(NMessageID::kDeleteFile);
|
||||
AString name (panelItems[0].FindData.cFileName);
|
||||
const unsigned kSizeLimit = 48;
|
||||
if (name.Len() > kSizeLimit)
|
||||
{
|
||||
UString s = MultiByteToUnicodeString(name, CP_OEMCP);
|
||||
ReduceString(s, kSizeLimit);
|
||||
name = UnicodeStringToMultiByte(s, CP_OEMCP);
|
||||
}
|
||||
str1.Replace(AString ("%.40s"), name);
|
||||
msgItems[1] = str1;
|
||||
// sprintf(msg, g_StartupInfo.GetMsgString(NMessageID::kDeleteFile), panelItems[0].FindData.cFileName);
|
||||
// msgItems[2] = msg;
|
||||
}
|
||||
else if (numItems > 1)
|
||||
{
|
||||
sprintf(msg, g_StartupInfo.GetMsgString(NMessageID::kDeleteNumberOfFiles), numItems);
|
||||
msgItems[1] = msg;
|
||||
str1 = g_StartupInfo.GetMsgString(NMessageID::kDeleteNumberOfFiles);
|
||||
{
|
||||
AString n;
|
||||
n.Add_UInt32(numItems);
|
||||
str1.Replace(AString ("%d"), n);
|
||||
}
|
||||
msgItems[1] = str1;
|
||||
// sprintf(msg, g_StartupInfo.GetMsgString(NMessageID::kDeleteNumberOfFiles), numItems);
|
||||
// msgItems[1] = msg;
|
||||
}
|
||||
if (g_StartupInfo.ShowMessage(FMSG_WARNING, NULL, msgItems, ARRAY_SIZE(msgItems), 2) != 0)
|
||||
return (FALSE);
|
||||
|
||||
@@ -89,7 +89,7 @@ NFileOperationReturnCode::EEnum CPlugin::PutFiles(
|
||||
}
|
||||
*/
|
||||
|
||||
if (numItems == 0)
|
||||
if (numItems <= 0)
|
||||
return NFileOperationReturnCode::kError;
|
||||
|
||||
if (_agent->IsThereReadOnlyArc())
|
||||
@@ -104,14 +104,18 @@ NFileOperationReturnCode::EEnum CPlugin::PutFiles(
|
||||
NCompression::CInfo compressionInfo;
|
||||
compressionInfo.Load();
|
||||
|
||||
int methodIndex = 0;
|
||||
int i;
|
||||
for (i = ARRAY_SIZE(g_MethodMap) - 1; i >= 0; i--)
|
||||
unsigned methodIndex = 0;
|
||||
|
||||
unsigned i;
|
||||
for (i = ARRAY_SIZE(g_MethodMap); i != 0;)
|
||||
{
|
||||
i--;
|
||||
if (compressionInfo.Level >= g_MethodMap[i])
|
||||
{
|
||||
methodIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const int kMethodRadioIndex = 2;
|
||||
const int kModeRadioIndex = kMethodRadioIndex + 7;
|
||||
@@ -200,10 +204,10 @@ NFileOperationReturnCode::EEnum CPlugin::PutFiles(
|
||||
|
||||
UStringVector fileNames;
|
||||
fileNames.ClearAndReserve(numItems);
|
||||
for (i = 0; i < numItems; i++)
|
||||
for (i = 0; i < (unsigned)numItems; i++)
|
||||
fileNames.AddInReserved(MultiByteToUnicodeString(panelItems[i].FindData.cFileName, CP_OEMCP));
|
||||
CObjArray<const wchar_t *> fileNamePointers(numItems);
|
||||
for (i = 0; i < numItems; i++)
|
||||
for (i = 0; i < (unsigned)numItems; i++)
|
||||
fileNamePointers[i] = fileNames[i];
|
||||
|
||||
CMyComPtr<IOutFolderArchive> outArchive;
|
||||
@@ -459,29 +463,36 @@ HRESULT CompressFiles(const CObjectVector<PluginPanelItem> &pluginPanelItems)
|
||||
const int kMethodRadioIndex = kArchiveNameIndex + 2;
|
||||
const int kModeRadioIndex = kMethodRadioIndex + 7;
|
||||
|
||||
|
||||
char updateAddToArchiveString[512];
|
||||
// char updateAddToArchiveString[512];
|
||||
AString str1;
|
||||
{
|
||||
const CArcInfoEx &arcInfo = codecs->Formats[archiverIndex];
|
||||
const AString s (UnicodeStringToMultiByte(arcInfo.Name, CP_OEMCP));
|
||||
str1 = g_StartupInfo.GetMsgString(NMessageID::kUpdateAddToArchive);
|
||||
str1.Replace(AString ("%s"), s);
|
||||
/*
|
||||
sprintf(updateAddToArchiveString,
|
||||
g_StartupInfo.GetMsgString(NMessageID::kUpdateAddToArchive), (const char *)s);
|
||||
*/
|
||||
}
|
||||
|
||||
int methodIndex = 0;
|
||||
int i;
|
||||
for (i = ARRAY_SIZE(g_MethodMap) - 1; i >= 0; i--)
|
||||
unsigned methodIndex = 0;
|
||||
unsigned i;
|
||||
for (i = ARRAY_SIZE(g_MethodMap); i != 0;)
|
||||
{
|
||||
i--;
|
||||
if (compressionInfo.Level >= g_MethodMap[i])
|
||||
{
|
||||
methodIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const struct CInitDialogItem initItems[]=
|
||||
{
|
||||
{ DI_DOUBLEBOX, 3, 1, 72, kYSize - 2, false, false, 0, false, NMessageID::kUpdateTitle, NULL, NULL },
|
||||
|
||||
{ DI_TEXT, 5, 2, 0, 0, false, false, 0, false, -1, updateAddToArchiveString, NULL },
|
||||
{ DI_TEXT, 5, 2, 0, 0, false, false, 0, false, -1, str1, NULL },
|
||||
|
||||
{ DI_EDIT, 5, 3, 70, 3, true, false, DIF_HISTORY, false, -1, archiveNameA, kArchiveHistoryKeyName},
|
||||
// { DI_EDIT, 5, 3, 70, 3, true, false, 0, false, -1, arcName, NULL},
|
||||
|
||||
@@ -20,7 +20,6 @@ CURRENT_OBJS = \
|
||||
$O\PluginWrite.obj \
|
||||
$O\ProgressBox.obj \
|
||||
$O\UpdateCallbackFar.obj \
|
||||
$O\UTFConvert.obj \
|
||||
|
||||
COMMON_OBJS = \
|
||||
$O\IntToString.obj \
|
||||
@@ -29,6 +28,7 @@ COMMON_OBJS = \
|
||||
$O\StringConvert.obj \
|
||||
$O\StringToInt.obj \
|
||||
$O\MyVector.obj \
|
||||
$O\UTFConvert.obj \
|
||||
$O\Wildcard.obj \
|
||||
|
||||
WIN_OBJS = \
|
||||
|
||||
Reference in New Issue
Block a user