ADD: AutoRefresh - final

This commit is contained in:
Alexander Koblov 2009-03-28 09:30:47 +00:00
commit 0941bc48f3
4 changed files with 17 additions and 5 deletions

View file

@ -3137,7 +3137,7 @@ begin
if Pos(sDrive, FrameFilePanel.ActiveDir) = 1 then Exit;
until sWatchDirsExclude = '';
end;
FrameFilePanel.RefreshPanel;
FrameFilePanel.RefreshPanel((watch_total_number_files in gWatchDirs), (watch_free_disk_space in gWatchDirs));
end;
function TfrmMain.ExecuteCommandFromEdit(sCmd: String; bRunInTerm: Boolean): Boolean;

View file

@ -2811,7 +2811,6 @@ object frmOptions: TfrmOptions
BorderSpacing.Left = 12
BorderSpacing.Top = 6
Caption = 'Update &footer (total number of files)'
Enabled = False
TabOrder = 3
end
object cbWatchFreeSpace: TCheckBox
@ -2825,7 +2824,6 @@ object frmOptions: TfrmOptions
BorderSpacing.Left = 12
BorderSpacing.Top = 6
Caption = 'Update &header (free disk space)'
Enabled = False
TabOrder = 4
end
object edtWatchExcludeDrives: TEdit

View file

@ -223,7 +223,7 @@ type
procedure MakeSelectedVisible;
procedure InvertAllFiles;
procedure MarkAll;
procedure RefreshPanel;
procedure RefreshPanel(bUpdateFileCount: Boolean = True; bUpdateDiskFreeSpace: Boolean = True);
procedure Init;
procedure ClearCmdLine;
procedure CloseAltPanel;
@ -330,10 +330,14 @@ begin
UpDatelblInfo;
end;
procedure TFrameFilePanel.RefreshPanel;
procedure TFrameFilePanel.RefreshPanel(bUpdateFileCount: Boolean = True; bUpdateDiskFreeSpace: Boolean = True);
var
aFileList: TFileList;
begin
// set up refresh parameters
pnlFile.bUpdateFileCount:= bUpdateFileCount;
pnlFile.bUpdateDiskFreeSpace:= bUpdateDiskFreeSpace;
if dgPanel.Row>=0 then
begin
if Assigned(pnlFile.GetActiveItem) then
@ -360,6 +364,10 @@ begin
CloseAltPanel;
UpDatelblInfo;
// dgPanel.SetFocus;
// restore default value
pnlFile.bUpdateFileCount:= True;
pnlFile.bUpdateDiskFreeSpace:= True;
end;

View file

@ -56,6 +56,8 @@ type
FOnBeforeChangeDirectory : TOnBeforeChangeDirectory;
FOnAfterChangeDirectory : TOnAfterChangeDirectory;
public
bUpdateFileCount,
bUpdateDiskFreeSpace: Boolean;
// iLastDrawnIndex :Integer; // fucking dirty hack (OnDrawItem
constructor Create(AOwner : TObject; APanel:TDrawGrid; AlblPath: TLabel; AlblCurPath, AlblFree:TLabel; AedtCommand:TComboBox);
@ -133,6 +135,8 @@ begin
fVFSmoduleList := TStringList.Create;
// LastActive:='';
// iLastDrawnIndex:=-1;
bUpdateFileCount:= True;
bUpdateDiskFreeSpace:= True;
end;
Destructor TFilePanel.Destroy;
@ -570,6 +574,7 @@ procedure TFilePanel.UpdateCountStatus;
var
i:Integer;
begin
if not bUpdateFileCount then Exit;
fFilesInDir:=0;
fFilesSelected:=0;
fSizeInDir:=0;
@ -708,6 +713,7 @@ begin
fedtCommand.Left:=flblCurPath.Width+5;
fedtCommand.Width:=TControl(fedtCommand.Parent).Width-fedtCommand.Left;
if not bUpdateDiskFreeSpace then Exit;
if fPanelMode=pmDirectory then
begin
GetDiskFreeSpace(fActiveDir, FreeSize, TotalSize);