ADD: Many improvements (patch by Denis Bisson)

This commit is contained in:
Alexander Koblov 2015-02-15 11:17:10 +00:00
commit c677891cfb
34 changed files with 3990 additions and 2256 deletions

View file

@ -43,6 +43,8 @@ type
{ public declarations }
end;
procedure ShowHelpForKeywordWithAnchor(const Keyword: String);
var
dmHelpMgr: TdmHelpManager;
@ -51,11 +53,46 @@ implementation
{$R *.lfm}
uses
{$IFDEF MSWindows}
LCLIntf,
{$IFDEF MSWINDOWS}
LCLIntf, uOSUtils, uFileProcs,
{$ELSE}
HelpIntfs,
{$ENDIF}
uGlobsPaths, uGlobs, DCStrUtils, DCOSUtils, StrUtils;
{$IF DEFINED(MSWINDOWS)}
procedure OpenURLWithAnchor(URL: String);
var
hFile:THandle;
TempoFilenameWithTheLink: String;
begin
TempoFilenameWithTheLink:= GetTempFolderDeletableAtTheEnd + 'FileWithALink.html';
hFile:= mbFileCreate(TempoFilenameWithTheLink);
if hFile <> feInvalidHandle then
try
FileWriteLn(hFile,'<html>');
FileWriteLn(hFile,'<head><meta http-equiv="refresh" content="0;url=' + URL + '" /></head>');
// In case browser doesn't support auto-redirection, give a link to user.
FileWriteLn(hFile,'<body><center><a href="' + URL + '">Click here</a> for help</center></body>');
FileWriteLn(hFile,'</html>');
finally
FileClose(hFile);
end;
if mbFileExists(TempoFilenameWithTheLink) then OpenURL(TempoFilenameWithTheLink);
end;
{$ENDIF}
procedure ShowHelpForKeywordWithAnchor(const Keyword: String);
{$IF DEFINED(MSWINDOWS)}
begin
OpenURLWithAnchor(dmHelpMgr.HTMLHelpDatabase.BaseURL + Keyword);
end;
{$ELSE}
begin
ShowHelpOrErrorForKeyword('', Keyword);
end;
{$ENDIF}
{ TdmHelpManager }
procedure TdmHelpManager.DataModuleCreate(Sender: TObject);
@ -87,4 +124,4 @@ begin
end;
end.

View file

@ -279,7 +279,7 @@ end;"/>
<MinVersion Minor="3" Valid="True"/>
</Item11>
</RequiredPackages>
<Units Count="221">
<Units Count="222">
<Unit0>
<Filename Value="doublecmd.lpr"/>
<IsPartOfProject Value="True"/>
@ -1142,6 +1142,7 @@ end;"/>
<Unit131>
<Filename Value="filesources\ufilesourceutil.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="uFileSourceUtil"/>
</Unit131>
<Unit132>
<Filename Value="filesources\ufilesourcewipeoperation.pas"/>
@ -1578,13 +1579,18 @@ end;"/>
<UnitName Value="fOptionsBriefView"/>
</Unit219>
<Unit220>
<Filename Value="fmaincommandsdlg.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmMainCommandsDlg"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="fMainCommandsDlg"/>
</Unit220>
<Unit221>
<Filename Value="frames\fsearchplugin.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmSearchPlugin"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Frame"/>
<UnitName Value="fSearchPlugin"/>
</Unit220>
</Unit221>
</Units>
</ProjectOptions>
<CompilerOptions>

View file

@ -15,7 +15,7 @@ object frmCheckSumCalc: TfrmCheckSumCalc
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
SessionProperties = 'cbOpenAfterJobIsComplete.Checked;cbSeparateFile.Checked;cmbHashAlgorithm.ItemIndex;lbHashAlgorithm.ItemIndex'
SessionProperties = 'cbOpenAfterJobIsComplete.Checked;cbSeparateFile.Checked;lbHashAlgorithm.ItemIndex'
LCLVersion = '1.2.6.0'
object lblSaveTo: TLabel
AnchorSideLeft.Control = Owner

View file

@ -1,4 +1,4 @@
inherited frmEditor: TfrmEditor
object frmEditor: TfrmEditor
Left = 100
Height = 480
Top = 100
@ -53,7 +53,8 @@ inherited frmEditor: TfrmEditor
OnCreate = FormCreate
SessionProperties = 'Height;Width;WindowState;Left;Top'
ShowInTaskBar = stAlways
object StatusBar: TStatusBar[0]
LCLVersion = '1.2.6.0'
object StatusBar: TStatusBar
Left = 0
Height = 23
Top = 437
@ -73,7 +74,7 @@ inherited frmEditor: TfrmEditor
end>
SimplePanel = False
end
inline Editor: TSynEdit[1]
inline Editor: TSynEdit
Left = 0
Height = 411
Top = 26
@ -596,7 +597,7 @@ inherited frmEditor: TfrmEditor
end
end
end
object tbToolBar: TToolBar[2]
object tbToolBar: TToolBar
Left = 0
Height = 26
Top = 0
@ -623,58 +624,58 @@ inherited frmEditor: TfrmEditor
object tbSeparator1: TToolButton
Left = 70
Top = 2
Width = 8
Width = 10
Style = tbsSeparator
end
object tbCut: TToolButton
Left = 78
Left = 80
Top = 2
Action = actEditCut
end
object tbCopy: TToolButton
Left = 101
Left = 103
Top = 2
Action = actEditCopy
end
object tbPaste: TToolButton
Left = 124
Left = 126
Top = 2
Action = actEditPaste
end
object tbSeparator2: TToolButton
Left = 147
Left = 149
Top = 2
Width = 8
Width = 10
Style = tbsSeparator
end
object tbUndo: TToolButton
Left = 155
Left = 159
Top = 2
Action = actEditUndo
end
object tbRedo: TToolButton
Left = 178
Left = 182
Top = 2
Action = actEditRedo
end
object tbSeparator3: TToolButton
Left = 201
Left = 205
Top = 2
Width = 8
Width = 10
Style = tbsSeparator
end
object tbConfig: TToolButton
Left = 209
Left = 215
Top = 2
Action = actConfHigh
end
object tbHelp: TToolButton
Left = 232
Left = 238
Top = 2
Action = actAbout
end
end
object MainMenu1: TMainMenu[3]
object MainMenu1: TMainMenu
Images = ilImageList
left = 48
top = 32
@ -1302,6 +1303,42 @@ inherited frmEditor: TfrmEditor
end
object miGotoLine: TMenuItem
Action = actEditGotoLine
Bitmap.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000064000000640000000000000000000000FFFFFF00BBBB
BBFF858A88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A
88FF858A88FF858A88FF858A88FF858A88FFBBBBBBFFFFFFFF00FFFFFF00858A
88FFD8D8D8FFD8D8D8FFBBBBBBFFFEFEFEFFFEFEFEFFFEFEFEFFFEFEFEFFFEFE
FEFFFEFEFEFFFEFEFEFFFEFEFEFFFFFFFFFF858A88FFFFFFFF00FFFFFF00858A
88FFD8D8D8FFD8D8D8FFBBBBBBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFEFEFF858A88FFFFFFFF00FFFFFF00858A
88FFD8D8D8FFD8D8D8FFBBBBBBFFFFFFFFFF0000FFFF0000FFFF0000FFFF0000
FFFF0000FFFF0000FFFF0000FFFFFEFEFEFF858A88FFFFFFFF00FFFFFF00858A
88FFD8D8D8FFD8D8D8FFBBBBBBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFEFEFF858A88FFFFFFFF00FFFFFF00858A
88FFD8D8D8FFD8D8D8FFBBBBBBFFFFFFFFFFD4D4D4FFD4D4D4FF874A20FF874A
20FFD4D4D4FFD4D4D4FFD4D4D4FFFEFEFEFF858A88FFFFFFFF00FFFFFF00858A
88FFD8D8D8FFD8D8D8FFBBBBBBFFFFFFFFFFFFFFFFFF874A20FFBAA38FFFCCBB
ADFF874A20FFFFFFFFFFFFFFFFFFFEFEFEFF858A88FFFFFFFF00FFFFFF00858A
88FFD8D8D8FFD8D8D8FFBBBBBBFFFFFFFFFF874A20FFBAA38FFFB5957AFFB595
7AFFCCBBADFF874A20FFC8C8C8FFFEFEFEFF858A88FFFFFFFF00FFFFFF00858A
88FFD8D8D8FFD8D8D8FFBBBBBBFF874A20FFBAA38FFFB5957AFFB5957AFFB595
7AFFB5957AFFCCBBADFF874A20FFFEFEFEFF858A88FFFFFFFF00FFFFFF00858A
88FFD8D8D8FFD8D8D8FF874A20FFBAA38FFFBAA38FFFBAA38FFFB5957AFFB595
7AFFB5957AFFB5957AFFCCBBADFF874A20FF858A88FFFFFFFF00FFFFFF00858A
88FFD8D8D8FF874A20FF874A20FF874A20FF874A20FF874A20FFBAA38FFFCCBB
ADFF874A20FF874A20FF874A20FF874A20FF874A20FFFFFFFF00FFFFFF00858A
88FFD8D8D8FFD8D8D8FFBBBBBBFFFFFFFFFFBFBFBFFF874A20FFBAA38FFFCCBB
ADFF874A20FFBFBFBFFFBFBFBFFFFEFEFEFF858A88FFFFFFFF00FFFFFF00858A
88FFD8D8D8FFD8D8D8FFBBBBBBFFFFFFFFFFFFFFFFFF874A20FFBAA38FFFCCBB
ADFF874A20FFFFFFFFFFFFFFFFFFFEFEFEFF858A88FFFFFFFF00FFFFFF00858A
88FFBBBBBBFFBBBBBBFF948A7CFF9A7441FF9F7844FFBAA38FFFBAA38FFFCCBB
ADFF874A20FFB7B7B7FFB7B7B7FFFEFEFEFF858A88FFFFFFFF00FFFFFF00858A
88FFA59C8FFFB2ADA8FFBAA38FFFBAA38FFFBAA38FFFBAA38FFFCCBBADFF874A
20FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF858A88FFFFFFFF00FFFFFF00BBBB
BBFF9B958AFFA09990FF948A7CFF886F4FFF8B6738FF896A40FF7F7253FF858A
88FF858A88FF858A88FF858A88FF858A88FFBBBBBBFFFFFFFF00
}
ImageIndex = 16
end
object N5: TMenuItem
@ -1379,7 +1416,7 @@ inherited frmEditor: TfrmEditor
end
end
end
object ActListEdit: TActionList[4]
object ActListEdit: TActionList
Images = ilImageList
left = 96
top = 32
@ -1577,7 +1614,7 @@ inherited frmEditor: TfrmEditor
ShortCut = 16455
end
end
object pmContextMenu: TPopupMenu[5]
object pmContextMenu: TPopupMenu
Images = ilImageList
left = 144
top = 32
@ -1828,7 +1865,7 @@ inherited frmEditor: TfrmEditor
OnClick = actEditSelectAllExecute
end
end
object ilImageList: TImageList[6]
object ilImageList: TImageList
left = 192
top = 32
Bitmap = {

View file

@ -1,86 +1,86 @@
inherited frmEditSearchReplace: TfrmEditSearchReplace
Left = 526
Height = 278
Top = 190
Width = 409
object frmEditSearchReplace: TfrmEditSearchReplace
Left = 748
Height = 218
Top = 377
Width = 356
ActiveControl = cbSearchText
AutoSize = True
BorderIcons = [biSystemMenu]
BorderStyle = bsDialog
BorderIcons = []
ChildSizing.TopBottomSpacing = 6
ClientHeight = 278
ClientWidth = 409
ClientHeight = 218
ClientWidth = 356
OnCloseQuery = FormCloseQuery
OnCreate = FormCreate
OnShow = FormShow
Position = poOwnerFormCenter
object lblSearchFor: TLabel[0]
SessionProperties = 'Left;Top;Width;Height'
LCLVersion = '1.2.6.0'
object lblSearchFor: TLabel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = cbSearchText
AnchorSideTop.Side = asrCenter
Left = 12
Height = 18
Top = 17
Width = 72
Height = 15
Top = 16
Width = 56
BorderSpacing.Left = 12
Caption = '&Search for:'
FocusControl = cbSearchText
ParentColor = False
end
object lblReplaceWith: TLabel[1]
object lblReplaceWith: TLabel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = cbReplaceText
AnchorSideTop.Side = asrCenter
Left = 12
Height = 18
Top = 51
Width = 89
Height = 15
Top = 45
Width = 70
BorderSpacing.Left = 12
Caption = '&Replace with:'
FocusControl = cbReplaceText
ParentColor = False
end
object cbSearchText: TComboBox[2]
object cbSearchText: TComboBox
AnchorSideLeft.Control = lblSearchFor
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Owner
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 90
Height = 28
Left = 74
Height = 23
Top = 12
Width = 311
Width = 274
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Top = 12
BorderSpacing.Right = 8
ItemHeight = 0
ItemHeight = 15
TabOrder = 0
end
object gbSearchOptions: TGroupBox[3]
object gbSearchOptions: TGroupBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = cbReplaceText
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = btnOK
Left = 12
Height = 148
Top = 86
Width = 197
Anchors = [akTop, akLeft, akRight]
Height = 133
Top = 76
Width = 141
AutoSize = True
BorderSpacing.Left = 12
BorderSpacing.Top = 12
BorderSpacing.Right = 6
Caption = 'Option'
ClientHeight = 125
ClientWidth = 193
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6
ClientHeight = 115
ClientWidth = 137
TabOrder = 2
object cbSearchCaseSensitive: TCheckBox
AnchorSideLeft.Control = gbSearchOptions
AnchorSideTop.Control = gbSearchOptions
Left = 8
Height = 23
Top = 2
Width = 123
Height = 19
Top = 6
Width = 100
BorderSpacing.Left = 8
BorderSpacing.Top = 2
Caption = 'C&ase sensitivity'
@ -91,9 +91,9 @@ inherited frmEditSearchReplace: TfrmEditSearchReplace
AnchorSideTop.Control = cbSearchCaseSensitive
AnchorSideTop.Side = asrBottom
Left = 8
Height = 23
Height = 19
Top = 27
Width = 143
Width = 115
BorderSpacing.Left = 8
BorderSpacing.Top = 2
Caption = '&Whole words only'
@ -104,9 +104,9 @@ inherited frmEditSearchReplace: TfrmEditSearchReplace
AnchorSideTop.Control = cbSearchWholeWords
AnchorSideTop.Side = asrBottom
Left = 8
Height = 23
Top = 52
Width = 145
Height = 19
Top = 48
Width = 112
BorderSpacing.Left = 8
BorderSpacing.Top = 2
Caption = 'Selected &text only'
@ -117,9 +117,9 @@ inherited frmEditSearchReplace: TfrmEditSearchReplace
AnchorSideTop.Control = cbSearchSelectedOnly
AnchorSideTop.Side = asrBottom
Left = 8
Height = 23
Top = 77
Width = 139
Height = 19
Top = 69
Width = 113
BorderSpacing.Left = 8
BorderSpacing.Top = 2
Caption = 'S&earch from caret'
@ -130,27 +130,25 @@ inherited frmEditSearchReplace: TfrmEditSearchReplace
AnchorSideTop.Control = cbSearchFromCursor
AnchorSideTop.Side = asrBottom
Left = 8
Height = 23
Top = 102
Width = 155
Height = 19
Top = 90
Width = 123
BorderSpacing.Left = 8
BorderSpacing.Top = 2
Caption = '&Regular expressions'
TabOrder = 4
end
end
object rgSearchDirection: TRadioGroup[4]
object rgSearchDirection: TRadioGroup
AnchorSideLeft.Control = gbSearchOptions
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = cbReplaceText
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 215
Left = 159
Height = 88
Top = 86
Width = 186
Anchors = [akTop, akLeft, akRight]
Top = 76
Width = 114
AutoFill = True
BorderSpacing.Left = 6
BorderSpacing.Top = 12
@ -164,43 +162,42 @@ inherited frmEditSearchReplace: TfrmEditSearchReplace
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 65
ClientWidth = 182
ClientHeight = 70
ClientWidth = 110
Items.Strings = (
'&Forward'
'&Backward'
)
TabOrder = 3
end
object cbReplaceText: TComboBox[5]
object cbReplaceText: TComboBox
AnchorSideLeft.Control = lblReplaceWith
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = cbSearchText
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 107
Height = 28
Top = 46
Width = 294
Left = 88
Height = 23
Top = 41
Width = 260
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Top = 6
BorderSpacing.Right = 8
ItemHeight = 0
ItemHeight = 15
TabOrder = 1
end
object btnOK: TBitBtn[6]
AnchorSideTop.Control = gbSearchOptions
object btnOK: TBitBtn
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = btnCancel
AnchorSideBottom.Control = Owner
AnchorSideBottom.Control = gbSearchOptions
AnchorSideBottom.Side = asrBottom
Left = 215
Left = 162
Height = 31
Top = 234
Top = 174
Width = 90
Anchors = [akTop, akRight]
Anchors = [akRight, akBottom]
BorderSpacing.Right = 6
BorderSpacing.Bottom = 4
Caption = '&OK'
@ -210,18 +207,17 @@ inherited frmEditSearchReplace: TfrmEditSearchReplace
OnClick = btnOKClick
TabOrder = 4
end
object btnCancel: TBitBtn[7]
AnchorSideTop.Control = gbSearchOptions
object btnCancel: TBitBtn
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Owner
AnchorSideBottom.Control = gbSearchOptions
AnchorSideBottom.Side = asrBottom
Left = 311
Left = 258
Height = 31
Top = 234
Top = 174
Width = 90
Anchors = [akTop, akRight]
Anchors = [akRight, akBottom]
BorderSpacing.Right = 8
BorderSpacing.Bottom = 4
Cancel = True

View file

@ -60,12 +60,22 @@ unit fEditSearch;
interface
uses
Classes, SysUtils, Forms, Controls, StdCtrls, ExtCtrls, Buttons, uOSForms;
Classes, SysUtils, Forms, Controls, StdCtrls, ExtCtrls, Buttons, uOSForms,
DCClassesUtf8;
type
{ TEditSearchDialogOption }
//Not only it helps to show what we want to offer to user, it will help to determine the default
//When used as paramters of function, place on required.
//When used as a returned value, we'll include the status of all.
TEditSearchDialogOption = set of (eswoCaseSensitiveChecked, eswoCaseSensitiveUnchecked,
eswoWholeWordChecked, eswoWholeWordUnchecked,
eswoSelectedTextChecked, eswoSelectedTextUnchecked,
eswoSearchFromCursorChecked, eswoSearchFromCursorUnchecked,
eswoRegularExpressChecked, eswoRegularExpressUnchecked,
eswoDirectionDisabled, eswoDirectionEnabledForward, eswoDirectionEnabledBackward);
{ TfrmEditSearchReplace }
TfrmEditSearchReplace = class(TModalForm)
btnOK: TBitBtn;
btnCancel: TBitBtn;
@ -82,6 +92,7 @@ type
rgSearchDirection: TRadioGroup;
procedure btnOKClick(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
private
function GetSearchBackwards: boolean;
@ -126,12 +137,84 @@ type
write SetReplaceTextHistory;
end;
function GetSimpleSearchAndReplaceString(AOwner:TComponent; OptionAllowed:TEditSearchDialogOption; var sSearchText:string; var sReplaceText:string; var OptionsToReturn:TEditSearchDialogOption; PastSearchList:TStringListEx; PastReplaceList:TStringListEx):boolean;
implementation
{$R *.lfm}
uses
uLng, uDCUtils;
math, uGlobs, uLng, uDCUtils;
function GetSimpleSearchAndReplaceString(AOwner:TComponent; OptionAllowed:TEditSearchDialogOption; var sSearchText:string; var sReplaceText:string; var OptionsToReturn:TEditSearchDialogOption; PastSearchList:TStringListEx; PastReplaceList:TStringListEx):boolean;
var
dlg: TfrmEditSearchReplace;
begin
result:=FALSE;
OptionsToReturn:=[];
dlg := TfrmEditSearchReplace.Create(AOwner, TRUE);
try
with dlg do
begin
//1. Let's enable to options host wanted to offer to user
cbSearchCaseSensitive.Enabled := ((eswoCaseSensitiveChecked in OptionAllowed) OR (eswoCaseSensitiveUnchecked in OptionAllowed));
cbSearchWholeWords.Enabled := ((eswoWholeWordChecked in OptionAllowed) OR (eswoWholeWordUnchecked in OptionAllowed));
cbSearchSelectedOnly.Enabled := ((eswoSelectedTextChecked in OptionAllowed) OR (eswoSelectedTextUnchecked in OptionAllowed));
cbSearchFromCursor.Enabled := ((eswoSearchFromCursorChecked in OptionAllowed) OR (eswoSearchFromCursorUnchecked in OptionAllowed));
cbSearchRegExp.Enabled := ((eswoRegularExpressChecked in OptionAllowed) OR (eswoRegularExpressUnchecked in OptionAllowed));
rgSearchDirection.Enabled := ((eswoDirectionEnabledForward in OptionAllowed) OR (eswoDirectionEnabledBackward in OptionAllowed));
//2. Let's set the option to their default according to what host wants to offer
cbSearchCaseSensitive.Checked := (eswoCaseSensitiveChecked in OptionAllowed);
cbSearchWholeWords.Checked := (eswoWholeWordChecked in OptionAllowed);
cbSearchSelectedOnly.Checked := (eswoSelectedTextChecked in OptionAllowed);
cbSearchFromCursor.Checked := (eswoSearchFromCursorChecked in OptionAllowed);
cbSearchRegExp.Checked := (eswoRegularExpressChecked in OptionAllowed);
rgSearchDirection.ItemIndex:=ifthen((eswoDirectionEnabledBackward in OptionAllowed),1,0);
//3. Setup the SEARCH info
if sSearchText='' then sSearchText:=rsEditSearchCaption;
SearchTextHistory:=PastSearchList.Text;
cbSearchText.Text:=sSearchText;
//4. Setup the REPLACE info
if sReplaceText='' then sReplaceText:=rsEditSearchReplace;
ReplaceTextHistory:=PastReplaceList.Text;
cbReplaceText.Text:=sReplaceText;
//5. Get feedback from user
if ShowModal=mrOk then
begin
//6. Let's set the options wanted by the user
if cbSearchCaseSensitive.Enabled then
if cbSearchCaseSensitive.Checked then OptionsToReturn:=OptionsToReturn+[eswoCaseSensitiveChecked] else OptionsToReturn:=OptionsToReturn+[eswoCaseSensitiveUnchecked];
if cbSearchWholeWords.Enabled then
if cbSearchWholeWords.Checked then OptionsToReturn:=OptionsToReturn+[eswoWholeWordChecked] else OptionsToReturn:=OptionsToReturn+[eswoWholeWordUnchecked];
if cbSearchSelectedOnly.Enabled then
if cbSearchSelectedOnly.Checked then OptionsToReturn:=OptionsToReturn+[eswoSelectedTextChecked] else OptionsToReturn:=OptionsToReturn+[eswoSelectedTextUnchecked];
if cbSearchFromCursor.Enabled then
if cbSearchFromCursor.Checked then OptionsToReturn:=OptionsToReturn+[eswoSearchFromCursorChecked] else OptionsToReturn:=OptionsToReturn+[eswoSearchFromCursorUnchecked];
if cbSearchRegExp.Enabled then
if cbSearchRegExp.Checked then OptionsToReturn:=OptionsToReturn+[eswoRegularExpressChecked] else OptionsToReturn:=OptionsToReturn+[eswoRegularExpressUnchecked];
if rgSearchDirection.Enabled then
if rgSearchDirection.ItemIndex=1 then OptionsToReturn:=OptionsToReturn+[eswoDirectionEnabledBackward] else OptionsToReturn:=OptionsToReturn+[eswoDirectionEnabledForward];
//7. Let's set our history
PastSearchList.Text:=SearchTextHistory;
PastReplaceList.Text:=ReplaceTextHistory;
//8. And FINALLY, our valuable text to search we wanted to replace!
sSearchText:=cbSearchText.Text;
sReplaceText:=cbReplaceText.Text;
result:=((sSearchText<>sReplaceText) AND (sSearchText<>''));
end;
end;
finally
FreeAndNil(Dlg);
end;
end;
{ TfrmEditSearchReplace }
@ -148,6 +231,11 @@ begin
InsertFirstItem(cbReplaceText.Text, cbReplaceText);
end;
procedure TfrmEditSearchReplace.FormCreate(Sender: TObject);
begin
InitPropStorage(Self);
end;
procedure TfrmEditSearchReplace.FormShow(Sender: TObject);
begin
if cbSearchText.Text = EmptyStr then

View file

@ -45,7 +45,7 @@ type
pmOperationsCancel: TPopupMenu;
procedure lblFilterClick(Sender: TObject);
procedure pmOperationsCancelClick(Sender: TObject);
procedure quickSearchChangeSearch(Sender: TObject; ASearchText: UTF8String; const ASearchOptions: TQuickSearchOptions; ASearchDirection: TQuickSearchDirection);
procedure quickSearchChangeSearch(Sender: TObject; ASearchText: UTF8String; const ASearchOptions: TQuickSearchOptions);
procedure quickSearchChangeFilter(Sender: TObject; AFilterText: UTF8String; const AFilterOptions: TQuickSearchOptions);
procedure quickSearchExecute(Sender: TObject);
procedure quickSearchHide(Sender: TObject);
@ -84,9 +84,7 @@ type
Search and position in a file that matches name taking into account
passed options.
}
procedure SearchFile(SearchTerm: UTF8String;
SearchOptions: TQuickSearchOptions;
SearchDirection: TQuickSearchDirection = qsdNone);
procedure SearchFile(SearchTerm: UTF8String; SearchOptions: TQuickSearchOptions);
procedure Selection(Key: Word; CurIndex: PtrInt);
procedure SelectRange(FileIndex: PtrInt);
procedure SetActiveFile(FileIndex: PtrInt); overload; virtual; abstract;
@ -468,10 +466,25 @@ begin
lblFilter.Visible := Filtered;
end;
procedure TOrderedFileView.quickSearchChangeSearch(Sender: TObject; ASearchText: UTF8String; const ASearchOptions: TQuickSearchOptions; ASearchDirection: TQuickSearchDirection);
procedure TOrderedFileView.quickSearchChangeSearch(Sender: TObject; ASearchText: UTF8String; const ASearchOptions: TQuickSearchOptions);
var
Index, MaybeFoundIndex: PtrInt;
begin
Index:=GetActiveFileIndex;
Active := True;
SearchFile(ASearchText, ASearchOptions, ASearchDirection);
SearchFile(ASearchText, ASearchOptions);
MaybeFoundIndex:=GetActiveFileIndex;
if (MaybeFoundIndex <= Index) AND (ASearchOptions.CancelSearchMode=qscmCancelIfNoFound) then
begin
SetActiveFile(Index-1);
quickSearch.Finalize;
end
else
begin
lblFilter.Caption := Format('(%s: %s)', [rsSearchStatus, ASearchText]);
lblFilter.Visible := (ASearchText<>EmptyStr);
end;
end;
procedure TOrderedFileView.quickSearchExecute(Sender: TObject);
@ -486,7 +499,7 @@ begin
SetFocus;
end;
procedure TOrderedFileView.SearchFile(SearchTerm: UTF8String; SearchOptions: TQuickSearchOptions; SearchDirection: TQuickSearchDirection);
procedure TOrderedFileView.SearchFile(SearchTerm: UTF8String; SearchOptions: TQuickSearchOptions);
var
StartIndex, Index: PtrInt;
Result: Boolean;
@ -539,7 +552,7 @@ begin
Index := GetActiveFileIndex; // start search from current position
if not IsFileIndexInRange(Index) then
Index := 0;
case SearchDirection of
case SearchOptions.Direction of
qsdFirst:
Index := 0; // begin search from first file
qsdLast:
@ -585,7 +598,7 @@ begin
end;
// check next file depending on search direction
if SearchDirection in [qsdNone, qsdFirst, qsdNext] then
if SearchOptions.Direction in [qsdNone, qsdFirst, qsdNext] then
Index := NextIndexWrap(Index)
else
Index := PrevIndexWrap(Index);

File diff suppressed because it is too large Load diff

View file

@ -55,149 +55,173 @@ TFRMMAIN.MILINE18.CAPTION=-
TFRMMAIN.MNUALLOPERSTART.CAPTION=Start
TFRMMAIN.MNUALLOPERPAUSE.CAPTION=||
TFRMMAIN.MNUALLOPERSTOP.CAPTION=Cancel
TFRMMAIN.ACTEXIT.CAPTION=E&xit
TFRMMAIN.ACTHORIZONTALFILEPANELS.CAPTION=&Horizontal Panels Mode
TFRMMAIN.ACTPANELSSPLITTERPERPOS.CAPTION=Set splitter position
TFRMMAIN.ACTVIEW.CAPTION=View
TFRMMAIN.ACTEDIT.CAPTION=Edit
TFRMMAIN.ACTCOPY.CAPTION=Copy
TFRMMAIN.ACTRENAME.CAPTION=Move
TFRMMAIN.ACTMAKEDIR.CAPTION=Create &Directory
TFRMMAIN.ACTDELETE.CAPTION=Delete
TFRMMAIN.ACTHELPINDEX.CAPTION=&Contents
TFRMMAIN.ACTKEYBOARD.CAPTION=&Keyboard
TFRMMAIN.ACTVISITHOMEPAGE.CAPTION=&Visit Double Commander Website
TFRMMAIN.ACTABOUT.CAPTION=&About
TFRMMAIN.ACTSHOWSYSFILES.CAPTION=Show &Hidden/System Files
TFRMMAIN.ACTOPTIONS.CAPTION=&Options...
TFRMMAIN.ACTMULTIRENAME.CAPTION=Multi &Rename Tool
TFRMMAIN.ACTSEARCH.CAPTION=&Search...
TFRMMAIN.ACTSYNCDIRS.CAPTION=Synchronize dirs...
TFRMMAIN.ACTCONFIGTOOLBARS.CAPTION=Configure toolbar
TFRMMAIN.ACTCONFIGDIRHOTLIST.CAPTION=Configuration of Directory Hotlist
TFRMMAIN.ACTWORKWITHDIRECTORYHOTLIST.CAPTION=Work with Directory Hotlist and paramters
TFRMMAIN.ACTFILEASSOC.CAPTION=File &Associations...
TFRMMAIN.ACTCOMPARECONTENTS.CAPTION=Compare by &Contents
TFRMMAIN.ACTSHOWMAINMENU.CAPTION=Menu
TFRMMAIN.ACTSHOWBUTTONMENU.CAPTION=Show button menu
TFRMMAIN.ACTOPERATIONSVIEWER.CAPTION=Operations &Viewer
TFRMMAIN.ACTREFRESH.CAPTION=&Refresh
TFRMMAIN.ACTSEARCH.CAPTION=&Search...
TFRMMAIN.ACTCONFIGDIRHOTLIST.CAPTION=Configuration of Directory Hotlist
TFRMMAIN.ACTSHOWSYSFILES.CAPTION=Show &Hidden/System Files
TFRMMAIN.ACTDIRHISTORY.CAPTION=Directory history
TFRMMAIN.ACTDIRHOTLIST.CAPTION=Directory &Hotlist
TFRMMAIN.ACTMARKMARKALL.CAPTION=&Select All
TFRMMAIN.ACTMARKINVERT.CAPTION=&Invert Selection
TFRMMAIN.ACTMARKUNMARKALL.CAPTION=&Unselect All
TFRMMAIN.ACTMARKPLUS.CAPTION=Select a &Group...
TFRMMAIN.ACTMARKMINUS.CAPTION=Unselect a Gro&up...
TFRMMAIN.ACTSYMLINK.CAPTION=Create Symbolic &Link...
TFRMMAIN.ACTHARDLINK.CAPTION=Create &Hard Link...
TFRMMAIN.ACTREVERSEORDER.CAPTION=Re&verse Order
TFRMMAIN.ACTSORTBYNAME.CAPTION=Sort by &Name
TFRMMAIN.ACTSORTBYEXT.CAPTION=Sort by &Extension
TFRMMAIN.ACTSORTBYSIZE.CAPTION=Sort by &Size
TFRMMAIN.ACTSORTBYDATE.CAPTION=Sort by &Date
TFRMMAIN.ACTSORTBYATTR.CAPTION=Sort by &Attributes
TFRMMAIN.ACTMULTIRENAME.CAPTION=Multi &Rename Tool
TFRMMAIN.ACTCOPYSAMEPANEL.CAPTION=Copy to same panel
TFRMMAIN.ACTRENAMEONLY.CAPTION=Rename
TFRMMAIN.ACTEDITNEW.CAPTION=Edit new file
TFRMMAIN.ACTDIRHISTORY.CAPTION=Directory history
TFRMMAIN.ACTMARKMARKALL.CAPTION=&Select All
TFRMMAIN.ACTMARKUNMARKALL.CAPTION=&Unselect All
TFRMMAIN.ACTCALCULATESPACE.CAPTION=Calculate &Occupied Space
TFRMMAIN.ACTFILEPROPERTIES.CAPTION=Show &File Properties
TFRMMAIN.ACTFILELINKER.CAPTION=Com&bine Files...
TFRMMAIN.ACTFILESPLITER.CAPTION=Spl&it File...
TFRMMAIN.ACTNEWTAB.CAPTION=&New Tab
TFRMMAIN.ACTPACKFILES.CAPTION=&Pack Files...
TFRMMAIN.ACTEXTRACTFILES.CAPTION=&Extract Files...
TFRMMAIN.ACTOPENARCHIVE.CAPTION=Try open archive
TFRMMAIN.ACTFILEASSOC.CAPTION=File &Associations...
TFRMMAIN.ACTOPEN.CAPTION=Open
TFRMMAIN.ACTCOPYNAMESTOCLIP.CAPTION=Copy &Filename(s) to Clipboard
TFRMMAIN.ACTCUTTOCLIPBOARD.CAPTION=Cu&t
TFRMMAIN.ACTCOPYTOCLIPBOARD.CAPTION=&Copy
TFRMMAIN.ACTPASTEFROMCLIPBOARD.CAPTION=&Paste
TFRMMAIN.ACTCOPYFULLNAMESTOCLIP.CAPTION=Copy Filename(s) with Full &Path
TFRMMAIN.ACTRUNTERM.CAPTION=Run &Terminal
TFRMMAIN.ACTMARKINVERT.CAPTION=&Invert Selection
TFRMMAIN.ACTMARKCURRENTEXTENSION.CAPTION=Select All with the Same E&xtension
TFRMMAIN.ACTUNMARKCURRENTEXTENSION.CAPTION=Unselect All with the Same Ex&tension
TFRMMAIN.ACTEDITCOMMENT.CAPTION=Edit Co&mment...
TFRMMAIN.ACTKEYBOARD.CAPTION=&Keyboard
TFRMMAIN.ACTVISITHOMEPAGE.CAPTION=&Visit Double Commander Website
TFRMMAIN.ACTHELPINDEX.CAPTION=&Contents
TFRMMAIN.ACTCHECKSUMVERIFY.CAPTION=&Verify Checksum...
TFRMMAIN.ACTCHECKSUMCALC.CAPTION=Calculate Check&sum...
TFRMMAIN.ACTSETFILEPROPERTIES.CAPTION=Change &Attributes...
TFRMMAIN.ACTCOMPAREDIRECTORIES.CAPTION=Compare Directories
TFRMMAIN.ACTCOMPAREDIRECTORIES.HINT=Compare Directories
TFRMMAIN.ACTEDITNEW.CAPTION=Edit new file
TFRMMAIN.ACTCOPY.CAPTION=Copy
TFRMMAIN.ACTCOPYNOASK.CAPTION=Copy files without asking for confirmation
TFRMMAIN.ACTCOPYSAMEPANEL.CAPTION=Copy to same panel
TFRMMAIN.ACTRENAME.CAPTION=Move
TFRMMAIN.ACTRENAMENOASK.CAPTION=Move/Rename files without asking for confirmation
TFRMMAIN.ACTRENAMEONLY.CAPTION=Rename
TFRMMAIN.ACTMAKEDIR.CAPTION=Create &Directory
TFRMMAIN.ACTDELETE.CAPTION=Delete
TFRMMAIN.ACTWIPE.CAPTION=Wipe
TFRMMAIN.ACTPACKFILES.CAPTION=&Pack Files...
TFRMMAIN.ACTTESTARCHIVE.CAPTION=&Test Archive(s)
TFRMMAIN.ACTOPENARCHIVE.CAPTION=Try open archive
TFRMMAIN.ACTEXTRACTFILES.CAPTION=&Extract Files...
TFRMMAIN.ACTOPENVIRTUALFILESYSTEMLIST.CAPTION=Open &VFS List
TFRMMAIN.ACTFILEPROPERTIES.CAPTION=Show &File Properties
TFRMMAIN.ACTOPENDIRINNEWTAB.CAPTION=Open &Folder in a New Tab
TFRMMAIN.ACTCLOSETAB.CAPTION=&Close Tab
TFRMMAIN.ACTCLOSEALLTABS.CAPTION=Close &All Tabs
TFRMMAIN.ACTSETTABOPTIONNORMAL.CAPTION=&Normal
TFRMMAIN.ACTSETTABOPTIONPATHLOCKED.CAPTION=&Locked
TFRMMAIN.ACTSETTABOPTIONPATHRESETS.CAPTION=Locked with &Directory Changes Allowed
TFRMMAIN.ACTSETTABOPTIONDIRSINNEWTAB.CAPTION=Locked with Directories Opened in New &Tabs
TFRMMAIN.ACTNEXTTAB.CAPTION=Switch to Nex&t Tab
TFRMMAIN.ACTPREVTAB.CAPTION=Switch to &Previous Tab
TFRMMAIN.ACTQUICKVIEW.CAPTION=&Quick View Panel
TFRMMAIN.ACTTESTARCHIVE.CAPTION=&Test Archive(s)
TFRMMAIN.ACTSWITCHIGNORELIST.CAPTION=Enable/disable ignore list file to not show file names
TFRMMAIN.ACTRESTORESELECTION.CAPTION=&Restore Selection
TFRMMAIN.ACTCOPYNAMESTOCLIP.CAPTION=Copy &Filename(s) to Clipboard
TFRMMAIN.ACTCOPYFULLNAMESTOCLIP.CAPTION=Copy Filename(s) with Full &Path
TFRMMAIN.ACTSAVESELECTION.CAPTION=Sa&ve Selection
TFRMMAIN.ACTRESTORESELECTION.CAPTION=&Restore Selection
TFRMMAIN.ACTSAVESELECTIONTOFILE.CAPTION=Save S&election to File...
TFRMMAIN.ACTLOADSELECTIONFROMFILE.CAPTION=&Load Selection from File...
TFRMMAIN.ACTLOADSELECTIONFROMCLIP.CAPTION=Load Selection from Clip&board
TFRMMAIN.ACTNETWORKCONNECT.CAPTION=Network &Connect...
TFRMMAIN.ACTNETWORKQUICKCONNECT.CAPTION=Network &Quick Connect...
TFRMMAIN.ACTNETWORKDISCONNECT.CAPTION=Network &Disconnect
TFRMMAIN.ACTHORIZONTALFILEPANELS.CAPTION=&Horizontal Panels Mode
TFRMMAIN.ACTOPERATIONSVIEWER.CAPTION=Operations &Viewer
TFRMMAIN.ACTCOPYPATHOFFILESTOCLIP.CAPTION=Copy Full Path of selected file(s)
TFRMMAIN.ACTCOPYPATHNOSEPOFFILESTOCLIP.CAPTION=Copy Full Path of selected file(s) with no ending dir separator
TFRMMAIN.ACTCOPYFILEDETAILSTOCLIP.CAPTION=Copy all shown &columns
TFRMMAIN.ACTRENAMETAB.CAPTION=&Rename Tab
TFRMMAIN.ACTCOMPAREDIRECTORIES.CAPTION=Compare Directories
TFRMMAIN.ACTCOMPAREDIRECTORIES.HINT=Compare Directories
TFRMMAIN.ACTSHELLEXECUTE.CAPTION=Open
TFRMMAIN.ACTSHELLEXECUTE.HINT=Open using system associations
TFRMMAIN.ACTBRIEFVIEW.CAPTION=Brief
TFRMMAIN.ACTCLOSETAB.CAPTION=&Close Tab
TFRMMAIN.ACTCLOSEALLTABS.CAPTION=Close &All Tabs
TFRMMAIN.ACTLOADTABS.CAPTION=&Load Tabs from File
TFRMMAIN.ACTSAVETABS.CAPTION=&Save Tabs to File
TFRMMAIN.ACTSETTABOPTIONNORMAL.CAPTION=&Normal
TFRMMAIN.ACTSETTABOPTIONPATHLOCKED.CAPTION=&Locked
TFRMMAIN.ACTSETTABOPTIONPATHRESETS.CAPTION=Locked with &Directory Changes Allowed
TFRMMAIN.ACTSETTABOPTIONDIRSINNEWTAB.CAPTION=Locked with Directories Opened in New &Tabs
TFRMMAIN.ACTLEFTBRIEFVIEW.CAPTION=Brief view on left panel
TFRMMAIN.ACTLEFTCOLUMNSVIEW.CAPTION=Columns view on left panel
TFRMMAIN.ACTLEFTTHUMBVIEW.CAPTION=Thumbnails view on left panel
TFRMMAIN.ACTLEFTFLATVIEW.CAPTION=&Flat view on left panel
TFRMMAIN.ACTLEFTSORTBYNAME.CAPTION=Sort left panel by &Name
TFRMMAIN.ACTLEFTSORTBYEXT.CAPTION=Sort left panel by &Extension
TFRMMAIN.ACTLEFTSORTBYSIZE.CAPTION=Sort left panel by &Size
TFRMMAIN.ACTLEFTSORTBYDATE.CAPTION=Sort left panel by &Date
TFRMMAIN.ACTLEFTSORTBYATTR.CAPTION=Sort left panel by &Attributes
TFRMMAIN.ACTLEFTREVERSEORDER.CAPTION=Re&verse order on left panel
TFRMMAIN.ACTLEFTOPENDRIVES.CAPTION=Open left drive list
TFRMMAIN.ACTRIGHTBRIEFVIEW.CAPTION=Brief view on right panel
TFRMMAIN.ACTRIGHTCOLUMNSVIEW.CAPTION=Columns view on right panel
TFRMMAIN.ACTRIGHTTHUMBVIEW.CAPTION=Thumbnails view on right panel
TFRMMAIN.ACTRIGHTFLATVIEW.CAPTION=&Flat view on right panel
TFRMMAIN.ACTRIGHTSORTBYNAME.CAPTION=Sort right panel by &Name
TFRMMAIN.ACTRIGHTSORTBYEXT.CAPTION=Sort right panel by &Extension
TFRMMAIN.ACTRIGHTSORTBYSIZE.CAPTION=Sort right panel by &Size
TFRMMAIN.ACTRIGHTSORTBYDATE.CAPTION=Sort right panel by &Date
TFRMMAIN.ACTRIGHTSORTBYATTR.CAPTION=Sort right panel by &Attributes
TFRMMAIN.ACTRIGHTREVERSEORDER.CAPTION=Re&verse order on right panel
TFRMMAIN.ACTRIGHTOPENDRIVES.CAPTION=Open right drive list
TFRMMAIN.ACTFOCUSCMDLINE.CAPTION=Focus command line
TFRMMAIN.ACTSHOWCMDLINEHISTORY.CAPTION=Show command line history
TFRMMAIN.ACTCHANGEDIRTOPARENT.CAPTION=Change Directory To Parent
TFRMMAIN.ACTCHANGEDIRTOHOME.CAPTION=Change directory to home
TFRMMAIN.ACTCHANGEDIRTOROOT.CAPTION=Change directory to root
TFRMMAIN.ACTTARGETEQUALSOURCE.CAPTION=Target &= Source
TFRMMAIN.ACTTRANSFERLEFT.CAPTION=Transfer dir under cursor to left window
TFRMMAIN.ACTTRANSFERRIGHT.CAPTION=Transfer dir under cursor to right window
TFRMMAIN.ACTLEFTEQUALRIGHT.CAPTION=Left &= Right
TFRMMAIN.ACTRIGHTEQUALLEFT.CAPTION=Right &= Left
TFRMMAIN.ACTBRIEFVIEW.CAPTION=Brief view
TFRMMAIN.ACTBRIEFVIEW.HINT=Brief View
TFRMMAIN.ACTCOLUMNSVIEW.CAPTION=Full
TFRMMAIN.ACTCOLUMNSVIEW.HINT=Columns View
TFRMMAIN.ACTTHUMBNAILSVIEW.CAPTION=Thumbnails
TFRMMAIN.ACTTHUMBNAILSVIEW.HINT=Thumbnails View
TFRMMAIN.ACTCOPYFILEDETAILSTOCLIP.CAPTION=Copy all shown &columns
TFRMMAIN.ACTSAVETABS.CAPTION=&Save Tabs to File
TFRMMAIN.ACTLOADTABS.CAPTION=&Load Tabs from File
TFRMMAIN.ACTCONFIGTOOLBARS.CAPTION=Configure toolbar
TFRMMAIN.ACTSHOWCMDLINEHISTORY.CAPTION=Show command line history
TFRMMAIN.ACTRUNTERM.CAPTION=Run &Terminal
TFRMMAIN.ACTOPENVIRTUALFILESYSTEMLIST.CAPTION=Open &VFS List
TFRMMAIN.ACTLEFTOPENDRIVES.CAPTION=Open left drive list
TFRMMAIN.ACTRIGHTOPENDRIVES.CAPTION=Open right drive list
TFRMMAIN.ACTADDPATHTOCMDLINE.CAPTION=Copy path to command line
TFRMMAIN.ACTFOCUSCMDLINE.CAPTION=Focus command line
TFRMMAIN.ACTTRANSFERLEFT.CAPTION=Transfer dir under cursor to left window
TFRMMAIN.ACTTRANSFERRIGHT.CAPTION=Transfer dir under cursor to right window
TFRMMAIN.ACTCONTEXTMENU.CAPTION=Show context menu
TFRMMAIN.ACTSHOWBUTTONMENU.CAPTION=Show button menu
TFRMMAIN.ACTQUICKSEARCH.CAPTION=Quick search
TFRMMAIN.ACTTARGETEQUALSOURCE.CAPTION=Target &= Source
TFRMMAIN.ACTFLATVIEW.CAPTION=&Flat view
TFRMMAIN.ACTQUICKVIEW.CAPTION=&Quick View Panel
TFRMMAIN.ACTSORTBYNAME.CAPTION=Sort by &Name
TFRMMAIN.ACTSORTBYEXT.CAPTION=Sort by &Extension
TFRMMAIN.ACTSORTBYSIZE.CAPTION=Sort by &Size
TFRMMAIN.ACTSORTBYDATE.CAPTION=Sort by &Date
TFRMMAIN.ACTSORTBYATTR.CAPTION=Sort by &Attributes
TFRMMAIN.ACTREVERSEORDER.CAPTION=Re&verse Order
TFRMMAIN.ACTSRCOPENDRIVES.CAPTION=Open drive list
TFRMMAIN.ACTEXCHANGE.CAPTION=Swap &Panels
TFRMMAIN.ACTWIPE.CAPTION=Wipe
TFRMMAIN.ACTLEFTEQUALRIGHT.CAPTION=Left &= Right
TFRMMAIN.ACTRIGHTEQUALLEFT.CAPTION=Right &= Left
TFRMMAIN.ACTCHANGEDIRTOROOT.CAPTION=Change directory to root
TFRMMAIN.ACTCOUNTDIRCONTENT.CAPTION=Sho&w Occupied Space
TFRMMAIN.ACTVIEWLOGFILE.CAPTION=Clear log file
TFRMMAIN.ACTQUICKSEARCH.CAPTION=Quick search
TFRMMAIN.ACTVIEWLOGFILE.CAPTION=View log file
TFRMMAIN.ACTCLEARLOGFILE.CAPTION=Clear log file
TFRMMAIN.ACTCLEARLOGWINDOW.CAPTION=Clear log window
TFRMMAIN.ACTMINIMIZE.CAPTION=Minimize window
TFRMMAIN.ACTCHANGEDIR.CAPTION=Change directory
TFRMMAIN.ACTADDFILENAMETOCMDLINE.CAPTION=Add file name to command line
TFRMMAIN.ACTADDPATHANDFILENAMETOCMDLINE.CAPTION=Add path and file name to command line
TFRMMAIN.ACTPANELSSPLITTERPERPOS.CAPTION=Set splitter position
TFRMMAIN.ACTCOPYNOASK.CAPTION=Copy files without asking for confirmation
TFRMMAIN.ACTRENAMENOASK.CAPTION=Move/Rename files without asking for confirmation
TFRMMAIN.ACTQUICKFILTER.CAPTION=Quick filter
TFRMMAIN.ACTOPENBAR.CAPTION=Open bar file
TFRMMAIN.ACTCHANGEDIRTOPARENT.CAPTION=Change Directory To Parent
TFRMMAIN.ACTEDITPATH.CAPTION=Edit path field above file list
TFRMMAIN.ACTVIEWHISTORY.CAPTION=Show history of visited paths for active view
TFRMMAIN.ACTVIEWHISTORYPREV.CAPTION=Go to previous entry in history
TFRMMAIN.ACTVIEWHISTORYNEXT.CAPTION=Go to next entry in history
TFRMMAIN.ACTGOTOFIRSTFILE.CAPTION=Place cursor on first file in list
TFRMMAIN.ACTGOTOLASTFILE.CAPTION=Place cursor on last file in list
TFRMMAIN.ACTCHANGEDIR.CAPTION=Change directory
TFRMMAIN.ACTCMDLINENEXT.CAPTION=Next Command Line
TFRMMAIN.ACTCMDLINENEXT.HINT=Set command line to next command in history
TFRMMAIN.ACTCMDLINEPREV.CAPTION=Previous Command Line
TFRMMAIN.ACTCMDLINEPREV.HINT=Set command line to previous command in history
TFRMMAIN.ACTCHANGEDIRTOHOME.CAPTION=Change directory to home
TFRMMAIN.ACTSYNCDIRS.CAPTION=Synchronize dirs...
TFRMMAIN.ACTFLATVIEW.CAPTION=&Flat view
TFRMMAIN.ACTADDPATHTOCMDLINE.CAPTION=Copy path to command line
TFRMMAIN.ACTADDFILENAMETOCMDLINE.CAPTION=Add file name to command line
TFRMMAIN.ACTADDPATHANDFILENAMETOCMDLINE.CAPTION=Add path and file name to command line
TFRMMAIN.ACTGOTOFIRSTFILE.CAPTION=Place cursor on first file in list
TFRMMAIN.ACTGOTOLASTFILE.CAPTION=Place cursor on last file in list
TFRMMAIN.ACTVIEWHISTORY.CAPTION=Show history of visited paths for active view
TFRMMAIN.ACTVIEWHISTORYNEXT.CAPTION=Go to next entry in history
TFRMMAIN.ACTVIEWHISTORYPREV.CAPTION=Go to previous entry in history
TFRMMAIN.ACTOPENBAR.CAPTION=Open bar file
TFRMMAIN.ACTMINIMIZE.CAPTION=Minimize window
TFRMMAIN.ACTEXIT.CAPTION=E&xit
TFRMMAIN.ACTDEBUGSHOWCOMMANDPARAMETERS.CAPTION=Show Command Parameters
TFRMMAIN.ACTCOPYPATHOFFILESTOCLIP.CAPTION=Copy Full Path of slected file(s)
TFRMMAIN.ACTCOPYPATHNOSEPOFFILESTOCLIP.CAPTION=Copy Full Path of slected file(s) with no ending dir separator
TFRMMAIN.ACTDOANYCMCOMMAND.CAPTION=Select any command and execute it
TFRMMAIN.ACTSETFILEPROPERTIES.CAPTION=Change &Attributes...
TFRMMAIN.ACTEDITCOMMENT.CAPTION=Edit Co&mment...
TFRMMAIN.ACTCONTEXTMENU.CAPTION=Show context menu
TFRMMAIN.ACTOPEN.CAPTION=Open
TFRMMAIN.ACTSHELLEXECUTE.CAPTION=Open
TFRMMAIN.ACTSHELLEXECUTE.HINT=Open using system associations
TFRMMAIN.ACTSYMLINK.CAPTION=Create Symbolic &Link...
TFRMMAIN.ACTHARDLINK.CAPTION=Create &Hard Link...
TFRMMAIN.ACTFILESPLITER.CAPTION=Spl&it File...
TFRMMAIN.ACTFILELINKER.CAPTION=Com&bine Files...
TFRMMAIN.ACTCHECKSUMCALC.CAPTION=Calculate Check&sum...
TFRMMAIN.ACTCHECKSUMVERIFY.CAPTION=&Verify Checksum...
TFRMMAIN.ACTUNIVERSALSINGLEDIRECTSORT.CAPTION=Sort according to parameters
TFRMMAIN.ACTCOUNTDIRCONTENT.CAPTION=Sho&w Occupied Space
TFRMMAIN.TBEDIT.CAPTION=Edit
TFRMMAIN.TBDELETE.CAPTION=Delete
TFRMMAIN.TBCHANGEDIR.CAPTION=CD

View file

@ -96,6 +96,30 @@ type
actConfigDirHotList: TAction;
actCopyPathOfFilesToClip: TAction;
actCopyPathNoSepOfFilesToClip: TAction;
actDoAnyCmCommand: TAction;
actSrcOpenDrives: TAction;
actRightReverseOrder: TAction;
actLeftReverseOrder: TAction;
actRightFlatView: TAction;
actLeftFlatView: TAction;
actRightSortByAttr: TAction;
actRightSortByDate: TAction;
actRightSortBySize: TAction;
actRightSortByExt: TAction;
actRightSortByName: TAction;
actLeftSortByAttr: TAction;
actLeftSortByDate: TAction;
actLeftSortBySize: TAction;
actLeftSortByExt: TAction;
actLeftSortByName: TAction;
actLeftThumbView: TAction;
actRightThumbView: TAction;
actRightColumnsView: TAction;
actLeftColumnsView: TAction;
actRightBriefView: TAction;
actLeftBriefView: TAction;
actWorkWithDirectoryHotlist: TAction;
actUniversalSingleDirectSort: TAction;
actViewLogFile: TAction;
actLoadTabs: TAction;
actSaveTabs: TAction;
@ -720,6 +744,7 @@ implementation
{$R *.lfm}
uses
uFileProcs,
LCLIntf, LCLVersion, Dialogs, uGlobs, uLng, uMasks, fCopyMoveDlg, uQuickViewPanel,
uShowMsg, uDCUtils, uLog, uGlobsPaths, LCLProc, uOSUtils, uOSForms, uPixMapManager,
uDragDropEx, uKeyboard, uFileSystemFileSource, fViewOperations, uMultiListFileSource,
@ -1275,8 +1300,6 @@ begin
end;
procedure TfrmMain.PanelButtonClick(Button: TSpeedButton; FileView: TFileView);
var
aFile : UTF8String;
begin
with FileView do
begin
@ -2371,7 +2394,6 @@ var
iconsDir: String;
fileName: String;
iconImg: TPicture;
actionName: TComponentName;
begin
pmHotList.Images:=nil; { TODO -oDB : The images of popup menu in configuration should also be nilled to be correct }
imgLstDirectoryHotlist.Clear;
@ -2472,7 +2494,7 @@ end;
procedure TfrmMain.miHotAddOrConfigClick(Sender: TObject);
begin
with Sender as TComponent do Commands.cm_WorkWithDirectoryHotlist([HOTLISTMAGICWORDS[tag],ActiveFrame.CurrentPath,NotActiveFrame.CurrentPath,'0']);
with Sender as TComponent do Commands.cm_WorkWithDirectoryHotlist(['action='+HOTLISTMAGICWORDS[tag], 'source='+ActiveFrame.CurrentPath, 'target='+NotActiveFrame.CurrentPath, 'index=0']);
end;
procedure TfrmMain.CreatePopUpDirHistory;
@ -2697,7 +2719,6 @@ var
isSHIFTDown, isCTRLDown: boolean;
PossibleCommande,PossibleParam: string;
PosFirstSpace: integer;
SelectedDirectories: TFiles = nil;
Editor: TOptionsEditor;
Options: IOptionsDialog;
begin
@ -2725,8 +2746,8 @@ begin
4: Commands.cm_UniversalSingleDirectSort([STR_ACTIVEFRAME,STR_EXTENSION,STR_DESCENDING]); //Ext, z-a
5: Commands.cm_UniversalSingleDirectSort([STR_ACTIVEFRAME,STR_SIZE,STR_DESCENDING]); //Size 9-0
6: Commands.cm_UniversalSingleDirectSort([STR_ACTIVEFRAME,STR_SIZE,STR_ASCENDING]); //Size 0-9
7: Commands.cm_UniversalSingleDirectSort([STR_ACTIVEFRAME,STR_MODIFICATIONTIME,STR_DESCENDING]); //Date 9-0
8: Commands.cm_UniversalSingleDirectSort([STR_ACTIVEFRAME,STR_MODIFICATIONTIME,STR_ASCENDING]); //Date 0-9
7: Commands.cm_UniversalSingleDirectSort([STR_ACTIVEFRAME,STR_MODIFICATIONDATETIME,STR_DESCENDING]); //Date 9-0
8: Commands.cm_UniversalSingleDirectSort([STR_ACTIVEFRAME,STR_MODIFICATIONDATETIME,STR_ASCENDING]); //Date 0-9
end;
aPath := mbExpandFileName(aPath);
@ -2744,8 +2765,8 @@ begin
4: Commands.cm_UniversalSingleDirectSort([STR_NOTACTIVEFRAME,STR_EXTENSION,STR_DESCENDING]); //Ext, z-a
5: Commands.cm_UniversalSingleDirectSort([STR_NOTACTIVEFRAME,STR_SIZE,STR_DESCENDING]); //Size 9-0
6: Commands.cm_UniversalSingleDirectSort([STR_NOTACTIVEFRAME,STR_SIZE,STR_ASCENDING]); //Size 0-9
7: Commands.cm_UniversalSingleDirectSort([STR_NOTACTIVEFRAME,STR_MODIFICATIONTIME,STR_DESCENDING]); //Date 9-0
8: Commands.cm_UniversalSingleDirectSort([STR_NOTACTIVEFRAME,STR_MODIFICATIONTIME,STR_ASCENDING]); //Date 0-9
7: Commands.cm_UniversalSingleDirectSort([STR_NOTACTIVEFRAME,STR_MODIFICATIONDATETIME,STR_DESCENDING]); //Date 9-0
8: Commands.cm_UniversalSingleDirectSort([STR_NOTACTIVEFRAME,STR_MODIFICATIONDATETIME,STR_ASCENDING]); //Date 0-9
end;
aPath := mbExpandFileName(aPath);
@ -2780,7 +2801,7 @@ begin
Editor := Options.GetEditor(TfrmOptionsDirectoryHotlist);
Application.ProcessMessages;
if Editor.CanFocus then Editor.SetFocus;
TfrmOptionsDirectoryHotlist(Editor).SubmitToAddOrConfigToHotDirDlg(HOTLISTMAGICWORDS[ACTION_DIRECTLYCONFIGENTRY],ActiveFrame.CurrentPath,NotActiveFrame.CurrentPath,IntToStr(Index));
TfrmOptionsDirectoryHotlist(Editor).SubmitToAddOrConfigToHotDirDlg(ACTION_DIRECTLYCONFIGENTRY,ActiveFrame.CurrentPath,NotActiveFrame.CurrentPath,Index);
end;
end
else

View file

@ -104,15 +104,9 @@ implementation
uses
//Lazarus, Free-Pascal, etc.
Clipbrd, LCLType, Graphics,
{$IFNDEF MSWINDOWS}
helpintfs,
{$ENDIF}
//DC
{$IFDEF MSWINDOWS}
dmHelpManager, uOSUtils,
{$ENDIF}
DCStrUtils, uLng, uPixMapManager, uGlobs, fMain, uDebug, LazUTF8, LCLIntf;
DCStrUtils, dmHelpManager, uLng, uPixMapManager, uGlobs, fMain, uDebug, LazUTF8, LCLIntf;
function ShowMainCommandDlgForm(DefaultCmd: string; var ReturnedCmd: string): boolean;
var
@ -473,12 +467,7 @@ end;
{ TfrmMainCommandsDlg.lblSelectedCommandHelpClick }
procedure TfrmMainCommandsDlg.lblSelectedCommandHelpClick(Sender: TObject);
begin
{$IFDEF MSWINDOWS}
OpenURLWithAnchor(dmHelpMgr.HTMLHelpDatabase.BaseURL + '\cmds.html#' + lblSelectedCommand.Caption);
{$ENDIF}
{$IFNDEF MSWINDOWS}
ShowHelpOrErrorForKeyword('', '/cmds.html#' + lblSelectedCommand.Caption);
{$ENDIF}
ShowHelpForKeywordWithAnchor('\cmds.html#' + lblSelectedCommand.Caption);
end;
{ TfrmMainCommandsDlg.lblSelectedCommandHelpClick }
@ -493,4 +482,4 @@ begin
lblSelectedCommandHelp.Font.Color := clDefault;
end;
end.
end.

View file

@ -11,14 +11,14 @@ object frmEditHotkey: TfrmEditHotkey
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
LCLVersion = '1.1'
LCLVersion = '1.2.6.0'
object lblShortcuts: TLabel
AnchorSideLeft.Control = pnlShortcuts
AnchorSideTop.Control = Owner
Left = 8
Height = 13
Height = 15
Top = 6
Width = 50
Width = 53
BorderSpacing.Top = 6
Caption = 'Shortcuts:'
ParentColor = False
@ -30,7 +30,7 @@ object frmEditHotkey: TfrmEditHotkey
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 8
Height = 1
Height = 0
Top = 28
Width = 442
Anchors = [akTop, akLeft, akRight]
@ -52,7 +52,7 @@ object frmEditHotkey: TfrmEditHotkey
AnchorSideRight.Side = asrBottom
Left = 8
Height = 1
Top = 33
Top = 32
Width = 442
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 4
@ -68,9 +68,9 @@ object frmEditHotkey: TfrmEditHotkey
AnchorSideTop.Control = lblHotKeyConflict
AnchorSideTop.Side = asrBottom
Left = 8
Height = 22
Height = 15
Top = 39
Width = 247
Width = 189
BorderSpacing.Top = 6
Caption = '&Parameters (each in a separate line):'
FocusControl = edtParameters
@ -84,8 +84,8 @@ object frmEditHotkey: TfrmEditHotkey
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = btnShowCommandHelp
Left = 8
Height = 331
Top = 53
Height = 328
Top = 54
Width = 442
HelpType = htKeyword
Anchors = [akTop, akLeft, akRight, akBottom]
@ -100,8 +100,8 @@ object frmEditHotkey: TfrmEditHotkey
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = cgHKControls
Left = 8
Height = 23
Top = 388
Height = 10
Top = 386
Width = 442
Anchors = [akLeft, akRight, akBottom]
AutoSize = True
@ -115,8 +115,8 @@ object frmEditHotkey: TfrmEditHotkey
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = btnOK
Left = 8
Height = 4
Top = 411
Height = 19
Top = 396
Width = 442
Anchors = [akLeft, akRight, akBottom]
AutoFill = True

View file

@ -102,7 +102,7 @@ implementation
{$R *.lfm}
uses
HelpIntfs, LCLType, uKeyboard, uLng, uGlobs, uFormCommands, DCStrUtils,
HelpIntfs, LCLType, dmHelpManager, uOSUtils, uKeyboard, uLng, uGlobs, uFormCommands, DCStrUtils,
uPixMapManager;
const
@ -117,6 +117,7 @@ begin
if GetShortcutsEditorsCount < MaxShortcutSequenceLength then
begin
EditControl := TEdit.Create(Self);
EditControl.Font.Color:=clRed;
EditControl.Parent := pnlShortcuts;
EditControl.OnKeyDown := @edtShortcutKeyDown;
EditControl.OnKeyPress := @edtShortcutKeyPress;
@ -225,7 +226,7 @@ end;
procedure TfrmEditHotkey.btnShowCommandHelpClick(Sender: TObject);
begin
ShowHelpOrErrorForKeyword('', edtParameters.HelpKeyword);
ShowHelpForKeywordWithAnchor(edtParameters.HelpKeyword);
end;
procedure TfrmEditHotkey.cgHKControlsItemClick(Sender: TObject; Index: integer);

File diff suppressed because it is too large Load diff

View file

@ -68,6 +68,12 @@ TFRMOPTIONSDIRECTORYHOTLIST.MISEPARATOR10.CAPTION=-
TFRMOPTIONSDIRECTORYHOTLIST.MIOPENALLBRANCHES.CAPTION=Open all branches
TFRMOPTIONSDIRECTORYHOTLIST.MICOLLAPSEALL.CAPTION=Collapse all
TFRMOPTIONSDIRECTORYHOTLIST.MISEPARATOR11.CAPTION=-
TFRMOPTIONSDIRECTORYHOTLIST.MISEARCHANDREPLACE.CAPTION=Search and replace...
TFRMOPTIONSDIRECTORYHOTLIST.MISEARCHANDREPLACEINPATH.CAPTION=in path...
TFRMOPTIONSDIRECTORYHOTLIST.MISEARCHANDREPLACEINTARGETPATH.CAPTION=in target path...
TFRMOPTIONSDIRECTORYHOTLIST.MISEPARATOR13.CAPTION=-
TFRMOPTIONSDIRECTORYHOTLIST.MISEARCHINREPLACEINBOTHPATHS.CAPTION=in path and target path...
TFRMOPTIONSDIRECTORYHOTLIST.MISEPARATOR12.CAPTION=-
TFRMOPTIONSDIRECTORYHOTLIST.MIDETECTIFPATHEXIST.CAPTION=Scan all hotdir's path to validate the ones that actually exist
TFRMOPTIONSDIRECTORYHOTLIST.MIDETECTIFPATHTARGETEXIST.CAPTION=Scan all hotdir's path && target to validate the ones that actually exist
TFRMOPTIONSDIRECTORYHOTLIST.MISORTSINGLEGROUP.CAPTION=...single group of item(s) only

View file

@ -52,6 +52,13 @@ type
lbleditHotDirName: TLabeledEdit;
lbleditHotDirPath: TLabeledEdit;
lbleditHotDirTarget: TLabeledEdit;
miSearchAndReplaceInPath: TMenuItem;
miSearchInReplaceInBothPaths: TMenuItem;
miSeparator13: TMenuItem;
miSearchAndReplaceInTargetPath: TMenuItem;
miSearchAndReplace: TMenuItem;
miSeparator12: TMenuItem;
miTypeTheDirectory3: TMenuItem;
miCollapseAll: TMenuItem;
miSeparator10: TMenuItem;
@ -134,6 +141,7 @@ type
procedure miCollapseAllClick(Sender: TObject);
procedure miOpenAllBranchesClick(Sender: TObject);
procedure pnlButtonsResize(Sender: TObject);
procedure miSearchAndReplaceClick(Sender: TObject);
procedure tvDirectoryHotlistDragDrop(Sender, {%H-}Source: TObject; X, Y: Integer);
procedure tvDirectoryHotlistDragOver(Sender, {%H-}Source: TObject; {%H-}X, {%H-}Y: Integer; {%H-}State: TDragState; var Accept: Boolean);
procedure tvDirectoryHotlistEnter(Sender: TObject);
@ -172,6 +180,7 @@ type
procedure CopyTTreeViewToAnother(tvSource,tvDestination:TTreeView);
function GetNextGroupNumber:integer;
procedure miGotoConfigureTCInfo2Click(Sender: TObject);
procedure GenericSomethingChanged(Sender: TObject);
protected
procedure Init; override;
procedure Load; override;
@ -182,13 +191,15 @@ type
DirectoryHotlistTemp: TDirectoryHotlist;
CutAndPasteIndexList: TStringList;
GlobalGroupNumber: integer;
FModificationTookPlace: boolean;
FLastLoadedDirectoryHotlistSignature: dword;
public
{ Public declarations }
class function GetIconIndex: Integer; override;
class function GetTitle: String; override;
destructor Destroy; override;
function CanWeClose(var WillNeedUpdateWindowView:boolean): boolean; override;
procedure SubmitToAddOrConfigToHotDirDlg(paramActionDispatcher,paramPath,paramTarget,paramOptionalIndex: string);
procedure SubmitToAddOrConfigToHotDirDlg(paramActionDispatcher: integer; paramPath,paramTarget:string; paramOptionalIndex: integer);
end;
implementation
@ -200,9 +211,9 @@ uses
Graphics, LCLType, LCLProc, LCLIntf, LCLMessageGlue, helpintfs,
//DC
fOptionsMisc,
DCStrUtils, uGlobs, uLng, uDCUtils, uDebug, fmain, uFormCommands, uFileProcs,
uShowMsg, DCOSUtils, uSpecialDir, fhotdirexportimport, fOptions;
fEditSearch, fOptionsMisc, DCStrUtils, uGlobs, uLng, uDCUtils, uDebug, fmain,
uFormCommands, uFileProcs, uShowMsg, DCOSUtils, uSpecialDir,
fhotdirexportimport, fOptions;
{ Constants used with export/import }
const
@ -262,7 +273,9 @@ begin
DirectoryHotlistTemp.LoadTTreeView(tvDirectoryHotlist,-1);
cbFullExpandTreeChange(cbFullExpandTree);
if tvDirectoryHotlist.Items.Count>0 then tvDirectoryHotlist.Items[0].Selected:=TRUE; //Select at least first one by default
DirectoryHotlistTemp.FlagModified:=FALSE;
FLastLoadedDirectoryHotlistSignature := DirectoryHotlistTemp.ComputeSignature;
FModificationTookPlace := False;
end;
{ TfrmOptionsDirectoryHotlist.Save }
@ -288,8 +301,9 @@ begin
gSpecialDirList.PopulateMenuWithSpecialDir(pmPathHelper, mp_PATHHELPER, nil);
end;
gWhereToAddNewHotDir:=TPositionWhereToAddHotDir(rgWhereToAdd.ItemIndex);
DirectoryHotlistTemp.FlagModified:=FALSE;
cbFullExpandTreeChange(cbFullExpandTree);
FLastLoadedDirectoryHotlistSignature := DirectoryHotlistTemp.ComputeSignature;
FModificationTookPlace := False;
end;
{ TfrmOptionsDirectoryHotlist.CanWeClose }
@ -301,7 +315,9 @@ begin
if Assigned(DirectoryHotlistTemp) then
begin
result:=not DirectoryHotlistTemp.FlagModified;
DirectoryHotlistTemp.RefreshFromTTreeView(tvDirectoryHotlist);
result := (FLastLoadedDirectoryHotlistSignature = DirectoryHotlistTemp.ComputeSignature) AND (not FModificationTookPlace);
if not result then
begin
ShowOptions(TfrmOptionsDirectoryHotlist);
@ -366,7 +382,6 @@ begin
tvDirectoryHotlist.Selections[Index].MoveTo(DestinationNode,naInsertBehind);
end;
end;
DirectoryHotlistTemp.FlagModified:=TRUE;
ClearCutAndPasteList;
end;
@ -384,6 +399,7 @@ begin
end;
end;
{ TfrmOptionsDirectoryHotlist.pnlButtonsResize }
procedure TfrmOptionsDirectoryHotlist.pnlButtonsResize(Sender: TObject);
var
I: Integer;
@ -394,6 +410,66 @@ begin
end;
end;
{ TfrmOptionsDirectoryHotlist.miSearchAndReplaceClick }
procedure TfrmOptionsDirectoryHotlist.miSearchAndReplaceClick(Sender: TObject);
var
NbOfReplacement:longint;
sSearchText,sReplaceText: string;
ReplaceFlags: TReplaceFlags;
function ReplaceIfNecessary(sWorkingText:string):string;
begin
result := StringReplace(sWorkingText, sSearchText, sReplaceText, ReplaceFlags);
if result<>sWorkingText then inc(NbOfReplacement);
end;
var
Index, ActionDispatcher: integer;
EditSearchOptionToOffer,EditSearchOptionReturned:TEditSearchDialogOption;
begin
with Sender as TComponent do ActionDispatcher:=tag;
if ((ActionDispatcher and $01) <> 0) AND (lbleditHotDirPath.Text<>'') then sSearchText:=lbleditHotDirPath.Text
else if ((ActionDispatcher and $02) <> 0) AND (lbleditHotDirTarget.Text<>'') then sSearchText:=lbleditHotDirTarget.Text
else sSearchText:='';
sReplaceText:=sSearchText;
EditSearchOptionToOffer:=[];
{$IFDEF MSWINDOWS}
EditSearchOptionToOffer:=EditSearchOptionToOffer+[eswoCaseSensitiveUnchecked];
{$ELSE}
EditSearchOptionToOffer:=EditSearchOptionToOffer+[eswoCaseSensitiveChecked];
{$ENDIF}
if GetSimpleSearchAndReplaceString(self, EditSearchOptionToOffer, sSearchText, sReplaceText, EditSearchOptionReturned, glsSearchPathHistory, glsReplacePathHistory) then
begin
NbOfReplacement:=0;
ReplaceFlags:=[rfReplaceAll];
if eswoCaseSensitiveUnchecked in EditSearchOptionReturned then ReplaceFlags := ReplaceFlags + [rfIgnoreCase];
for Index:=0 to pred(gDirectoryHotlist.Count) do
begin
case DirectoryHotlistTemp.HotDir[Index].Dispatcher of
hd_CHANGEPATH:
begin
if (ActionDispatcher and $01) <> 0 then DirectoryHotlistTemp.HotDir[Index].HotDirPath:=ReplaceIfNecessary(DirectoryHotlistTemp.HotDir[Index].HotDirPath);
if (ActionDispatcher and $02) <> 0 then DirectoryHotlistTemp.HotDir[Index].HotDirTarget:=ReplaceIfNecessary(DirectoryHotlistTemp.HotDir[Index].HotDirTarget);
end;
end;
end;
if NbOfReplacement=0 then
begin
msgOk(rsZeroReplacement);
end
else
begin
tvDirectoryHotlistSelectionChanged(tvDirectoryHotlist);
msgOk(format(rsXReplacements,[NbOfReplacement]));
end;
end;
end;
{ TfrmOptionsDirectoryHotlist.miCollapseAllClick }
procedure TfrmOptionsDirectoryHotlist.miCollapseAllClick(Sender: TObject);
begin
@ -411,6 +487,7 @@ end;
{ TfrmOptionsDirectoryHotlist.cbFullExpandTreeChange }
procedure TfrmOptionsDirectoryHotlist.cbFullExpandTreeChange(Sender: TObject);
begin
GenericSomethingChanged(cbFullExpandTree);
if cbFullExpandTree.Checked then tvDirectoryHotlist.FullExpand else tvDirectoryHotlist.FullCollapse;
end;
@ -765,7 +842,6 @@ begin
tvDirectoryHotlist.Enabled:=TRUE;
if isTreeHadFocus AND tvDirectoryHotlist.CanFocus then tvDirectoryHotlist.SetFocus;
end;
DirectoryHotlistTemp.FlagModified:=TRUE;
end;
end;
@ -899,7 +975,7 @@ begin
ACTION_WITH_HOTLISTFILE:
begin
OpenDialog.DefaultExt := '*.hotlist';
OpenDialog.FilterIndex := 3;
OpenDialog.FilterIndex := 1;
OpenDialog.Title := rsMsgHotDirLocateHotlistFile;
FlagKeepGoing := OpenDialog.Execute;
end;
@ -909,10 +985,10 @@ begin
BackupPath := IncludeTrailingPathDelimiter(mbExpandFileName(EnvVarConfigPath)) + 'Backup';
if mbForceDirectory(BackupPath) then
begin
OpenDialog.FilterIndex := 3;
OpenDialog.InitialDir := ExcludeTrailingPathDelimiter(BackupPath);
OpenDialog.DefaultExt := '*.hotlist';
OpenDialog.FilterIndex := 1;
OpenDialog.Title := rsMsgHotDirRestoreWhat;
OpenDialog.Filter := 'Backup_*.hotlist';
OpenDialog.InitialDir := ExcludeTrailingPathDelimiter(BackupPath);
FlagKeepGoing := OpenDialog.Execute;
end;
end;
@ -961,7 +1037,6 @@ begin
if ((Answer = mrOk) and (tvDirectoryHotlistToExportImport.SelectionCount > 0)) or ((Answer = mrAll) and (tvDirectoryHotlistToExportImport.Items.Count > 0)) then
begin
ClearCutAndPasteList;
DirectoryHotlistTemp.FlagModified:=TRUE; //Ok.. It still might happen the list won't be modified but let's don't be too "picky"...
if ((ActionDispatcher and MASK_ACTION_WITH_WHAT) = ACTION_WITH_BACKUP) AND (Answer = mrAll) then
begin
@ -1067,7 +1142,6 @@ begin
//... and the finale!
tvDirectoryHotlist.CustomSort(@MySortViaGroup);
DirectoryHotlistTemp.FlagModified:=TRUE;
ClearCutAndPasteList;
end;
@ -1162,64 +1236,65 @@ end;
{ TfrmOptionsDirectoryHotlist.lbleditHotDirExit }
procedure TfrmOptionsDirectoryHotlist.lbleditHotDirExit(Sender: TObject);
begin
with Sender as TLabeledEdit do
//If nothing currently selected, no need to update anything here.
if tvDirectoryHotlist.Selected<>nil then
begin
pmPathHelper.Tag := 0;
Font.Style := [];
EditLabel.Font.Style := []; //Text not in bold anymore
with Sender as TLabeledEdit do
begin
pmPathHelper.Tag := 0;
Font.Style := [];
EditLabel.Font.Style := []; //Text not in bold anymore
case tag of
1: //Hot dir name
begin
try
if (Text <> '') and (Text[1] <> '-') then
case tag of
1: //Hot dir name
begin
try
//Make sure we actually have something, not an attempf of submenu or end of menu
begin
if THotDir(tvDirectoryHotlist.Selected.Data).HotDirName <> Text then
//Make sure it's different than what it was
if (Text <> '') and (Text[1] <> '-') then
begin
DirectoryHotlistTemp.FlagModified := True;
THotDir(tvDirectoryHotlist.Selected.Data).HotDirName := Text;
tvDirectoryHotlist.Selected.Text:=Text;
//Make sure it's different than what it was
if THotDir(tvDirectoryHotlist.Selected.Data).HotDirName <> Text then
begin
THotDir(tvDirectoryHotlist.Selected.Data).HotDirName := Text;
tvDirectoryHotlist.Selected.Text:=Text;
end;
end;
except
//Just in case the "Text" is empty to don't show error with Text[1] check.
end;
except
//Just in case the "Text" is empty to don't show error with Text[1] check.
end;
end;
2: //Hot dir path
begin
try
if (Text <> '') and (THotDir(tvDirectoryHotlist.Selected.Data).Dispatcher =
hd_CHANGEPATH) then
Text := IncludeTrailingPathDelimiter(Text);
if THotDir(tvDirectoryHotlist.Selected.Data).HotDirPath <> Text then
2: //Hot dir path
begin
try
if (Text <> '') and (THotDir(tvDirectoryHotlist.Selected.Data).Dispatcher = hd_CHANGEPATH) then
Text := IncludeTrailingPathDelimiter(Text);
//Make sure it's different than what it was
begin
DirectoryHotlistTemp.FlagModified := True;
THotDir(tvDirectoryHotlist.Selected.Data).HotDirPath := Text;
THotDir(tvDirectoryHotlist.Selected.Data).HotDirExisting := DirExistUnknown;
if THotDir(tvDirectoryHotlist.Selected.Data).HotDirPath <> Text then
begin
THotDir(tvDirectoryHotlist.Selected.Data).HotDirPath := Text;
THotDir(tvDirectoryHotlist.Selected.Data).HotDirExisting := DirExistUnknown;
end;
except
//Just in case we have an empty list so "DirectoryHotlistTemp.HotDir[tvDirectoryHotlist.Selected.ImageIndex]" will not caused an error (since ItemIndex=-1 at this moment);
end;
except
//Just in case we have an empty list so "DirectoryHotlistTemp.HotDir[tvDirectoryHotlist.Selected.ImageIndex]" will not caused an error (since ItemIndex=-1 at this moment);
end;
end;
3: //Hot dir target
begin
try
if (Text <> '') and (THotDir(tvDirectoryHotlist.Selected.Data).Dispatcher =
hd_CHANGEPATH) then
Text := IncludeTrailingPathDelimiter(Text);
if THotDir(tvDirectoryHotlist.Selected.Data).HotDirTarget <> Text then
3: //Hot dir target
begin
try
if (Text <> '') and (THotDir(tvDirectoryHotlist.Selected.Data).Dispatcher =hd_CHANGEPATH) then
Text := IncludeTrailingPathDelimiter(Text);
//Make sure it's different than what it was
begin
DirectoryHotlistTemp.FlagModified := True;
THotDir(tvDirectoryHotlist.Selected.Data).HotDirTarget := Text;
if THotDir(tvDirectoryHotlist.Selected.Data).HotDirTarget <> Text then
begin
THotDir(tvDirectoryHotlist.Selected.Data).HotDirTarget := Text;
end;
except
//Just in case we have an empty list so "DirectoryHotlistTemp.HotDir[tvDirectoryHotlist.Selected.ImageIndex]" will not caused an error (since ItemIndex=-1 at this moment);
end;
except
//Just in case we have an empty list so "DirectoryHotlistTemp.HotDir[tvDirectoryHotlist.Selected.ImageIndex]" will not caused an error (since ItemIndex=-1 at this moment);
end;
end;
end;
@ -1230,23 +1305,22 @@ end;
procedure TfrmOptionsDirectoryHotlist.lbleditHotDirKeyPress(Sender: TObject; var Key: char);
begin
case Ord(Key) of
$0D: //Enter? Let's save the field and go to next one
$0D: //Enter? Let's save the field and we'll exit
begin
lbleditHotDirExit(Sender); //Doing this will SAVE the new typed text if it's different than what we have in memory for the entry. Then we could attempt to quit.
//Key := #00; --> We don't do that because we want the "ENTER" key still quit the editor like it does for other config window
end;
$1B: //Escape? Place back the fields like they were
begin
//If typed text has been changed, yes we will restore it but if it was not change, we will quit so user won't have to press two times escape
case tag of
1: if Text <> THotDir(tvDirectoryHotlist.Selected.Data).HotDirName then Key := #$00;
2: if Text <> THotDir(tvDirectoryHotlist.Selected.Data).HotDirPath then Key := #00;
3: if Text <> THotDir(tvDirectoryHotlist.Selected.Data).HotDirTarget then Key := #00;
end;
with Sender as TLabeledEdit do
begin
//If typed text has been changed, yes we will restore it but if it was not change, we will quit so user won't have to press two times escape
case tag of
1: if Text <> THotDir(tvDirectoryHotlist.Selected.Data).HotDirName then Key := #$00;
2: if Text <> THotDir(tvDirectoryHotlist.Selected.Data).HotDirPath then Key := #00;
3: if Text <> THotDir(tvDirectoryHotlist.Selected.Data).HotDirTarget then Key := #00;
end;
case tag of
1: tvDirectoryHotlistSelectionChanged(tvDirectoryHotlist);
2: Text := THotDir(tvDirectoryHotlist.Selected.Data).HotDirPath;
@ -1283,7 +1357,6 @@ begin
if THotDir(tvDirectoryHotlist.Selected.Data).HotDirPath <>lbleditHotDirPath.Text then
begin
THotDir(tvDirectoryHotlist.Selected.Data).HotDirPath := lbleditHotDirPath.Text;
DirectoryHotlistTemp.FlagModified := True;
end;
end;
@ -1307,7 +1380,6 @@ end;
{ TfrmOptionsDirectoryHotlist.cbSortHotDirPathChange }
procedure TfrmOptionsDirectoryHotlist.cbSortHotDirPathChange(Sender: TObject);
begin
DirectoryHotlistTemp.FlagModified := True;
if Assigned(tvDirectoryHotlist.Selected) then
begin
THotDir(tvDirectoryHotlist.Selected.Data).HotDirPathSort := cbSortHotDirPath.ItemIndex;
@ -1317,7 +1389,6 @@ end;
{ TfrmOptionsDirectoryHotlist.cbSortHotDirTargetChange }
procedure TfrmOptionsDirectoryHotlist.cbSortHotDirTargetChange(Sender: TObject);
begin
DirectoryHotlistTemp.FlagModified := True;
if Assigned(tvDirectoryHotlist.Selected) then
begin
THotDir(tvDirectoryHotlist.Selected.Data).HotDirTargetSort := cbSortHotDirTarget.ItemIndex;
@ -1454,7 +1525,6 @@ begin
LocalHotDir.HotDirPath := IncludeTrailingPathDelimiter(sPath);
if sTarget <> '' then LocalHotDir.HotDirTarget := IncludeTrailingPathDelimiter(sTarget);
DirectoryHotlistTemp.Add(LocalHotDir);
DirectoryHotlistTemp.FlagModified := True;
WorkingTreeNode:=tvDirectoryHotlist.Selected;
if WorkingTreeNode<>nil then
result:=tvDirectoryHotlist.Items.AddNode(nil,WorkingTreeNode, sName,LocalHotDir,SelectedNoAttachedMode[InsertOrAdd])
@ -1552,7 +1622,7 @@ begin
begin
if THotDir(tvDirectoryHotlist.Items.Item[I].Data).Dispatcher = hd_CHANGEPATH then
begin
if localDirToFindAPlaceFor = UTF8LowerCase(IncludeTrailingPathDelimiter(ExpandFileName(ReplaceEnvVars(THotDir(tvDirectoryHotlist.Items.Item[I].Data).HotDirPath)))) then result:=tvDirectoryHotlist.Items.Item[I];
if localDirToFindAPlaceFor = UTF8LowerCase(IncludeTrailingPathDelimiter(mbExpandFileName(THotDir(tvDirectoryHotlist.Items.Item[I].Data).HotDirPath))) then result:=tvDirectoryHotlist.Items.Item[I];
end;
inc(I);
end;
@ -1568,7 +1638,7 @@ begin
begin
if THotDir(tvDirectoryHotlist.Items.Item[I].Data).Dispatcher = hd_CHANGEPATH then
begin
sRepresentantString:=UTF8LowerCase(IncludeTrailingPathDelimiter(ExpandFileName(ReplaceEnvVars(THotDir(tvDirectoryHotlist.Items.Item[I].Data).HotDirPath))))+IntToStr(I);
sRepresentantString:=UTF8LowerCase(IncludeTrailingPathDelimiter(mbExpandFileName(THotDir(tvDirectoryHotlist.Items.Item[I].Data).HotDirPath)))+IntToStr(I);
MagickSortedList.Add(sRepresentantString);
end;
end;
@ -1579,8 +1649,8 @@ begin
I:=MagickSortedList.IndexOf(localDirToFindAPlaceFor);
if I=0 then sUnderPart:='' else sUnderPart:=UTF8LowerCase(IncludeTrailingPathDelimiter(ExpandFileName(ReplaceEnvVars(THotDir(tvDirectoryHotlist.Items.Item[StrToInt(GetLastDir(MagickSortedList.Strings[I-1]))].Data).HotDirPath))));
if I=pred(MagickSortedList.Count) then sOverPart:='' else sOverPart:=UTF8LowerCase(IncludeTrailingPathDelimiter(ExpandFileName(ReplaceEnvVars(THotDir(tvDirectoryHotlist.Items.Item[StrToInt(GetLastDir(MagickSortedList.Strings[I+1]))].Data).HotDirPath))));
if I=0 then sUnderPart:='' else sUnderPart:=UTF8LowerCase(IncludeTrailingPathDelimiter(mbExpandFileName(THotDir(tvDirectoryHotlist.Items.Item[StrToInt(GetLastDir(MagickSortedList.Strings[I-1]))].Data).HotDirPath)));
if I=pred(MagickSortedList.Count) then sOverPart:='' else sOverPart:=UTF8LowerCase(IncludeTrailingPathDelimiter(mbExpandFileName(THotDir(tvDirectoryHotlist.Items.Item[StrToInt(GetLastDir(MagickSortedList.Strings[I+1]))].Data).HotDirPath)));
BestOne:=GetBestDir(sUnderPart,sOverPart);
case BestOne of
@ -1590,7 +1660,7 @@ begin
if result<>nil then
begin
if CompareStrings(localDirToFindAPlaceFor, UTF8LowerCase(IncludeTrailingPathDelimiter(ExpandFileName(ReplaceEnvVars(tHotDir(result.Data).HotDirPath)))), gSortNatural, gSortCaseSensitivity) = -1 then TypeOfAddition:=ACTION_INSERTHOTDIR;
if CompareStrings(localDirToFindAPlaceFor, UTF8LowerCase(IncludeTrailingPathDelimiter(mbExpandFileName(tHotDir(result.Data).HotDirPath))), gSortNatural, gSortCaseSensitivity) = -1 then TypeOfAddition:=ACTION_INSERTHOTDIR;
end;
finally
MagickSortedList.Free;
@ -1702,7 +1772,6 @@ var
if not Result then
begin
DirectoryHotlistTemp.FlagModified := DirectoryHotlistTemp.FlagModified or (THotDir(tvDirectoryHotlist.Items.Item[Index].Data).HotDirExisting <> DirNotExist);
THotDir(tvDirectoryHotlist.Items.Item[Index].Data).HotDirExisting := DirNotExist;
tvDirectoryHotlist.Items.Item[Index].ImageIndex:=ICONINDEX_DIRECTORYNOTPRESENTHERE;
tvDirectoryHotlist.Items.Item[Index].SelectedIndex:=ICONINDEX_DIRECTORYNOTPRESENTHERE;
@ -1769,7 +1838,6 @@ begin
case ScanMode of
1:
begin
DirectoryHotlistTemp.FlagModified := DirectoryHotlistTemp.FlagModified or (THotDir(tvDirectoryHotlist.Items.Item[Index].Data).HotDirExisting <> DirExist);
THotDir(tvDirectoryHotlist.Items.Item[Index].Data).HotDirExisting := DirExist;
end;
@ -1777,7 +1845,6 @@ begin
begin
if CheckIfThisDirectoryExists(THotDir(tvDirectoryHotlist.Items.Item[Index].Data).HotDirTarget) then
begin
DirectoryHotlistTemp.FlagModified := DirectoryHotlistTemp.FlagModified or (THotDir(tvDirectoryHotlist.Items.Item[Index].Data).HotDirExisting <> DirExist);
THotDir(tvDirectoryHotlist.Items.Item[Index].Data).HotDirExisting := DirExist;
end;
end;
@ -1861,17 +1928,17 @@ begin
end;
{ TfrmOptionsDirectoryHotlist.SubmitToAddOrConfigToHotDirDlg }
procedure TfrmOptionsDirectoryHotlist.SubmitToAddOrConfigToHotDirDlg(paramActionDispatcher,paramPath,paramTarget,paramOptionalIndex: string);
procedure TfrmOptionsDirectoryHotlist.SubmitToAddOrConfigToHotDirDlg(paramActionDispatcher: integer; paramPath,paramTarget:string; paramOptionalIndex: integer);
var
ActualActionDispatcher, TypeOfAddition, IndexFile: longint;
TypeOfAddition, IndexFile: longint;
sTempo: string;
NodeToSelect:TTreeNode=nil;
SelectedOrActiveDirectories:TFiles;
iOptionalIndex:integer;
procedure AddThisSubmittedDirectory(DirectoryPath:string);
begin
if cbAddTarget.Checked then sTempo := IncludeTrailingPathDelimiter(paramTarget) else sTempo := '';
if ((paramActionDispatcher=ACTION_ADDTOHOTLIST) AND (cbAddTarget.Checked)) OR
(paramActionDispatcher=ACTION_ADDBOTHTOHOTLIST) then sTempo := IncludeTrailingPathDelimiter(paramTarget) else sTempo := '';
if gWhereToAddNewHotDir = ahdLast then TypeOfAddition:=ACTION_ADDHOTDIR else TypeOfAddition:=ACTION_INSERTHOTDIR;
NodeToSelect:=nil;
@ -1889,16 +1956,8 @@ var
end;
begin
if UTF8LowerCase(paramActionDispatcher)='add' then ActualActionDispatcher:=ACTION_ADDTOHOTLIST
else if UTF8LowerCase(paramActionDispatcher)='addsel' then ActualActionDispatcher:=ACTION_ADDSELECTEDDIR
else if UTF8LowerCase(paramActionDispatcher)='config' then ActualActionDispatcher:=ACTION_CONFIGTOHOTLIST
else if UTF8LowerCase(paramActionDispatcher)='directconfig' then ActualActionDispatcher:=ACTION_DIRECTLYCONFIGENTRY
else ActualActionDispatcher:=-1;
iOptionalIndex:=StrToInt(paramOptionalIndex);
case ActualActionDispatcher of
ACTION_ADDTOHOTLIST:
case paramActionDispatcher of
ACTION_ADDTOHOTLIST, ACTION_ADDJUSTSOURCETOHOTLIST, ACTION_ADDBOTHTOHOTLIST:
begin
AddThisSubmittedDirectory(paramPath);
end;
@ -1910,7 +1969,7 @@ begin
ACTION_JUSTSHOWCONFIGHOTLIST:
begin
NodeToSelect:=tvDirectoryHotlist.Items.Item[0];
if tvDirectoryHotlist.Items.Count>0 then NodeToSelect:=tvDirectoryHotlist.Items.Item[0];
end;
ACTION_ADDSELECTEDDIR:
@ -1928,7 +1987,7 @@ begin
ACTION_DIRECTLYCONFIGENTRY:
begin
NodeToSelect := TryToGetExactHotDir(iOptionalIndex);
NodeToSelect := TryToGetExactHotDir(paramOptionalIndex);
end
end;
@ -1955,14 +2014,19 @@ begin
BringUsToTCConfigurationPage;
end;
{ TfrmOptionsDirectoryHotlist.GenericSomethingChanged }
procedure TfrmOptionsDirectoryHotlist.GenericSomethingChanged(Sender: TObject);
begin
FModificationTookPlace := True;
end;
{ TfrmOptionsDirectoryHotlist.Init }
procedure TfrmOptionsDirectoryHotlist.Init;
begin
ParseLineToList(rsOptAddFromMainPanel, rgWhereToAdd.Items);
end;
{ TODO -oDB : Would be nice if directory does not exist to offer immediately to re-configure it. }
{ TODO -oDB : Would be nice to be able to SEARCH through. Something like "Start Search" and then "Search again". }
{ TODO -oDB : Would be nice to be able to do a kind of "Search and replace" like changing all the "X:\" by "\\whatever_server\" for example. }
{ TODO -oDB : Be able to add a quick 16x16 icon to some friendly shortcut like a little star or something to help to see a special entry. }
{ TODO -oDB : Would be nice to have also a COPY-and-PASTE in addition to CUT-and-PASTE. Also, make sure to create new THotDir entry, not just copy entries in tree otherwise it's not good. }
end.

View file

@ -8,9 +8,9 @@ inherited frmOptionsHotkeys: TfrmOptionsHotkeys
AnchorSideLeft.Control = lbxCategories
AnchorSideTop.Control = Owner
Left = 317
Height = 13
Height = 15
Top = 6
Width = 55
Width = 59
BorderSpacing.Top = 6
Caption = 'C&ategories:'
FocusControl = lbxCategories
@ -20,9 +20,9 @@ inherited frmOptionsHotkeys: TfrmOptionsHotkeys
AnchorSideLeft.Control = lbSCFilesList
AnchorSideTop.Control = edtFilter
Left = 6
Height = 13
Top = 79
Width = 57
Height = 15
Top = 81
Width = 65
BorderSpacing.Top = 6
Caption = 'Co&mmands:'
FocusControl = stgCommands
@ -32,10 +32,10 @@ inherited frmOptionsHotkeys: TfrmOptionsHotkeys
AnchorSideTop.Control = edtFilter
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = edtFilter
Left = 670
Height = 13
Top = 78
Width = 25
Left = 669
Height = 15
Top = 79
Width = 26
Anchors = [akTop, akRight]
BorderSpacing.Top = 4
BorderSpacing.Right = 4
@ -52,7 +52,7 @@ inherited frmOptionsHotkeys: TfrmOptionsHotkeys
AnchorSideRight.Side = asrBottom
Left = 317
Height = 50
Top = 19
Top = 21
Width = 485
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
@ -61,7 +61,6 @@ inherited frmOptionsHotkeys: TfrmOptionsHotkeys
OnSelectionChange = lbxCategoriesSelectionChange
ScrollWidth = 483
TabOrder = 1
TopIndex = -1
end
object edtFilter: TEdit[4]
AnchorSideTop.Control = lbxCategories
@ -70,7 +69,7 @@ inherited frmOptionsHotkeys: TfrmOptionsHotkeys
AnchorSideRight.Side = asrBottom
Left = 699
Height = 23
Top = 73
Top = 75
Width = 103
Anchors = [akTop, akRight]
BorderSpacing.Top = 4
@ -85,8 +84,8 @@ inherited frmOptionsHotkeys: TfrmOptionsHotkeys
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 6
Height = 268
Top = 100
Height = 266
Top = 102
Width = 796
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Right = 6
@ -100,6 +99,7 @@ inherited frmOptionsHotkeys: TfrmOptionsHotkeys
RowCount = 1
TabOrder = 3
TitleStyle = tsNative
OnDrawCell = stgCommandsDrawCell
OnResize = stgCommandsResize
OnSelectCell = stgCommandsSelectCell
end
@ -113,7 +113,7 @@ inherited frmOptionsHotkeys: TfrmOptionsHotkeys
Left = 6
Height = 137
Top = 372
Width = 700
Width = 682
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Top = 4
BorderSpacing.Right = 8
@ -156,10 +156,10 @@ inherited frmOptionsHotkeys: TfrmOptionsHotkeys
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = stgHotkeys
AnchorSideBottom.Side = asrBottom
Left = 714
Left = 696
Height = 137
Top = 372
Width = 88
Width = 106
Anchors = [akTop, akRight, akBottom]
AutoSize = True
BevelOuter = bvNone
@ -171,14 +171,14 @@ inherited frmOptionsHotkeys: TfrmOptionsHotkeys
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 137
ClientWidth = 88
ClientWidth = 106
TabOrder = 5
object btnAddHotKey: TButton
AnchorSideRight.Side = asrBottom
Left = 0
Height = 42
Top = 0
Width = 88
Width = 106
AutoSize = True
BorderSpacing.InnerBorder = 4
Caption = 'Add &hotkey'
@ -190,7 +190,7 @@ inherited frmOptionsHotkeys: TfrmOptionsHotkeys
Left = 0
Height = 42
Top = 48
Width = 88
Width = 106
AutoSize = True
BorderSpacing.InnerBorder = 4
Caption = '&Edit hotkey'
@ -203,7 +203,7 @@ inherited frmOptionsHotkeys: TfrmOptionsHotkeys
Left = 0
Height = 41
Top = 96
Width = 88
Width = 106
AutoSize = True
BorderSpacing.InnerBorder = 4
Caption = '&Delete hotkey'
@ -218,22 +218,21 @@ inherited frmOptionsHotkeys: TfrmOptionsHotkeys
AnchorSideTop.Side = asrBottom
Left = 6
Height = 50
Top = 19
Top = 21
Width = 305
BorderSpacing.Left = 6
ItemHeight = 0
OnSelectionChange = lbSCFilesListSelectionChange
ScrollWidth = 303
TabOrder = 0
TopIndex = -1
end
object lblSCFiles: TLabel[9]
AnchorSideLeft.Control = lbSCFilesList
AnchorSideTop.Control = Owner
Left = 6
Height = 13
Height = 15
Top = 6
Width = 68
Width = 72
BorderSpacing.Top = 6
Caption = '&Shortcut files:'
FocusControl = lbSCFilesList

View file

@ -54,6 +54,8 @@ type
procedure edtFilterChange(Sender: TObject);
procedure lbSCFilesListSelectionChange(Sender: TObject; User: boolean);
procedure lbxCategoriesSelectionChange(Sender: TObject; User: boolean);
procedure stgCommandsDrawCell(Sender: TObject; aCol, aRow: Integer;
aRect: TRect; aState: TGridDrawState);
procedure stgCommandsResize(Sender: TObject);
procedure stgCommandsSelectCell(Sender: TObject; aCol, aRow: Integer;
var CanSelect: Boolean);
@ -120,7 +122,7 @@ implementation
{$R *.lfm}
uses
Forms, Controls, Dialogs, LCLProc, LCLVersion,
graphics, Forms, Controls, Dialogs, LCLProc, LCLVersion,
uFindEx, uGlobs, uGlobsPaths, uLng, uKeyboard, uFormCommands, DCStrUtils;
const
@ -247,6 +249,28 @@ begin
FillCommandList('');
end;
procedure TfrmOptionsHotkeys.stgCommandsDrawCell(Sender: TObject; aCol,
aRow: Integer; aRect: TRect; aState: TGridDrawState);
var
OffsetY: integer;
begin
if aCol=1 then
begin
if aRow>0 then
begin
with Sender as TStringGrid do
begin
if Cells[aCol,aRow]<>'' then
begin
OffsetY:=(DefaultRowHeight-Canvas.TextHeight(Cells[aCol,aRow])) div 2;
Canvas.Font.Color:=clRed;
Canvas.TextOut(aRect.Left+3,aRect.Top+OffsetY,Cells[aCol,aRow]);
end;
end;
end;
end;
end;
procedure TfrmOptionsHotkeys.stgCommandsResize(Sender: TObject);
begin
AutoSizeCommandsGrid;

View file

@ -60,16 +60,30 @@ var
fr: TSearchRecEx;
iIndex: Integer;
sLangName: String;
LanguageFileList: TStringList;
begin
lngList.Clear;
DCDebug('Language directory: ' + gpLngDir);
if FindFirstEx(gpLngDir + '*.po', faAnyFile, fr) = 0 then
repeat
sLangName := GetLanguageName(gpLngDir + fr.Name);
iIndex := lngList.Items.Add(Format('%s = %s', [sLangName, fr.Name]));
if (gPOFileName = fr.Name) then lngList.Selected[iIndex] := True;
until FindNextEx(fr) <> 0;
FindCloseEx(fr);
LanguageFileList:=TStringList.Create;
LanguageFileList.Sorted:=True;
LanguageFileList.Duplicates:=dupAccept;
try
lngList.Clear;
DCDebug('Language directory: ' + gpLngDir);
if FindFirstEx(gpLngDir + '*.po', faAnyFile, fr) = 0 then
repeat
sLangName := GetLanguageName(gpLngDir + fr.Name);
LanguageFileList.Add(Format('%s = %s', [sLangName, fr.Name]));
until FindNextEx(fr) <> 0;
FindCloseEx(fr);
for iIndex:=0 to pred(LanguageFileList.Count) do
begin
lngList.Items.add(LanguageFileList.Strings[iIndex]);
if (gPOFileName = Trim(lngList.Items.ValueFromIndex[iIndex])) then lngList.ItemIndex:=iIndex;
end;
finally
LanguageFileList.Free;
end;
end;
class function TfrmOptionsLanguage.GetIconIndex: Integer;

View file

@ -5,7 +5,8 @@ inherited frmOptionsQuickSearchFilter: TfrmOptionsQuickSearchFilter
ChildSizing.TopBottomSpacing = 6
ClientHeight = 354
ClientWidth = 702
DesignTop = 27
DesignLeft = 418
DesignTop = 232
object gbExactNameMatch: TGroupBox[0]
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
@ -13,7 +14,7 @@ inherited frmOptionsQuickSearchFilter: TfrmOptionsQuickSearchFilter
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Side = asrBottom
Left = 6
Height = 81
Height = 68
Top = 6
Width = 690
Anchors = [akTop, akLeft, akRight]
@ -21,16 +22,16 @@ inherited frmOptionsQuickSearchFilter: TfrmOptionsQuickSearchFilter
Caption = 'Exact name match'
ChildSizing.TopBottomSpacing = 4
ChildSizing.VerticalSpacing = 4
ClientHeight = 58
ClientHeight = 50
ClientWidth = 686
TabOrder = 0
object cbExactBeginning: TCheckBox
AnchorSideLeft.Control = gbExactNameMatch
AnchorSideTop.Control = gbExactNameMatch
Left = 10
Height = 23
Height = 19
Top = 6
Width = 376
Width = 305
BorderSpacing.Left = 10
BorderSpacing.Top = 6
Caption = '&Beginning (name must start with first typed character)'
@ -43,9 +44,9 @@ inherited frmOptionsQuickSearchFilter: TfrmOptionsQuickSearchFilter
AnchorSideBottom.Control = gbExactNameMatch
AnchorSideBottom.Side = asrBottom
Left = 10
Height = 19
Top = 33
Width = 382
Height = 15
Top = 29
Width = 311
Anchors = [akTop, akLeft, akBottom]
BorderSpacing.Bottom = 6
Caption = 'En&ding (last character before a typed dot . must match)'
@ -59,8 +60,8 @@ inherited frmOptionsQuickSearchFilter: TfrmOptionsQuickSearchFilter
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 6
Height = 104
Top = 87
Height = 87
Top = 74
Width = 690
Anchors = [akTop, akLeft, akRight]
AutoFill = True
@ -74,7 +75,7 @@ inherited frmOptionsQuickSearchFilter: TfrmOptionsQuickSearchFilter
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 81
ClientHeight = 69
ClientWidth = 686
Items.Strings = (
'Files'
@ -90,8 +91,8 @@ inherited frmOptionsQuickSearchFilter: TfrmOptionsQuickSearchFilter
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 6
Height = 81
Top = 191
Height = 68
Top = 161
Width = 690
Anchors = [akTop, akLeft, akRight]
AutoFill = True
@ -105,7 +106,7 @@ inherited frmOptionsQuickSearchFilter: TfrmOptionsQuickSearchFilter
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 58
ClientHeight = 50
ClientWidth = 686
Items.Strings = (
'Sensitive'
@ -120,8 +121,8 @@ inherited frmOptionsQuickSearchFilter: TfrmOptionsQuickSearchFilter
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 6
Height = 58
Top = 272
Height = 68
Top = 229
Width = 690
Anchors = [akTop, akLeft, akRight]
AutoFill = True
@ -135,12 +136,15 @@ inherited frmOptionsQuickSearchFilter: TfrmOptionsQuickSearchFilter
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 50
ClientWidth = 686
Items.Strings = (
'Hide filter panel when not focused'
'Keep saving setting modifications for next session'
)
TabOrder = 3
Data = {
0100000002
020000000202
}
end
end

View file

@ -58,6 +58,7 @@ uses
const
OPTION_AUTOHIDE_POSITION = 0;
OPTION_SAVE_SESSION_MODIFICATIONS = 1;
{ TfrmOptionsQuickSearchFilter }
@ -86,6 +87,7 @@ begin
rgpSearchItems.ItemIndex := Integer(gQuickSearchOptions.Items);
rgpSearchCase.ItemIndex := Integer(gQuickSearchOptions.SearchCase);
cgpOptions.Checked[OPTION_AUTOHIDE_POSITION] := gQuickFilterAutoHide;
cgpOptions.Checked[OPTION_SAVE_SESSION_MODIFICATIONS] := gQuickFilterSaveSessionModifications;
end;
function TfrmOptionsQuickSearchFilter.Save: TOptionsEditorSaveFlags;
@ -105,6 +107,7 @@ begin
gQuickSearchOptions.Items := TQuickSearchItems(rgpSearchItems.ItemIndex);
gQuickSearchOptions.SearchCase := TQuickSearchCase(rgpSearchCase.ItemIndex);
gQuickFilterAutoHide := cgpOptions.Checked[OPTION_AUTOHIDE_POSITION];
gQuickFilterSaveSessionModifications := cgpOptions.Checked[OPTION_SAVE_SESSION_MODIFICATIONS];
end;
end.

View file

@ -4,8 +4,8 @@ inherited frmOptionsToolbar: TfrmOptionsToolbar
ClientHeight = 573
ClientWidth = 850
OnEnter = FrameEnter
DesignLeft = 158
DesignTop = 294
DesignLeft = 247
DesignTop = 141
object gbGroupBox: TGroupBox[0]
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
@ -166,10 +166,10 @@ inherited frmOptionsToolbar: TfrmOptionsToolbar
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = pnlFullToolbarButtons
AnchorSideBottom.Side = asrBottom
Left = 156
Left = 209
Height = 25
Top = 0
Width = 527
Width = 420
AutoSize = True
BevelOuter = bvNone
ChildSizing.HorizontalSpacing = 8
@ -180,7 +180,7 @@ inherited frmOptionsToolbar: TfrmOptionsToolbar
ChildSizing.Layout = cclTopToBottomThenLeftToRight
ChildSizing.ControlsPerLine = 1
ClientHeight = 25
ClientWidth = 527
ClientWidth = 420
TabOrder = 0
object btnInsertButton: TButton
Left = 0
@ -212,36 +212,17 @@ inherited frmOptionsToolbar: TfrmOptionsToolbar
OnClick = btnDeleteButtonClick
TabOrder = 2
end
object btnExport: TButton
Left = 298
object btnOther: TButton
Left = 355
Height = 25
Top = 0
Width = 68
Width = 65
AutoSize = True
Caption = 'Export...'
OnClick = btnExportClick
BorderSpacing.Left = 65
Caption = 'Other...'
OnClick = btnOtherClick
TabOrder = 3
end
object btnImport: TButton
Left = 374
Height = 25
Top = 0
Width = 71
AutoSize = True
Caption = 'Import...'
OnClick = btnImportClick
TabOrder = 4
end
object btnBackup: TButton
Left = 453
Height = 25
Top = 0
Width = 74
AutoSize = True
Caption = 'Backup...'
OnClick = btnBackupClick
TabOrder = 5
end
end
end
object pnlEditToolbar: TPanel[2]
@ -367,12 +348,11 @@ inherited frmOptionsToolbar: TfrmOptionsToolbar
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = lblToolTip
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = pnlEditControls
AnchorSideRight.Side = asrBottom
AnchorSideRight.Control = btnSuggestionTooltip
Left = 64
Height = 23
Top = 27
Width = 681
Width = 628
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 2
MaxLength = 259
@ -396,12 +376,11 @@ inherited frmOptionsToolbar: TfrmOptionsToolbar
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = lblInternalCommand
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = pnlEditControls
AnchorSideRight.Side = asrBottom
AnchorSideRight.Control = btnOpenCmdDlg
Left = 64
Height = 23
Top = 52
Width = 681
Width = 600
HelpType = htKeyword
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 2
@ -770,6 +749,62 @@ inherited frmOptionsToolbar: TfrmOptionsToolbar
Visible = False
OnClick = btnRelativeStartPathClick
end
object btnOpenCmdDlg: TButton
AnchorSideLeft.Control = cbInternalCommand
AnchorSideTop.Control = cbInternalCommand
AnchorSideRight.Control = lblHelpOnInternalCommand
AnchorSideBottom.Control = cbInternalCommand
AnchorSideBottom.Side = asrBottom
Left = 667
Height = 23
Top = 52
Width = 50
Anchors = [akTop, akRight, akBottom]
BorderSpacing.Left = 3
BorderSpacing.InnerBorder = 4
Caption = 'Select'
OnClick = btnOpenCmdDlgClick
TabOrder = 12
Visible = False
end
object lblHelpOnInternalCommand: TLabel
AnchorSideTop.Control = lblInternalCommand
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = pnlEditControls
AnchorSideRight.Side = asrBottom
Cursor = crHandPoint
Left = 720
Height = 15
Top = 56
Width = 25
Anchors = [akTop, akRight]
BorderSpacing.Left = 3
Caption = 'Help'
Font.Style = [fsUnderline]
ParentColor = False
ParentFont = False
Visible = False
OnClick = lblHelpOnInternalCommandClick
end
object btnSuggestionTooltip: TButton
AnchorSideTop.Control = edtToolTip
AnchorSideRight.Control = pnlEditControls
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = edtToolTip
AnchorSideBottom.Side = asrBottom
Left = 695
Height = 23
Hint = 'Have DC suggest the tooltip based on button type, command and parameters'
Top = 27
Width = 50
Anchors = [akTop, akRight, akBottom]
BorderSpacing.Left = 3
BorderSpacing.InnerBorder = 4
Caption = 'Suggest'
OnClick = btnSuggestionTooltipClick
TabOrder = 13
Visible = False
end
end
end
object pnToolbars: TPanel[3]
@ -789,7 +824,7 @@ inherited frmOptionsToolbar: TfrmOptionsToolbar
TabOrder = 3
end
object OpenDialog: TOpenDialog[4]
Filter = 'TC Toolbar files|*.BAR|DC Toolbar files|*.toolbar|Any filesAny files|*.*'
Filter = 'DC Toolbar files|*.toolbar|.xml Config files|*.xml|TC Toolbar files|*.BAR|Any files|*.*'
Options = [ofPathMustExist, ofFileMustExist, ofEnableSizing, ofViewDetail]
left = 48
top = 104
@ -799,8 +834,8 @@ inherited frmOptionsToolbar: TfrmOptionsToolbar
top = 232
end
object pmInsertButtonMenu: TPopupMenu[6]
left = 312
top = 192
left = 256
top = 176
object miAddSeparatorSubMenu: TMenuItem
Caption = 'for a separator'
object miSeparatorFirstItem: TMenuItem
@ -894,235 +929,280 @@ inherited frmOptionsToolbar: TfrmOptionsToolbar
end
end
end
object pmExportToolbar: TPopupMenu[7]
Tag = 1
left = 480
top = 200
object miExportTop: TMenuItem
Caption = 'Top toolbar...'
object miExportTopToDCBar: TMenuItem
Tag = 2
Caption = 'to a Toolbar File (.toolbar)'
OnClick = miExportToAnythingClick
end
object miExportSeparator1: TMenuItem
Caption = '-'
end
object miExportTopToTCIniKeep: TMenuItem
Caption = 'to a "wincmd.ini" of TC (keep existing)'
OnClick = miExportToAnythingClick
end
object miExportTopToTCIniNoKeep: TMenuItem
Tag = 128
Caption = 'to a "wincmd.ini" of TC (erase existing)'
OnClick = miExportToAnythingClick
end
object miExportSeparator2: TMenuItem
Caption = '-'
end
object miExportTopToTCBarKeep: TMenuItem
Tag = 1
Caption = 'to a TC .BAR file (keep existing)'
OnClick = miExportToAnythingClick
end
object miExportTopToTCBarNoKeep: TMenuItem
Tag = 129
Caption = 'to a TC .BAR file (erase existing)'
OnClick = miExportToAnythingClick
end
end
object miExportCurrent: TMenuItem
Caption = 'Current toolbar...'
Enabled = False
object miExportCurrentToDCBar: TMenuItem
Tag = 34
Caption = 'to a Toolbar File (.toolbar)'
OnClick = miExportToAnythingClick
end
object miExportSeparator3: TMenuItem
Caption = '-'
end
object miExportCurrentToTCIniKeep: TMenuItem
Tag = 32
Caption = 'to a "wincmd.ini" of TC (keep existing)'
OnClick = miExportToAnythingClick
end
object miExportCurrentToTCIniNoKeep: TMenuItem
Tag = 160
Caption = 'to a "wincmd.ini" of TC (erase existing)'
OnClick = miExportToAnythingClick
end
object miExportSeparator4: TMenuItem
Caption = '-'
end
object miExportCurrentToTCBarKeep: TMenuItem
Tag = 33
Caption = 'to a TC .BAR file (keep existing)'
OnClick = miExportToAnythingClick
end
object miExportCurrentToTCBarNoKeep: TMenuItem
Tag = 161
Caption = 'to a TC .BAR file (erase existing)'
OnClick = miExportToAnythingClick
end
end
end
object pmImportToolbar: TPopupMenu[8]
left = 552
object pmOtherClickToolbar: TPopupMenu[7]
left = 592
top = 176
object miImportDCBAR: TMenuItem
Caption = 'from a Toolbar File (.toolbar)'
object miImportDCBARReplaceTop: TMenuItem
Tag = 130
Caption = 'to replace top toolbar'
OnClick = miImportFromAnythingClick
object miAddAllCmds: TMenuItem
Caption = 'Add toolbar with ALL DC commands'
OnClick = miAddAllCmdsClick
end
object miSearchAndReplace: TMenuItem
Caption = 'Search and replace...'
object miSrcRplIconNames: TMenuItem
Tag = 1
Caption = 'in all icon names...'
OnClick = miSrcRplClick
end
object miSeparator8: TMenuItem
Caption = '-'
end
object miImportDCBARAddTop: TMenuItem
object miSrcRplCommands: TMenuItem
Tag = 2
Caption = 'to add to top toolbar'
OnClick = miImportFromAnythingClick
Caption = 'in all commands...'
OnClick = miSrcRplClick
end
object miImportDCBARAddMenuTop: TMenuItem
Tag = 18
Caption = 'to add to a new toolbar to top toolbar'
OnClick = miImportFromAnythingClick
object miSrcRplParameters: TMenuItem
Tag = 4
Caption = 'in all parameters...'
OnClick = miSrcRplClick
end
object miSeparator9: TMenuItem
object miSrcRplStartPath: TMenuItem
Tag = 8
Caption = 'in all start path...'
OnClick = miSrcRplClick
end
object miSrcRplClickSeparator: TMenuItem
Caption = '-'
end
object miImportDCBARAddCurrent: TMenuItem
Tag = 34
Caption = 'to add to current toolbar'
OnClick = miImportFromAnythingClick
end
object miImportDCBARAddMenuCurrent: TMenuItem
Tag = 50
Caption = 'to add to a new toolbar to current toolbar'
OnClick = miImportFromAnythingClick
object miSrcRplAllOfAll: TMenuItem
Tag = 15
Caption = 'in all of all the above...'
OnClick = miSrcRplClick
end
end
object miImportSeparator: TMenuItem
object miSeparator1: TMenuItem
Caption = '-'
end
object miImportTCINI: TMenuItem
Caption = 'from "wincmd.ini" of TC...'
object miImportTCINIReplaceTop: TMenuItem
Tag = 128
Caption = 'to replace top toolbar'
OnClick = miImportFromAnythingClick
object miExport: TMenuItem
Caption = 'Export...'
object miExportTop: TMenuItem
Caption = 'Top toolbar...'
object miExportTopToDCBar: TMenuItem
Tag = 2
Caption = 'to a Toolbar File (.toolbar)'
OnClick = miExportToAnythingClick
end
object miExportSeparator1: TMenuItem
Caption = '-'
end
object miExportTopToTCIniKeep: TMenuItem
Caption = 'to a "wincmd.ini" of TC (keep existing)'
OnClick = miExportToAnythingClick
end
object miExportTopToTCIniNoKeep: TMenuItem
Tag = 128
Caption = 'to a "wincmd.ini" of TC (erase existing)'
OnClick = miExportToAnythingClick
end
object miExportSeparator2: TMenuItem
Caption = '-'
end
object miExportTopToTCBarKeep: TMenuItem
Tag = 1
Caption = 'to a TC .BAR file (keep existing)'
OnClick = miExportToAnythingClick
end
object miExportTopToTCBarNoKeep: TMenuItem
Tag = 129
Caption = 'to a TC .BAR file (erase existing)'
OnClick = miExportToAnythingClick
end
end
object miSeparator6: TMenuItem
Caption = '-'
end
object miImportTCINIAddTop: TMenuItem
Caption = 'to add to top toolbar'
OnClick = miImportFromAnythingClick
end
object miImportTCINIAddMenuTop: TMenuItem
Tag = 16
Caption = 'to add to a new toolbar to top toolbar'
OnClick = miImportFromAnythingClick
end
object miSeparator7: TMenuItem
Caption = '-'
end
object miImportTCINIAddCurrent: TMenuItem
Tag = 32
Caption = 'to add to current toolbar'
OnClick = miImportFromAnythingClick
end
object miImportTCINIAddMenuCurrent: TMenuItem
Tag = 48
Caption = 'to add to a new toobar to current toolbar'
OnClick = miImportFromAnythingClick
object miExportCurrent: TMenuItem
Caption = 'Current toolbar...'
object miExportCurrentToDCBar: TMenuItem
Tag = 34
Caption = 'to a Toolbar File (.toolbar)'
OnClick = miExportToAnythingClick
end
object miExportSeparator3: TMenuItem
Caption = '-'
end
object miExportCurrentToTCIniKeep: TMenuItem
Tag = 32
Caption = 'to a "wincmd.ini" of TC (keep existing)'
OnClick = miExportToAnythingClick
end
object miExportCurrentToTCIniNoKeep: TMenuItem
Tag = 160
Caption = 'to a "wincmd.ini" of TC (erase existing)'
OnClick = miExportToAnythingClick
end
object miExportSeparator4: TMenuItem
Caption = '-'
end
object miExportCurrentToTCBarKeep: TMenuItem
Tag = 33
Caption = 'to a TC .BAR file (keep existing)'
OnClick = miExportToAnythingClick
end
object miExportCurrentToTCBarNoKeep: TMenuItem
Tag = 161
Caption = 'to a TC .BAR file (erase existing)'
OnClick = miExportToAnythingClick
end
end
end
object miImportTCBAR: TMenuItem
Caption = 'from a single TC .BAR file'
object miImportTCBARRepaceTop: TMenuItem
Tag = 129
Caption = 'to replace top toolbar'
OnClick = miImportFromAnythingClick
object miImport: TMenuItem
Caption = 'Import...'
object miImportDCBAR: TMenuItem
Caption = 'from a Toolbar File (.toolbar)'
object miImportDCBARReplaceTop: TMenuItem
Tag = 130
Caption = 'to replace top toolbar'
OnClick = miImportFromAnythingClick
end
object miSeparator8: TMenuItem
Caption = '-'
end
object miImportDCBARAddTop: TMenuItem
Tag = 2
Caption = 'to add to top toolbar'
OnClick = miImportFromAnythingClick
end
object miImportDCBARAddMenuTop: TMenuItem
Tag = 18
Caption = 'to add to a new toolbar to top toolbar'
OnClick = miImportFromAnythingClick
end
object miSeparator9: TMenuItem
Caption = '-'
end
object miImportDCBARAddCurrent: TMenuItem
Tag = 34
Caption = 'to add to current toolbar'
OnClick = miImportFromAnythingClick
end
object miImportDCBARAddMenuCurrent: TMenuItem
Tag = 50
Caption = 'to add to a new toobar to current toolbar'
OnClick = miImportFromAnythingClick
end
end
object miSeparator10: TMenuItem
object miImportSeparator: TMenuItem
Caption = '-'
end
object miImportTCBARAddTop: TMenuItem
Tag = 1
Caption = 'to add to top toolbar'
OnClick = miImportFromAnythingClick
object miImportTCINI: TMenuItem
Caption = 'from "wincmd.ini" of TC...'
object miImportTCINIReplaceTop: TMenuItem
Tag = 128
Caption = 'to replace top toolbar'
OnClick = miImportFromAnythingClick
end
object miSeparator6: TMenuItem
Caption = '-'
end
object miImportTCINIAddTop: TMenuItem
Caption = 'to add to top toolbar'
OnClick = miImportFromAnythingClick
end
object miImportTCINIAddMenuTop: TMenuItem
Tag = 16
Caption = 'to add to a new toolbar to top toolbar'
OnClick = miImportFromAnythingClick
end
object miSeparator7: TMenuItem
Caption = '-'
end
object miImportTCINIAddCurrent: TMenuItem
Tag = 32
Caption = 'to add to current toolbar'
OnClick = miImportFromAnythingClick
end
object miImportTCINIAddMenuCurrent: TMenuItem
Tag = 48
Caption = 'to add to a new toobar to current toolbar'
OnClick = miImportFromAnythingClick
end
end
object miImportTCBARAddMenuTop: TMenuItem
Tag = 17
Caption = 'to add to a new toolbar to top toolbar'
OnClick = miImportFromAnythingClick
end
object miSeparator11: TMenuItem
Caption = '-'
end
object miImportTCBARAddCurrent: TMenuItem
Tag = 33
Caption = 'to add to current toolbar'
OnClick = miImportFromAnythingClick
end
object miImportTCBARAddMenuCurrent: TMenuItem
Tag = 49
Caption = 'to add to a new toobar to current toolbar'
OnClick = miImportFromAnythingClick
object miImportTCBAR: TMenuItem
Caption = 'from a single TC .BAR file'
object miImportTCBARReplaceTop: TMenuItem
Tag = 129
Caption = 'to replace top toolbar'
OnClick = miImportFromAnythingClick
end
object miSeparator10: TMenuItem
Caption = '-'
end
object miImportTCBARAddTop: TMenuItem
Tag = 1
Caption = 'to add to top toolbar'
OnClick = miImportFromAnythingClick
end
object miImportTCBARAddMenuTop: TMenuItem
Tag = 17
Caption = 'to add to a new toolbar to top toolbar'
OnClick = miImportFromAnythingClick
end
object miSeparator11: TMenuItem
Caption = '-'
end
object miImportTCBARAddCurrent: TMenuItem
Tag = 33
Caption = 'to add to current toolbar'
OnClick = miImportFromAnythingClick
end
object miImportTCBARAddMenuCurrent: TMenuItem
Tag = 49
Caption = 'to add to a new toobar to current toolbar'
OnClick = miImportFromAnythingClick
end
end
end
end
object pmBackupToolbar: TPopupMenu[9]
left = 632
top = 200
object miExportTopToBackup: TMenuItem
Tag = 3
Caption = 'Save a backup of Toolbar'
OnClick = miExportToAnythingClick
object miSeparator2: TMenuItem
Caption = '-'
end
object miImportBackup: TMenuItem
Caption = 'Restore a backup of Toolbar'
object miImportBackupReplaceTop: TMenuItem
Tag = 131
Caption = 'to replace top toolbar'
OnClick = miImportFromAnythingClick
end
object miSeparator13: TMenuItem
Caption = '-'
end
object miImportBackupAddTop: TMenuItem
object miBackup: TMenuItem
Caption = 'Backup...'
object miExportTopToBackup: TMenuItem
Tag = 3
Caption = 'to add to top toolbar'
OnClick = miImportFromAnythingClick
Caption = 'Save a backup of Toolbar'
OnClick = miExportToAnythingClick
end
object miImportBackupAddMenuTop: TMenuItem
Tag = 19
Caption = 'to add to a new toolbar to top toolbar'
OnClick = miImportFromAnythingClick
end
object miSeparator14: TMenuItem
Caption = '-'
end
object miImportBackupAddCurrent: TMenuItem
Tag = 35
Caption = 'to add to current toolbar'
OnClick = miImportFromAnythingClick
end
object miImportBackupAddMenuCurrent: TMenuItem
Tag = 51
Caption = 'to add to a new toobar to current toolbar'
OnClick = miImportFromAnythingClick
object miImportBackup: TMenuItem
Caption = 'Restore a backup of Toolbar'
object miImportBackupReplaceTop: TMenuItem
Tag = 131
Caption = 'to replace top toolbar'
OnClick = miImportFromAnythingClick
end
object miSeparator13: TMenuItem
Caption = '-'
end
object miImportBackupAddTop: TMenuItem
Tag = 3
Caption = 'to add to top toolbar'
OnClick = miImportFromAnythingClick
end
object miImportBackupAddMenuTop: TMenuItem
Tag = 19
Caption = 'to add to a new toolbar to top toolbar'
OnClick = miImportFromAnythingClick
end
object miSeparator14: TMenuItem
Caption = '-'
end
object miImportBackupAddCurrent: TMenuItem
Tag = 35
Caption = 'to add to current toolbar'
OnClick = miImportFromAnythingClick
end
object miImportBackupAddMenuCurrent: TMenuItem
Tag = 51
Caption = 'to add to a new toobar to current toolbar'
OnClick = miImportFromAnythingClick
end
end
end
end
object SaveDialog: TSaveDialog[10]
object SaveDialog: TSaveDialog[8]
DefaultExt = '.hotlist'
Filter = 'TC Toolbar file|*.BAR|DC Toolbar file|*.toolbar|Any files|*.*'
Filter = 'DC Toolbar files|*.toolbar|TC Toolbar files|*.BAR|Any files|*.*'
Options = [ofOverwritePrompt, ofPathMustExist, ofEnableSizing, ofViewDetail]
left = 152
top = 104
end
object ReplaceDialog: TReplaceDialog[9]
Options = [frHideWholeWord, frHideUpDown, frDisableUpDown, frDisableWholeWord, frHideEntireScope, frHidePromptOnReplace]
left = 288
top = 112
end
end

View file

@ -6,9 +6,7 @@ TFRMOPTIONSTOOLBAR.CBREPORTERRORWITHCOMMANDS.CAPTION=Report errors with commands
TFRMOPTIONSTOOLBAR.BTNINSERTBUTTON.CAPTION=&Insert new button
TFRMOPTIONSTOOLBAR.BTNCLONEBUTTON.CAPTION=C&lone button
TFRMOPTIONSTOOLBAR.BTNDELETEBUTTON.CAPTION=&Delete
TFRMOPTIONSTOOLBAR.BTNEXPORT.CAPTION=Export...
TFRMOPTIONSTOOLBAR.BTNIMPORT.CAPTION=Import...
TFRMOPTIONSTOOLBAR.BTNBACKUP.CAPTION=Backup...
TFRMOPTIONSTOOLBAR.BTNOTHER.CAPTION=Other...
TFRMOPTIONSTOOLBAR.RGTOOLITEMTYPE.CAPTION=Button type
TFRMOPTIONSTOOLBAR.LBLICONFILE.CAPTION=Ico&n:
TFRMOPTIONSTOOLBAR.BTNOPENICON.CAPTION=>>
@ -24,6 +22,10 @@ TFRMOPTIONSTOOLBAR.LBLHOTKEY.CAPTION=Hot key:
TFRMOPTIONSTOOLBAR.BTNEDITHOTKEY.CAPTION=Edit hot&key
TFRMOPTIONSTOOLBAR.BTNREMOVEHOTKEY.CAPTION=Remove hotke&y
TFRMOPTIONSTOOLBAR.BTNSTARTPATH.CAPTION=>>
TFRMOPTIONSTOOLBAR.BTNOPENCMDDLG.CAPTION=Select
TFRMOPTIONSTOOLBAR.LBLHELPONINTERNALCOMMAND.CAPTION=Help
TFRMOPTIONSTOOLBAR.BTNSUGGESTIONTOOLTIP.HINT=Have DC suggest the tooltip based on button type, command and parameters
TFRMOPTIONSTOOLBAR.BTNSUGGESTIONTOOLTIP.CAPTION=Suggest
TFRMOPTIONSTOOLBAR.MIADDSEPARATORSUBMENU.CAPTION=for a separator
TFRMOPTIONSTOOLBAR.MISEPARATORFIRSTITEM.CAPTION=as first element
TFRMOPTIONSTOOLBAR.MISEPARATORPRIORCURRENT.CAPTION=just prior current selection
@ -44,6 +46,16 @@ TFRMOPTIONSTOOLBAR.MISUBTOOLBARFIRSTELEMENT.CAPTION=as first element
TFRMOPTIONSTOOLBAR.MISUBTOOLBARPRIORCURRENT.CAPTION=just prior current selection
TFRMOPTIONSTOOLBAR.MISUBTOOLBARAFTERCURRENT.CAPTION=just after current selection
TFRMOPTIONSTOOLBAR.MISUBTOOLBARLASTELEMENT.CAPTION=as last element
TFRMOPTIONSTOOLBAR.MIADDALLCMDS.CAPTION=Add toolbar with ALL DC commands
TFRMOPTIONSTOOLBAR.MISEARCHANDREPLACE.CAPTION=Search and replace...
TFRMOPTIONSTOOLBAR.MISRCRPLICONNAMES.CAPTION=in all icon names...
TFRMOPTIONSTOOLBAR.MISRCRPLCOMMANDS.CAPTION=in all commands...
TFRMOPTIONSTOOLBAR.MISRCRPLPARAMETERS.CAPTION=in all parameters...
TFRMOPTIONSTOOLBAR.MISRCRPLSTARTPATH.CAPTION=in all start path...
TFRMOPTIONSTOOLBAR.MISRCRPLCLICKSEPARATOR.CAPTION=-
TFRMOPTIONSTOOLBAR.MISRCRPLALLOFALL.CAPTION=in all of all the above...
TFRMOPTIONSTOOLBAR.MISEPARATOR1.CAPTION=-
TFRMOPTIONSTOOLBAR.MIEXPORT.CAPTION=Export...
TFRMOPTIONSTOOLBAR.MIEXPORTTOP.CAPTION=Top toolbar...
TFRMOPTIONSTOOLBAR.MIEXPORTTOPTODCBAR.CAPTION=to a Toolbar File (.toolbar)
TFRMOPTIONSTOOLBAR.MIEXPORTSEPARATOR1.CAPTION=-
@ -60,6 +72,7 @@ TFRMOPTIONSTOOLBAR.MIEXPORTCURRENTTOTCININOKEEP.CAPTION=to a "wincmd.ini" of TC
TFRMOPTIONSTOOLBAR.MIEXPORTSEPARATOR4.CAPTION=-
TFRMOPTIONSTOOLBAR.MIEXPORTCURRENTTOTCBARKEEP.CAPTION=to a TC .BAR file (keep existing)
TFRMOPTIONSTOOLBAR.MIEXPORTCURRENTTOTCBARNOKEEP.CAPTION=to a TC .BAR file (erase existing)
TFRMOPTIONSTOOLBAR.MIIMPORT.CAPTION=Import...
TFRMOPTIONSTOOLBAR.MIIMPORTDCBAR.CAPTION=from a Toolbar File (.toolbar)
TFRMOPTIONSTOOLBAR.MIIMPORTDCBARREPLACETOP.CAPTION=to replace top toolbar
TFRMOPTIONSTOOLBAR.MISEPARATOR8.CAPTION=-
@ -67,7 +80,7 @@ TFRMOPTIONSTOOLBAR.MIIMPORTDCBARADDTOP.CAPTION=to add to top toolbar
TFRMOPTIONSTOOLBAR.MIIMPORTDCBARADDMENUTOP.CAPTION=to add to a new toolbar to top toolbar
TFRMOPTIONSTOOLBAR.MISEPARATOR9.CAPTION=-
TFRMOPTIONSTOOLBAR.MIIMPORTDCBARADDCURRENT.CAPTION=to add to current toolbar
TFRMOPTIONSTOOLBAR.MIIMPORTDCBARADDMENUCURRENT.CAPTION=to add to a new toolbar to current toolbar
TFRMOPTIONSTOOLBAR.MIIMPORTDCBARADDMENUCURRENT.CAPTION=to add to a new toobar to current toolbar
TFRMOPTIONSTOOLBAR.MIIMPORTSEPARATOR.CAPTION=-
TFRMOPTIONSTOOLBAR.MIIMPORTTCINI.CAPTION=from "wincmd.ini" of TC...
TFRMOPTIONSTOOLBAR.MIIMPORTTCINIREPLACETOP.CAPTION=to replace top toolbar
@ -78,13 +91,15 @@ TFRMOPTIONSTOOLBAR.MISEPARATOR7.CAPTION=-
TFRMOPTIONSTOOLBAR.MIIMPORTTCINIADDCURRENT.CAPTION=to add to current toolbar
TFRMOPTIONSTOOLBAR.MIIMPORTTCINIADDMENUCURRENT.CAPTION=to add to a new toobar to current toolbar
TFRMOPTIONSTOOLBAR.MIIMPORTTCBAR.CAPTION=from a single TC .BAR file
TFRMOPTIONSTOOLBAR.MIIMPORTTCBARREPACETOP.CAPTION=to replace top toolbar
TFRMOPTIONSTOOLBAR.MIIMPORTTCBARREPLACETOP.CAPTION=to replace top toolbar
TFRMOPTIONSTOOLBAR.MISEPARATOR10.CAPTION=-
TFRMOPTIONSTOOLBAR.MIIMPORTTCBARADDTOP.CAPTION=to add to top toolbar
TFRMOPTIONSTOOLBAR.MIIMPORTTCBARADDMENUTOP.CAPTION=to add to a new toolbar to top toolbar
TFRMOPTIONSTOOLBAR.MISEPARATOR11.CAPTION=-
TFRMOPTIONSTOOLBAR.MIIMPORTTCBARADDCURRENT.CAPTION=to add to current toolbar
TFRMOPTIONSTOOLBAR.MIIMPORTTCBARADDMENUCURRENT.CAPTION=to add to a new toobar to current toolbar
TFRMOPTIONSTOOLBAR.MISEPARATOR2.CAPTION=-
TFRMOPTIONSTOOLBAR.MIBACKUP.CAPTION=Backup...
TFRMOPTIONSTOOLBAR.MIEXPORTTOPTOBACKUP.CAPTION=Save a backup of Toolbar
TFRMOPTIONSTOOLBAR.MIIMPORTBACKUP.CAPTION=Restore a backup of Toolbar
TFRMOPTIONSTOOLBAR.MIIMPORTBACKUPREPLACETOP.CAPTION=to replace top toolbar

View file

@ -41,8 +41,10 @@ type
btnInsertButton: TButton;
btnCloneButton: TButton;
btnDeleteButton: TButton;
btnSuggestionTooltip: TButton;
btnOpenFile: TButton;
btnEditHotkey: TButton;
btnOpenCmdDlg: TButton;
btnRelativeStartPath: TSpeedButton;
btnStartPath: TButton;
btnRelativeIconFileName: TSpeedButton;
@ -51,6 +53,7 @@ type
cbFlatButtons: TCheckBox;
edtExternalParameters: TEdit;
edtExternalCommand: TEdit;
lblHelpOnInternalCommand: TLabel;
lblHotkeyValue: TLabel;
edtStartPath: TEdit;
edtToolTip: TEdit;
@ -69,6 +72,15 @@ type
lblStartPath: TLabel;
lblToolTip: TLabel;
edtInternalParameters: TMemo;
miSrcRplIconNames: TMenuItem;
miSrcRplCommands: TMenuItem;
miSrcRplParameters: TMenuItem;
miSrcRplStartPath: TMenuItem;
miSrcRplClickSeparator: TMenuItem;
miSrcRplAllOfAll: TMenuItem;
miSearchAndReplace: TMenuItem;
miExportCurrent: TMenuItem;
miImportAllDCCommands: TMenuItem;
miAddSeparatorSubMenu: TMenuItem;
miExternalCommandFirstElement: TMenuItem;
miSubToolBarFirstElement: TMenuItem;
@ -96,72 +108,76 @@ type
pnlEditToolbar: TPanel;
pnlToolbarButtons: TPanel;
pmInsertButtonMenu: TPopupMenu;
ReplaceDialog: TReplaceDialog;
rgToolItemType: TRadioGroup;
btnOpenIcon: TButton;
pnToolbars: TPanel;
btnRelativeExternalCommand: TSpeedButton;
trbBarSize: TTrackBar;
trbIconSize: TTrackBar;
miExportSeparator1: TMenuItem;
miExportSeparator2: TMenuItem;
miExportSeparator3: TMenuItem;
miExportSeparator4: TMenuItem;
miSeparator6: TMenuItem;
miSeparator7: TMenuItem;
miSeparator9: TMenuItem;
miSeparator8: TMenuItem;
miSeparator10: TMenuItem;
miSeparator11: TMenuItem;
miSeparator13: TMenuItem;
miSeparator14: TMenuItem;
miImportSeparator: TMenuItem;
SaveDialog: TSaveDialog;
cbReportErrorWithCommands: TCheckBox;
btnExport: TButton;
pmExportToolbar: TPopupMenu;
btnOther: TButton;
pmOtherClickToolbar: TPopupMenu;
miAddAllCmds: TMenuItem;
miSeparator1: TMenuItem;
miExport: TMenuItem;
miExportTop: TMenuItem;
miExportTopToDCBar: TMenuItem;
miExportSeparator1: TMenuItem;
miExportTopToTCIniKeep: TMenuItem;
miExportTopToTCIniNoKeep: TMenuItem;
miExportSeparator2: TMenuItem;
miExportTopToTCBarKeep: TMenuItem;
miExportTopToTCBarNoKeep: TMenuItem;
miExportTopToDCBar: TMenuItem;
miExportCurrent: TMenuItem;
miExportCurrentToDCBar: TMenuItem;
miExportSeparator3: TMenuItem;
miExportCurrentToTCIniKeep: TMenuItem;
miExportCurrentToTCIniNoKeep: TMenuItem;
miExportSeparator4: TMenuItem;
miExportCurrentToTCBarKeep: TMenuItem;
miExportCurrentToTCBarNoKeep: TMenuItem;
miExportCurrentToDCBar: TMenuItem;
btnImport: TButton;
pmImportToolbar: TPopupMenu;
miImport: TMenuItem;
miImportDCBAR: TMenuItem;
miImportDCBARReplaceTop: TMenuItem;
miSeparator8: TMenuItem;
miImportDCBARAddTop: TMenuItem;
miImportDCBARAddMenuTop: TMenuItem;
miSeparator9: TMenuItem;
miImportDCBARAddCurrent: TMenuItem;
miImportDCBARAddMenuCurrent: TMenuItem;
miImportSeparator2: TMenuItem;
miImportTCINI: TMenuItem;
miImportTCINIReplaceTop: TMenuItem;
miSeparator6: TMenuItem;
miImportTCINIAddTop: TMenuItem;
miImportTCINIAddMenuTop: TMenuItem;
miSeparator7: TMenuItem;
miImportTCINIAddCurrent: TMenuItem;
miImportTCINIAddMenuCurrent: TMenuItem;
miImportTCBAR: TMenuItem;
miImportTCBARRepaceTop: TMenuItem;
miImportTCBARReplaceTop: TMenuItem;
miSeparator10: TMenuItem;
miImportTCBARAddTop: TMenuItem;
miImportTCBARAddMenuTop: TMenuItem;
miSeparator11: TMenuItem;
miImportTCBARAddCurrent: TMenuItem;
miImportTCBARAddMenuCurrent: TMenuItem;
miImportDCBAR: TMenuItem;
miImportDCBARReplaceTop: TMenuItem;
miImportDCBARAddTop: TMenuItem;
miImportDCBARAddMenuTop: TMenuItem;
miImportDCBARAddCurrent: TMenuItem;
miImportDCBARAddMenuCurrent: TMenuItem;
btnBackup: TButton;
pmBackupToolbar: TPopupMenu;
miSeparator2: TMenuItem;
miBackup: TMenuItem;
miExportTopToBackup: TMenuItem;
miImportBackup: TMenuItem;
miImportBackupReplaceTop: TMenuItem;
miSeparator13: TMenuItem;
miImportBackupAddTop: TMenuItem;
miImportBackupAddMenuTop: TMenuItem;
miSeparator14: TMenuItem;
miImportBackupAddCurrent: TMenuItem;
miImportBackupAddMenuCurrent: TMenuItem;
procedure btnEditHotkeyClick(Sender: TObject);
procedure btnInsertButtonClick(Sender: TObject);
procedure btnOpenCmdDlgClick(Sender: TObject);
procedure btnRelativeExternalCommandClick(Sender: TObject);
procedure btnRelativeIconFileNameClick(Sender: TObject);
procedure btnRelativeStartPathClick(Sender: TObject);
@ -170,10 +186,14 @@ type
procedure btnDeleteButtonClick(Sender: TObject);
procedure btnOpenFileClick(Sender: TObject);
procedure btnStartPathClick(Sender: TObject);
procedure btnSuggestionTooltipClick(Sender: TObject);
procedure cbInternalCommandSelect(Sender: TObject);
procedure cbFlatButtonsChange(Sender: TObject);
procedure edtIconFileNameChange(Sender: TObject);
procedure lblHelpOnInternalCommandClick(Sender: TObject);
procedure miAddAllCmdsClick(Sender: TObject);
procedure miInsertButtonClick(Sender: TObject);
procedure miSrcRplClick(Sender: TObject);
procedure ToolbarDragOver(Sender, Source: TObject; X, Y: Integer;
State: TDragState; var Accept: Boolean);
procedure ToolbarDragDrop(Sender, Source: TObject; X, Y: Integer);
@ -196,9 +216,7 @@ type
procedure trbIconSizeChange(Sender: TObject);
procedure FrameEnter(Sender: TObject);
function ComputeToolbarsSignature: dword;
procedure btnExportClick(Sender: TObject);
procedure btnImportClick(Sender: TObject);
procedure btnBackupClick(Sender: TObject);
procedure btnOtherClick(Sender: TObject);
procedure miExportToAnythingClick(Sender: TObject);
procedure miImportFromAnythingClick(Sender: TObject);
procedure GenericSomethingChanged(Sender: TObject);
@ -249,11 +267,11 @@ uses
//DC
{$IFDEF MSWINDOWS}
uTotalCommander,
dmHelpManager, uOSUtils, uTotalCommander,
{$ENDIF}
uFileProcs, uDebug, DCOSUtils, uShowMsg, DCClassesUtf8, fOptions,
DCStrUtils, uGlobs, uLng, uOSForms, uDCUtils, uPixMapManager,
uKASToolItemsExtended, fMain, uSpecialDir;
fEditSearch, fMainCommandsDlg, uFileProcs, uDebug, DCOSUtils, uShowMsg,
DCClassesUtf8, fOptions, DCStrUtils, uGlobs, uLng, uOSForms, uDCUtils,
uPixMapManager, uKASToolItemsExtended, fMain, uSpecialDir;
const
cHotKeyCommand = 'cm_ExecuteToolbarItem';
@ -405,7 +423,8 @@ begin
FUpdatingIconText := True;
edtIconFileName.Text := NormalItem.Icon;
FUpdatingIconText := False;
edtToolTip.Text := NormalItem.Hint;
edtToolTip.Text:=StringReplace(NormalItem.Hint, #$0A, '\n', [rfReplaceAll]);
ShortcutsHint := NormalItem.GetShortcutsHint;
if ShortcutsHint = '' then
lblHotkeyValue.Caption := rsOptHotkeysNoHotkey
@ -468,8 +487,11 @@ begin
btnRelativeIconFileName.Visible := EnableNormal;
lblToolTip.Visible := EnableNormal;
edtToolTip.Visible := EnableNormal;
btnSuggestionTooltip.Visible := EnableNormal;
lblInternalCommand.Visible := EnableCommand;
cbInternalCommand.Visible := EnableCommand;
btnOpenCmdDlg.Visible := EnableCommand;
lblHelpOnInternalCommand.Visible := EnableCommand;
lblInternalParameters.Visible := EnableCommand;
edtInternalParameters.Visible := EnableCommand;
lblExternalCommand.Visible := EnableProgram;
@ -626,7 +648,7 @@ begin
begin
NormalItem := TKASNormalItem(ToolItem);
NormalItem.Icon := edtIconFileName.Text;
NormalItem.Hint := edtToolTip.Text;
NormalItem.Hint := StringReplace(edtToolTip.Text, '\n', #$0A, [rfReplaceAll]);
NormalItem.Text := EmptyStr;
end;
if ToolItem is TKASCommandItem then
@ -651,6 +673,29 @@ begin
pmInsertButtonMenu.PopUp(Mouse.CursorPos.X, Mouse.CursorPos.Y);
end;
{ TfrmOptionsToolbar.btnOpenCmdDlgClick }
procedure TfrmOptionsToolbar.btnOpenCmdDlgClick(Sender: TObject);
var
WantedCommand:UTF8String;
IndexMaybe:longint;
begin
if cbInternalCommand.ItemIndex=-1 then
begin
cbInternalCommand.ItemIndex:=0;
cbInternalCommandSelect(cbInternalCommand);
end;
if ShowMainCommandDlgForm(cbInternalCommand.Items.Strings[cbInternalCommand.ItemIndex],WantedCommand) then
begin
IndexMaybe:=cbInternalCommand.Items.IndexOf(WantedCommand);
if IndexMaybe<>-1 then
begin
cbInternalCommand.ItemIndex:=IndexMaybe;
cbInternalCommandSelect(cbInternalCommand);
end;
end;
end;
procedure TfrmOptionsToolbar.miInsertButtonClick(Sender: TObject);
var
ToolBar: TKASToolBar;
@ -700,6 +745,118 @@ begin
FCurrentButton := ToolBar.InsertButton(IndexWhereToAdd, ToolItem);
end;
PressButtonDown(FCurrentButton);
//Let's speed up process if we can pre-open requester according to what was just inserted as new button
with Sender as TComponent do
begin
case ((tag shr 4) and $0F) of
2: btnOpenCmdDlgClick(btnOpenCmdDlg);
3: btnOpenFileClick(btnOpenFile);
end;
end;
end;
end;
{ TfrmOptionsToolbar.miSrcRplClick }
procedure TfrmOptionsToolbar.miSrcRplClick(Sender: TObject);
const
SaRMASK_ICON = $01;
SaRMASK_COMMAND = $02;
SaRMASK_PARAMS = $04;
SaRMASK_STARTPATH = $08;
var
ActionDispatcher, NbOfReplacement:integer;
sSearchText, sReplaceText:string;
ReplaceFlags: TReplaceFlags;
function ReplaceIfNecessary(sWorkingText:string):string;
begin
result := StringReplace(sWorkingText, sSearchText, sReplaceText, ReplaceFlags);
if result<>sWorkingText then inc(NbOfReplacement);
end;
procedure PossiblyRecursiveSearchAndReplaceInThisButton(ToolItem: TKASToolItem);
var
IndexItem, IndexParam: integer;
begin
if ToolItem is TKASSeparatorItem then
begin
end;
if ToolItem is TKASCommandItem then
begin
if (ActionDispatcher AND SaRMASK_ICON) <> 0 then TKASCommandItem(ToolItem).Icon:=ReplaceIfNecessary(TKASCommandItem(ToolItem).Icon);
if (ActionDispatcher AND SaRMASK_PARAMS) <> 0 then
for IndexParam:=0 to pred(length(TKASCommandItem(ToolItem).Params)) do
TKASCommandItem(ToolItem).Params[IndexParam]:=ReplaceIfNecessary(TKASCommandItem(ToolItem).Params[IndexParam]);
end;
if ToolItem is TKASProgramItem then
begin
if (ActionDispatcher AND SaRMASK_ICON) <> 0 then TKASProgramItem(ToolItem).Icon:=ReplaceIfNecessary(TKASProgramItem(ToolItem).Icon);
if (ActionDispatcher AND SaRMASK_COMMAND) <> 0 then TKASProgramItem(ToolItem).Command:=ReplaceIfNecessary(TKASProgramItem(ToolItem).Command);
if (ActionDispatcher AND SaRMASK_STARTPATH) <> 0 then TKASProgramItem(ToolItem).StartPath:=ReplaceIfNecessary(TKASProgramItem(ToolItem).StartPath);
if (ActionDispatcher AND SaRMASK_PARAMS) <> 0 then TKASProgramItem(ToolItem).Params:=ReplaceIfNecessary(TKASProgramItem(ToolItem).Params);
end;
if ToolItem is TKASMenuItem then
begin
if (ActionDispatcher AND SaRMASK_ICON) <> 0 then TKASMenuItem(ToolItem).Icon:=ReplaceIfNecessary(TKASMenuItem(ToolItem).Icon);
for IndexItem := 0 to pred(TKASMenuItem(ToolItem).SubItems.Count) do
PossiblyRecursiveSearchAndReplaceInThisButton(TKASMenuItem(ToolItem).SubItems[IndexItem]);
end;
end;
var
//Placed intentionnally *AFTER* above routine to make sure these variable names are not used in above possibly recursive routines.
IndexButton: integer;
Toolbar: TKASToolbar;
EditSearchOptionToOffer,EditSearchOptionReturned:TEditSearchDialogOption;
begin
with Sender as TComponent do ActionDispatcher:=tag;
ApplyEditControls;
Application.ProcessMessages;
if ((ActionDispatcher AND SaRMASK_ICON) <>0) AND (edtIconFileName.Visible) AND (edtIconFileName.Text<>'') then sSearchText:=edtIconFileName.Text else
if ((ActionDispatcher AND SaRMASK_COMMAND) <>0) AND (edtExternalCommand.Visible) AND (edtExternalCommand.Text<>'') then sSearchText:=edtExternalCommand.Text else
if ((ActionDispatcher AND SaRMASK_PARAMS) <>0) AND (edtExternalParameters.Visible) AND (edtExternalParameters.Text<>'') then sSearchText:=edtExternalParameters.Text else
if ((ActionDispatcher AND SaRMASK_STARTPATH) <>0) AND (edtStartPath.Visible) AND (edtStartPath.Text<>'') then sSearchText:=edtStartPath.Text else
if ((ActionDispatcher AND SaRMASK_PARAMS) <>0) AND (edtInternalParameters.Visible) AND (edtInternalParameters.Lines.Count>0) then sSearchText:=edtInternalParameters.Lines.Strings[0] else
sSearchText:='';
sReplaceText:=sSearchText;
EditSearchOptionToOffer:=[];
{$IFDEF MSWINDOWS}
EditSearchOptionToOffer:=EditSearchOptionToOffer+[eswoCaseSensitiveUnchecked];
{$ELSE}
EditSearchOptionToOffer:=EditSearchOptionToOffer+[eswoCaseSensitiveChecked];
{$ENDIF}
if GetSimpleSearchAndReplaceString(self, EditSearchOptionToOffer, sSearchText, sReplaceText, EditSearchOptionReturned, glsSearchPathHistory, glsReplacePathHistory) then
begin
NbOfReplacement:=0;
ReplaceFlags:=[rfReplaceAll];
if eswoCaseSensitiveUnchecked in EditSearchOptionReturned then ReplaceFlags := ReplaceFlags + [rfIgnoreCase];
Toolbar := GetTopToolbar;
//Let's scan the current bar!
for IndexButton := 0 to pred(Toolbar.ButtonCount) do
begin
PossiblyRecursiveSearchAndReplaceInThisButton(Toolbar.Buttons[IndexButton].ToolItem);
ToolBar.UpdateIcon(Toolbar.Buttons[IndexButton]);
end;
if NbOfReplacement=0 then
begin
msgOk(rsZeroReplacement);
end
else
begin
if ToolBar.ButtonCount > 0 then
PressButtonDown(ToolBar.Buttons[0]);
msgOk(format(rsXReplacements,[NbOfReplacement]));
end;
end;
end;
@ -870,13 +1027,55 @@ begin
edtStartPath.Text:=MaybeResultingOutputPath;
end;
{ TfrmOptionsToolbar.btnSuggestionTooltipClick }
procedure TfrmOptionsToolbar.btnSuggestionTooltipClick(Sender: TObject);
var
sSuggestion, sWorkingString : string;
iLineIndex, pOriginalSuggestion : integer;
begin
sSuggestion:=EmptyStr;
case rgToolItemType.ItemIndex of
1: //Internal command: Idea is to keep the existing one for the single first line, then add systematically the parameters.
begin
sWorkingString:=edtToolTip.Text;
pOriginalSuggestion:=pos('\n',edtToolTip.Text);
if pOriginalSuggestion<>0 then
sSuggestion:=leftstr(edtToolTip.Text,pred(pOriginalSuggestion))+'\n----'
else
sSuggestion:=edtToolTip.Text+'\n----';
if edtInternalParameters.Lines.Count>0 then
begin
for iLineIndex:=0 to pred(edtInternalParameters.Lines.Count) do
sSuggestion:=sSuggestion+'\n'+edtInternalParameters.Lines.Strings[iLineIndex];
end;
end;
2://External command: Idea is to keep the existing one for the first line, then add systematically command, parameters and start path, one per line.
begin
sWorkingString:=edtToolTip.Text;
pOriginalSuggestion:=pos(('\n----\n'+StringReplace(lblExternalCommand.Caption, '&', '', [rfReplaceAll])),edtToolTip.Text);
if pOriginalSuggestion<>0 then
sSuggestion:=leftstr(edtToolTip.Text,pred(pOriginalSuggestion))+'\n----\n'
else
sSuggestion:=edtToolTip.Text+'\n----\n';
sSuggestion:=sSuggestion+StringReplace(lblExternalCommand.Caption, '&', '', [rfReplaceAll])+' '+edtExternalCommand.Text;
if edtExternalParameters.Text<>EmptyStr then sSuggestion:=sSuggestion+'\n'+StringReplace(lblExternalParameters.Caption, '&', '', [rfReplaceAll])+' '+edtExternalParameters.Text;
if edtStartPath.Text<>EmptyStr then sSuggestion:=sSuggestion+'\n'+StringReplace(lblStartPath.Caption, '&', '', [rfReplaceAll])+' '+edtStartPath.Text;
end;
end;
if sSuggestion<>EmptyStr then edtToolTip.Text:=sSuggestion;
end;
procedure TfrmOptionsToolbar.cbInternalCommandSelect(Sender: TObject);
var
Command: String;
begin
Command := cbInternalCommand.Items[cbInternalCommand.ItemIndex];
edtToolTip.Text := FFormCommands.GetCommandCaption(Command, cctLong);
edtInternalParameters.HelpKeyword := '/cmds.html#' + Command;
edtIconFileName.Text := UTF8LowerCase(Command);
end;
@ -923,6 +1122,11 @@ begin
UpdateIcon(edtIconFileName.Text);
end;
procedure TfrmOptionsToolbar.lblHelpOnInternalCommandClick(Sender: TObject);
begin
ShowHelpForKeywordWithAnchor('\cmds.html#' + cbInternalCommand.Text);
end;
class function TfrmOptionsToolbar.FindHotkey(NormalItem: TKASNormalItem; Hotkeys: THotkeys): THotkey;
var
i: Integer;
@ -1174,7 +1378,7 @@ end;
procedure TfrmOptionsToolbar.FrameEnter(Sender: TObject);
begin
//Tricky pass to don't have the "pnlEditToolbar" being continously resized depending on the button task we're going through.
//The idea is to have system arrange for the "CommandItem", which is the taller size one, then froze size there and keep this way.
//The idea is to have system arrange for the "CommandItem", which is the taller size one, then freeze size there and keep this way.
if bFirstTimeDrawn then
begin
bFirstTimeDrawn := False;
@ -1221,7 +1425,7 @@ end;
// give the same CRC32 but odds are very good that it will be a different one.
function TfrmOptionsToolbar.ComputeToolbarsSignature: dword;
const
CONSTFORTOOLITEM: array[1..4] of dword = ($2335, $28DE, $1971, $0805);
CONSTFORTOOLITEM: array[1..4] of byte = ($23, $35, $28, $DE);
procedure RecursiveGetSignature(ToolItem: TKASToolItem; var Result: dword);
var
@ -1281,21 +1485,79 @@ begin
end;
{ TfrmOptionsToolbar.btnExportClick }
procedure TfrmOptionsToolbar.btnExportClick(Sender: TObject);
procedure TfrmOptionsToolbar.btnOtherClick(Sender: TObject);
begin
pmExportToolbar.PopUp(Mouse.CursorPos.X, Mouse.CursorPos.Y);
pmOtherClickToolbar.PopUp(Mouse.CursorPos.X, Mouse.CursorPos.Y);
end;
{ TfrmOptionsToolbar.btnImportClick }
procedure TfrmOptionsToolbar.btnImportClick(Sender: TObject);
begin
pmImportToolbar.PopUp(Mouse.CursorPos.X, Mouse.CursorPos.Y);
end;
{ TfrmOptionsToolbar.miImportAllDCCommandsClick }
procedure TfrmOptionsToolbar.miAddAllCmdsClick(Sender: TObject);
var
IndexCommand: integer;
FlagCategoryTitle:boolean;
sCmdName,sHintName,sHotKey,sCategory:string;
ToolBar: TKASToolBar;
CategorySubToolBar: TKASToolBar = nil;
LocalKASMenuItem: TKASMenuItem;
ListCommands: TStringList;
SubToolItem: TKASToolItem = nil;
{ TfrmOptionsToolbar.btnBackupClick }
procedure TfrmOptionsToolbar.btnBackupClick(Sender: TObject);
begin
pmBackupToolbar.PopUp(Mouse.CursorPos.X, Mouse.CursorPos.Y);
ListCommands := TStringList.Create;
try
FFormCommands.GetCommandsListForACommandCategory(ListCommands, '('+rsSimpleWordAll+')', csLegacy);
FCurrentButton := nil;
ToolBar := GetTopToolbar;
CloseToolbarsBelowCurrentButton;
if FCurrentButton <> nil then
FCurrentButton.Down := False;
LocalKASMenuItem := TKASMenuItem.Create;
LocalKASMenuItem.Icon := 'cm_doanycmcommand';
LocalKASMenuItem.Hint := 'All DC internal commands';
FCurrentButton := ToolBar.AddButton(LocalKASMenuItem);
Toolbar := AddNewSubToolbar(LocalKASMenuItem);
PressButtonDown(FCurrentButton);
Toolbar.RemoveButton(0); //Remove the default added button by the "AddNewSubToolbar" routine.
for IndexCommand:=0 to pred(ListCommands.Count) do
begin
FFormCommands.ExtractCommandFields(ListCommands.Strings[IndexCommand],sCategory,sCmdName,sHintName,sHotKey,FlagCategoryTitle);
if FlagCategoryTitle=FALSE then
begin
SubToolItem := TKASCommandItem.Create(FFormCommands);
TKASCommandItem(SubToolItem).Command := sCmdName;
TKASCommandItem(SubToolItem).Hint := sHintName;
TKASCommandItem(SubToolItem).Icon := UTF8LowerCase(TKASCommandItem(SubToolItem).Command);
FCurrentButton := CategorySubToolBar.AddButton(SubToolItem);
end
else
begin
if CategorySubToolBar<>nil then
begin
FCurrentButton:=Toolbar.Buttons[pred(Toolbar.ButtonCount)];
CloseToolbarsBelowCurrentButton;
end;
LocalKASMenuItem := TKASMenuItem.Create;
LocalKASMenuItem.Hint := sCmdName;
//Let's take icon of first command of the category for the subtoolbar icon for this "new" category
FFormCommands.ExtractCommandFields(ListCommands.Strings[IndexCommand+1],sCategory,sCmdName,sHintName,sHotKey,FlagCategoryTitle);
LocalKASMenuItem.Icon := UTF8LowerCase(sCmdName);
FCurrentButton := ToolBar.AddButton(LocalKASMenuItem);
CategorySubToolBar := AddNewSubToolbar(LocalKASMenuItem);
PressButtonDown(FCurrentButton);
CategorySubToolBar.RemoveButton(0); //Remove the default added button by the "AddNewSubToolbar" routine.
end;
end;
//To give the impression of complete addition, let's finish by selecting last command added.
FCurrentButton:=CategorySubToolBar.Buttons[pred(CategorySubToolBar.ButtonCount)];
PressButtonDown(FCurrentButton);
finally
ListCommands.Free;
end;
end;
{ TfrmOptionsToolbar.miExportToAnythingClick }
@ -1334,7 +1596,7 @@ begin
ACTION_WITH_DC_TOOLBARFILE:
begin
SaveDialog.DefaultExt := '*.toolbar';
SaveDialog.FilterIndex := 2;
SaveDialog.FilterIndex := 1;
SaveDialog.Title := rsMsgDCToolbarWhereToSave;
SaveDialog.FileName := 'New DC Toolbar filename';
FlagKeepGoing := SaveDialog.Execute;
@ -1363,7 +1625,7 @@ begin
ACTION_WITH_TC_TOOLBARFILE:
begin
SaveDialog.DefaultExt := '*.BAR';
SaveDialog.FilterIndex := 1;
SaveDialog.FilterIndex := 2;
SaveDialog.Title := rsMsgTCToolbarWhereToSave;
SaveDialog.FileName := 'New TC Toolbar filename';
SaveDialog.InitialDir := ExcludeTrailingPathDelimiter(gTotalCommanderToolbarPath);
@ -1455,7 +1717,7 @@ begin
if areWeInSituationToPlayWithTCFiles then
begin
OpenDialog.DefaultExt := '*.BAR';
OpenDialog.FilterIndex := 1;
OpenDialog.FilterIndex := 3;
OpenDialog.Title := rsMsgToolbarLocateTCToolbarFile;
ImportedToolbarHint := rsDefaultImportedTCToolbarHint;
FlagKeepGoing := OpenDialog.Execute;
@ -1466,7 +1728,7 @@ begin
ACTION_WITH_DC_TOOLBARFILE:
begin
OpenDialog.DefaultExt := '*.toolbar';
OpenDialog.FilterIndex := 2;
OpenDialog.FilterIndex := 1;
OpenDialog.Title := rsMsgToolbarLocateDCToolbarFile;
ImportedToolbarHint := rsDefaultImportedDCToolbarHint;
FlagKeepGoing := OpenDialog.Execute;
@ -1477,10 +1739,10 @@ begin
BackupPath := IncludeTrailingPathDelimiter(mbExpandFileName(EnvVarConfigPath)) + 'Backup';
if mbForceDirectory(BackupPath) then
begin
OpenDialog.FilterIndex := 2;
OpenDialog.DefaultExt := '*.toolbar';
OpenDialog.FilterIndex := 1;
OpenDialog.InitialDir := ExcludeTrailingPathDelimiter(BackupPath);
OpenDialog.Title := rsMsgToolbarRestoreWhat;
OpenDialog.Filter := 'Backup_*.toolbar';
ImportedToolbarHint := rsDefaultImportedDCToolbarHint;
FlagKeepGoing := OpenDialog.Execute;
end;
@ -1586,5 +1848,4 @@ begin
FModificationTookPlace := True;
end;
end.

View file

@ -6,7 +6,6 @@ object frmQuickSearch: TfrmQuickSearch
AutoSize = True
ClientHeight = 43
ClientWidth = 436
LCLVersion = '1.0.1.3'
OnExit = FrameExit
TabOrder = 0
DesignLeft = 134
@ -16,10 +15,10 @@ object frmQuickSearch: TfrmQuickSearch
AnchorSideTop.Control = Owner
AnchorSideRight.Control = tglFilter
Left = 2
Height = 29
Height = 23
Hint = 'Enter text to search for or filter by'
Top = 2
Width = 192
Width = 211
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Around = 2
OnChange = edtSearchChange
@ -33,11 +32,11 @@ object frmQuickSearch: TfrmQuickSearch
AnchorSideRight.Control = pnlOptions
AnchorSideBottom.Control = edtSearch
AnchorSideBottom.Side = asrBottom
Left = 196
Height = 29
Left = 215
Height = 23
Hint = 'Toggle between search or filter'
Top = 2
Width = 64
Width = 46
Anchors = [akTop, akRight, akBottom]
AutoSize = True
BorderSpacing.Right = 2
@ -54,11 +53,11 @@ object frmQuickSearch: TfrmQuickSearch
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = edtSearch
AnchorSideBottom.Side = asrBottom
Left = 398
Height = 29
Left = 399
Height = 23
Hint = 'Close filter panel'
Top = 2
Width = 34
Width = 33
Anchors = [akTop, akRight, akBottom]
AutoSize = True
BorderSpacing.Right = 4
@ -75,15 +74,15 @@ object frmQuickSearch: TfrmQuickSearch
AnchorSideRight.Control = btnCancel
AnchorSideBottom.Control = edtSearch
AnchorSideBottom.Side = asrBottom
Left = 262
Height = 29
Left = 263
Height = 23
Top = 2
Width = 132
Anchors = [akTop, akRight, akBottom]
AutoSize = True
BorderSpacing.Right = 4
BevelOuter = bvNone
ClientHeight = 29
ClientHeight = 23
ClientWidth = 132
TabOrder = 2
object sbMatchBeginning: TSpeedButton
@ -93,12 +92,11 @@ object frmQuickSearch: TfrmQuickSearch
Left = 0
Height = 24
Hint = 'Match Beginning'
Top = 2
Top = -1
Width = 24
AllowAllUp = True
Caption = '{'
GroupIndex = 1
NumGlyphs = 0
OnClick = sbMatchBeginningClick
ShowHint = True
ParentShowHint = False
@ -112,14 +110,13 @@ object frmQuickSearch: TfrmQuickSearch
Left = 26
Height = 24
Hint = 'Match Ending'
Top = 2
Top = -1
Width = 24
AllowAllUp = True
Anchors = [akTop, akLeft, akBottom]
BorderSpacing.Left = 2
Caption = '}'
GroupIndex = 2
NumGlyphs = 0
OnClick = sbMatchEndingClick
ShowHint = True
ParentShowHint = False
@ -133,14 +130,13 @@ object frmQuickSearch: TfrmQuickSearch
Left = 54
Height = 24
Hint = 'Case Sensitive'
Top = 2
Top = -1
Width = 24
AllowAllUp = True
Anchors = [akTop, akLeft, akBottom]
BorderSpacing.Left = 4
Caption = 'Aa'
GroupIndex = 3
NumGlyphs = 0
OnClick = sbCaseSensitiveClick
ShowHint = True
ParentShowHint = False
@ -154,14 +150,13 @@ object frmQuickSearch: TfrmQuickSearch
Left = 82
Height = 24
Hint = 'Files'
Top = 2
Top = -1
Width = 24
AllowAllUp = True
Anchors = [akTop, akLeft, akBottom]
BorderSpacing.Left = 4
Caption = 'F'
GroupIndex = 4
NumGlyphs = 0
OnClick = sbFilesAndDirectoriesClick
ShowHint = True
ParentShowHint = False
@ -175,14 +170,13 @@ object frmQuickSearch: TfrmQuickSearch
Left = 108
Height = 24
Hint = 'Directories'
Top = 2
Top = -1
Width = 24
AllowAllUp = True
Anchors = [akTop, akLeft, akBottom]
BorderSpacing.Left = 2
Caption = 'D'
GroupIndex = 5
NumGlyphs = 0
OnClick = sbFilesAndDirectoriesClick
ShowHint = True
ParentShowHint = False

View file

@ -9,19 +9,23 @@ uses
ExtCtrls, Buttons;
type
TQuickSearchMode = (qsSearch, qsFilter);
TQuickSearchMode = (qsSearch, qsFilter, qsNone);
TQuickSearchDirection = (qsdNone, qsdFirst, qsdLast, qsdNext, qsdPrevious);
TQuickSearchMatch = (qsmBeginning, qsmEnding);
TQuickSearchCase = (qscSensitive, qscInsensitive);
TQuickSearchItems = (qsiFiles, qsiDirectories, qsiFilesAndDirectories);
TQuickSearchCancelMode = (qscmNode, qscmAtLeastOneThenCancelIfNoFound, qscmCancelIfNoFound);
TQuickSearchOptions = record
Match: set of TQuickSearchMatch;
SearchCase: TQuickSearchCase;
Items: TQuickSearchItems;
Direction: TQuickSearchDirection;
LastSearchMode: TQuickSearchMode;
CancelSearchMode: TQuickSearchCancelMode;
end;
TOnChangeSearch = procedure(Sender: TObject; ASearchText: UTF8String; const ASearchOptions: TQuickSearchOptions; Direction: TQuickSearchDirection = qsdNone) of Object;
TOnChangeSearch = procedure(Sender: TObject; ASearchText: UTF8String; const ASearchOptions: TQuickSearchOptions) of Object;
TOnChangeFilter = procedure(Sender: TObject; AFilterText: UTF8String; const AFilterOptions: TQuickSearchOptions) of Object;
TOnExecute = procedure(Sender: TObject) of Object;
TOnHide = procedure(Sender: TObject) of Object;
@ -70,7 +74,7 @@ type
procedure PopFilter;
procedure ClearFilter;
procedure CancelFilter;
procedure ProcessParams(const Params: array of String);
procedure ProcessParams(const SearchMode: TQuickSearchMode; const Params: array of String);
public
OnChangeSearch: TOnChangeSearch;
OnChangeFilter: TOnChangeFilter;
@ -101,6 +105,7 @@ const
Parameters:
"filter" - set filtering (on/off/toggle)
"search" - set searching (on/off/cycle)
"matchbeginning" - set match beginning option (on/off/toggle)
"matchending" - set match ending option (on/off/toggle)
"casesensitive" - set case sensitive searching (on/off/toggle)
@ -110,9 +115,12 @@ const
"text"="<...>" - set <...> as new text to search/filter (string)
'toggle' switches between on and off
'cycle' goto to next, next, next and so one
}
// parameters for quick search / filter actions
PARAMETER_FILTER = 'filter';
PARAMETER_SEARCH = 'search';
PARAMETER_DIRECTION = 'direction';
PARAMETER_MATCH_BEGINNING = 'matchbeginning';
PARAMETER_MATCH_ENDING = 'matchending';
PARAMETER_CASE_SENSITIVE = 'casesensitive';
@ -122,6 +130,10 @@ const
PARAMETER_TEXT = 'text';
TOGGLE_VALUE = 'toggle';
CYCLE_VALUE = 'cycle';
FIRST_VALUE = 'first';
LAST_VALUE = 'last';
NEXT_VALUE = 'next';
{$R *.lfm}
@ -157,6 +169,7 @@ begin
// load default options
Options := gQuickSearchOptions;
Options.LastSearchMode := qsNone;
LoadControlStates;
FilterOptions := gQuickSearchOptions;
@ -180,6 +193,7 @@ begin
FNeedsChangeSearch := True
else
begin
Options.LastSearchMode:=Self.Mode;
case Self.Mode of
qsSearch:
if Assigned(Self.OnChangeSearch) then
@ -194,8 +208,6 @@ end;
procedure TfrmQuickSearch.Execute(SearchMode: TQuickSearchMode; const Params: array of String; Char: TUTF8Char = #0);
begin
tglFilter.Checked := SearchMode = qsFilter;
Self.Visible := True;
if not edtSearch.Focused then
@ -210,28 +222,78 @@ begin
Self.Active := True;
ProcessParams(Params);
ProcessParams(SearchMode, Params);
end;
procedure TfrmQuickSearch.Finalize;
begin
PopFilter;
Self.Visible := False;
Options.LastSearchMode := qsNone;
Options.Direction := qsdNone;
Options.CancelSearchMode:=qscmNode;
end;
procedure TfrmQuickSearch.ProcessParams(const Params: array of String);
{ TfrmQuickSearch.ProcessParams }
procedure TfrmQuickSearch.ProcessParams(const SearchMode: TQuickSearchMode; const Params: array of String);
var
Param: String;
Value: String;
bWeGotMainParam: boolean = False;
bLegacyBehavior: boolean = False;
begin
BeginUpdate;
try
Options.Direction:=qsdNone;
for Param in Params do
begin
if GetParamValue(Param, PARAMETER_FILTER, Value) then
if (SearchMode=qsFilter) AND (GetParamValue(Param, PARAMETER_FILTER, Value)) then
begin
if (Value <> TOGGLE_VALUE) then
tglFilter.Checked := GetBoolState(Value, tglFilter.Checked)
else
tglFilter.Checked := (not tglFilter.Checked) OR (Options.LastSearchMode<>qsFilter); //With "toggle", if mode was not previously, we activate filter mode.
bWeGotMainParam := True;
end
else if (SearchMode=qsSearch) AND (GetParamValue(Param, PARAMETER_FILTER, Value)) then //Legacy
begin
tglFilter.Checked := GetBoolState(Value, tglFilter.Checked);
bWeGotMainParam := True;
bLegacyBehavior:= True;
end
else if (SearchMode=qsSearch) AND (GetParamValue(Param, PARAMETER_SEARCH, Value)) then
begin
if (Value <> CYCLE_VALUE) then
begin
Options.CancelSearchMode:=qscmNode;
if (Value <> TOGGLE_VALUE) then
tglFilter.Checked := not (GetBoolState(Value, tglFilter.Checked))
else
tglFilter.Checked := not((tglFilter.Checked) OR (Options.LastSearchMode<>qsSearch)); //With "toggle", if mode was not previously, we activate search mode.
end
else
begin
tglFilter.Checked:=FALSE;
if Options.LastSearchMode<>qsSearch then
begin
Options.Direction:=qsdFirst; //With "cycle", if mode was not previously, we activate search mode AND do to first item
Options.CancelSearchMode:=qscmAtLeastOneThenCancelIfNoFound;
end
else
begin
Options.Direction:=qsdNext;
Options.CancelSearchMode:=qscmCancelIfNoFound;
end;
end;
bWeGotMainParam := True;
end
else if (SearchMode=qsSearch) AND GetParamValue(Param, PARAMETER_DIRECTION, Value) then
begin
if Value = FIRST_VALUE then Options.Direction:=qsdFirst;
if Value = LAST_VALUE then Options.Direction:=qsdLast;
if Value = NEXT_VALUE then Options.Direction:=qsdNext;
end
else if GetParamValue(Param, PARAMETER_MATCH_BEGINNING, Value) then
begin
@ -286,6 +348,20 @@ begin
CheckFilesOrDirectoriesDown;
//If search or filter was called with no parameter...
case SearchMode of
qsSearch: if not bWeGotMainParam then tglFilter.Checked:=False;
qsFilter: if not bWeGotMainParam then tglFilter.Checked:=True;
end;
if not bLegacyBehavior then
begin
case SearchMode of
qsSearch: if tglFilter.Checked then CancelFilter;
qsFilter: if not tglFilter.Checked then CancelFilter;
end;
end;
finally
EndUpdate;
end;
@ -473,7 +549,10 @@ begin
Key := 0;
if Assigned(Self.OnChangeSearch) then
Self.OnChangeSearch(Self, edtSearch.Text, Options, qsdNext);
begin
Options.Direction:=qsdNext;
Self.OnChangeSearch(Self, edtSearch.Text, Options);
end;
end;
VK_UP:
@ -481,7 +560,10 @@ begin
Key := 0;
if Assigned(Self.OnChangeSearch) then
Self.OnChangeSearch(Self, edtSearch.Text, Options, qsdPrevious);
begin
Options.Direction:=qsdPrevious;
Self.OnChangeSearch(Self, edtSearch.Text, Options);
end;
end;
(* // disabled as they can conflict with trying to get to start/end position
@ -491,7 +573,10 @@ begin
Key := 0;
if Assigned(Self.OnChangeSearch) then
Self.OnChangeSearch(Self, edtSearch.Text, Options, qsdFirst);
begin
Options := qsdFirst;
Self.OnChangeSearch(Self, edtSearch.Text, Options);
end;
end;
VK_END:
@ -499,7 +584,10 @@ begin
Key := 0;
if Assigned(Self.OnChangeSearch) then
Self.OnChangeSearch(Self, edtSearch.Text, Options, qsdLast);
begin
Options := qsdLast;
Self.OnChangeSearch(Self, edtSearch.Text, Options);
end;
end;
*)
VK_RETURN, VK_SELECT:
@ -559,6 +647,7 @@ begin
Finalizing := False;
end;
end;
procedure TfrmQuickSearch.sbCaseSensitiveClick(Sender: TObject);
@ -568,6 +657,8 @@ begin
else
Options.SearchCase := qscInsensitive;
if gQuickFilterSaveSessionModifications then gQuickSearchOptions.SearchCase := Options.SearchCase;
DoOnChangeSearch;
end;
@ -585,6 +676,8 @@ begin
Exit;
end;
if gQuickFilterSaveSessionModifications then gQuickSearchOptions.Items := Options.Items;
DoOnChangeSearch;
end;
@ -595,6 +688,8 @@ begin
else
Exclude(Options.Match, qsmBeginning);
if gQuickFilterSaveSessionModifications then gQuickSearchOptions.Match := Options.Match;
DoOnChangeSearch;
end;
@ -605,18 +700,21 @@ begin
else
Exclude(Options.Match, qsmEnding);
if gQuickFilterSaveSessionModifications then gQuickSearchOptions.Match := Options.Match;
DoOnChangeSearch;
end;
procedure TfrmQuickSearch.tglFilterChange(Sender: TObject);
begin
Options.LastSearchMode := qsNone;
if tglFilter.Checked then
Mode := qsFilter
else
Mode := qsSearch;
// if a filter was set in background and a search is opened, the filter
// will get pushed staying active. Otherwise the filter wil be converted
// will get pushed staying active. Otherwise the filter will be converted
// in a search
if not Active and (Mode = qsSearch) then
PushFilter

View file

@ -803,13 +803,11 @@ var
Enum: IEnumFormatEtc;
DragAndDropSupportedFormatList:TStringList;
UnusedInteger : integer;
FlagTempFiletoDelete:boolean;
begin
DragAndDropSupportedFormatList:=TStringList.Create;
try
FileNames:=nil;
FlagTempFiletoDelete:=FALSE;
UnusedInteger:=0;
dataObj._AddRef;
@ -882,18 +880,13 @@ begin
begin
case ChosenFormat.CfFormat of
CF_HDROP: FileNames := GetDropFilenames(Medium.hGlobal);
CF_UNICODETEXT, CF_TEXT:
begin
FileNames := GetDropTextCreatedFilenames(Medium, ChosenFormat);
FlagTempFiletoDelete:=(Filenames.Count>0);
end;
CF_UNICODETEXT, CF_TEXT: FileNames := GetDropTextCreatedFilenames(Medium, ChosenFormat);
else
begin
if ChosenFormat.CfFormat=CFU_FILEGROUPDESCRIPTORW then FileNames := GetDropFileGroupFilenames(dataObj, Medium, ChosenFormat);
if ChosenFormat.CfFormat=CFU_FILEGROUPDESCRIPTOR then FileNames := GetDropFileGroupFilenames(dataObj, Medium, ChosenFormat);
if ChosenFormat.CfFormat=CFU_HTML then FileNames := GetDropTextCreatedFilenames(Medium, ChosenFormat);
if ChosenFormat.CfFormat=CFU_RICHTEXT then FileNames := GetDropTextCreatedFilenames(Medium, ChosenFormat);
FlagTempFiletoDelete:=(Filenames.Count>0);
end;
end;
end;
@ -918,11 +911,7 @@ begin
// Set default effect by examining keyboard keys, taking into
// consideration effects allowed by the source (dwEffect parameter).
dwEffect := dwEffect and GetEffectByKeyState(grfKeyState);
if FlagTempFiletoDelete then
DropEffect := DropMoveEffect
else
DropEffect := WinEffectToDropEffect(dwEffect);
DropEffect := WinEffectToDropEffect(dwEffect);
FDragDropTarget.GetDropEvent()(DropInfo.Files, DropEffect, pt);
dwEffect := DropEffectToWinEffect(DropEffect);

View file

@ -74,7 +74,7 @@ type
{ TfromWhatBitmapWasLoaded }
//Used to indicate from where the icon was loaded from.
//Useful when exporting to TC for example which cannot used "as is" the same icon file in some circumstances.
TfromWhatBitmapWasLoaded = (fwbwlNotLoaded, fwbwlIconThemeBitmap, fwbwlResourceFileExtracted, fwbwlGraphicFileGTK2, fwbwlGraphicFileOtherGTK2, fwbwlGraphicFileNotSupportedByTC, fwbwlFileIconByExtension, fwbwlFiDefaultIconID);
TfromWhatBitmapWasLoaded = (fwbwlNotLoaded, fwbwlIconThemeBitmap, fwbwlResourceFileExtracted, fwbwlGraphicFile, fwbwlGraphicFileNotSupportedByTC, fwbwlFileIconByExtension, fwbwlFiDefaultIconID);
PTfromWhatBitmapWasLoaded = ^TfromWhatBitmapWasLoaded;
{ TPixMapManager }
@ -419,11 +419,32 @@ end;
{ TPixMapManager }
{ TPixMapManager.LoadBitmapFromFile }
function TPixMapManager.LoadBitmapFromFile(AIconFileName: String; out ABitmap: Graphics.TBitmap): Boolean;
var
{$IFDEF LCLGTK2}
pbPicture : PGdkPixbuf;
{$ELSE}
Picture: TPicture;
{$ENDIF}
begin
Result:= False;
{$IFDEF LCLGTK2}
pbPicture := gdk_pixbuf_new_from_file(PChar(AIconFileName), nil);
if pbPicture <> nil then
begin
ABitmap := PixBufToBitmap(pbPicture);
gdk_pixmap_unref(pbPicture);
// if unsupported BitsPerPixel then exit
if ABitmap.RawImage.Description.BitsPerPixel > 32 then
raise EInvalidGraphic.Create('Unsupported bits per pixel');
Result:= True;
end;
{$ELSE}
Picture := TPicture.Create;
try
ABitmap := Graphics.TBitmap.Create;
@ -447,6 +468,7 @@ begin
finally
FreeAndNil(Picture);
end;
{$ENDIF}
end;
function TPixMapManager.LoadBitmapEnhanced(sFileName : String; iIconSize : Integer; Stretch: Boolean; clBackColor : TColor; fromWhatItWasLoaded:PTfromWhatBitmapWasLoaded) : Graphics.TBitmap;
@ -466,9 +488,6 @@ var
sExtFilter,
sGraphicFilter : String;
bmStandartBitmap : Graphics.TBitMap = nil;
{$IFDEF LCLGTK2}
pbPicture : PGdkPixbuf;
{$ENDIF}
begin
Result := nil;
if fromWhatItWasLoaded<> nil then fromWhatItWasLoaded^ := fwbwlNotLoaded;
@ -521,19 +540,8 @@ begin
// if file is graphic
if (Length(sExtFilter) > 1) and (Pos(sExtFilter, sGraphicFilter) <> 0) and mbFileExists(sFileName) then
begin
{$IFDEF LCLGTK2}
pbPicture := gdk_pixbuf_new_from_file(PChar(sFileName), nil);
if pbPicture <> nil then
begin
bmStandartBitmap:= PixBufToBitmap(pbPicture);
if fromWhatItWasLoaded<> nil then fromWhatItWasLoaded^ := fwbwlGraphicFileGTK2;
gdk_pixmap_unref(pbPicture);
end
else // Try loading the standard way.
{$ELSE}
LoadBitmapFromFile(sFileName, bmStandartBitmap);
if fromWhatItWasLoaded<> nil then fromWhatItWasLoaded^ := fwbwlGraphicFileOtherGTK2;
{$ENDIF}
LoadBitmapFromFile(sFileName, bmStandartBitmap);
if fromWhatItWasLoaded<> nil then fromWhatItWasLoaded^ := fwbwlGraphicFile;
end;
end;
@ -580,6 +588,7 @@ begin
DCDebug(Format('Warning: pixmap [%s] not exists!',[AIconName]));
Exit(nil);
end;
LoadBitmapFromFile(AIconName, Result);
end;
@ -2015,4 +2024,4 @@ finalization
end;
end.

View file

@ -96,30 +96,30 @@ const
COMMANDS_LIST_TC: array[1..NUMBEROFCOMMANDS] of TTCommandEquivalence =
(
(TCCommand: 'cm_SrcComments'; TCIcon: 21; DCCommand: ''), //Source: Show comments
(TCCommand: 'cm_SrcShort'; TCIcon: 3; DCCommand: 'cm_briefview'), //Source: Only file names
(TCCommand: 'cm_SrcLong'; TCIcon: 4; DCCommand: 'cm_columnsview'), //Source: All file details
(TCCommand: 'cm_SrcShort'; TCIcon: 3; DCCommand: 'cm_BriefView'), //Source: Only file names
(TCCommand: 'cm_SrcLong'; TCIcon: 4; DCCommand: 'cm_ColumnsView'), //Source: All file details
(TCCommand: 'cm_SrcTree'; TCIcon: 2; DCCommand: ''), //Source: Directory tree
(TCCommand: 'cm_SrcQuickview'; TCIcon: 22; DCCommand: 'cm_quickview'), //Source: Quick view panel
(TCCommand: 'cm_VerticalPanels'; TCIcon: 23; DCCommand: ''), //File windows above each other
(TCCommand: 'cm_SrcQuickview'; TCIcon: 22; DCCommand: 'cm_QuickView'), //Source: Quick view panel
(TCCommand: 'cm_VerticalPanels'; TCIcon: 23; DCCommand: 'cm_HorizontalFilePanels'), //File windows above each other
(TCCommand: 'cm_SrcQuickInternalOnly'; TCIcon: 22; DCCommand: ''), //Source: Quick view, no plugins
(TCCommand: 'cm_SrcHideQuickview'; TCIcon: 22; DCCommand: ''), //Source: Quick view panel off
(TCCommand: 'cm_SrcExecs'; TCIcon: 12; DCCommand: ''), //Source: Only programs
(TCCommand: 'cm_SrcAllFiles'; TCIcon: 13; DCCommand: ''), //Source: All files
(TCCommand: 'cm_SrcUserSpec'; TCIcon: 24; DCCommand: ''), //Source: Last selected
(TCCommand: 'cm_SrcUserDef'; TCIcon: 25; DCCommand: ''), //Source: Select user type
(TCCommand: 'cm_SrcByName'; TCIcon: 5; DCCommand: 'cm_sortbyname'), //Source: Sort by name
(TCCommand: 'cm_SrcByExt'; TCIcon: 6; DCCommand: 'cm_sortbyext'), //Source: Sort by extension
(TCCommand: 'cm_SrcBySize'; TCIcon: 8; DCCommand: 'cm_sortbysize'), //Source: Sort by size
(TCCommand: 'cm_SrcByDateTime'; TCIcon: 7; DCCommand: 'cm_sortbydate'), //Source: Sort by date
(TCCommand: 'cm_SrcByName'; TCIcon: 5; DCCommand: 'cm_SortByName'), //Source: Sort by name
(TCCommand: 'cm_SrcByExt'; TCIcon: 6; DCCommand: 'cm_SortByExt'), //Source: Sort by extension
(TCCommand: 'cm_SrcBySize'; TCIcon: 8; DCCommand: 'cm_SortBySize'), //Source: Sort by size
(TCCommand: 'cm_SrcByDateTime'; TCIcon: 7; DCCommand: 'cm_SortByDate'), //Source: Sort by date
(TCCommand: 'cm_SrcUnsorted'; TCIcon: 9; DCCommand: ''), //Source: Unsorted
(TCCommand: 'cm_SrcNegOrder'; TCIcon: 10; DCCommand: ''), //Source: Reversed order
(TCCommand: 'cm_SrcOpenDrives'; TCIcon: -1; DCCommand: ''), //Source: Open drive list
(TCCommand: 'cm_SrcThumbs'; TCIcon: 26; DCCommand: 'cm_thumbnailsview'), //Source: Thumbnail view
(TCCommand: 'cm_SrcNegOrder'; TCIcon: 10; DCCommand: 'cm_ReverseOrder'), //Source: Reversed order
(TCCommand: 'cm_SrcOpenDrives'; TCIcon: -1; DCCommand: 'cm_SrcOpenDrives'), //Source: Open drive list
(TCCommand: 'cm_SrcThumbs'; TCIcon: 26; DCCommand: 'cm_ThumbnailsView'), //Source: Thumbnail view
(TCCommand: 'cm_SrcCustomViewMenu'; TCIcon: 52; DCCommand: ''), //Source: Custom view menu
(TCCommand: 'cm_SrcPathFocus'; TCIcon: -1; DCCommand: ''), //Source: Put focus on path
(TCCommand: 'cm_LeftComments'; TCIcon: 21; DCCommand: ''), //Left: Show comments
(TCCommand: 'cm_LeftShort'; TCIcon: 3; DCCommand: 'cm_briefview'), //Left: Only file names
(TCCommand: 'cm_LeftLong'; TCIcon: 4; DCCommand: ''), //Left: All file details
(TCCommand: 'cm_LeftShort'; TCIcon: 3; DCCommand: 'cm_LeftBriefView'), //Left: Only file names
(TCCommand: 'cm_LeftLong'; TCIcon: 4; DCCommand: 'cm_LeftColumnsView'), //Left: All file details
(TCCommand: 'cm_LeftTree'; TCIcon: 2; DCCommand: ''), //Left: Directory tree
(TCCommand: 'cm_LeftQuickview'; TCIcon: 22; DCCommand: ''), //Left: Quick view panel
(TCCommand: 'cm_LeftQuickInternalOnly'; TCIcon: 22; DCCommand: ''), //Left: Quick view, no plugins
@ -128,21 +128,21 @@ const
(TCCommand: 'cm_LeftAllFiles'; TCIcon: 13; DCCommand: ''), //Left: All files
(TCCommand: 'cm_LeftUserSpec'; TCIcon: 24; DCCommand: ''), //Left: Last selected
(TCCommand: 'cm_LeftUserDef'; TCIcon: 25; DCCommand: ''), //Left: Select user type
(TCCommand: 'cm_LeftByName'; TCIcon: 5; DCCommand: ''), //Left: Sort by name
(TCCommand: 'cm_LeftByExt'; TCIcon: 6; DCCommand: ''), //Left: Sort by extension
(TCCommand: 'cm_LeftBySize'; TCIcon: 8; DCCommand: ''), //Left: Sort by size
(TCCommand: 'cm_LeftByDateTime'; TCIcon: 7; DCCommand: ''), //Left: Sort by date
(TCCommand: 'cm_LeftByName'; TCIcon: 5; DCCommand: 'cm_LeftSortByName'), //Left: Sort by name
(TCCommand: 'cm_LeftByExt'; TCIcon: 6; DCCommand: 'cm_LeftSortByExt'), //Left: Sort by extension
(TCCommand: 'cm_LeftBySize'; TCIcon: 8; DCCommand: 'cm_LeftSortBySize'), //Left: Sort by size
(TCCommand: 'cm_LeftByDateTime'; TCIcon: 7; DCCommand: 'cm_LeftSortByDate'), //Left: Sort by date
(TCCommand: 'cm_LeftUnsorted'; TCIcon: 9; DCCommand: ''), //Left: Unsorted
(TCCommand: 'cm_LeftNegOrder'; TCIcon: 10; DCCommand: ''), //Left: Reversed order
(TCCommand: 'cm_LeftOpenDrives'; TCIcon: -1; DCCommand: 'cm_leftopendrives'), //Left: Open drive list
(TCCommand: 'cm_LeftNegOrder'; TCIcon: 10; DCCommand: 'cm_LeftReverseOrder'), //Left: Reversed order
(TCCommand: 'cm_LeftOpenDrives'; TCIcon: -1; DCCommand: 'cm_LeftOpenDrives'), //Left: Open drive list
(TCCommand: 'cm_LeftPathFocus'; TCIcon: -1; DCCommand: ''), //Left: Put focus on path
(TCCommand: 'cm_LeftDirBranch'; TCIcon: 50; DCCommand: ''), //Left: Branch view
(TCCommand: 'cm_LeftDirBranch'; TCIcon: 50; DCCommand: 'cm_LeftFlatView'), //Left: Branch view
(TCCommand: 'cm_LeftDirBranchSel'; TCIcon: 50; DCCommand: ''), //Left: branch view, only selected
(TCCommand: 'cm_LeftThumbs'; TCIcon: 26; DCCommand: ''), //Left: Thumbnail view
(TCCommand: 'cm_LeftThumbs'; TCIcon: 26; DCCommand: 'cm_LeftThumbView'), //Left: Thumbnail view
(TCCommand: 'cm_LeftCustomViewMenu'; TCIcon: 52; DCCommand: ''), //Left: Custom view menu
(TCCommand: 'cm_RightComments'; TCIcon: 21; DCCommand: ''), //Right: Show comments
(TCCommand: 'cm_RightShort'; TCIcon: 3; DCCommand: 'cm_briefview'), //Right: Only file names
(TCCommand: 'cm_RightLong'; TCIcon: 4; DCCommand: ''), //Right: All file details
(TCCommand: 'cm_RightShort'; TCIcon: 3; DCCommand: 'cm_RightBriefView'), //Right: Only file names
(TCCommand: 'cm_RightLong'; TCIcon: 4; DCCommand: 'cm_RightColumnsView'), //Right: All file details
(TCCommand: 'cm_RightTree'; TCIcon: 2; DCCommand: ''), //Right: Directory tree
(TCCommand: 'cm_RightQuickview'; TCIcon: 22; DCCommand: ''), //Right: Quick view panel
(TCCommand: 'cm_RightQuickInternalOnly'; TCIcon: 22; DCCommand: ''), //Right: Quick view, no plugins
@ -152,43 +152,43 @@ const
(TCCommand: 'cm_RightUserSpec'; TCIcon: 24; DCCommand: ''), //Right: Last selected
(TCCommand: 'cm_RightUserDef'; TCIcon: 25; DCCommand: ''), //Right: Select user type
(TCCommand: 'cm_RightByName'; TCIcon: 5; DCCommand: ''), //Right: Sort by name
(TCCommand: 'cm_RightByExt'; TCIcon: 6; DCCommand: ''), //Right: Sort by extension
(TCCommand: 'cm_RightBySize'; TCIcon: 8; DCCommand: ''), //Right: Sort by size
(TCCommand: 'cm_RightByDateTime'; TCIcon: 7; DCCommand: ''), //Right: Sort by date
(TCCommand: 'cm_RightUnsorted'; TCIcon: 9; DCCommand: ''), //Right: Unsorted
(TCCommand: 'cm_RightNegOrder'; TCIcon: 10; DCCommand: ''), //Right: Reversed order
(TCCommand: 'cm_RightOpenDrives'; TCIcon: -1; DCCommand: 'cm_rightopendrives'), //Right: Open drive list
(TCCommand: 'cm_RightByExt'; TCIcon: 6; DCCommand: 'cm_RightSortByName'), //Right: Sort by extension
(TCCommand: 'cm_RightBySize'; TCIcon: 8; DCCommand: 'cm_RightSortByExt'), //Right: Sort by size
(TCCommand: 'cm_RightByDateTime'; TCIcon: 7; DCCommand: 'cm_RightSortBySize'), //Right: Sort by date
(TCCommand: 'cm_RightUnsorted'; TCIcon: 9; DCCommand: 'cm_RightSortByDate'), //Right: Unsorted
(TCCommand: 'cm_RightNegOrder'; TCIcon: 10; DCCommand: 'cm_RightReverseOrder'), //Right: Reversed order
(TCCommand: 'cm_RightOpenDrives'; TCIcon: -1; DCCommand: 'cm_RightOpenDrives'), //Right: Open drive list
(TCCommand: 'cm_RightPathFocus'; TCIcon: -1; DCCommand: ''), //Right: Put focus on path
(TCCommand: 'cm_RightDirBranch'; TCIcon: 50; DCCommand: ''), //Right: branch view
(TCCommand: 'cm_RightDirBranch'; TCIcon: 50; DCCommand: 'cm_RightFlatView'), //Right: branch view
(TCCommand: 'cm_RightDirBranchSel'; TCIcon: 50; DCCommand: ''), //Right: branch view, only selected
(TCCommand: 'cm_RightThumbs'; TCIcon: 26; DCCommand: ''), //Right: Thumbnail view
(TCCommand: 'cm_RightThumbs'; TCIcon: 26; DCCommand: 'cm_RightThumbView'), //Right: Thumbnail view
(TCCommand: 'cm_RightCustomViewMenu'; TCIcon: 52; DCCommand: ''), //Right: Custom view menu
(TCCommand: 'cm_List'; TCIcon: 27; DCCommand: 'cm_view'), //View with Lister
(TCCommand: 'cm_List'; TCIcon: 27; DCCommand: 'cm_View'), //View with Lister
(TCCommand: 'cm_ListInternalOnly'; TCIcon: 27; DCCommand: 'cm_view'), //Lister without plugins/multimedia
(TCCommand: 'cm_Edit'; TCIcon: 28; DCCommand: 'cm_edit'), //Edit (Notepad)
(TCCommand: 'cm_Copy'; TCIcon: 62; DCCommand: 'cm_copy'), //Copy files
(TCCommand: 'cm_CopySamepanel'; TCIcon: 62; DCCommand: 'cm_copysamepanel'), //Copy within panel
(TCCommand: 'cm_Edit'; TCIcon: 28; DCCommand: 'cm_Edit'), //Edit (Notepad)
(TCCommand: 'cm_Copy'; TCIcon: 62; DCCommand: 'cm_Copy'), //Copy files
(TCCommand: 'cm_CopySamepanel'; TCIcon: 62; DCCommand: 'cm_CopySamePanel'), //Copy within panel
(TCCommand: 'cm_CopyOtherpanel'; TCIcon: 62; DCCommand: ''), //Copy to other
(TCCommand: 'cm_RenMov'; TCIcon: 63; DCCommand: 'cm_rename'), //Rename/Move files
(TCCommand: 'cm_MkDir'; TCIcon: 29; DCCommand: 'cm_makedir'), //Make directory
(TCCommand: 'cm_Delete'; TCIcon: 64; DCCommand: 'cm_delete'), //Delete files
(TCCommand: 'cm_TestArchive'; TCIcon: 60; DCCommand: 'cm_testarchive'), //Test selected archives
(TCCommand: 'cm_PackFiles'; TCIcon: 30; DCCommand: 'cm_packfiles'), //Pack files
(TCCommand: 'cm_UnpackFiles'; TCIcon: 31; DCCommand: 'cm_extractfiles'), //Unpack all
(TCCommand: 'cm_RenameOnly'; TCIcon: 32; DCCommand: 'cm_renameonly'), //Rename (Shift+F6)
(TCCommand: 'cm_RenMov'; TCIcon: 63; DCCommand: 'cm_Rename'), //Rename/Move files
(TCCommand: 'cm_MkDir'; TCIcon: 29; DCCommand: 'cm_MakeDir'), //Make directory
(TCCommand: 'cm_Delete'; TCIcon: 64; DCCommand: 'cm_Delete'), //Delete files
(TCCommand: 'cm_TestArchive'; TCIcon: 60; DCCommand: 'cm_TestArchive'), //Test selected archives
(TCCommand: 'cm_PackFiles'; TCIcon: 30; DCCommand: 'cm_PackFiles'), //Pack files
(TCCommand: 'cm_UnpackFiles'; TCIcon: 31; DCCommand: 'cm_ExtractFiles'), //Unpack all
(TCCommand: 'cm_RenameOnly'; TCIcon: 32; DCCommand: 'cm_RenameOnly'), //Rename (Shift+F6)
(TCCommand: 'cm_RenameSingleFile'; TCIcon: 32; DCCommand: ''), //Rename file under cursor
(TCCommand: 'cm_MoveOnly'; TCIcon: 63; DCCommand: ''), //Move (F6)
(TCCommand: 'cm_Properties'; TCIcon: -1; DCCommand: 'cm_fileproperties'), //Properties dialog
(TCCommand: 'cm_Properties'; TCIcon: -1; DCCommand: 'cm_FileProperties'), //Properties dialog
(TCCommand: 'cm_CreateShortcut'; TCIcon: 65; DCCommand: ''), //Create a shortcut
(TCCommand: 'cm_Return'; TCIcon: -1; DCCommand: 'cm_open'), //Simulate: Return pressed
(TCCommand: 'cm_Return'; TCIcon: -1; DCCommand: 'cm_Open'), //Simulate: Return pressed
(TCCommand: 'cm_OpenAsUser'; TCIcon: -1; DCCommand: ''), //Open program under cursor as different user
(TCCommand: 'cm_Split'; TCIcon: 68; DCCommand: 'cm_filespliter'), //Split file into pieces
(TCCommand: 'cm_Combine'; TCIcon: 69; DCCommand: 'cm_filelinker'), //Combine partial files
(TCCommand: 'cm_Split'; TCIcon: 68; DCCommand: 'cm_FileSpliter'), //Split file into pieces
(TCCommand: 'cm_Combine'; TCIcon: 69; DCCommand: 'cm_FileLinker'), //Combine partial files
(TCCommand: 'cm_Encode'; TCIcon: 66; DCCommand: ''), //Encode MIME/UUE/XXE
(TCCommand: 'cm_Decode'; TCIcon: 67; DCCommand: ''), //Decode MIME/UUE/XXE/BinHex
(TCCommand: 'cm_CRCcreate'; TCIcon: -1; DCCommand: 'cm_checksumcalc'), //Create CRC checksums
(TCCommand: 'cm_CRCcheck'; TCIcon: 61; DCCommand: 'cm_checksumverify'), //Verify CRC checksums
(TCCommand: 'cm_SetAttrib'; TCIcon: 33; DCCommand: 'cm_setfileproperties'), //Change attributes
(TCCommand: 'cm_CRCcreate'; TCIcon: -1; DCCommand: 'cm_CheckSumCalc'), //Create CRC checksums
(TCCommand: 'cm_CRCcheck'; TCIcon: 61; DCCommand: 'cm_CheckSumVerify'), //Verify CRC checksums
(TCCommand: 'cm_SetAttrib'; TCIcon: 33; DCCommand: 'cm_SetFileProperties'), //Change attributes
(TCCommand: 'cm_Config'; TCIcon: 34; DCCommand: 'cm_Options'), //Conf: Layout (first page)
(TCCommand: 'cm_DisplayConfig'; TCIcon: 34; DCCommand: ''), //Conf: Display
(TCCommand: 'cm_IconConfig'; TCIcon: 34; DCCommand: ''), //Conf: Icons
@ -213,38 +213,38 @@ const
(TCCommand: 'cm_ZipPackerConfig'; TCIcon: 34; DCCommand: ''), //Conf: ZIP packer
(TCCommand: 'cm_Confirmation'; TCIcon: 34; DCCommand: ''), //Conf: Misc, Confirmation
(TCCommand: 'cm_ConfigSavePos'; TCIcon: -1; DCCommand: ''), //Conf: Save position
(TCCommand: 'cm_ButtonConfig'; TCIcon: 14; DCCommand: 'cm_configtoolbars'), //Conf: Button bar
(TCCommand: 'cm_ButtonConfig'; TCIcon: 14; DCCommand: 'cm_ConfigToolbars'), //Conf: Button bar
(TCCommand: 'cm_ConfigSaveSettings'; TCIcon: -1; DCCommand: ''), //Save current paths etc.
(TCCommand: 'cm_ConfigChangeIniFiles'; TCIcon: -1; DCCommand: ''), //Open ini files in notepad
(TCCommand: 'cm_ConfigSaveDirHistory'; TCIcon: -1; DCCommand: ''), //Save directory history
(TCCommand: 'cm_ChangeStartMenu'; TCIcon: 34; DCCommand: ''), //Change Start menu
(TCCommand: 'cm_NetConnect'; TCIcon: 53; DCCommand: 'cm_networkconnect'), //Network connections
(TCCommand: 'cm_NetDisconnect'; TCIcon: 54; DCCommand: 'cm_networkdisconnect'), //Disconnect network drives
(TCCommand: 'cm_NetConnect'; TCIcon: 53; DCCommand: 'cm_NetworkConnect'), //Network connections
(TCCommand: 'cm_NetDisconnect'; TCIcon: 54; DCCommand: 'cm_NetworkDisconnect'), //Disconnect network drives
(TCCommand: 'cm_NetShareDir'; TCIcon: -1; DCCommand: ''), //Share directory
(TCCommand: 'cm_NetUnshareDir'; TCIcon: -1; DCCommand: ''), //Unshare directory
(TCCommand: 'cm_AdministerServer'; TCIcon: -1; DCCommand: ''), //Connect to admin share to open \\server\c$ etc.
(TCCommand: 'cm_ShowFileUser'; TCIcon: -1; DCCommand: ''), //Which remote user has opened a local file
(TCCommand: 'cm_GetFileSpace'; TCIcon: -1; DCCommand: 'cm_calculatespace'), //Calculate space
(TCCommand: 'cm_GetFileSpace'; TCIcon: -1; DCCommand: 'cm_CalculateSpace'), //Calculate space
(TCCommand: 'cm_VolumeId'; TCIcon: -1; DCCommand: ''), //Volume label
(TCCommand: 'cm_VersionInfo'; TCIcon: -1; DCCommand: ''), //Version information
(TCCommand: 'cm_ExecuteDOS'; TCIcon: -1; DCCommand: 'cm_runterm'), //Open command prompt window
(TCCommand: 'cm_CompareDirs'; TCIcon: 35; DCCommand: 'cm_comparedirectories'), //Compare dirs
(TCCommand: 'cm_CompareDirsWithSubdirs'; TCIcon: 35; DCCommand: 'cm_comparedirectories'), //Also mark subdirs not present in other dir
(TCCommand: 'cm_ContextMenu'; TCIcon: -1; DCCommand: 'cm_contextmenu'), //Show context menu
(TCCommand: 'cm_ExecuteDOS'; TCIcon: -1; DCCommand: 'cm_RunTerm'), //Open command prompt window
(TCCommand: 'cm_CompareDirs'; TCIcon: 35; DCCommand: 'cm_CompareDirectories'), //Compare dirs
(TCCommand: 'cm_CompareDirsWithSubdirs'; TCIcon: 35; DCCommand: 'cm_CompareDirectories'), //Also mark subdirs not present in other dir
(TCCommand: 'cm_ContextMenu'; TCIcon: -1; DCCommand: 'cm_ContextMenu'), //Show context menu
(TCCommand: 'cm_ContextMenuInternal'; TCIcon: -1; DCCommand: ''), //Show context menu for internal associations
(TCCommand: 'cm_ContextMenuInternalCursor'; TCIcon: -1; DCCommand: ''), //Internal context menu for file under cursor
(TCCommand: 'cm_ShowRemoteMenu'; TCIcon: -1; DCCommand: ''), //Context menu for Media Center remote control Play/Pause
(TCCommand: 'cm_SyncChangeDir'; TCIcon: 75; DCCommand: ''), //Synchronous directory changing in both windows
(TCCommand: 'cm_EditComment'; TCIcon: -1; DCCommand: 'cm_editcomment'), //Edit file comment
(TCCommand: 'cm_EditComment'; TCIcon: -1; DCCommand: 'cm_EditComment'), //Edit file comment
(TCCommand: 'cm_FocusLeft'; TCIcon: -1; DCCommand: ''), //Focus on left file list
(TCCommand: 'cm_FocusRight'; TCIcon: -1; DCCommand: ''), //Focus on right file list
(TCCommand: 'cm_FocusCmdLine'; TCIcon: -1; DCCommand: 'cm_focuscmdline'), //Focus on command line
(TCCommand: 'cm_FocusCmdLine'; TCIcon: -1; DCCommand: 'cm_FocusCmdLine'), //Focus on command line
(TCCommand: 'cm_FocusButtonBar'; TCIcon: -1; DCCommand: ''), //Focus on button bar
(TCCommand: 'cm_CountDirContent'; TCIcon: 36; DCCommand: 'cm_countdircontent'), //Calculate space occupied by subdirs in current dir
(TCCommand: 'cm_CountDirContent'; TCIcon: 36; DCCommand: 'cm_CountDirContent'), //Calculate space occupied by subdirs in current dir
(TCCommand: 'cm_UnloadPlugins'; TCIcon: -1; DCCommand: ''), //Unload all plugins
(TCCommand: 'cm_DirMatch'; TCIcon: 35; DCCommand: ''), //Mark newer
(TCCommand: 'cm_Exchange'; TCIcon: 37; DCCommand: 'cm_exchange'), //Swap panels
(TCCommand: 'cm_MatchSrc'; TCIcon: 86; DCCommand: 'cm_targetequalsource'), //target=Source
(TCCommand: 'cm_Exchange'; TCIcon: 37; DCCommand: 'cm_Exchange'), //Swap panels
(TCCommand: 'cm_MatchSrc'; TCIcon: 86; DCCommand: 'cm_TargetEqualSource'), //target=Source
(TCCommand: 'cm_ReloadSelThumbs'; TCIcon: -1; DCCommand: ''), //Re-load selected thumbnails
(TCCommand: 'cm_DirectCableConnect'; TCIcon: -1; DCCommand: ''), //Connect to other PC by cable
(TCCommand: 'cm_NTinstallDriver'; TCIcon: -1; DCCommand: ''), //Install parallel port driver on NT
@ -252,57 +252,57 @@ const
(TCCommand: 'cm_PrintDir'; TCIcon: 38; DCCommand: ''), //Print current directory (with preview)
(TCCommand: 'cm_PrintDirSub'; TCIcon: 38; DCCommand: ''), //Print dir with subdirs
(TCCommand: 'cm_PrintFile'; TCIcon: 38; DCCommand: ''), //Print file
(TCCommand: 'cm_SpreadSelection'; TCIcon: 39; DCCommand: 'cm_markplus'), //Select group
(TCCommand: 'cm_SpreadSelection'; TCIcon: 39; DCCommand: 'cm_MarkPlus'), //Select group
(TCCommand: 'cm_SelectBoth'; TCIcon: 72; DCCommand: ''), //Select group: files+folders
(TCCommand: 'cm_SelectFiles'; TCIcon: 70; DCCommand: ''), //Select group: just files
(TCCommand: 'cm_SelectFolders'; TCIcon: 71; DCCommand: ''), //Select group: just folders
(TCCommand: 'cm_ShrinkSelection'; TCIcon: 40; DCCommand: 'cm_markminus'), //Unselect group
(TCCommand: 'cm_ShrinkSelection'; TCIcon: 40; DCCommand: 'cm_MarkMinus'), //Unselect group
(TCCommand: 'cm_ClearFiles'; TCIcon: 40; DCCommand: ''), //Unselect group: just files
(TCCommand: 'cm_ClearFolders'; TCIcon: 40; DCCommand: ''), //Unselect group: just folders
(TCCommand: 'cm_ClearSelCfg'; TCIcon: 40; DCCommand: ''), //Unselect group (files or both, as configured)
(TCCommand: 'cm_SelectAll'; TCIcon: 44; DCCommand: 'cm_markmarkall'), //Select all (files or both, as configured)
(TCCommand: 'cm_SelectAll'; TCIcon: 44; DCCommand: 'cm_MarkMarkAll'), //Select all (files or both, as configured)
(TCCommand: 'cm_SelectAllBoth'; TCIcon: 44; DCCommand: ''), //Select both files+folders
(TCCommand: 'cm_SelectAllFiles'; TCIcon: 44; DCCommand: ''), //Select all files
(TCCommand: 'cm_SelectAllFolders'; TCIcon: 44; DCCommand: ''), //Select all folders
(TCCommand: 'cm_ClearAll'; TCIcon: -1; DCCommand: 'cm_markunmarkall'), //Unselect all (files+folders)
(TCCommand: 'cm_ClearAll'; TCIcon: -1; DCCommand: 'cm_MarkUnmarkAll'), //Unselect all (files+folders)
(TCCommand: 'cm_ClearAllFiles'; TCIcon: -1; DCCommand: ''), //Unselect all files
(TCCommand: 'cm_ClearAllFolders'; TCIcon: -1; DCCommand: ''), //Unselect all folders
(TCCommand: 'cm_ClearAllCfg'; TCIcon: -1; DCCommand: ''), //Unselect all (files or both, as configured)
(TCCommand: 'cm_ExchangeSelection'; TCIcon: 11; DCCommand: 'cm_markinvert'), //Invert selection
(TCCommand: 'cm_ExchangeSelection'; TCIcon: 11; DCCommand: 'cm_MarkInvert'), //Invert selection
(TCCommand: 'cm_ExchangeSelBoth'; TCIcon: 11; DCCommand: ''), //Invert selection (files+folders)
(TCCommand: 'cm_ExchangeSelFiles'; TCIcon: 11; DCCommand: ''), //Invert selection (files)
(TCCommand: 'cm_ExchangeSelFolders'; TCIcon: 11; DCCommand: ''), //Invert selection (folders)
(TCCommand: 'cm_SelectCurrentExtension'; TCIcon: 41; DCCommand: 'cm_markcurrentextension'), //Select all files with same ext.
(TCCommand: 'cm_UnselectCurrentExtension'; TCIcon: -1; DCCommand: 'cm_unmarkcurrentextension'), //Unselect all files with same ext.
(TCCommand: 'cm_SelectCurrentExtension'; TCIcon: 41; DCCommand: 'cm_MarkCurrentExtension'), //Select all files with same ext.
(TCCommand: 'cm_UnselectCurrentExtension'; TCIcon: -1; DCCommand: 'cm_UnmarkCurrentExtension'), //Unselect all files with same ext.
(TCCommand: 'cm_SelectCurrentName'; TCIcon: -1; DCCommand: ''), //Select all files with same name
(TCCommand: 'cm_UnselectCurrentName'; TCIcon: -1; DCCommand: ''), //Unselect all files with same name
(TCCommand: 'cm_SelectCurrentNameExt'; TCIcon: -1; DCCommand: ''), //Select all files with same name+ext.
(TCCommand: 'cm_UnselectCurrentNameExt'; TCIcon: -1; DCCommand: ''), //Unselect all files with same name+ext.
(TCCommand: 'cm_SelectCurrentPath'; TCIcon: 72; DCCommand: ''), //Select all in same path (for branch view+search)
(TCCommand: 'cm_UnselectCurrentPath'; TCIcon: -1; DCCommand: ''), //Unselect all in same path
(TCCommand: 'cm_RestoreSelection'; TCIcon: 42; DCCommand: ''), //Selection before last operation
(TCCommand: 'cm_SaveSelection'; TCIcon: 43; DCCommand: 'cm_saveselection'), //Temporarily save selection
(TCCommand: 'cm_SaveSelectionToFile'; TCIcon: -1; DCCommand: 'cm_saveselectiontofile'), //Save file selection to file
(TCCommand: 'cm_RestoreSelection'; TCIcon: 42; DCCommand: 'cm_RestoreSelection'), //Selection before last operation
(TCCommand: 'cm_SaveSelection'; TCIcon: 43; DCCommand: 'cm_SaveSelection'), //Temporarily save selection
(TCCommand: 'cm_SaveSelectionToFile'; TCIcon: -1; DCCommand: 'cm_SaveSelectionToFile'), //Save file selection to file
(TCCommand: 'cm_SaveSelectionToFileA'; TCIcon: -1; DCCommand: ''), //Save file selection to file (ANSI)
(TCCommand: 'cm_SaveSelectionToFileW'; TCIcon: -1; DCCommand: ''), //Save file selection to file (Unicode)
(TCCommand: 'cm_SaveDetailsToFile'; TCIcon: -1; DCCommand: ''), //Save all shown columns to file
(TCCommand: 'cm_SaveDetailsToFileA'; TCIcon: -1; DCCommand: ''), //Save all shown columns to file (ANSI)
(TCCommand: 'cm_SaveDetailsToFileW'; TCIcon: -1; DCCommand: ''), //Save all shown columns to file (Unicode)
(TCCommand: 'cm_LoadSelectionFromFile'; TCIcon: -1; DCCommand: 'cm_loadselectionfromfile'), //Read file selection from file
(TCCommand: 'cm_LoadSelectionFromClip'; TCIcon: -1; DCCommand: 'cm_loadselectionfromclip'), //Read file selection from clipboard
(TCCommand: 'cm_LoadSelectionFromFile'; TCIcon: -1; DCCommand: 'cm_LoadSelectionFromFile'), //Read file selection from file
(TCCommand: 'cm_LoadSelectionFromClip'; TCIcon: -1; DCCommand: 'cm_LoadSelectionFromClip'), //Read file selection from clipboard
(TCCommand: 'cm_EditPermissionInfo'; TCIcon: -1; DCCommand: ''), //Permissions dialog (NTFS)
(TCCommand: 'cm_EditPersmissionInfo'; TCIcon: -1; DCCommand: ''), //Typo...
(TCCommand: 'cm_EditAuditInfo'; TCIcon: -1; DCCommand: ''), //File auditing (NTFS)
(TCCommand: 'cm_EditOwnerInfo'; TCIcon: -1; DCCommand: ''), //Take ownership (NTFS)
(TCCommand: 'cm_CutToClipboard'; TCIcon: -1; DCCommand: 'cm_cuttoclipboard'), //Cut selected files to clipboard
(TCCommand: 'cm_CopyToClipboard'; TCIcon: -1; DCCommand: 'cm_copytoclipboard'), //Copy selected files to clipboard
(TCCommand: 'cm_PasteFromClipboard'; TCIcon: -1; DCCommand: 'cm_pastefromvlipboard'), //Paste from clipboard to current dir
(TCCommand: 'cm_CopyNamesToClip'; TCIcon: 45; DCCommand: 'cm_copynamestoclip'), //Copy filenames to clipboard
(TCCommand: 'cm_CopyFullNamesToClip'; TCIcon: 45; DCCommand: 'cm_copyfullnamestoclip'), //Copy names with full path
(TCCommand: 'cm_CutToClipboard'; TCIcon: -1; DCCommand: 'cm_CutToClipboard'), //Cut selected files to clipboard
(TCCommand: 'cm_CopyToClipboard'; TCIcon: -1; DCCommand: 'cm_CopyToClipboard'), //Copy selected files to clipboard
(TCCommand: 'cm_PasteFromClipboard'; TCIcon: -1; DCCommand: 'cm_PasteFromClipboard'), //Paste from clipboard to current dir
(TCCommand: 'cm_CopyNamesToClip'; TCIcon: 45; DCCommand: 'cm_CopyNamesToClip'), //Copy filenames to clipboard
(TCCommand: 'cm_CopyFullNamesToClip'; TCIcon: 45; DCCommand: 'cm_CopyFullNamesToClip'), //Copy names with full path
(TCCommand: 'cm_CopyNetNamesToClip'; TCIcon: 45; DCCommand: ''), //Copy names with UNC path
(TCCommand: 'cm_CopySrcPathToClip'; TCIcon: 45; DCCommand: ''), //Copy source path to clipboard
(TCCommand: 'cm_CopyTrgPathToClip'; TCIcon: 45; DCCommand: ''), //Copy target path to clipboard
(TCCommand: 'cm_CopyFileDetailsToClip'; TCIcon: 59; DCCommand: 'cm_copyfiledetailstoclip'), //Copy all shown columns
(TCCommand: 'cm_CopyFileDetailsToClip'; TCIcon: 59; DCCommand: 'cm_CopyFileDetailsToClip'), //Copy all shown columns
(TCCommand: 'cm_CopyFpFileDetailsToClip'; TCIcon: 59; DCCommand: ''), //Copy all columns, with full path
(TCCommand: 'cm_CopyNetFileDetailsToClip'; TCIcon: 59; DCCommand: ''), //Copy all columns, with UNC path
(TCCommand: 'cm_FtpConnect'; TCIcon: 16; DCCommand: ''), //Connect to FTP
@ -316,12 +316,12 @@ const
(TCCommand: 'cm_FtpDownloadList'; TCIcon: -1; DCCommand: ''), //Download files in download list
(TCCommand: 'cm_GotoPreviousDir'; TCIcon: 18; DCCommand: ''), //Go back
(TCCommand: 'cm_GotoNextDir'; TCIcon: 19; DCCommand: ''), //Go forward
(TCCommand: 'cm_DirectoryHistory'; TCIcon: -1; DCCommand: 'cm_dirhistory'), //History list
(TCCommand: 'cm_DirectoryHistory'; TCIcon: -1; DCCommand: 'cm_DirHistory'), //History list
(TCCommand: 'cm_GotoPreviousLocalDir'; TCIcon: 18; DCCommand: ''), //Go back, no ftp
(TCCommand: 'cm_GotoNextLocalDir'; TCIcon: 19; DCCommand: ''), //Go forward, no ftp
(TCCommand: 'cm_DirectoryHotlist'; TCIcon: -1; DCCommand: 'cm_dirhotlist'), //Directory popup menu
(TCCommand: 'cm_GoToRoot'; TCIcon: -1; DCCommand: 'cm_changedirtoroot'), //Go to root directory
(TCCommand: 'cm_GoToParent'; TCIcon: 15; DCCommand: 'cm_changedirtoparent'), //Go to parent directory
(TCCommand: 'cm_DirectoryHotlist'; TCIcon: -1; DCCommand: 'cm_DirHotList'), //Directory popup menu
(TCCommand: 'cm_GoToRoot'; TCIcon: -1; DCCommand: 'cm_ChangeDirToRoot'), //Go to root directory
(TCCommand: 'cm_GoToParent'; TCIcon: 15; DCCommand: 'cm_ChangeDirToParent'), //Go to parent directory
(TCCommand: 'cm_GoToDir'; TCIcon: -1; DCCommand: ''), //Open dir or zip under cursor
(TCCommand: 'cm_OpenDesktop'; TCIcon: -1; DCCommand: ''), //Desktop folder
(TCCommand: 'cm_OpenDrives'; TCIcon: -1; DCCommand: ''), //My computer
@ -331,10 +331,10 @@ const
(TCCommand: 'cm_OpenPrinters'; TCIcon: -1; DCCommand: ''), //Printers folder
(TCCommand: 'cm_OpenRecycled'; TCIcon: -1; DCCommand: ''), //Recycle bin
(TCCommand: 'cm_CDtree'; TCIcon: 1; DCCommand: ''), //Popup directory tree
(TCCommand: 'cm_TransferLeft'; TCIcon: -1; DCCommand: 'cm_transferleft'), //Transfer dir under cursor to left window
(TCCommand: 'cm_TransferRight'; TCIcon: -1; DCCommand: 'cm_transferright'), //Transfer dir under cursor to right window
(TCCommand: 'cm_EditPath'; TCIcon: -1; DCCommand: 'cm_editpath'), //Edit path field above file list
(TCCommand: 'cm_GoToFirstFile'; TCIcon: -1; DCCommand: 'cm_gotofirstfile'), //Place cursor on first file in list
(TCCommand: 'cm_TransferLeft'; TCIcon: -1; DCCommand: 'cm_TransferLeft'), //Transfer dir under cursor to left window
(TCCommand: 'cm_TransferRight'; TCIcon: -1; DCCommand: 'cm_TransferRight'), //Transfer dir under cursor to right window
(TCCommand: 'cm_EditPath'; TCIcon: -1; DCCommand: 'cm_EditPath'), //Edit path field above file list
(TCCommand: 'cm_GoToFirstFile'; TCIcon: -1; DCCommand: 'cm_GoToFirstFile'), //Place cursor on first file in list
(TCCommand: 'cm_GotoNextDrive'; TCIcon: -1; DCCommand: ''), //Go one drive up (C->D)
(TCCommand: 'cm_GotoPreviousDrive'; TCIcon: -1; DCCommand: ''), //Go one drive down
(TCCommand: 'cm_GotoNextSelected'; TCIcon: -1; DCCommand: ''), //Go to next selected file
@ -345,29 +345,29 @@ const
(TCCommand: 'cm_GotoDriveE'; TCIcon: -1; DCCommand: ''), //Switch to drive E
(TCCommand: 'cm_GotoDriveF'; TCIcon: -1; DCCommand: ''), //(etc, define your own if)
(TCCommand: 'cm_GotoDriveZ'; TCIcon: -1; DCCommand: ''), //(you need more drives)
(TCCommand: 'cm_HelpIndex'; TCIcon: 55; DCCommand: 'cm_helpindex'), //Help index
(TCCommand: 'cm_Keyboard'; TCIcon: -1; DCCommand: 'cm_keyboard'), //Keyboard help
(TCCommand: 'cm_HelpIndex'; TCIcon: 55; DCCommand: 'cm_HelpIndex'), //Help index
(TCCommand: 'cm_Keyboard'; TCIcon: -1; DCCommand: 'cm_Keyboard'), //Keyboard help
(TCCommand: 'cm_Register'; TCIcon: -1; DCCommand: ''), //Registration info
(TCCommand: 'cm_VisitHomepage'; TCIcon: -1; DCCommand: 'cm_visithomepage'), //Visit http://www.ghisler.com/
(TCCommand: 'cm_About'; TCIcon: -1; DCCommand: 'cm_about'), //Help/About Total Commander
(TCCommand: 'cm_Exit'; TCIcon: -1; DCCommand: 'cm_exit'), //Exit Total Commander
(TCCommand: 'cm_Minimize'; TCIcon: -1; DCCommand: 'cm_minimize'), //Minimize Total Commander
(TCCommand: 'cm_VisitHomepage'; TCIcon: -1; DCCommand: 'cm_VisitHomePage'), //Visit http://www.ghisler.com/
(TCCommand: 'cm_About'; TCIcon: -1; DCCommand: 'cm_About'), //Help/About Total Commander
(TCCommand: 'cm_Exit'; TCIcon: -1; DCCommand: 'cm_Exit'), //Exit Total Commander
(TCCommand: 'cm_Minimize'; TCIcon: -1; DCCommand: 'cm_Minimize'), //Minimize Total Commander
(TCCommand: 'cm_Maximize'; TCIcon: -1; DCCommand: ''), //Maximize Total Commander
(TCCommand: 'cm_Restore'; TCIcon: -1; DCCommand: ''), //Restore normal size
(TCCommand: 'cm_ClearCmdLine'; TCIcon: -1; DCCommand: ''), //Clear command line
(TCCommand: 'cm_NextCommand'; TCIcon: -1; DCCommand: 'cm_cmdlinenext'), //Next command line
(TCCommand: 'cm_PrevCommand'; TCIcon: -1; DCCommand: 'cm_cmdlineprev'), //Previous command line
(TCCommand: 'cm_AddPathToCmdline'; TCIcon: -1; DCCommand: 'cm_addpathtocmdline'), //Copy path to command line
(TCCommand: 'cm_MultiRenameFiles'; TCIcon: 46; DCCommand: 'cm_multirename'), //Rename multiple files
(TCCommand: 'cm_NextCommand'; TCIcon: -1; DCCommand: 'cm_CmdLineNext'), //Next command line
(TCCommand: 'cm_PrevCommand'; TCIcon: -1; DCCommand: 'cm_CmdLinePrev'), //Previous command line
(TCCommand: 'cm_AddPathToCmdline'; TCIcon: -1; DCCommand: 'cm_AddPathToCmdLine'), //Copy path to command line
(TCCommand: 'cm_MultiRenameFiles'; TCIcon: 46; DCCommand: 'cm_MultiRename'), //Rename multiple files
(TCCommand: 'cm_SysInfo'; TCIcon: -1; DCCommand: ''), //System information
(TCCommand: 'cm_OpenTransferManager'; TCIcon: 74; DCCommand: ''), //Background transfer manager
(TCCommand: 'cm_SearchFor'; TCIcon: 47; DCCommand: 'cm_search'), //Search for
(TCCommand: 'cm_SearchFor'; TCIcon: 47; DCCommand: 'cm_Search'), //Search for
(TCCommand: 'cm_SearchStandalone'; TCIcon: 47; DCCommand: ''), //Search in separate process
(TCCommand: 'cm_FileSync'; TCIcon: 48; DCCommand: 'cm_syncdirs'), //Synchronize directories
(TCCommand: 'cm_FileSync'; TCIcon: 48; DCCommand: 'cm_SyncDirs'), //Synchronize directories
(TCCommand: 'cm_Associate'; TCIcon: -1; DCCommand: ''), //Associate
(TCCommand: 'cm_InternalAssociate'; TCIcon: -1; DCCommand: 'cm_fileassoc'), //Define internal associations
(TCCommand: 'cm_CompareFilesByContent'; TCIcon: 49; DCCommand: 'cm_comparecontents'), //File comparison
(TCCommand: 'cm_IntCompareFilesByContent'; TCIcon: 49; DCCommand: 'cm_comparecontents'), //Use internal compare tool
(TCCommand: 'cm_InternalAssociate'; TCIcon: -1; DCCommand: 'cm_FileAssoc'), //Define internal associations
(TCCommand: 'cm_CompareFilesByContent'; TCIcon: 49; DCCommand: 'cm_CompareContents'), //File comparison
(TCCommand: 'cm_IntCompareFilesByContent'; TCIcon: 49; DCCommand: 'cm_CompareContents'), //Use internal compare tool
(TCCommand: 'cm_CommandBrowser'; TCIcon: 82; DCCommand: ''), //Browse internal commands
(TCCommand: 'cm_VisButtonbar'; TCIcon: -1; DCCommand: ''), //Show/hide button bar
(TCCommand: 'cm_VisDriveButtons'; TCIcon: -1; DCCommand: ''), //Show/hide drive button bars
@ -384,11 +384,11 @@ const
(TCCommand: 'cm_ShowHint'; TCIcon: -1; DCCommand: ''), //Show file tip window
(TCCommand: 'cm_ShowQuickSearch'; TCIcon: -1; DCCommand: ''), //Show name search window
(TCCommand: 'cm_SwitchLongNames'; TCIcon: -1; DCCommand: ''), //Turn long names on and off
(TCCommand: 'cm_RereadSource'; TCIcon: 0; DCCommand: 'cm_refresh'), //Reread source
(TCCommand: 'cm_RereadSource'; TCIcon: 0; DCCommand: 'cm_Refresh'), //Reread source
(TCCommand: 'cm_ShowOnlySelected'; TCIcon: 73; DCCommand: ''), //Hide files which aren't selected
(TCCommand: 'cm_SwitchHidSys'; TCIcon: 79; DCCommand: ''), //Turn hidden/system files on and off
(TCCommand: 'cm_SwitchHid'; TCIcon: 79; DCCommand: ''), //Turn hidden files on and off
(TCCommand: 'cm_SwitchSys'; TCIcon: 79; DCCommand: 'cm_showsysfiles'), //Turn system files on and off
(TCCommand: 'cm_SwitchSys'; TCIcon: 79; DCCommand: 'cm_ShowSysFiles'), //Turn system files on and off
(TCCommand: 'cm_Switch83Names'; TCIcon: -1; DCCommand: ''), //Turn 8.3 names lowercase on/off
(TCCommand: 'cm_SwitchDirSort'; TCIcon: -1; DCCommand: ''), //Turn directory sorting by name on/off
(TCCommand: 'cm_DirBranch'; TCIcon: 50; DCCommand: 'cm_FlatView'), //Show all files in current dir and all subdirs
@ -400,7 +400,7 @@ const
(TCCommand: 'cm_SwitchOverlayIcons'; TCIcon: -1; DCCommand: ''), //Switch icon overlays on/off
(TCCommand: 'cm_VisHistHotButtons'; TCIcon: -1; DCCommand: ''), //Show/hide dir history+hotlist
(TCCommand: 'cm_SwitchWatchDirs'; TCIcon: 80; DCCommand: ''), //Enable/disable WatchDirs auto-refresh temporarily
(TCCommand: 'cm_SwitchIgnoreList'; TCIcon: 81; DCCommand: 'cm_switchignorelist'), //Enable/disable ignore list file to not show file names
(TCCommand: 'cm_SwitchIgnoreList'; TCIcon: 81; DCCommand: 'cm_SwitchIgnoreList'), //Enable/disable ignore list file to not show file names
(TCCommand: 'cm_SwitchX64Redirection'; TCIcon: -1; DCCommand: ''), //64-bit Windows: Redirect 32-bit system32 dir off/on
(TCCommand: 'cm_SeparateTreeOff'; TCIcon: 76; DCCommand: ''), //Disable separate tree panel
(TCCommand: 'cm_SeparateTree1'; TCIcon: 77; DCCommand: ''), //One separate tree panel
@ -418,14 +418,14 @@ const
(TCCommand: 'cm_UserMenu8'; TCIcon: -1; DCCommand: ''), //You can add more
(TCCommand: 'cm_UserMenu9'; TCIcon: -1; DCCommand: ''), //custom user menu ids
(TCCommand: 'cm_UserMenu10'; TCIcon: -1; DCCommand: ''), //in totalcmd.inc!
(TCCommand: 'cm_OpenNewTab'; TCIcon: 83; DCCommand: 'cm_newtab'), //Open new tab
(TCCommand: 'cm_OpenNewTab'; TCIcon: 83; DCCommand: 'cm_NewTab'), //Open new tab
(TCCommand: 'cm_OpenNewTabBg'; TCIcon: 83; DCCommand: ''), //Open new tab in background
(TCCommand: 'cm_OpenDirInNewTab'; TCIcon: -1; DCCommand: 'cm_opendirinnewtab'), //Open dir under cursor in tab
(TCCommand: 'cm_OpenDirInNewTab'; TCIcon: -1; DCCommand: 'cm_OpenDirInNewTab'), //Open dir under cursor in tab
(TCCommand: 'cm_OpenDirInNewTabOther'; TCIcon: -1; DCCommand: ''), //Open dir under cursor (other window)
(TCCommand: 'cm_SwitchToNextTab'; TCIcon: -1; DCCommand: 'cm_nexttab'), //Switch to next Tab (as Ctrl+Tab)
(TCCommand: 'cm_SwitchToPreviousTab'; TCIcon: -1; DCCommand: 'cm_prevtab'), //Switch to previous Tab (Ctrl+Shift+Tab)
(TCCommand: 'cm_CloseCurrentTab'; TCIcon: 84; DCCommand: 'cm_closetab'), //Close tab
(TCCommand: 'cm_CloseAllTabs'; TCIcon: 85; DCCommand: 'cm_closealltabs'), //Close all
(TCCommand: 'cm_SwitchToNextTab'; TCIcon: -1; DCCommand: 'cm_NextTab'), //Switch to next Tab (as Ctrl+Tab)
(TCCommand: 'cm_SwitchToPreviousTab'; TCIcon: -1; DCCommand: 'cm_PrevTab'), //Switch to previous Tab (Ctrl+Shift+Tab)
(TCCommand: 'cm_CloseCurrentTab'; TCIcon: 84; DCCommand: 'cm_CloseTab'), //Close tab
(TCCommand: 'cm_CloseAllTabs'; TCIcon: 85; DCCommand: 'cm_CloseAllTabs'), //Close all
(TCCommand: 'cm_DirTabsShowMenu'; TCIcon: -1; DCCommand: ''), //Show tab menu
(TCCommand: 'cm_ToggleLockCurrentTab'; TCIcon: -1; DCCommand: ''), //Turn on/off tab locking
(TCCommand: 'cm_ToggleLockDcaCurrentTab'; TCIcon: -1; DCCommand: ''), //Same but with dir changes allowed
@ -557,11 +557,11 @@ const
//DC commands unmatched for the moment
//------------------------------------
//cm_AddFilenameToCmdLine
//cm_AddPathAndFilenameToCmdLine
//cm_ChangeDir
//cm_ChangeDirToHome
//cm_ClearLogFile
//cm_AddFilenameToCmdLine - Looks like TC can do it with a CTRL+ENTER but no cm_ command for this.
//cm_AddPathAndFilenameToCmdLine - Looks like TC can do it with a CTRL+SHIFT+ENTER but no cm_ command for this.
//cm_ChangeDir - Looks like TC can do it with "CD ..." bit no cm_ command for this.
//cm_ChangeDirToHome - Looks like there is no TC equivalent
//cm_ClearLogFile -
//cm_ClearLogWindow
//cm_ConfigDirHotList
//cm_CopyNoAsk
@ -569,7 +569,6 @@ const
//cm_EditNew
//cm_GoToLastFile
//cm_HardLink
//cm_HorizontalFilePanels
//cm_LeftEqualRight
//cm_LoadTabs
//cm_OpenArchive
@ -581,13 +580,12 @@ const
//cm_QuickSearch
//cm_RenameNoAsk
//cm_RenameTab
//cm_RestoreSelection
//cm_ReverseOrder
//cm_RightEqualLeft
//cm_SaveTabs
//cm_SetTabOptionNormal
//cm_SetTabOptionPathLocked
//cm_SetTabOptionPathResets
//cm_SetTabOptionDirsInNewTab
//cm_ShellExecute
//cm_ShowButtonMenu
//cm_ShowCmdLineHistory
@ -598,6 +596,7 @@ const
//cm_ViewHistory
//cm_ViewHistoryNext
//cm_ViewHistoryPrev
//cm_ViewLogFile
//cm_Wipe
//cm_WorkWithDirectoryHotlist
@ -902,9 +901,8 @@ end;
// fwbwlNotLoaded: NOT TESTED
// fwbwlIconThemeBitmap: Tested with 'cm_configdirhotlist', 'cm_dirhotlist', 'utilities-terminal', 'cm_markunmarkall', 'go-previous', 'go-next'
// fwbwlResourceFileExtracted: Tested with 'wcmicons.dll,3', 'MyOwnIcons.icl,12', 'doublecmd.exe', 'TOTALCMD64.EXE', 'HWorks32.exe'
// fwbwlGraphicFileGTK2: NOT TESTED
// fwbwlGraphicFileOtherGTK2: Test with 'UploadDispatcher.ico', 'Carlos.bmp'
// fwbwlGraphicFileOtherGTK2 switched to fwbwlGraphicFileNotSupportedByTC: Tested with 'Nop.png', 'cm_extractfiles.png', 'cm_about.png', a corrutped .png file
// fwbwlGraphicFile: Test with 'UploadDispatcher.ico', 'Carlos.bmp'
// fwbwlGraphicFile switched to fwbwlGraphicFileNotSupportedByTC: Tested with 'Nop.png', 'cm_extractfiles.png', 'cm_about.png', a corrutped .png file
// fwbwlFileIconByExtension: Tested with 'ElementaryOS-32bits.vbox', 'backupsource.bat', 'Microsoft Word 2010.lnk', a corrupted .bmp file since DC at least attenmpt to by the extension which is nice!
// fwbwlFiDefaultIconID: Tested with "a missing unknown extension file", An empty icon string,
@ -928,8 +926,7 @@ begin
fwbwlNotLoaded: needToBeConvertToIco := False;
fwbwlIconThemeBitmap: needToBeConvertToIco := True;
fwbwlResourceFileExtracted: needToBeConvertToIco := False;
fwbwlGraphicFileGTK2: needToBeConvertToIco := False;
fwbwlGraphicFileOtherGTK2: needToBeConvertToIco := False;
fwbwlGraphicFile: needToBeConvertToIco := False;
fwbwlGraphicFileNotSupportedByTC: needToBeConvertToIco := True;
fwbwlFileIconByExtension: needToBeConvertToIco := True;
fwbwlFiDefaultIconID: needToBeConvertToIco := True;
@ -1025,7 +1022,7 @@ var
procedure PossiblyRecursiveAddThisToolItemToConfigFile(ToolItem: TKASToolItem; TCBarConfigFile: TIniFileEx; TCIndexButton: integer);
var
sTCIndexButton: string;
DCIndexButton, TCInitialNumberOfButton, TCIndexOfCommand, IndexItem: integer;
TCIndexOfCommand, IndexItem: integer;
TCCommand, TCIcon: string;
InnerTCBarConfigFilename: string;
InnerTCBarConfigFile: TIniFileEx;

View file

@ -33,6 +33,8 @@ type
TCommandFuncResult = (cfrSuccess, cfrDisabled, cfrNotFound);
TCommandFunc = procedure(const Params: array of string) of object;
TCommandCaptionType = (cctShort, cctLong);
TCommandCategorySortOrder = (ccsLegacy, ccsAlphabetical);
TCommandSortOrder = (csLegacy, csAlphabetical);
(*
The commands are 'user' functions which can be assigned to toolbar
@ -79,6 +81,9 @@ type
function ExecuteCommand(Command: String; const Params: array of string): TCommandFuncResult;
function GetCommandCaption(Command: String; CaptionType: TCommandCaptionType = cctShort): String;
procedure GetCommandsList(List: TStrings);
procedure GetCommandCategoriesList(List: TStringList; CommandCategorySortOrder:TCommandCategorySortOrder);
procedure GetCommandsListForACommandCategory(List: TStringList; sCategoryName:String; CommandSortOrder: TCommandSortOrder);
procedure ExtractCommandFields(ItemInList: string; var sCategory:string; var sCommand: string; var sHint: string; var sHotKey: string; var FlagCategoryTitle: boolean);
end;
{$interfaces default}
@ -106,6 +111,7 @@ type
FFilterFunc: TCommandFilterFunc;
FInstanceObject: TObject;
FMethods: TStringHashList;
FTranslatableCommandCategory: TStringList;
class procedure GetMethodsList(Instance: TObject; MethodsList: TStringHashList; ActionList: TActionList);
@ -138,6 +144,9 @@ type
function GetCommandName(Index: Integer): String;
function GetCommandRec(Command: String): PCommandRec;
procedure GetCommandsList(List: TStrings);
procedure GetCommandCategoriesList(List: TStringList; CommandCategorySortOrder:TCommandCategorySortOrder);
procedure GetCommandsListForACommandCategory(List: TStringList; sCategoryName:String; CommandSortOrder: TCommandSortOrder);
procedure ExtractCommandFields(ItemInList: string; var sCategory: string; var sCommand: string; var sHint: string; var sHotKey: string; var FlagCategoryTitle: boolean);
class procedure GetCategoriesList(List: TStrings; Translated: TStrings);
class function GetCommandsForm(CategoryName: String): TComponentClass;
@ -165,7 +174,7 @@ type
implementation
uses
DCStrUtils;
uGlobs, uHotkeyManager, DCStrUtils, uLng;
type
TCommandsFormRec = record
@ -185,6 +194,8 @@ begin
FInstanceObject := TheOwner;
FMethods := TStringHashList.Create(False); // False = not case-sensitive
GetMethodsList(FInstanceObject, FMethods, ActionList);
FTranslatableCommandCategory:=TStringList.Create;
ParseLineToList(rsCmdCategoryListInOrder, FTranslatableCommandCategory);
end;
destructor TFormCommands.Destroy;
@ -194,6 +205,7 @@ begin
for Index := 0 to FMethods.Count - 1 do
Dispose(PCommandRec(FMethods.List[Index]^.Data));
FreeAndNil(FMethods);
FTranslatableCommandCategory.Free;
inherited;
end;
@ -287,6 +299,182 @@ begin
end;
end;
procedure TFormCommands.GetCommandCategoriesList(List: TStringList; CommandCategorySortOrder:TCommandCategorySortOrder);
var
Index: Integer;
Command, Category: String;
begin
List.Clear;
List.BeginUpdate;
try
for Index := 0 to FMethods.Count - 1 do
begin
Command := FMethods.List[Index]^.Key;
if not (Assigned(FilterFunc) and FilterFunc(Command)) then
begin
if TCommandRec(FMethods.List[Index]^.Data^).Action.GroupIndex <> 0 then
begin
case CommandCategorySortOrder of
ccsLegacy: Category:=Format('%2.2d',[TCommandRec(FMethods.List[Index]^.Data^).Action.GroupIndex])+FTranslatableCommandCategory.Strings[TCommandRec(FMethods.List[Index]^.Data^).Action.GroupIndex];
else Category:=FTranslatableCommandCategory.Strings[TCommandRec(FMethods.List[Index]^.Data^).Action.GroupIndex];
end;
if List.IndexOf(Category)=-1 then
List.Add(Category);
end;
end;
end;
List.Sort;
if CommandCategorySortOrder=ccsLegacy then
for Index:=0 to pred(List.count) do List.Strings[Index]:=RightStr(List.Strings[Index],length(List.Strings[Index])-2);
List.Insert(0,'('+rsSimpleWordAll+')');
finally
List.EndUpdate;
end;
end;
{ TFormCommands.GetCommandsListForACommandCategory }
{
Routine is in fact going through all the commands present in the main form.
They will store them into a list passed in parameter "List".
Each item of the list will be a string with information separate between pipe "|" symbol.
These info will be command name|shortcut|hint|category number.
For example: cm_ChangeDirToHome|Ctrl+Alt+H|Change directory to home|14
While building the list, if the wanted sort method is "csLegacy", each item will preceeded with category index on two digt and by command index on three digits.
This is to help to sort the element. We'll simply sort calling "TStringList.Sort" since the beginning of the string have the legacy reference order.
For example: 14106cm_ChangeDirToHome|Ctrl+Alt+H|Change directory to home|14
At the end, when exiting, these 5 digits which help to sort will simply be removed.
ALSO, the routine has the parameter "sCategoryName" to determine the command from which category should be in the list OR if all the commands from ALL the catagory must be returned.
When the commands from ALL the category are requested, category header will be inserted in the returned list.
These command will have the prefix for the command index set to '000' to make sure it appear at the beginning of the category command name.
For these category identifier, the other fields are empty so that's why pipe are following with nothing between.
Example: 14000Navigation||||
No special "class" has been created for all this. It seem simple like that.
}
procedure TFormCommands.GetCommandsListForACommandCategory(List: TStringList; sCategoryName:String; CommandSortOrder: TCommandSortOrder);
var
Index, iHotKey, iControl: Integer;
Command, Category, sHotKey, LocalHint, HeaderSortedHelper, HeaderCategorySortedHelper: String;
HMForm: THMForm;
HMControl: THMControl;
hotkey: THotkey;
begin
List.Clear;
List.BeginUpdate;
try
HeaderSortedHelper:='';
HMForm := HotMan.Forms.Find('main');
for Index := 0 to FMethods.Count - 1 do
begin
Command := FMethods.List[Index]^.Key;
if not (Assigned(FilterFunc) and FilterFunc(Command)) then
begin
Category:=FTranslatableCommandCategory.Strings[TCommandRec(FMethods.List[Index]^.Data^).Action.GroupIndex];
if (Category = sCategoryName) OR (sCategoryName=('('+rsSimpleWordAll+')')) then
begin
sHotKey := '';
iHotKey := 0;
while (iHotKey < HMForm.Hotkeys.Count) and (sHotKey = '') do
begin
hotkey := HMForm.Hotkeys[iHotKey];
if hotkey.Command = Command then
sHotKey := ShortcutsToText(hotkey.Shortcuts);
Inc(iHotKey);
end;
if sHotKey='' then
begin
iControl:=0;
while (iControl<HMForm.Controls.Count) and (sHotKey='') do
begin
HMControl := HMForm.Controls[iControl];
iHotKey:=0;
while (iHotKey < HMControl.Hotkeys.Count) and (sHotKey = '') do
begin
hotkey := HMControl.Hotkeys[iHotKey];
if hotkey.Command = Command then
sHotKey := ShortcutsToText(hotkey.Shortcuts);
Inc(iHotKey);
end;
inc(iControl);
end;
end;
if CommandSortOrder=csLegacy then
begin
HeaderSortedHelper:=Format('%2.2d',[TCommandRec(FMethods.List[Index]^.Data^).Action.GroupIndex])+
Format('%3.3d',[TCommandRec(FMethods.List[Index]^.Data^).Action.Index+1]);
if sCategoryName=('('+rsSimpleWordAll+')') then
begin
HeaderCategorySortedHelper:=Format('%2.2d',[TCommandRec(FMethods.List[Index]^.Data^).Action.GroupIndex])+'000';
if List.IndexOf(HeaderCategorySortedHelper+Category+'||||')=-1 then
List.Add(HeaderCategorySortedHelper+Category+'||||');
end;
end;
if TCommandRec(FMethods.List[Index]^.Data^).Action.Hint <> EmptyStr then
LocalHint := TCommandRec(FMethods.List[Index]^.Data^).Action.Hint
else
LocalHint := StringReplace(TCommandRec(FMethods.List[Index]^.Data^).Action.Caption, '&', '', [rfReplaceAll]);
if LocalHint<>EmptyStr then Command:=Command+'|'+sHotKey+'|'+LocalHint+'|'+Format('%2.2d',[TCommandRec(FMethods.List[Index]^.Data^).Action.GroupIndex]);
List.Add(HeaderSortedHelper+Command);
end;
end;
end;
List.Sort;
if CommandSortOrder=csLegacy then
for Index:=0 to pred(List.count) do List.Strings[Index]:=RightStr(List.Strings[Index],length(List.Strings[Index])-(2+3));
finally
List.EndUpdate;
end;
end;
procedure TFormCommands.ExtractCommandFields(ItemInList: string; var sCategory: string; var sCommand: string; var sHint: string; var sHotKey: string; var FlagCategoryTitle: boolean);
var
PosPipe: longint;
sWorkingString: String;
begin
FlagCategoryTitle := False;
sCommand := '';
sHint := '';
sHotKey := '';
sCategory := '';
PosPipe := Pos('|', ItemInList);
if PosPipe <> 0 then
begin
if pos('||||', ItemInList) = 0 then
begin
sCommand := Copy(ItemInList, 1, pred(PosPipe));
sWorkingString := RightStr(ItemInList, length(ItemInList) - PosPipe);
PosPipe := pos('|', sWorkingString);
if PosPipe <> 0 then
begin
sHotKey := copy(sWorkingString, 1, pred(PosPipe));
sWorkingString := rightStr(sWorkingString, length(sWorkingString) - PosPipe);
PosPipe := pos('|', sWorkingString);
if PosPipe <> 0 then
begin
sHint := copy(sWorkingString, 1, pred(PosPipe));
sCategory := rightStr(sWorkingString, length(sWorkingString) - PosPipe);
sCategory := FTranslatableCommandCategory.Strings[StrToIntDef(sCategory,0)];
end;
end;
end
else
begin
sCommand := Copy(ItemInList, 1, pred(PosPipe));
FlagCategoryTitle := True;
end;
end;
end;
class procedure TFormCommands.GetMethodsList(Instance: TObject; MethodsList: TStringHashList; ActionList: TActionList);
type
pmethodnamerec = ^tmethodnamerec;

View file

@ -105,7 +105,7 @@ type
const
{ Default hotkey list version number }
hkVersion = 20;
hkVersion = 21;
// Previously existing names if reused must check for ConfigVersion >= X.
// History:
@ -212,7 +212,9 @@ var
glsCmdLineHistory: TStringListEx;
glsMaskHistory : TStringListEx;
glsSearchHistory : TStringListEx;
glsSearchPathHistory : TStringListEx;
glsReplaceHistory : TStringListEx;
glsReplacePathHistory : TStringListEx;
glsSearchExcludeFiles: TStringList;
glsSearchExcludeDirectories: TStringList;
glsIgnoreList : TStringListEx;
@ -232,6 +234,7 @@ var
gDelayLoadingTabs: Boolean;
gHighlightUpdatedFiles: Boolean;
gLastUsedPacker: String;
gLastDoAnyCommand: String;
gBriefViewFileExtAligned: Boolean;
{ Tools page }
@ -325,6 +328,7 @@ var
{ Quick Search page }
gQuickSearchOptions: TQuickSearchOptions;
gQuickFilterAutoHide: Boolean;
gQuickFilterSaveSessionModifications: Boolean;
{ Misc page }
gGridVertLine,
@ -616,7 +620,9 @@ begin
LoadHistory('CommandLine', glsCmdLineHistory);
LoadHistory('FileMask', glsMaskHistory);
LoadHistory('SearchText', glsSearchHistory);
LoadHistory('SearchTextPath', glsSearchPathHistory);
LoadHistory('ReplaceText', glsReplaceHistory);
LoadHistory('ReplaceTextPath', glsReplacePathHistory);
LoadHistory('SearchExcludeFiles', glsSearchExcludeFiles);
LoadHistory('SearchExcludeDirectories', glsSearchExcludeDirectories);
end;
@ -656,7 +662,9 @@ begin
if gSaveSearchReplaceHistory then
begin
SaveHistory('SearchText', glsSearchHistory);
SaveHistory('SearchTextPath', glsSearchPathHistory);
SaveHistory('ReplaceText', glsReplaceHistory);
SaveHistory('ReplaceTextPath', glsReplacePathHistory);
SaveHistory('SearchExcludeFiles', glsSearchExcludeFiles);
SaveHistory('SearchExcludeDirectories', glsSearchExcludeDirectories);
end;
@ -714,10 +722,12 @@ begin
'Shift+F8','','trashcan=reversesetting',''], 'cm_Delete');
AddIfNotExists(['F9'],[],'cm_RunTerm');
AddIfNotExists(['Ctrl+7'],[],'cm_ShowCmdLineHistory');
AddIfNotExists(['Ctrl+Down'],'cm_ShowCmdLineHistory',['Ctrl+7'],[]); //Historic backward support reason...
AddIfNotExists(['Ctrl+B'],[],'cm_FlatView');
AddIfNotExists(['Ctrl+D'],[],'cm_DirHotList');
AddIfNotExists(['Ctrl+F'],[],'cm_QuickFilter');
AddIfNotExists(['Ctrl+H'],[],'cm_DirHistory');
AddIfNotExists(['Alt+Down'],'cm_DirHistory',['Ctrl+H'],[]); //Historic backward support reason...
AddIfNotExists(['Ctrl+L'],[],'cm_CalculateSpace');
AddIfNotExists(['Ctrl+M'],[],'cm_MultiRename');
AddIfNotExists(['Ctrl+P'],[],'cm_AddPathToCmdLine');
@ -734,7 +744,6 @@ begin
AddIfNotExists(['Ctrl+F4'],[],'cm_SortByExt');
AddIfNotExists(['Ctrl+F5'],[],'cm_SortByDate');
AddIfNotExists(['Ctrl+F6'],[],'cm_SortBySize');
AddIfNotExists(['Ctrl+Down'],[],'cm_ShowCmdLineHistory');
AddIfNotExists(['Ctrl+Enter'],[],'cm_AddFilenameToCmdLine');
AddIfNotExists(['Ctrl+PgDn'],[],'cm_OpenArchive');
AddIfNotExists(['Ctrl+PgUp'],[],'cm_ChangeDirToParent');
@ -754,6 +763,7 @@ begin
AddIfNotExists(['Shift+F4'],[],'cm_EditNew');
AddIfNotExists(['Shift+F5'],[],'cm_CopySamePanel');
AddIfNotExists(['Shift+F10'],[],'cm_ContextMenu');
AddIfNotExists(['Shift+F12'],[],'cm_DoAnyCmCommand');
AddIfNotExists(['Alt+V'],[],'cm_OperationsViewer');
AddIfNotExists(['Alt+X'],[],'cm_Exit');
AddIfNotExists(['Alt+Z'],[],'cm_TargetEqualSource');
@ -763,7 +773,6 @@ begin
AddIfNotExists(['Alt+F7'],[],'cm_Search');
AddIfNotExists(['Alt+F9'],[],'cm_ExtractFiles');
AddIfNotExists(['Alt+Del'],[],'cm_Wipe');
AddIfNotExists(['Alt+Down'],[],'cm_DirHistory');
AddIfNotExists(['Alt+Enter'],[],'cm_FileProperties');
AddIfNotExists(['Alt+Left'],[],'cm_ViewHistoryPrev');
AddIfNotExists(['Alt+Right'],[],'cm_ViewHistoryNext');
@ -973,7 +982,9 @@ begin
glsCmdLineHistory := TStringListEx.Create;
glsMaskHistory := TStringListEx.Create;
glsSearchHistory := TStringListEx.Create;
glsSearchPathHistory := TStringListEx.Create;
glsReplaceHistory := TStringListEx.Create;
glsReplacePathHistory := TStringListEx.Create;
glsIgnoreList := TStringListEx.Create;
glsSearchExcludeFiles:= TStringList.Create;
glsSearchExcludeDirectories:= TStringList.Create;
@ -998,7 +1009,9 @@ begin
FreeThenNil(gDirectoryHotlist);
FreeThenNil(glsMaskHistory);
FreeThenNil(glsSearchHistory);
FreeThenNil(glsSearchPathHistory);
FreeThenNil(glsReplaceHistory);
FreeThenNil(glsReplacePathHistory);
FreeThenNil(glsIgnoreList);
FreeThenNil(glsSearchExcludeFiles);
FreeThenNil(glsSearchExcludeDirectories);
@ -1225,6 +1238,7 @@ begin
gQuickSearchOptions.Items := qsiFilesAndDirectories;
gQuickSearchOptions.SearchCase := qscInsensitive;
gQuickFilterAutoHide := True;
gQuickFilterSaveSessionModifications := False; //Legacy...
{ Miscellaneous page }
gGridVertLine := False;
@ -1301,6 +1315,7 @@ begin
gLastUsedPacker := 'zip';
gUseShellForFileOperations :=
{$IF DEFINED(MSWINDOWS)}WindowsVersion >= wvVista{$ELSE}False{$ENDIF};
gLastDoAnyCommand := 'cm_Refresh';
{ TotalCommander Import/Export }
//Will search minimally where TC could be installed so the default value would have some chances to be correct.
@ -1335,7 +1350,9 @@ begin
glsDirHistory.Clear;
glsMaskHistory.Clear;
glsSearchHistory.Clear;
glsSearchPathHistory.Clear;
glsReplaceHistory.Clear;
glsReplacePathHistory.Clear;
glsIgnoreList.Clear;
gSearchTemplateList.Clear;
gDSXPlugins.Clear;
@ -2321,6 +2338,7 @@ begin
OldKeysToNew(oldQuickFilter, oldQuickFilterMode, ktaQuickFilter);
end;
gQuickFilterAutoHide := GetValue(Node, 'AutoHide', gQuickFilterAutoHide);
gQuickFilterSaveSessionModifications := GetValue(Node, 'SaveSessionModifications', gQuickFilterSaveSessionModifications);
end;
{ Miscellaneous page }
@ -2429,6 +2447,7 @@ begin
gNameSCFile:= GetValue(Root, 'NameShortcutFile', gNameSCFile);
gLastUsedPacker:= GetValue(Root, 'LastUsedPacker', gLastUsedPacker);
gUseShellForFileOperations:= GetValue(Root, 'UseShellForFileOperations', gUseShellForFileOperations);
gLastDoAnyCommand:=GetValue(Root, 'LastDoAnyCommand', gLastDoAnyCommand);
{ TotalCommander Import/Export }
{$IFDEF MSWINDOWS}
@ -2683,6 +2702,7 @@ begin
SetValue(Node, 'Items', Integer(gQuickSearchOptions.Items));
Node := FindNode(Root, 'QuickFilter', True);
SetValue(Node, 'AutoHide', gQuickFilterAutoHide);
SetValue(Node, 'SaveSessionModifications', gQuickFilterSaveSessionModifications);
{ Misc page }
Node := FindNode(Root, 'Miscellaneous', True);
@ -2765,6 +2785,7 @@ begin
SetValue(Root, 'NameShortcutFile', gNameSCFile);
SetValue(Root, 'LastUsedPacker', gLastUsedPacker);
SetValue(Root, 'UseShellForFileOperations', gUseShellForFileOperations);
SetValue(Root, 'LastDoAnyCommand', gLastDoAnyCommand);
{$IFDEF MSWINDOWS}
{ TotalCommander Import/Export }

View file

@ -38,13 +38,16 @@ uses
const
cSectionOfHotDir = 'DirectoryHotList';
ACTION_INVALID = 0;
ACTION_ADDTOHOTLIST = 1;
ACTION_CONFIGTOHOTLIST = 2;
ACTION_JUSTSHOWCONFIGHOTLIST = 3;
ACTION_ADDSELECTEDDIR = 4;
ACTION_DIRECTLYCONFIGENTRY = 5;
ACTION_ADDJUSTSOURCETOHOTLIST = 2;
ACTION_ADDBOTHTOHOTLIST = 3;
ACTION_CONFIGTOHOTLIST = 4;
ACTION_JUSTSHOWCONFIGHOTLIST = 5;
ACTION_ADDSELECTEDDIR = 6;
ACTION_DIRECTLYCONFIGENTRY = 7;
HOTLISTMAGICWORDS:array[1..5] of string =('add','config','show','addsel','directconfig');
HOTLISTMAGICWORDS:array[1..7] of string =('add','addsrconly','addboth','config','show','addsel','directconfig');
TAGOFFSET_FORCHANGETOSPECIALDIR = $10000;
@ -57,14 +60,16 @@ const
HOTLIST_SEPARATORSTRING:string='···························';
TERMINATORNOTPRESENT = ':-<#/?*+*?\#>-:';
STR_ACTIVEFRAME: string = 'ActiveFrame';
STR_NOTACTIVEFRAME: string = 'NotActiveFrame';
STR_NAME: string = 'Name';
STR_EXTENSION: string = 'Extension';
STR_SIZE: string = 'Size';
STR_MODIFICATIONTIME: string = 'ModificationTime';
STR_ASCENDING : string = 'Ascending';
STR_DESCENDING : string = 'Descending';
STR_ACTIVEFRAME: string = 'panel=active';
STR_NOTACTIVEFRAME: string = 'panel=inactive';
STR_LEFTFRAME: string = 'panel=left';
STR_RIGHTFRAME: string = 'panel=right';
STR_NAME: string = 'column=name';
STR_EXTENSION: string = 'column=ext';
STR_SIZE: string = 'column=size';
STR_MODIFICATIONDATETIME: string = 'column=datetime';
STR_ASCENDING : string = 'order=ascending';
STR_DESCENDING : string = 'order=descending';
type
@ -112,7 +117,6 @@ type
private
function GetHotDir(Index: integer): THotDir;
public
FlagModified: boolean;
constructor Create;
procedure Clear; override;
function Add(HotDir: THotDir): integer;
@ -126,6 +130,7 @@ type
function LoadTTreeView(ParamTreeView:TTreeView; DirectoryHotlistIndexToSelectIfAny:longint):TTreeNode;
procedure RefreshFromTTreeView(ParamTreeView:TTreeView);
function AddFromAnotherTTreeViewTheSelected(ParamWorkingTreeView, ParamTreeViewToImport:TTreeView; FlagAddThemAll: boolean): longint;
function ComputeSignature:dword;
property HotDir[Index: integer]: THotDir read GetHotDir;
{$IFDEF MSWINDOWS}
function ImportTotalCommander(TotalCommanderFilename: utf8string): integer;
@ -152,7 +157,7 @@ implementation
uses
//Lazarus, Free-Pascal, etc.
Graphics, Forms, lazutf8,
crc, Graphics, Forms, lazutf8,
//DC
DCFileAttributes, uDebug, uDCUtils, fMain, uFile, uLng, DCOSUtils, uGlobs,
@ -193,7 +198,6 @@ end;
constructor TDirectoryHotlist.Create;
begin
inherited Create;
FlagModified := False;
end;
{ TDirectoryHotlist.Clear }
@ -209,7 +213,6 @@ end;
function TDirectoryHotlist.Add(HotDir: THotDir): integer;
begin
Result := inherited Add(HotDir);
FlagModified := True;
end;
{ TDirectoryHotlist.DeleteHotDir }
@ -217,7 +220,6 @@ procedure TDirectoryHotlist.DeleteHotDir(Index: integer);
begin
HotDir[Index].Free;
Delete(Index);
FlagModified := True;
end;
{ TDirectoryHotlist.CopyDirectoryHotlistToDirectoryHotlist }
@ -244,7 +246,6 @@ begin
LocalHotDir.FGroupNumber := HotDir[Index].GroupNumber;
DestinationDirectoryHotlist.Add(LocalHotDir);
end;
DestinationDirectoryHotlist.FlagModified := True;
end;
{ TDirectoryHotlist.LoadTTreeView }
@ -909,6 +910,32 @@ begin
RecursiveAddTheOnesWithGroupNumberOne(ParamTreeViewToImport.Items.Item[0],nil);
end;
{ TDirectoryHotlist.ComputeSignature }
// Routine tries to pickup all char chain from element of directory hotlist and compute a unique CRC32.
// This CRC32 will bea kind of signature of the directory hotlist.
// We compute the CRC32 at the start of edition (TfrmOptionsDirectoryHotlist.Load) and
// at the end (TfrmOptionsDirectoryHotlist.CanWeClose).
// If they are different, it's a sign that directory hotlist have been modified.
// It's not "perfect" since it might happen that two different combinaisons will
// give the same CRC32 but odds are very good that it will be a different one.
function TDirectoryHotlist.ComputeSignature:dword;
var
Index:integer;
begin
result:=$000000002;
for Index := 0 to pred(Count) do
begin
Result := crc32(Result,@HotDir[Index].Dispatcher,1);
if length(HotDir[Index].HotDirName)>0 then Result := crc32(Result,@HotDir[Index].HotDirName[1],length(HotDir[Index].HotDirName));
if length(HotDir[Index].HotDirPath)>0 then Result := crc32(Result,@HotDir[Index].HotDirPath[1],length(HotDir[Index].HotDirPath));
Result := crc32(Result,@HotDir[Index].HotDirPathSort,4);
if length(HotDir[Index].HotDirTarget)>0 then Result := crc32(Result,@HotDir[Index].HotDirTarget[1],length(HotDir[Index].HotDirTarget));
Result := crc32(Result,@HotDir[Index].HotDirTargetSort,4);
Result := crc32(Result,@HotDir[Index].HotDirExisting,1);
Result := crc32(Result,@HotDir[Index].GroupNumber,4);
end;
end;
{ TDirectoryHotlist.GetHotDir }
function TDirectoryHotlist.GetHotDir(Index: integer): THotDir;
begin

View file

@ -347,6 +347,7 @@ resourcestring
// Filter status in file panel
rsFilterStatus = 'FILTER';
rsSearchStatus = 'SEARCH';
// Cancel operations in file panel
rsCancelFilter = 'Cancel Quick Filter';
@ -474,6 +475,8 @@ resourcestring
rsEditSearchReplace ='Replace';
rsEditSearchFrw = '&Forward';
rsEditSearchBack = '&Backward';
rsZeroReplacement = 'No replacement took place.';
rsXReplacements = 'Number of replacement: %d';
// Options editors
rsOptionsEditorArchivers = 'Archivers';
rsOptionsEditorAutoRefresh = 'Auto refresh';
@ -573,6 +576,11 @@ resourcestring
rsHotkeyCategoryDiffer = 'Differ';
rsHotkeyCategoryCopyMoveDialog = 'Copy/Move Dialog';
rsHotkeyCategoryEditCommentDialog = 'Edit Comment Dialog';
rsCmdCategoryListInOrder='All;Active Panel;Left Panel;Right Panel;File Operations;Configuration;Network;Miscellaneous;Parallel Port;Print;Mark;Security;Clipboard;FTP;Navigation;Help;Window;Command Line;Tools;View;User;Tabs;Sorting;Log';
rsCmdKindOfSort='Legacy sorted;A-Z sorted';
rsMsgThisIsNowInClipboard = '"%s" is now in the clipboard';
rsSimpleWordAll = 'All';
rsSimpleWordCategory = 'Category';
// Plugins
rsOptPluginsActive = 'Active';
rsOptPluginsName = 'Name';
@ -596,7 +604,7 @@ resourcestring
// Quick Search/Filter
rsOptSearchItems = '&Files;Di&rectories;Files a&nd Directories';
rsOptSearchCase = '&Sensitive;&Insensitive';
rsOptSearchOpt = '&Hide filter panel when not focused';
rsOptSearchOpt = '&Hide filter panel when not focused;Keep saving setting modifications for next session';
// Toolbar
rsOptToolbarButtonType = 'S&eparator;Inte&rnal command;E&xternal command;Men&u';

View file

@ -94,6 +94,46 @@ type
// 3. Commands intended for file sources (cm_Copy, cm_Rename, cm_MakeDir).
// The file operations will mostly work only for non-virtual file sources.
//
//--------------------------------------------------------------------------
// RECIPE TO ADD A "cm_" COMMAND:
//--------------------------------------------------------------------------
// In this recipe, we use as an exemple the command "cm_SrcOpenDrives"
// 1. In "fMain" we add the action in the "actionLst".
// 2. Make sure we add it in the appropriate category.
// 3. The action name must start with "act" and have the exact same name as the "cm_" we want to add.
// 4. So if we want "cm_SrcOpenDrives", we name the action "actSrcOpenDrives".
// 5. By the way, "KEEP THE SAME SPELLING EVERYWHERE!".
// 6. The order in which the "cm_SrcOpenDrives" will appear, is the same as its position in the "actionLst".
// 7. So command is "cm_SrcOpenDrives", so keep writing "cm_SrcOpenDrives" and not "cm_srcopendrives" for example.
// 8. The only single place to have lowercases is for the icon name which will be "cm_srcopendrives" but it's the only one case.
// 9. Give an appropriate "caption" name for the command, so for our example "Open drive list"
// 10. Set the "GroupIndex" to the same number as the other command of the same category.
// 11. In the "uMainCommands", for the type "TMainCommands", add the code for the command.
// 12. The command name must start with "cm_" and ends with the same name as what we added for the "act".
// 13. So with our example we add "cm_SrcOpenDrives".
// 14. Create an icon for the command.
// 15. Make a 24-bits with alpha .PNG file.
// 16. Name the file with he same name of the "cm_" command.
// 17. But write the name all in lower case so here "cm_srcopendrives".
// 18. Store the file here: to path "pixmaps\dctheme\32x32\actions\".
// 19. If command is a compatible on with TC, add it in unit "uTotalCommander".
// 20. So with this example we add: "(TCCommand: 'cm_SrcOpenDrives'; TCIcon: -1; DCCommand: 'cm_SrcOpenDrives')".
// 21. If command needs to have a shortcut, go in unit "uGlobs", go to routine "LoadDefaultHotkeyBindings" and add the appropriate "AddIfNotExists".
// 22. Don't abuse on adding keyboard shortcut! We must let some user's keys for user!
// 23. For this example, we won't add a keyboard shortcut. TC does'nt have neither.
// 24. Edit the file "doc\en\cmds.html" to add help for the command.
// 25. For the languages we know, translate the caption of the action added.
// 26. For example in our example, it will be "tfrmmain.actsrcopendrives.caption" that will need to be change.
// 27. It's important to * T E S T * the "cm_" command you add.
// 28. Add a single button in the toolbar to test it works.
// 29. Make sure we see the expected icon and the expected tooltip.
// 30. Make sure the actual button you added do the expected task.
// 31. If command is using parameters, make sure you test the most cases of parameters.
// 32. If you added keyboard hosrtcut, make sure keyboard shortcut works.
// 33. With the "cm_DoAnyCmCommand", go find in the "Internal Command Selector" the command you added.
// 34. Make sure it's present there, under the appropriate category, sorted at the classic logical place.
// 35. Make sure we see the shortcut if any and that the description is correct.
// 36. Test the help for the command from there to make sure it links to the correct place in the help file.
procedure cm_AddPathToCmdLine(const Params: array of string);
procedure cm_AddFilenameToCmdLine(const Params: array of string);
procedure cm_AddPathAndFilenameToCmdLine(const Params: array of string);
@ -104,6 +144,8 @@ type
procedure cm_CopyFileDetailsToClip(const Params: array of string);
procedure cm_Exchange(const Params: array of string);
procedure cm_FlatView(const Params: array of string);
procedure cm_LeftFlatView(const Params: array of string);
procedure cm_RightFlatView(const Params: array of string);
procedure cm_OpenArchive(const Params: array of string);
procedure cm_TestArchive(const Params: array of string);
procedure cm_OpenDirInNewTab(const Params: array of string);
@ -117,6 +159,7 @@ type
procedure cm_ExtractFiles(const Params: array of string);
procedure cm_QuickSearch(const Params: array of string);
procedure cm_QuickFilter(const Params: array of string);
procedure cm_SrcOpenDrives(const Params: array of string);
procedure cm_LeftOpenDrives(const Params: array of string);
procedure cm_RightOpenDrives(const Params: array of string);
procedure cm_OpenBar(const Params: array of string);
@ -153,8 +196,14 @@ type
procedure cm_View(const Params: array of string);
procedure cm_QuickView(const Params: array of string);
procedure cm_BriefView(const Params: array of string);
procedure cm_LeftBriefView(const Params: array of string);
procedure cm_RightBriefView(const Params: array of string);
procedure cm_ColumnsView(const Params: array of string);
procedure cm_LeftColumnsView(const Params: array of string);
procedure cm_RightColumnsView(const Params: array of string);
procedure cm_ThumbnailsView(const Params: array of string);
procedure cm_LeftThumbView(const Params: array of string);
procedure cm_RightThumbView(const Params: array of string);
procedure cm_CopyNamesToClip(const Params: array of string);
procedure cm_FocusCmdLine(const Params: array of string);
procedure cm_FileAssoc(const Params: array of string);
@ -188,12 +237,24 @@ type
procedure cm_HardLink(const Params: array of string);
procedure cm_MultiRename(const Params: array of string);
procedure cm_ReverseOrder(const Params: array of string);
procedure cm_SortByAttr(const Params: array of string);
procedure cm_LeftReverseOrder(const Params: array of string);
procedure cm_RightReverseOrder(const Params: array of string);
procedure cm_UniversalSingleDirectSort(const Params: array of string);
procedure cm_SortByDate(const Params: array of string);
procedure cm_SortByExt(const Params: array of string);
procedure cm_SortByName(const Params: array of string);
procedure cm_SortByExt(const Params: array of string);
procedure cm_SortByDate(const Params: array of string);
procedure cm_SortBySize(const Params: array of string);
procedure cm_SortByAttr(const Params: array of string);
procedure cm_LeftSortByName(const Params: array of string);
procedure cm_LeftSortByExt(const Params: array of string);
procedure cm_LeftSortByDate(const Params: array of string);
procedure cm_LeftSortBySize(const Params: array of string);
procedure cm_LeftSortByAttr(const Params: array of string);
procedure cm_RightSortByName(const Params: array of string);
procedure cm_RightSortByExt(const Params: array of string);
procedure cm_RightSortByDate(const Params: array of string);
procedure cm_RightSortBySize(const Params: array of string);
procedure cm_RightSortByAttr(const Params: array of string);
procedure cm_SymLink(const Params: array of string);
procedure cm_CopySamePanel(const Params: array of string);
procedure cm_DirHistory(const Params: array of string);
@ -231,6 +292,7 @@ type
procedure cm_DebugShowCommandParameters(const Params: array of string);
procedure cm_CopyPathOfFilesToClip(const Params: array of string);
procedure cm_CopyPathNoSepOfFilesToClip(const Params: array of string);
procedure cm_DoAnyCmCommand(const Params: array of string);
// Internal commands
procedure cm_ExecuteToolbarItem(const Params: array of string);
@ -255,7 +317,7 @@ uses Forms, Controls, Dialogs, Clipbrd, strutils, LCLProc, HelpIntfs, StringHash
fViewOperations, uVfsModule, uMultiListFileSource, uExceptions,
DCOSUtils, DCStrUtils, DCBasicTypes, uFileSourceCopyOperation, fSyncDirsDlg,
uHotDir, DCXmlConfig, dmCommonData, fOptionsFrame, foptionsDirectoryHotlist,
fOptionsToolbar
fOptionsToolbar, fMainCommandsDlg
{$IFDEF COLUMNSFILEVIEW_VTV}
, uColumnsFileViewVtv
{$ENDIF}
@ -814,14 +876,40 @@ end;
procedure TMainCommands.cm_FlatView(const Params: array of string);
begin
with frmMain.ActiveFrame do
if not (fspListFlatView in frmMain.ActiveFrame.FileSource.GetProperties) then
begin
if not (fspListFlatView in FileSource.GetProperties) then
msgWarning(rsMsgErrNotSupported)
else begin
FlatView:= not FlatView;
Reload;
end;
msgWarning(rsMsgErrNotSupported)
end
else
begin
frmMain.ActiveFrame.FlatView:= not frmMain.ActiveFrame.FlatView;
frmMain.ActiveFrame.Reload;
end;
end;
procedure TMainCommands.cm_LeftFlatView(const Params: array of string);
begin
if not (fspListFlatView in frmMain.FrameLeft.FileSource.GetProperties) then
begin
msgWarning(rsMsgErrNotSupported)
end
else
begin
frmMain.FrameLeft.FlatView:= not frmMain.FrameLeft.FlatView;
frmMain.FrameLeft.Reload;
end;
end;
procedure TMainCommands.cm_RightFlatView(const Params: array of string);
begin
if not (fspListFlatView in frmMain.FrameRight.FileSource.GetProperties) then
begin
msgWarning(rsMsgErrNotSupported)
end
else
begin
frmMain.FrameRight.FlatView:= not frmMain.FrameRight.FlatView;
frmMain.FrameRight.Reload;
end;
end;
@ -1034,6 +1122,11 @@ begin
FrmMain.ActiveFrame.ExecuteCommand('cm_QuickFilter', Params);
end;
procedure TMainCommands.cm_SrcOpenDrives(const Params: array of string);
begin
frmMain.ShowDrivesList(frmMain.SelectedPanel);
end;
procedure TMainCommands.cm_LeftOpenDrives(const Params: array of string);
begin
frmMain.ShowDrivesList(fpLeft);
@ -1450,6 +1543,28 @@ begin
end;
end;
procedure TMainCommands.cm_LeftBriefView(const Params: array of string);
var
aFileView: TFileView;
begin
with frmMain do
begin
aFileView:= TBriefFileView.Create(LeftTabs.ActivePage, FrameLeft);
LeftTabs.ActivePage.FileView:= aFileView;
end;
end;
procedure TMainCommands.cm_RightBriefView(const Params: array of string);
var
aFileView: TFileView;
begin
with frmMain do
begin
aFileView:= TBriefFileView.Create(RightTabs.ActivePage, FrameRight);
RightTabs.ActivePage.FileView:= aFileView;
end;
end;
procedure TMainCommands.cm_ColumnsView(const Params: array of string);
var
aFileView: TFileView;
@ -1466,42 +1581,81 @@ begin
end;
end;
procedure TMainCommands.cm_ThumbnailsView(const Params: array of string);
const
// Static variables
LeftFileViewClass: TFileViewClass = TColumnsFileView;
RightFileViewClass: TFileViewClass = TColumnsFileView;
procedure TMainCommands.cm_LeftColumnsView(const Params: array of string);
var
aFileView: TFileView;
begin
with frmMain do
begin
if ActiveFrame.ClassType <> TThumbFileView then
begin
// Save current file view type
case SelectedPanel of
fpLeft:
LeftFileViewClass:= TFileViewClass(FrameLeft.ClassType);
fpRight:
RightFileViewClass:= TFileViewClass(FrameRight.ClassType);
end;
// Create thumbnails view
aFileView:= TThumbFileView.Create(ActiveNotebook.ActivePage, ActiveFrame);
end
else begin
// Restore previous file view type
case SelectedPanel of
fpLeft:
aFileView:= LeftFileViewClass.Create(ActiveNotebook.ActivePage, ActiveFrame);
fpRight:
aFileView:= RightFileViewClass.Create(ActiveNotebook.ActivePage, ActiveFrame);
end;
end;
ActiveNotebook.ActivePage.FileView:= aFileView;
ActiveFrame.SetFocus;
{$IFDEF COLUMNSFILEVIEW_VTV}
aFileView:= TColumnsFileViewVTV.Create(ActiveNotebook.ActivePage, ActiveFrame);
{$ELSE}
aFileView:= TColumnsFileView.Create(LeftTabs.ActivePage, FrameLeft);
{$ENDIF}
LeftTabs.ActivePage.FileView:= aFileView;
end;
end;
procedure TMainCommands.cm_RightColumnsView(const Params: array of string);
var
aFileView: TFileView;
begin
with frmMain do
begin
{$IFDEF COLUMNSFILEVIEW_VTV}
aFileView:= TColumnsFileViewVTV.Create(ActiveNotebook.ActivePage, ActiveFrame);
{$ELSE}
aFileView:= TColumnsFileView.Create(RightTabs.ActivePage, FrameRight);
{$ENDIF}
RightTabs.ActivePage.FileView:= aFileView;
end;
end;
var
// Static variables
BackupLeftFileViewClass: TFileViewClass = TColumnsFileView;
BackupRightFileViewClass: TFileViewClass = TColumnsFileView;
procedure ToggleOrNotToOrFromThumbnailsView(WorkingFileView:TFileView; WorkingFileViewClass:TFileViewClass; WorkingNotebook:TFileViewNotebook);
var
aFileView: TFileView;
begin
if WorkingFileView.ClassType <> TThumbFileView then
begin
// Save current file view type
WorkingFileViewClass:=TFileViewClass(WorkingFileView.ClassType);
// Create thumbnails view
aFileView:= TThumbFileView.Create(WorkingNotebook.ActivePage, WorkingFileView);
end
else
begin
// Restore previous file view type
aFileView:= WorkingFileViewClass.Create(WorkingNotebook.ActivePage, WorkingFileView);
end;
WorkingNotebook.ActivePage.FileView:= aFileView;
end;
procedure TMainCommands.cm_ThumbnailsView(const Params: array of string);
begin
case frmMain.SelectedPanel of
fpLeft: ToggleOrNotToOrFromThumbnailsView(frmMain.FrameLeft, BackupLeftFileViewClass,frmMain.LeftTabs);
fpRight: ToggleOrNotToOrFromThumbnailsView(frmMain.FrameRight, BackupRightFileViewClass,frmMain.RightTabs);
end;
frmMain.ActiveFrame.SetFocus;
end;
procedure TMainCommands.cm_LeftThumbView(const Params: array of string);
begin
ToggleOrNotToOrFromThumbnailsView(frmMain.FrameLeft, BackupLeftFileViewClass,frmMain.LeftTabs);
frmMain.ActiveFrame.SetFocus;
end;
procedure TMainCommands.cm_RightThumbView(const Params: array of string);
begin
ToggleOrNotToOrFromThumbnailsView(frmMain.FrameRight, BackupRightFileViewClass,frmMain.RightTabs);
frmMain.ActiveFrame.SetFocus;
end;
procedure TMainCommands.cm_Edit(const Params: array of string);
var
i: Integer;
@ -2010,14 +2164,32 @@ begin
end;
procedure TMainCommands.cm_SwitchIgnoreList(const Params: array of string);
var
WantedIgnoreList, BoolValue:boolean;
begin
WantedIgnoreList:=gIgnoreListFileEnabled;
with frmMain do
begin
gIgnoreListFileEnabled:= not gIgnoreListFileEnabled;
actSwitchIgnoreList.Checked:= gIgnoreListFileEnabled;
//repaint both panels
FrameLeft.Reload;
FrameRight.Reload;
if Length(Params)>0 then
begin
if GetParamBoolValue(Params[0], 'ignorelist', BoolValue) then
WantedIgnoreList:=BoolValue
else
WantedIgnoreList := not WantedIgnoreList;
end
else
begin
WantedIgnoreList := not WantedIgnoreList;
end;
if WantedIgnoreList<>gIgnoreListFileEnabled then
begin
gIgnoreListFileEnabled:=WantedIgnoreList;
actSwitchIgnoreList.Checked:= gIgnoreListFileEnabled;
//repaint both panels
FrameLeft.Reload;
FrameRight.Reload;
end;
end;
end;
@ -2178,8 +2350,28 @@ begin
end;
procedure TMainCommands.cm_ShowMainMenu(const Params: array of string);
var
WantedMainMenu, BoolValue:boolean;
begin
DoShowMainMenu(not gMainMenu);
WantedMainMenu:=gMainMenu;
if Length(Params)>0 then
begin
if GetParamBoolValue(Params[0], 'menu', BoolValue) then
WantedMainMenu:=BoolValue
else
WantedMainMenu := not WantedMainMenu;
end
else
begin
WantedMainMenu := not WantedMainMenu;
end;
if WantedMainMenu<>gMainMenu then
begin
gMainMenu:=WantedMainMenu;
DoShowMainMenu(gMainMenu);
end;
end;
procedure TMainCommands.cm_Refresh(const Params: array of string);
@ -2278,11 +2470,10 @@ end;
{ TMainCommands.cm_ConfigDirHotList }
// Mainly present for backward compatibility since "cm_ConfigDirHotList" existed before.
// Calling "cm_WorkWithDirectoryHotlist" with "config" as first parameters would do the same
//
procedure TMainCommands.cm_ConfigDirHotList(const Params: array of string);
begin
cm_WorkWithDirectoryHotlist([HOTLISTMAGICWORDS[ACTION_CONFIGTOHOTLIST],frmMain.ActiveFrame.CurrentPath,frmMain.NotActiveFrame.CurrentPath,'0']);
cm_WorkWithDirectoryHotlist(['action=config', 'source='+frmMain.ActiveFrame.CurrentPath, 'target='+frmMain.NotActiveFrame.CurrentPath, 'index=0']);
end;
{ TMainCommands.cm_WorkWithDirectoryHotlist }
@ -2293,15 +2484,48 @@ procedure TMainCommands.cm_WorkWithDirectoryHotlist(const Params: array of strin
var
Editor: TOptionsEditor;
Options: IOptionsDialog;
SearchingIndex, WantedAction, WantedIndexToEdit: integer;
WantedSourcePath, WantedTargetPath : string;
Param, sValue: String;
begin
if Length(Params) >= 1 then
//1o) Let's set our default values
WantedAction := ACTION_INVALID;
WantedSourcePath := frmMain.ActiveFrame.CurrentPath;
WantedTargetPath := frmMain.NotActiveFrame.CurrentPath;
WantedIndexToEdit := 0;
//2o) Let's parse the parameter to get the wanted ones
for Param in Params do
begin
Options := ShowOptions(TfrmOptionsDirectoryHotlist);
Editor := Options.GetEditor(TfrmOptionsDirectoryHotlist);
Application.ProcessMessages;
if Editor.CanFocus then Editor.SetFocus;
TfrmOptionsDirectoryHotlist(Editor).SubmitToAddOrConfigToHotDirDlg(Params[0],Params[1],Params[2],Params[3]);
if GetParamValue(Param, 'action', sValue) then
begin
SearchingIndex:=1;
while ( (SearchingIndex<=length(HOTLISTMAGICWORDS)) AND (WantedAction = ACTION_INVALID) ) do
if sValue=HOTLISTMAGICWORDS[SearchingIndex] then WantedAction:=SearchingIndex else inc(SearchingIndex);
end
else if GetParamValue(Param, 'source', sValue) then
begin
sValue:=RemoveQuotation(PrepareParameter(sValue, frmMain.FrameLeft, frmMain.FrameRight, frmMain.ActiveFrame, []));
if (sValue<>'') and (not HasPathInvalidCharacters(sValue)) then WantedSourcePath:=sValue;
end
else if GetParamValue(Param, 'target', sValue) then
begin
sValue:=RemoveQuotation(PrepareParameter(sValue, frmMain.FrameLeft, frmMain.FrameRight, frmMain.ActiveFrame, []));
if (sValue<>'') and (not HasPathInvalidCharacters(sValue)) then WantedTargetPath:=sValue;
end
else if GetParamValue(Param, 'index', sValue) then
begin
WantedIndexToEdit:=(strtointdef(sValue,0));
end;
end;
if WantedAction=ACTION_INVALID then WantedAction:=ACTION_JUSTSHOWCONFIGHOTLIST;
//3o) Let's do the sorting job now!
Options := ShowOptions(TfrmOptionsDirectoryHotlist);
Editor := Options.GetEditor(TfrmOptionsDirectoryHotlist);
Application.ProcessMessages;
if Editor.CanFocus then Editor.SetFocus;
TfrmOptionsDirectoryHotlist(Editor).SubmitToAddOrConfigToHotDirDlg(WantedAction, WantedSourcePath, WantedTargetPath, WantedIndexToEdit);
end;
procedure TMainCommands.cm_Search(const Params: array of string);
@ -2436,6 +2660,18 @@ begin
Sorting := ReverseSortDirection(Sorting);
end;
procedure TMainCommands.cm_LeftReverseOrder(const Params: array of string);
begin
with frmMain.FrameLeft do
Sorting := ReverseSortDirection(Sorting);
end;
procedure TMainCommands.cm_RightReverseOrder(const Params: array of string);
begin
with frmMain.FrameRight do
Sorting := ReverseSortDirection(Sorting);
end;
procedure TMainCommands.cm_SortByName(const Params: array of string);
var
FileFunctions: TFileFunctions = nil;
@ -2476,34 +2712,133 @@ begin
DoSortByFunctions(frmMain.ActiveFrame, FileFunctions);
end;
{Command to request to sort a frame with a column with a defined order.
Must provide THREE parameters:
-1st, the panel, ActiveFrame or NotActiveFrame
-2nd, the column
-3rd, the order}
procedure TMainCommands.cm_LeftSortByName(const Params: array of string);
var
FileFunctions: TFileFunctions = nil;
begin
AddSortFunction(FileFunctions, fsfNameNoExtension);
DoSortByFunctions(frmMain.FrameLeft, FileFunctions);
end;
procedure TMainCommands.cm_LeftSortByExt(const Params: array of string);
var
FileFunctions: TFileFunctions = nil;
begin
AddSortFunction(FileFunctions, fsfExtension);
DoSortByFunctions(frmMain.FrameLeft, FileFunctions);
end;
procedure TMainCommands.cm_LeftSortBySize(const Params: array of string);
var
FileFunctions: TFileFunctions = nil;
begin
AddSortFunction(FileFunctions, fsfSize);
DoSortByFunctions(frmMain.FrameLeft, FileFunctions);
end;
procedure TMainCommands.cm_LeftSortByDate(const Params: array of string);
var
FileFunctions: TFileFunctions = nil;
begin
AddSortFunction(FileFunctions, fsfModificationTime);
DoSortByFunctions(frmMain.FrameLeft, FileFunctions);
end;
procedure TMainCommands.cm_LeftSortByAttr(const Params: array of string);
var
FileFunctions: TFileFunctions = nil;
begin
AddSortFunction(FileFunctions, fsfAttr);
DoSortByFunctions(frmMain.FrameLeft, FileFunctions);
end;
procedure TMainCommands.cm_RightSortByName(const Params: array of string);
var
FileFunctions: TFileFunctions = nil;
begin
AddSortFunction(FileFunctions, fsfNameNoExtension);
DoSortByFunctions(frmMain.FrameRight, FileFunctions);
end;
procedure TMainCommands.cm_RightSortByExt(const Params: array of string);
var
FileFunctions: TFileFunctions = nil;
begin
AddSortFunction(FileFunctions, fsfExtension);
DoSortByFunctions(frmMain.FrameRight, FileFunctions);
end;
procedure TMainCommands.cm_RightSortBySize(const Params: array of string);
var
FileFunctions: TFileFunctions = nil;
begin
AddSortFunction(FileFunctions, fsfSize);
DoSortByFunctions(frmMain.FrameRight, FileFunctions);
end;
procedure TMainCommands.cm_RightSortByDate(const Params: array of string);
var
FileFunctions: TFileFunctions = nil;
begin
AddSortFunction(FileFunctions, fsfModificationTime);
DoSortByFunctions(frmMain.FrameRight, FileFunctions);
end;
procedure TMainCommands.cm_RightSortByAttr(const Params: array of string);
var
FileFunctions: TFileFunctions = nil;
begin
AddSortFunction(FileFunctions, fsfAttr);
DoSortByFunctions(frmMain.FrameRight, FileFunctions);
end;
{ Command to request to sort a frame with a column with a defined order.
This command may be user by the user via the toolbar,
but it is definitively a nice-to-have for the "uHotDir" unit who may specify the order to be in when switching to a hotdir.}
procedure TMainCommands.cm_UniversalSingleDirectSort(const Params: array of string);
var
DesignatedFileView: TFileView;
DesignatedSortFunction: TFileFunction;
DesignatedSortDirection: TSortDirection;
Param: String;
sValue: String;
WantedFileView: TFileView;
WantedSortFunction: TFileFunction;
WantedSortDirection: TSortDirection;
FileFunctions: TFileFunctions = nil;
SortDirection: TSortDirection = sdNone;
NewSorting: TFileSortings = nil;
begin
if Length(Params) = 3 then
//1o) Let's set our default values
WantedFileView:=frmMain.ActiveFrame;
WantedSortFunction:=fsfName;
WantedSortDirection:=sdAscending;
//2o) Let's parse the parameter to get the wanted ones
for Param in Params do
begin
if Params[0]='NotActiveFrame' then DesignatedFileView:=frmMain.NotActiveFrame else DesignatedFileView:=frmMain.ActiveFrame;
if Params[1]='ModificationTime' then DesignatedSortFunction:=fsfModificationTime else
if Params[1]='Size' then DesignatedSortFunction:=fsfSize else
if Params[1]='Extension' then DesignatedSortFunction:=fsfExtension else DesignatedSortFunction:=fsfName;
if Params[2]='Descending' then DesignatedSortDirection:=sdDescending else DesignatedSortDirection:=sdAscending;
SetLength(NewSorting, 1);
SetLength(NewSorting[0].SortFunctions, 1);
NewSorting[0].SortFunctions[0] := DesignatedSortFunction;
NewSorting[0].SortDirection := DesignatedSortDirection;
DesignatedFileView.Sorting := NewSorting;
if GetParamValue(Param, 'panel', sValue) then
begin
if sValue='inactive' then WantedFileView:=frmMain.NotActiveFrame else
if sValue='left' then WantedFileView:=frmMain.FrameLeft else
if sValue='right' then WantedFileView:=frmMain.FrameRight;
end
else if GetParamValue(Param, 'column', sValue) then
begin
if sValue='ext' then WantedSortFunction:=fsfExtension else
if sValue='size' then WantedSortFunction:=fsfSize else
if sValue='datetime' then WantedSortFunction:=fsfModificationTime;
end
else if GetParamValue(Param, 'order', sValue) then
begin
if sValue='descending' then WantedSortDirection:=sdDescending;
end;
end;
//3o) Let's do the sorting job now!
AddSortFunction(FileFunctions, WantedSortFunction);
SetLength(NewSorting, 1);
SetLength(NewSorting[0].SortFunctions, 1);
NewSorting[0].SortFunctions[0] := FileFunctions[0];
NewSorting[0].SortDirection := WantedSortDirection;
WantedFileView.Sorting := NewSorting;
end;
procedure TMainCommands.cm_MultiRename(const Params: array of string);
@ -2905,15 +3240,13 @@ end;
procedure TMainCommands.cm_PanelsSplitterPerPos(const Params: array of string);
var
Split: Integer = -1;
Split: Integer = 50;
Param, SplitPct: String;
begin
for Param in Params do
begin
if GetParamValue(Param, 'splitpct', SplitPct) then
Split := StrToIntDef(SplitPct, Split)
else if Split = -1 then
Split := StrToIntDef(Param, Split); // deprecated
Split := StrToIntDef(SplitPct, Split);
end;
DoPanelsSplitterPerPos(Split);
end;
@ -3138,9 +3471,48 @@ end;
// Parameters:
// Full path to a directory.
procedure TMainCommands.cm_ChangeDir(const Params: array of string);
var
WantedFileView: TFileView;
Param, WantedPath: string;
begin
if Length(Params) > 0 then
ChooseFileSource(FrmMain.ActiveFrame, RemoveQuotation(ReplaceEnvVars(Params[0])));
//1o) Let's set our default values
WantedFileView := frmMain.ActiveFrame;
WantedPath := frmMain.ActiveFrame.CurrentPath;
//2o) Let's parse the parameter to get the wanted ones
for Param in Params do
begin
if GetParamValue(Param, 'activepath', WantedPath) then
begin
WantedPath:=RemoveQuotation(PrepareParameter(WantedPath, frmMain.FrameLeft, frmMain.FrameRight, frmMain.ActiveFrame, []));
ChooseFileSource(frmMain.ActiveFrame, RemoveQuotation(ReplaceEnvVars(WantedPath)));
end
else
if GetParamValue(Param, 'inactivepath', WantedPath) then
begin
WantedPath:=RemoveQuotation(PrepareParameter(WantedPath, frmMain.FrameLeft, frmMain.FrameRight, frmMain.ActiveFrame, []));
ChooseFileSource(frmMain.NotActiveFrame, RemoveQuotation(ReplaceEnvVars(WantedPath)));
end
else
if GetParamValue(Param, 'leftpath', WantedPath) then
begin
WantedPath:=RemoveQuotation(PrepareParameter(WantedPath, frmMain.FrameLeft, frmMain.FrameRight, frmMain.ActiveFrame, []));
ChooseFileSource(frmMain.FrameLeft, RemoveQuotation(ReplaceEnvVars(WantedPath)));
end
else
if GetParamValue(Param, 'rightpath', WantedPath) then
begin
WantedPath:=RemoveQuotation(PrepareParameter(WantedPath, frmMain.FrameLeft, frmMain.FrameRight, frmMain.ActiveFrame, []));
ChooseFileSource(frmMain.FrameRight, RemoveQuotation(ReplaceEnvVars(WantedPath)));
end;
end;
//3o) Let's support the DC legacy way of working of the command
if Length(Params)=1 then
begin
if (not GetParamValue(Params[0], 'activepath', WantedPath)) AND (not GetParamValue(Params[0], 'inactivepath', WantedPath)) AND (not GetParamValue(Params[0], 'leftpath', WantedPath)) AND (not GetParamValue(Params[0], 'rightpath', WantedPath)) then
ChooseFileSource(frmMain.ActiveFrame, RemoveQuotation(Params[0]));
end;
end;
procedure TMainCommands.cm_ClearLogWindow(const Params: array of string);
@ -3191,10 +3563,32 @@ begin
end;
procedure TMainCommands.cm_HorizontalFilePanels(const Params: array of string);
var
sParamValue:string;
WantedHorizontalFilePanels:boolean;
begin
gHorizontalFilePanels := not gHorizontalFilePanels;
frmMain.actHorizontalFilePanels.Checked := gHorizontalFilePanels;
frmMain.UpdateWindowView;
WantedHorizontalFilePanels:=gHorizontalFilePanels;
if Length(Params)>0 then
begin
if GetParamValue(Params[0], 'mode', sParamValue) then
begin
if sParamValue='legacy' then WantedHorizontalFilePanels := not WantedHorizontalFilePanels else
if sParamValue='vertical' then WantedHorizontalFilePanels:=FALSE else
if sParamValue='horizontal' then WantedHorizontalFilePanels:=TRUE;
end;
end
else
begin
WantedHorizontalFilePanels := not WantedHorizontalFilePanels;
end;
if WantedHorizontalFilePanels<>gHorizontalFilePanels then
begin
gHorizontalFilePanels:=WantedHorizontalFilePanels;
frmMain.actHorizontalFilePanels.Checked := gHorizontalFilePanels;
frmMain.UpdateWindowView;
end;
end;
procedure TMainCommands.cm_OperationsViewer(const Params: array of string);
@ -3297,5 +3691,17 @@ begin
DoCopySelectedFileNamesToClipboard(frmMain.ActiveFrame, cfntcPathWithoutSeparator);
end;
{ TMainCommands.cm_DoAnyCmCommand }
procedure TMainCommands.cm_DoAnyCmCommand(const Params: array of string);
var
CommandReturnedToExecute:string;
begin
if ShowMainCommandDlgForm(gLastDoAnyCommand,CommandReturnedToExecute) then
begin
gLastDoAnyCommand := CommandReturnedToExecute;
frmMain.Commands.Commands.ExecuteCommand(CommandReturnedToExecute, []);
end;
end;
end.