Skip to content

Commit

Permalink
Bug 1817: Failure when starting synchronization when application task…
Browse files Browse the repository at this point in the history
… bar button is not fully working

https://winscp.net/tracker/1817

Source commit: fb45fcb599b3b845cc568a64818b225e6bff4b4f
  • Loading branch information
martinprikryl committed Jan 6, 2020
1 parent 04b3d64 commit ad26ff3
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions source/forms/CustomScpExplorer.cpp
Expand Up @@ -850,15 +850,21 @@ void __fastcall TCustomScpExplorerForm::RefreshQueueItems()
//---------------------------------------------------------------------------
void __fastcall TCustomScpExplorerForm::SetTaskbarListProgressState(TBPFLAG Flags)
{
// Could now use Application->MainFormHandle, now that we implement Application->OnGetMainFormHandle
FTaskbarList->SetProgressState(GetMainForm()->Handle, Flags);
if (FTaskbarList != NULL)
{
// Could now use Application->MainFormHandle, now that we implement Application->OnGetMainFormHandle
FTaskbarList->SetProgressState(GetMainForm()->Handle, Flags);
}
}
//---------------------------------------------------------------------------
void __fastcall TCustomScpExplorerForm::SetTaskbarListProgressValue(int Progress)
{
if (Progress >= 0)
{
FTaskbarList->SetProgressValue(GetMainForm()->Handle, Progress, 100);
if (FTaskbarList != NULL)
{
FTaskbarList->SetProgressValue(GetMainForm()->Handle, Progress, 100);
}
}
else
{
Expand Down Expand Up @@ -1416,12 +1422,9 @@ void __fastcall TCustomScpExplorerForm::CreateProgressForm(TSynchronizeProgress
// As progress window has delayed show now, we need to lock ourselves, (at least) until then
LockWindow();

if (FTaskbarList != NULL)
{
// Actually, do not know what hides the progress once the operation finishes
// (it is possibly the SetQueueProgress - and we should not rely on that)
SetTaskbarListProgressState(TBPF_NORMAL);
}
// Actually, do not know what hides the progress once the operation finishes
// (it is possibly the SetQueueProgress - and we should not rely on that)
SetTaskbarListProgressState(TBPF_NORMAL);
}
//---------------------------------------------------------------------------
void __fastcall TCustomScpExplorerForm::DestroyProgressForm()
Expand Down Expand Up @@ -1486,11 +1489,8 @@ void __fastcall TCustomScpExplorerForm::FileOperationProgress(
{
FProgressForm->SetProgressData(ProgressData);

if (FTaskbarList != NULL)
{
DebugAssert(ProgressData.InProgress);
SetTaskbarListProgressValue(&ProgressData);
}
DebugAssert(ProgressData.InProgress);
SetTaskbarListProgressValue(&ProgressData);

if (FProgressForm->Cancel > csContinue)
{
Expand Down

0 comments on commit ad26ff3

Please sign in to comment.