Kaynağa Gözat

Removing (non-working) panel loading animation

Source commit: e11ebbadf97428c78727de18f53e3a251254cca3
Martin Prikryl 7 yıl önce
ebeveyn
işleme
6b34aff91c

+ 0 - 2
source/components/UnixDirView.cpp

@@ -149,7 +149,6 @@ void __fastcall TUnixDirView::ReloadDirectory()
 {
 #ifndef DESIGN_ONLY
   FLastPath = L"";
-  DoAnimation(true);
   Terminal->ReloadDirectory();
 #endif
 }
@@ -805,7 +804,6 @@ void __fastcall TUnixDirView::ChangeDirectory(UnicodeString Path)
   UnicodeString LastFile = L"";
   if (ItemFocused) LastFile = ItemFileName(ItemFocused);
   ClearItems();
-  DoAnimation(true);
 #ifndef DESIGN_ONLY
   try
   {

+ 0 - 1
source/components/UnixDirView.h

@@ -112,7 +112,6 @@ __published:
 
   __property OnUpdateStatusBar;
   __property PathLabel;
-  __property LoadAnimation;
 
   __property AddParentDir;
   __property DimmHiddenFiles;

+ 7 - 0
source/forms/CustomScpExplorer.cpp

@@ -9839,3 +9839,10 @@ bool __fastcall TCustomScpExplorerForm::TryOpenDirectory(TOperationSide Side, co
   return Result;
 }
 //---------------------------------------------------------------------------
+void __fastcall TCustomScpExplorerForm::ReloadDirectory(TOperationSide Side)
+{
+  // Make sure there some feedback even when loading tine local folders
+  TInstantOperationVisualizer Visualizer;
+  DirView(Side)->ReloadDirectory();
+}
+//---------------------------------------------------------------------------

+ 1 - 0
source/forms/CustomScpExplorer.h

@@ -654,6 +654,7 @@ public:
   void __fastcall CloseSession();
   void __fastcall OpenDirectory(TOperationSide Side);
   virtual void __fastcall HomeDirectory(TOperationSide Side);
+  void __fastcall ReloadDirectory(TOperationSide Side);
   void __fastcall OpenStoredSession(TSessionData * Data);
   void __fastcall OpenFolderOrWorkspace(const UnicodeString & Name);
   void __fastcall Idle();

+ 1 - 1
source/forms/NonVisual.cpp

@@ -601,7 +601,7 @@ void __fastcall TNonVisualDataModule::ExplorerActionsExecute(
       EXE(SIDE ## ParentDirAction, DirView(os ## SIDE)->ExecuteParentDirectory()) \
       EXE(SIDE ## RootDirAction, DirView(os ## SIDE)->ExecuteRootDirectory()) \
       EXE(SIDE ## HomeDirAction, ScpExplorer->HomeDirectory(os ## SIDE)) \
-      EXE(SIDE ## RefreshAction, DirView(os ## SIDE)->ReloadDirectory()) \
+      EXE(SIDE ## RefreshAction, ScpExplorer->ReloadDirectory(os ## SIDE)) \
       EXE(SIDE ## OpenDirAction, ScpExplorer->OpenDirectory(os ## SIDE)) \
       EXE(SIDE ## ChangePathAction, ScpExplorer->ChangePath(os ## SIDE)) \
       EXE(SIDE ## AddBookmarkAction, ScpExplorer->AddBookmark(os ## SIDE)) \

+ 1 - 71
source/packages/filemng/CustomDirView.pas

@@ -139,7 +139,6 @@ type
     FStartPos: TPoint;
     FDDOwnerIsSource: Boolean;
     FAbortLoading: Boolean;
-    FAnimation: TAnimate;
     FBackCount: Integer;
     FDontRecordPath: Boolean;
     FDragOnDriveIsMove: Boolean;
@@ -148,7 +147,6 @@ type
     FHistoryPaths: TStrings;
     FImageList16: TImageList;
     FImageList32: TImageList;
-    FLoadAnimation: Boolean;
     FMaxHistoryCount: Integer;
     FPathLabel: TCustomPathLabel;
     FOnUpdateStatusBar: TDirViewUpdateStatusBarEvent;
@@ -254,7 +252,6 @@ type
       State: TCustomDrawState; Stage: TCustomDrawStage): Boolean; override;
     procedure CustomSortItems(SortProc: Pointer);
     procedure Delete(Item: TListItem); override;
-    procedure DoAnimation(Start: Boolean);
     procedure DoHistoryChange; dynamic;
     function DragCompleteFileList: Boolean; virtual;
     procedure Edit(const HItem: TLVItem); override;
@@ -391,7 +388,6 @@ type
     property AbortLoading: Boolean read FAbortLoading write FAbortLoading stored False;
     property BackCount: Integer read FBackCount;
     {Enable or disable populating the item list:}
-    property LoadAnimation: Boolean read FLoadAnimation write FLoadAnimation default True;
     property LoadEnabled: Boolean read FLoadEnabled write SetLoadEnabled default True;
     {Displayed data is not valid => reload required}
     property Dirty: Boolean read FDirty;
@@ -776,36 +772,6 @@ begin
 end;
 
 
-  { TLoadAnimationStartThread }
-
-{constructor TLoadAnimationStartThread.Create(AInterval: Integer; AAnimation: TAnimate);
-begin
-  inherited Create(True);
-  FInterval := AInterval;
-  FAnimation := AAnimation;
-  Resume;
-end;
-
-procedure TLoadAnimationStartThread.Execute;
-var
-  XInterval: Integer;
-begin
-  XInterval := FInterval;
-  while (not Terminated) and (XInterval > 0) do
-  begin
-    Sleep(10);
-    Dec(XInterval, 10);
-  end;
-  if (not Terminated) and Assigned(FAnimation) then
-    Synchronize(StartAnimation);
-end;
-
-procedure TLoadAnimationStartThread.StartAnimation;
-begin
-  FAnimation.Visible := True;
-  FAnimation.Active := True;
-end; }
-
   { TCustomizableDragDropFilesEx }
 
 function TCustomizableDragDropFilesEx.Execute(DataObject: TDataObject): TDragResult;
@@ -838,8 +804,6 @@ begin
   FHasParentDir := False;
   FDragOnDriveIsMove := False;
   FCaseSensitive := False;
-  FLoadAnimation := True;
-  FAnimation := nil;
 
   FIsRecycleBin := False;
   FLoading := False;
@@ -1209,8 +1173,6 @@ begin
   // to force drag&drop re-registration when recreating handle
   // (occurs when changing ViewStyle)
   FDragDropFilesEx.DragDropControl := nil;
-  // Destroy the animation, as we keep getting reports that the animation fails to recreate
-  DoAnimation(False);
   inherited;
 end;
 
@@ -1279,7 +1241,6 @@ begin
 
   FreeAndNil(FDragDropFilesEx);
   FreeImageLists;
-  FreeAndNil(FAnimation);
 
   inherited;
 end;
@@ -1901,12 +1862,7 @@ begin
         SortType := stNone;
         Items.BeginUpdate;
         try
-          try
-            DoAnimation(True);
-            LoadFiles;
-          finally
-            DoAnimation(False);
-          end;
+          LoadFiles;
         finally
           Items.EndUpdate;
         end;
@@ -2777,32 +2733,6 @@ begin
   Result := nil;
 end;
 
-procedure TCustomDirView.DoAnimation(Start: Boolean);
-begin
-  if Start and LoadAnimation then
-  begin
-    if not Assigned(FAnimation) then
-    begin
-      FAnimation := TAnimate.Create(Self);
-      try
-        FAnimation.Top  := (Height - FAnimation.Height) div 2;
-        FAnimation.Left := (Width - FAnimation.Width) div 2;
-        FAnimation.Parent := Self;
-        FAnimation.CommonAVI := aviFindFolder;
-        FAnimation.Transparent := True;
-        FAnimation.Active := True;
-      except
-        FreeAndNil(FAnimation);
-      end;
-    end;
-  end
-    else
-  if not Start then
-  begin
-    FreeAndNil(FAnimation);
-  end;
-end; { DoAnimation }
-
 function TCustomDirView.GetForwardCount: Integer;
 begin
   Result := FHistoryPaths.Count - BackCount;

+ 0 - 1
source/packages/filemng/DirView.pas

@@ -316,7 +316,6 @@ type
     property PathLabel;
     property OnUpdateStatusBar;
 
-    property LoadAnimation;
     property DimmHiddenFiles;
     property ShowHiddenFiles;
     property WantUseDragImages;