UPD: Restored 'cm_ChangeDirToRoot', added 'cm_ChangeDirToParent' (hotkey Ctrl+PageUp).

This commit is contained in:
cobines 2009-10-27 18:26:41 +00:00
commit efc3ca9dff
5 changed files with 4279 additions and 4258 deletions

File diff suppressed because it is too large Load diff

View file

@ -88,6 +88,8 @@ type
}
function IsAtRootPath: Boolean; virtual;
class function GetParentDir(sPath : String): String; virtual;
class function GetRootDir(sPath : String): String; virtual;
class function GetPathType(sPath : String): TPathType; virtual;
function GetFreeSpace(out FreeSize, TotalSize : Int64) : Boolean; virtual;
@ -162,6 +164,16 @@ begin
Result := (CurrentPath = PathDelim);
end;
class function TFileSource.GetParentDir(sPath : String): String;
begin
Result := uDCUtils.GetParentDir(sPath);
end;
class function TFileSource.GetRootDir(sPath : String): String;
begin
Result := PathDelim;
end;
class function TFileSource.GetPathType(sPath : String): TPathType;
begin
Result := ptNone;

View file

@ -41,6 +41,8 @@ type
class function GetProperties: TFileSourceProperties; override;
function IsAtRootPath: Boolean; override;
class function GetRootDir(sPath: String): String; override;
class function GetPathType(sPath : String): TPathType; override;
function GetFreeSpace(out FreeSize, TotalSize : Int64) : Boolean; override;
@ -156,6 +158,11 @@ begin
Result := (uDCUtils.GetParentDir(CurrentPath) = '');
end;
class function TFileSystemFileSource.GetRootDir(sPath : String): String;
begin
Result := uDCUtils.GetRootDir(sPath);
end;
class function TFileSystemFileSource.GetPathType(sPath : String): TPathType;
begin
Result := uDCUtils.GetPathType(sPath);

View file

@ -227,6 +227,7 @@ const cf_Null=0;
procedure cm_CutToClipboard(param: string='');
procedure cm_PasteFromClipboard(param: string='');
procedure cm_ChangeDirToRoot(param: string='');
procedure cm_ChangeDirToParent(param: string='');
procedure cm_ChangeDir(param: string='');
procedure cm_ClearLogWindow(param: string='');
procedure cm_ClearLogFile(param: string='');
@ -2548,10 +2549,22 @@ end;
procedure TActs.cm_ChangeDirToRoot(param: string='');
begin
frmMain.ActiveFrame.ExecuteCommand('cm_ChangeDirToRoot', param);
{
FrmMain.ActiveFrame.pnlFile.cdRootLevel;
}
with frmMain.ActiveFrame do
begin
CurrentPath := FileSource.GetRootDir(CurrentPath);
end;
end;
procedure TActs.cm_ChangeDirToParent(param: string='');
var
NewPath: String;
begin
with frmMain.ActiveFrame do
begin
NewPath := FileSource.GetParentDir(CurrentPath);
if NewPath <> '' then
CurrentPath := NewPath;
end;
end;
// Parameters:

File diff suppressed because it is too large Load diff