From c65230d8585317f7cd58ae2982067385269fdee9 Mon Sep 17 00:00:00 2001 From: Igor Pavlov Date: Tue, 2 Nov 2010 00:00:00 +0000 Subject: 9.18 --- CPP/7zip/UI/Agent/Agent.cpp | 2 +- CPP/7zip/UI/Agent/Agent.h | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) (limited to 'CPP/7zip/UI/Agent') diff --git a/CPP/7zip/UI/Agent/Agent.cpp b/CPP/7zip/UI/Agent/Agent.cpp index 4db95c87..4a099308 100755 --- a/CPP/7zip/UI/Agent/Agent.cpp +++ b/CPP/7zip/UI/Agent/Agent.cpp @@ -609,7 +609,7 @@ STDMETHODIMP CAgent::GetArcProp(UInt32 level, PROPID propID, PROPVARIANT *value) CArc &arc = _archiveLink.Arcs[level]; switch(propID) { - case kpidType: prop = _codecs->Formats[arc.FormatIndex].Name; break; + case kpidType: prop = GetTypeOfArc(arc); break; case kpidPath: prop = arc.Path; break; default: return arc.Archive->GetArchiveProperty(propID, value); } diff --git a/CPP/7zip/UI/Agent/Agent.h b/CPP/7zip/UI/Agent/Agent.h index c5efb411..454964bc 100755 --- a/CPP/7zip/UI/Agent/Agent.h +++ b/CPP/7zip/UI/Agent/Agent.h @@ -206,6 +206,27 @@ public: const CArc &GetArc() { return _archiveLink.Arcs.Back(); } IInArchive *GetArchive() { if ( _archiveLink.Arcs.IsEmpty()) return 0; return GetArc().Archive; } bool CanUpdate() const { return _archiveLink.Arcs.Size() <= 1; } + + UString GetTypeOfArc(const CArc &arc) const { return _codecs->Formats[arc.FormatIndex].Name; } + UString GetErrorMessage() const + { + UString s; + for (int i = _archiveLink.Arcs.Size() - 1; i >= 0; i--) + { + const CArc &arc = _archiveLink.Arcs[i]; + if (arc.ErrorMessage.IsEmpty()) + continue; + if (!s.IsEmpty()) + s += L"--------------------\n"; + s += arc.ErrorMessage; + s += L"\n\n["; + s += GetTypeOfArc(arc); + s += L"] "; + s += arc.Path; + s += L"\n"; + } + return s; + } }; #ifdef NEW_FOLDER_INTERFACE -- cgit v1.2.3