This commit is contained in:
Igor Pavlov
2018-05-02 22:28:04 +01:00
committed by Kornel
parent f19b649c73
commit 18dc2b4161
121 changed files with 3523 additions and 1866 deletions

View File

@@ -236,7 +236,10 @@ void CProgressSync::AddError_Code_Name(DWORD systemError, const wchar_t *name)
AddError_Message_Name(s, name);
}
CProgressDialog::CProgressDialog(): _timer(0), CompressingMode(true), MainWindow(0)
CProgressDialog::CProgressDialog():
_timer(0),
CompressingMode(true),
MainWindow(0)
{
_isDir = false;
@@ -974,7 +977,9 @@ bool CProgressDialog::OnExternalCloseMessage()
::SendMessage(GetItem(IDCANCEL), BM_SETSTYLE, BS_DEFPUSHBUTTON, MAKELPARAM(TRUE, 0));
HideItem(IDB_PROGRESS_BACKGROUND);
HideItem(IDB_PAUSE);
ProcessWasFinished_GuiVirt();
bool thereAreMessages;
CProgressFinalMessage fm;
{
@@ -982,6 +987,7 @@ bool CProgressDialog::OnExternalCloseMessage()
thereAreMessages = !Sync.Messages.IsEmpty();
fm = Sync.FinalMessage;
}
if (!fm.ErrorMessage.Message.IsEmpty())
{
MessagesDisplayed = true;
@@ -992,6 +998,7 @@ bool CProgressDialog::OnExternalCloseMessage()
else if (!thereAreMessages)
{
MessagesDisplayed = true;
if (!fm.OkMessage.Message.IsEmpty())
{
if (fm.OkMessage.Title.IsEmpty())
@@ -1245,11 +1252,24 @@ void CProgressDialog::ProcessWasFinished()
}
static THREAD_FUNC_DECL MyThreadFunction(void *param)
{
CProgressThreadVirt *p = (CProgressThreadVirt *)param;
try
{
p->Process();
p->ThreadFinishedOK = true;
}
catch (...) { p->Result = E_FAIL; }
return 0;
}
HRESULT CProgressThreadVirt::Create(const UString &title, HWND parentWindow)
{
NWindows::CThread thread;
RINOK(thread.Create(MyThreadFunction, this));
ProgressDialog.Create(title, thread, parentWindow);
CProgressDialog::Create(title, thread, parentWindow);
return S_OK;
}
@@ -1265,7 +1285,7 @@ static void AddMessageToString(UString &dest, const UString &src)
void CProgressThreadVirt::Process()
{
CProgressCloser closer(ProgressDialog);
CProgressCloser closer(*this);
UString m;
try { Result = ProcessVirt(); }
catch(const wchar_t *s) { m = s; }
@@ -1293,7 +1313,7 @@ void CProgressThreadVirt::Process()
}
}
CProgressSync &sync = ProgressDialog.Sync;
CProgressSync &sync = Sync;
NSynchronization::CCriticalSectionLock lock(sync._cs);
if (m.IsEmpty())
{