mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: Restored 'cm_ChangeDirToRoot', added 'cm_ChangeDirToParent' (hotkey Ctrl+PageUp).
This commit is contained in:
parent
e15ce0fa02
commit
efc3ca9dff
5 changed files with 4279 additions and 4258 deletions
6772
src/fmain.pas
6772
src/fmain.pas
File diff suppressed because it is too large
Load diff
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
1725
src/uglobs.pas
1725
src/uglobs.pas
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue