mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-28 10:02:14 +00:00
ADD: cm_MarkCurrentName, cm_UnmarkCurrentName, cm_MarkCurrentPath, cm_UnmarkCurrentPath commands
This commit is contained in:
parent
681fbcf213
commit
4f60fea042
5 changed files with 104 additions and 0 deletions
|
|
@ -457,7 +457,9 @@ type
|
|||
procedure InvertAll;
|
||||
procedure LoadSelectionFromClipboard;
|
||||
procedure LoadSelectionFromFile(const AFileName: String);
|
||||
procedure MarkCurrentName(bSelect: Boolean);
|
||||
procedure MarkCurrentExtension(bSelect: Boolean);
|
||||
procedure MarkCurrentPath(bSelect: Boolean);
|
||||
procedure MarkFile(AFile: TDisplayFile; bSelect: Boolean; bNotify: Boolean = True);
|
||||
procedure MarkFiles(bSelect: Boolean);
|
||||
procedure MarkFiles(FromIndex, ToIndex: PtrInt; bSelect: Boolean);
|
||||
|
|
@ -1807,6 +1809,37 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure TFileView.MarkCurrentPath(bSelect: Boolean);
|
||||
var
|
||||
I: Integer;
|
||||
sPath: String;
|
||||
bSelected: Boolean = False;
|
||||
begin
|
||||
if IsActiveItemValid then
|
||||
begin
|
||||
sPath := GetActiveDisplayFile.FSFile.Path;
|
||||
|
||||
BeginUpdate;
|
||||
try
|
||||
for I := 0 to FFiles.Count - 1 do
|
||||
begin
|
||||
if FFiles[I].FSFile.IsDirectory then Continue;
|
||||
|
||||
if mbCompareFileNames(FFiles[I].FSFile.Path, sPath) then
|
||||
begin
|
||||
FFiles[I].Selected := bSelect;
|
||||
bSelected := True;
|
||||
end;
|
||||
end;
|
||||
|
||||
if bSelected then
|
||||
Notify([fvnSelectionChanged]);
|
||||
finally
|
||||
EndUpdate;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TFileView.IsVisibleToUser: Boolean;
|
||||
begin
|
||||
if NotebookPage is TFileViewPage then
|
||||
|
|
@ -2575,6 +2608,21 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure TFileView.MarkCurrentName(bSelect: Boolean);
|
||||
var
|
||||
sGroup: String;
|
||||
bCaseSensitive: boolean = false;
|
||||
bIgnoreAccents: boolean = false;
|
||||
bWindowsInterpretation: boolean = True;
|
||||
begin
|
||||
if IsActiveItemValid then
|
||||
begin
|
||||
sGroup := GetActiveDisplayFile.FSFile.NameNoExt;
|
||||
if Length(sGroup) > 0 then sGroup += ExtensionSeparator + '*';
|
||||
MarkGroup(sGroup, bSelect, @bCaseSensitive, @bIgnoreAccents, @bWindowsInterpretation);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFileView.SaveConfiguration(AConfig: TXmlConfig; ANode: TXmlNode; ASaveHistory:boolean);
|
||||
var
|
||||
HistoryNode, EntryNode, FSNode, PathsNode, PathNode: TXmlNode;
|
||||
|
|
|
|||
|
|
@ -2568,6 +2568,30 @@ object frmMain: TfrmMain
|
|||
Caption = 'Save Settings'
|
||||
OnExecute = actExecute
|
||||
end
|
||||
object actMarkCurrentPath: TAction
|
||||
Tag = 10
|
||||
Category = 'Mark'
|
||||
Caption = 'Select all in same path'
|
||||
OnExecute = actExecute
|
||||
end
|
||||
object actUnmarkCurrentPath: TAction
|
||||
Tag = 10
|
||||
Category = 'Mark'
|
||||
Caption = 'Unselect all in same path'
|
||||
OnExecute = actExecute
|
||||
end
|
||||
object actMarkCurrentName: TAction
|
||||
Tag = 10
|
||||
Category = 'Mark'
|
||||
Caption = 'Select all files with same name'
|
||||
OnExecute = actExecute
|
||||
end
|
||||
object actUnmarkCurrentName: TAction
|
||||
Tag = 10
|
||||
Category = 'Mark'
|
||||
Caption = 'Unselect all files with same name'
|
||||
OnExecute = actExecute
|
||||
end
|
||||
end
|
||||
object pmHotList: TPopupMenu
|
||||
Images = imgLstDirectoryHotlist
|
||||
|
|
|
|||
|
|
@ -245,6 +245,10 @@ TFRMMAIN.ACTNEXTFAVORITETABS.CAPTION=Load the Next Favorite Tabs in the list
|
|||
TFRMMAIN.ACTCONFIGTREEVIEWMENUS.CAPTION=Configuration of Tree View Menu
|
||||
TFRMMAIN.ACTCONFIGTREEVIEWMENUSCOLORS.CAPTION=Configuration of Tree View Menu Colors
|
||||
TFRMMAIN.ACTCONFIGSAVESETTINGS.CAPTION=Save Settings
|
||||
TFRMMAIN.ACTMARKCURRENTPATH.CAPTION=Select all in same path
|
||||
TFRMMAIN.ACTUNMARKCURRENTPATH.CAPTION=Unselect all in same path
|
||||
TFRMMAIN.ACTMARKCURRENTNAME.CAPTION=Select all files with same name
|
||||
TFRMMAIN.ACTUNMARKCURRENTNAME.CAPTION=Unselect all files with same name
|
||||
TFRMMAIN.TBEDIT.CAPTION=Edit
|
||||
TFRMMAIN.TBDELETE.CAPTION=Delete
|
||||
TFRMMAIN.TBCHANGEDIR.CAPTION=CD
|
||||
|
|
|
|||
|
|
@ -102,6 +102,10 @@ type
|
|||
actConfigTreeViewMenus: TAction;
|
||||
actConfigTreeViewMenusColors: TAction;
|
||||
actConfigSaveSettings: TAction;
|
||||
actUnmarkCurrentName: TAction;
|
||||
actMarkCurrentName: TAction;
|
||||
actUnmarkCurrentPath: TAction;
|
||||
actMarkCurrentPath: TAction;
|
||||
actTreeView: TAction;
|
||||
actToggleFullscreenConsole: TAction;
|
||||
actSrcOpenDrives: TAction;
|
||||
|
|
|
|||
|
|
@ -253,8 +253,12 @@ type
|
|||
procedure cm_MarkUnmarkAll(const Params: array of string);
|
||||
procedure cm_MarkPlus(const Params: array of string);
|
||||
procedure cm_MarkMinus(const Params: array of string);
|
||||
procedure cm_MarkCurrentName(const Params: array of string);
|
||||
procedure cm_UnmarkCurrentName(const Params: array of string);
|
||||
procedure cm_MarkCurrentExtension(const Params: array of string);
|
||||
procedure cm_UnmarkCurrentExtension(const Params: array of string);
|
||||
procedure cm_MarkCurrentPath(const Params: array of string);
|
||||
procedure cm_UnmarkCurrentPath(const Params: array of string);
|
||||
procedure cm_SaveSelection(const Params: array of string);
|
||||
procedure cm_RestoreSelection(const Params: array of string);
|
||||
procedure cm_SaveSelectionToFile(const Params: array of string);
|
||||
|
|
@ -2863,6 +2867,16 @@ begin
|
|||
DoActualMarkUnMark(Params, False);
|
||||
end;
|
||||
|
||||
procedure TMainCommands.cm_MarkCurrentName(const Params: array of string);
|
||||
begin
|
||||
frmMain.ActiveFrame.MarkCurrentName(True);
|
||||
end;
|
||||
|
||||
procedure TMainCommands.cm_UnmarkCurrentName(const Params: array of string);
|
||||
begin
|
||||
frmMain.ActiveFrame.MarkCurrentName(False);
|
||||
end;
|
||||
|
||||
procedure TMainCommands.cm_MarkCurrentExtension(const Params: array of string);
|
||||
begin
|
||||
frmMain.ActiveFrame.MarkCurrentExtension(True);
|
||||
|
|
@ -2873,6 +2887,16 @@ begin
|
|||
frmMain.ActiveFrame.MarkCurrentExtension(False);
|
||||
end;
|
||||
|
||||
procedure TMainCommands.cm_MarkCurrentPath(const Params: array of string);
|
||||
begin
|
||||
frmMain.ActiveFrame.MarkCurrentPath(True);
|
||||
end;
|
||||
|
||||
procedure TMainCommands.cm_UnmarkCurrentPath(const Params: array of string);
|
||||
begin
|
||||
frmMain.ActiveFrame.MarkCurrentPath(False);
|
||||
end;
|
||||
|
||||
procedure TMainCommands.cm_SaveSelection(const Params: array of string);
|
||||
begin
|
||||
frmMain.ActiveFrame.SaveSelection;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue