mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: cm_SetSortMode command (#2642)
This commit is contained in:
parent
83d2cfa181
commit
039bc46b18
3 changed files with 64 additions and 1 deletions
|
|
@ -2871,6 +2871,13 @@ object frmMain: TfrmMain
|
|||
HelpType = htKeyword
|
||||
OnExecute = actExecute
|
||||
end
|
||||
object actSetSortMode: TAction
|
||||
Tag = 7
|
||||
Category = 'Configuration'
|
||||
Caption = 'Set Sort Mode'
|
||||
HelpType = htKeyword
|
||||
OnExecute = actExecute
|
||||
end
|
||||
end
|
||||
object pmHotList: TPopupMenu
|
||||
Images = imgLstDirectoryHotlist
|
||||
|
|
|
|||
|
|
@ -232,6 +232,7 @@ type
|
|||
actConfigToolbars: TAction;
|
||||
actDebugShowCommandParameters: TAction;
|
||||
actOpenDriveByIndex: TAction;
|
||||
actSetSortMode: TAction;
|
||||
btnF10: TSpeedButton;
|
||||
btnF3: TSpeedButton;
|
||||
btnF4: TSpeedButton;
|
||||
|
|
|
|||
|
|
@ -385,6 +385,7 @@ type
|
|||
procedure cm_OpenDriveByIndex(const Params: array of string);
|
||||
procedure cm_AddPlugin(const Params: array of string);
|
||||
procedure cm_LoadList(const Params: array of string);
|
||||
procedure cm_SetSortMode(const Params: array of string);
|
||||
|
||||
// Internal commands
|
||||
procedure cm_ExecuteToolbarItem(const Params: array of string);
|
||||
|
|
@ -413,7 +414,7 @@ uses fOptionsPluginsBase, fOptionsPluginsDSX, fOptionsPluginsWCX,
|
|||
uHotDir, DCXmlConfig, dmCommonData, fOptionsFrame, foptionsDirectoryHotlist,
|
||||
fMainCommandsDlg, uConnectionManager, fOptionsFavoriteTabs, fTreeViewMenu,
|
||||
uArchiveFileSource, fOptionsHotKeys, fBenchmark, uAdministrator, uWcxArchiveFileSource,
|
||||
uColumnsFileView
|
||||
uColumnsFileView, uTypes
|
||||
;
|
||||
|
||||
resourcestring
|
||||
|
|
@ -5672,5 +5673,59 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure TMainCommands.cm_SetSortMode(const Params: array of string);
|
||||
var
|
||||
Param, Value: String;
|
||||
State: Boolean;
|
||||
begin
|
||||
for Param in Params do
|
||||
begin
|
||||
if GetParamValue(Param, 'casesensitivity', Value) then
|
||||
begin
|
||||
if Value = 'notsensitive' then
|
||||
gSortCaseSensitivity:= cstNotSensitive
|
||||
else if Value = 'locale' then
|
||||
gSortCaseSensitivity:= cstLocale
|
||||
else if Value = 'charvalue' then
|
||||
gSortCaseSensitivity:= cstCharValue;
|
||||
end
|
||||
else if GetParamValue(Param, 'foldermode', Value) then
|
||||
begin
|
||||
if Value = 'nameshowfirst' then
|
||||
gSortFolderMode:= sfmSortNameShowFirst
|
||||
else if Value = 'likefileshowfirst' then
|
||||
gSortFolderMode:= sfmSortLikeFileShowFirst
|
||||
else if Value = 'likefile' then
|
||||
gSortFolderMode:= sfmSortLikeFile;
|
||||
end
|
||||
else if GetParamBoolValue(Param, 'natural', State) then
|
||||
gSortNatural:= State
|
||||
else if GetParamBoolValue(Param, 'special', State) then
|
||||
gSortSpecial:= State
|
||||
else if GetParamValue(Param, 'newfiles', Value) then
|
||||
begin
|
||||
if Value = 'top' then
|
||||
gNewFilesPosition:= nfpTop
|
||||
else if Value = 'topafterdirectories' then
|
||||
gNewFilesPosition:= nfpTopAfterDirectories
|
||||
else if Value = 'sortedposition' then
|
||||
gNewFilesPosition:= nfpSortedPosition
|
||||
else if Value = 'bottom' then
|
||||
gNewFilesPosition:= nfpBottom;
|
||||
end
|
||||
else if GetParamValue(Param, 'updatedfiles', Value) then
|
||||
begin
|
||||
if Value = 'nochange' then
|
||||
gUpdatedFilesPosition:= ufpNoChange
|
||||
else if Value = 'sameasnewfiles' then
|
||||
gUpdatedFilesPosition:= ufpSameAsNewFiles
|
||||
else if Value = 'sortedposition' then
|
||||
gUpdatedFilesPosition:= ufpSortedPosition;
|
||||
end
|
||||
end;
|
||||
frmMain.ActiveFrame.Reload(True);
|
||||
frmMain.NotActiveFrame.Reload(True);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue