Преглед изворни кода

Bug 1815: "Enable queue processing"/"Once Done" queue options should be disabled/triggered once all queued operations are completed, not only after the queue list is empty

https://winscp.net/tracker/1815

Source commit: f7ce6c1654f9b32e9c3f7cb73aee25aa70e52fb5
Martin Prikryl пре 5 година
родитељ
комит
71367b515a
2 измењених фајлова са 8 додато и 2 уклоњено
  1. 7 2
      source/forms/CustomScpExplorer.cpp
  2. 1 0
      source/forms/CustomScpExplorer.h

+ 7 - 2
source/forms/CustomScpExplorer.cpp

@@ -663,6 +663,11 @@ void __fastcall TCustomScpExplorerForm::QueueView3Deletion(TObject * /*Sender*/,
   }
 }
 //---------------------------------------------------------------------------
+bool TCustomScpExplorerForm::IsAnythingQueued()
+{
+  return (FQueueStatus != NULL) && (FQueueStatus->ActiveAndPendingPrimaryCount > 0);
+}
+//---------------------------------------------------------------------------
 void __fastcall TCustomScpExplorerForm::UpdateQueueStatus(bool QueueChanging)
 {
   {
@@ -687,7 +692,7 @@ void __fastcall TCustomScpExplorerForm::UpdateQueueStatus(bool QueueChanging)
 
   UpdateQueueView();
 
-  bool IsEmpty = (FQueueStatus == NULL) || (FQueueStatus->Count == 0);
+  bool IsEmpty = !IsAnythingQueued();
 
   if (IsEmpty && (Terminal != NULL))
   {
@@ -7815,7 +7820,7 @@ bool __fastcall TCustomScpExplorerForm::AllowQueueOperation(
       return ComponentVisible[fcQueueView] && QueueView3->Enabled;
 
     case qoOnceEmpty:
-      return !FQueueController->Empty;
+      return IsAnythingQueued();
 
     default:
       return FQueueController->AllowOperation(Operation, Param);

+ 1 - 0
source/forms/CustomScpExplorer.h

@@ -487,6 +487,7 @@ protected:
   void __fastcall QueueListUpdate(TTerminalQueue * Queue);
   void __fastcall QueueItemUpdate(TTerminalQueue * Queue, TQueueItem * Item);
   void __fastcall UpdateQueueStatus(bool QueueChanging);
+  bool IsAnythingQueued();
   void __fastcall RefreshQueueItems();
   virtual int __fastcall GetStaticComponentsHeight();
   void __fastcall FillQueueViewItem(TListItem * Item,