mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-08 12:07:03 -06:00
18.05
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include "App.h"
|
||||
#include "FormatUtils.h"
|
||||
#include "LangUtils.h"
|
||||
#include "ListViewDialog.h"
|
||||
#include "MyLoadMenu.h"
|
||||
#include "PropertyName.h"
|
||||
|
||||
@@ -50,17 +51,40 @@ void CPanel::InvokeSystemCommand(const char *command)
|
||||
contextMenu->InvokeCommand(&ci);
|
||||
}
|
||||
|
||||
static const char * const kSeparator = "----------------------------\n";
|
||||
static const char * const kSeparatorSmall = "----\n";
|
||||
static const char * const kPropValueSeparator = ": ";
|
||||
static const char * const kSeparator = "------------------------";
|
||||
static const char * const kSeparatorSmall = "----------------";
|
||||
|
||||
extern UString ConvertSizeToString(UInt64 value) throw();
|
||||
bool IsSizeProp(UINT propID) throw();
|
||||
|
||||
UString GetOpenArcErrorMessage(UInt32 errorFlags);
|
||||
|
||||
|
||||
static void AddListAscii(CListViewDialog &dialog, const char *s)
|
||||
{
|
||||
dialog.Strings.Add((UString)s);
|
||||
dialog.Values.AddNew();
|
||||
}
|
||||
|
||||
static void AddSeparator(CListViewDialog &dialog)
|
||||
{
|
||||
AddListAscii(dialog, kSeparator);
|
||||
}
|
||||
|
||||
static void AddSeparatorSmall(CListViewDialog &dialog)
|
||||
{
|
||||
AddListAscii(dialog, kSeparatorSmall);
|
||||
}
|
||||
|
||||
static void AddPropertyPair(const UString &name, const UString &val, CListViewDialog &dialog)
|
||||
{
|
||||
dialog.Strings.Add(name);
|
||||
dialog.Values.Add(val);
|
||||
}
|
||||
|
||||
|
||||
static void AddPropertyString(PROPID propID, const wchar_t *nameBSTR,
|
||||
const NCOM::CPropVariant &prop, UString &s)
|
||||
const NCOM::CPropVariant &prop, CListViewDialog &dialog)
|
||||
{
|
||||
if (prop.vt != VT_EMPTY)
|
||||
{
|
||||
@@ -87,23 +111,16 @@ static void AddPropertyString(PROPID propID, const wchar_t *nameBSTR,
|
||||
|
||||
if (!val.IsEmpty())
|
||||
{
|
||||
s += GetNameOfProperty(propID, nameBSTR);
|
||||
s += kPropValueSeparator;
|
||||
/*
|
||||
if (propID == kpidComment)
|
||||
s.Add_LF();
|
||||
*/
|
||||
s += val;
|
||||
s.Add_LF();
|
||||
AddPropertyPair(GetNameOfProperty(propID, nameBSTR), val, dialog);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void AddPropertyString(PROPID propID, UInt64 val, UString &s)
|
||||
static void AddPropertyString(PROPID propID, UInt64 val, CListViewDialog &dialog)
|
||||
{
|
||||
NCOM::CPropVariant prop = val;
|
||||
AddPropertyString(propID, NULL, prop, s);
|
||||
AddPropertyString(propID, NULL, prop, dialog);
|
||||
}
|
||||
|
||||
|
||||
@@ -137,7 +154,9 @@ void CPanel::Properties()
|
||||
}
|
||||
|
||||
{
|
||||
UString message;
|
||||
CListViewDialog message;
|
||||
// message.DeleteIsAllowed = false;
|
||||
// message.SelectFirst = false;
|
||||
|
||||
CRecordVector<UInt32> operatedIndices;
|
||||
GetOperatedItemIndices(operatedIndices);
|
||||
@@ -205,15 +224,12 @@ void CPanel::Properties()
|
||||
}
|
||||
}
|
||||
}
|
||||
message += GetNameOfProperty(propID, name);
|
||||
message += kPropValueSeparator;
|
||||
message += s.Ptr();
|
||||
message.Add_LF();
|
||||
AddPropertyPair(GetNameOfProperty(propID, name), (UString)s.Ptr(), message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
message += kSeparator;
|
||||
AddSeparator(message);
|
||||
}
|
||||
else if (operatedIndices.Size() >= 1)
|
||||
{
|
||||
@@ -239,8 +255,7 @@ void CPanel::Properties()
|
||||
{
|
||||
wchar_t temp[32];
|
||||
ConvertUInt32ToString(operatedIndices.Size(), temp);
|
||||
message += MyFormatNew(g_App.LangString_N_SELECTED_ITEMS, temp);
|
||||
message.Add_LF();
|
||||
AddPropertyPair(L"", MyFormatNew(g_App.LangString_N_SELECTED_ITEMS, temp), message);
|
||||
}
|
||||
|
||||
if (numDirs != 0)
|
||||
@@ -250,7 +265,7 @@ void CPanel::Properties()
|
||||
AddPropertyString(kpidSize, unpackSize, message);
|
||||
AddPropertyString(kpidPackSize, packSize, message);
|
||||
|
||||
message += kSeparator;
|
||||
AddSeparator(message);
|
||||
}
|
||||
|
||||
|
||||
@@ -309,7 +324,7 @@ void CPanel::Properties()
|
||||
{
|
||||
const int kNumSpecProps = ARRAY_SIZE(kSpecProps);
|
||||
|
||||
message += kSeparator;
|
||||
AddSeparator(message);
|
||||
|
||||
for (Int32 i = -(int)kNumSpecProps; i < (Int32)numProps; i++)
|
||||
{
|
||||
@@ -334,7 +349,7 @@ void CPanel::Properties()
|
||||
UInt32 numProps;
|
||||
if (getProps->GetArcNumProps2(level, &numProps) == S_OK)
|
||||
{
|
||||
message += kSeparatorSmall;
|
||||
AddSeparatorSmall(message);
|
||||
for (Int32 i = 0; i < (Int32)numProps; i++)
|
||||
{
|
||||
CMyComBSTR name;
|
||||
@@ -352,10 +367,15 @@ void CPanel::Properties()
|
||||
}
|
||||
}
|
||||
}
|
||||
::MessageBoxW(*(this), message, LangString(IDS_PROPERTIES), MB_OK);
|
||||
|
||||
message.Title = LangString(IDS_PROPERTIES);
|
||||
message.NumColumns = 2;
|
||||
message.Create(GetParent());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CPanel::EditCut()
|
||||
{
|
||||
// InvokeSystemCommand("cut");
|
||||
|
||||
Reference in New Issue
Block a user