ADD: Copy buffer size option

This commit is contained in:
Alexander Koblov 2007-12-16 12:30:26 +00:00
commit f7736372e0
7 changed files with 139 additions and 39 deletions

View file

@ -1,7 +1,7 @@
object frmOptions: TfrmOptions
Left = 289
Left = 357
Height = 409
Top = 131
Top = 252
Width = 577
HorzScrollBar.Page = 576
VertScrollBar.Page = 408
@ -87,7 +87,7 @@ object frmOptions: TfrmOptions
TabOrder = 1
OnChange = tvTreeViewChange
Items.Data = {
F9FFFFFF0100080000000000000000000000FFFFFFFFFFFFFFFF000000000000
F9FFFFFF0100090000000000000000000000FFFFFFFFFFFFFFFF000000000000
00000000000000080000004C616E67756167650100000001000000FFFFFFFFFF
FFFFFF00000000000000000000000000090000004265686176696F7273020000
0002000000FFFFFFFFFFFFFFFF0000000000000000000000000005000000546F
@ -99,7 +99,9 @@ object frmOptions: TfrmOptions
652074797065730500000005000000FFFFFFFFFFFFFFFF000000000000000000
0000000008000000486F74206B6579730600000006000000FFFFFFFFFFFFFFFF
0000000000000000000000000007000000506C7567696E730800000008000000
FFFFFFFFFFFFFFFF00000000000000000000000000060000004C61796F7574
FFFFFFFFFFFFFFFF00000000000000000000000000060000004C61796F757409
0000000900000009000000FFFFFFFF000000000000000000000000000F000000
46696C65206F7065726174696F6E73
}
end
object Panel3: TPanel
@ -117,15 +119,15 @@ object frmOptions: TfrmOptions
Width = 454
Align = alClient
OnPageChanged = nbNotebookPageChanged
PageIndex = 0
PageIndex = 9
ShowTabs = False
TabOrder = 0
object pgLng: TPage
Caption = 'pgLng'
ClientWidth = 446
ClientHeight = 315
ClientHeight = 333
object lngList: TListBox
Height = 315
Height = 333
Width = 446
Align = alClient
TabOrder = 0
@ -133,6 +135,8 @@ object frmOptions: TfrmOptions
end
object pgBehav: TPage
Caption = 'pgBehav'
ClientWidth = 446
ClientHeight = 315
object lblTerm: TLabel
Left = 8
Height = 14
@ -231,7 +235,7 @@ object frmOptions: TfrmOptions
object lblIconsSize: TLabel
Left = 14
Height = 14
Top = 112
Top = 118
Width = 53
Caption = 'Icons Size:'
ParentColor = False
@ -239,7 +243,7 @@ object frmOptions: TfrmOptions
object cbIconsSize: TComboBox
Left = 86
Height = 21
Top = 105
Top = 111
Width = 91
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending]
Enabled = False
@ -255,22 +259,14 @@ object frmOptions: TfrmOptions
TabOrder = 0
Text = '16x16'
end
object cbDropReadOnlyFlag: TCheckBox
Left = 6
Height = 19
Top = -3
Width = 112
Caption = 'Drop readonly flag'
TabOrder = 1
end
object cbShowIcons: TCheckBox
Left = 6
Left = 14
Height = 19
Top = 84
Top = 82
Width = 81
Caption = 'Show icons'
OnChange = cbShowIconsChange
TabOrder = 2
TabOrder = 1
end
end
end
@ -1300,6 +1296,61 @@ object frmOptions: TfrmOptions
end
end
end
object pgFileOp: TPage
Caption = 'pgFileOp'
ClientWidth = 446
ClientHeight = 315
object gbCopyBufferSize: TGroupBox
Left = 10
Height = 105
Top = 6
Width = 424
Caption = '&Buffer size for files:'
ClientHeight = 87
ClientWidth = 420
TabOrder = 0
object lblCopyBufferSize: TLabel
AnchorSideTop.Side = asrBottom
Left = 14
Height = 14
Top = 6
Width = 79
Caption = 'Buffer size (Kb):'
ParentColor = False
end
object edtCopyBufferSize: TEdit
AnchorSideTop.Control = lblCopyBufferSize
AnchorSideTop.Side = asrCenter
AnchorSideBottom.Side = asrCenter
Left = 326
Height = 23
Top = 2
Width = 80
TabOrder = 0
end
end
object gbGeneralOptions: TGroupBox
AnchorSideTop.Control = gbCopyBufferSize
AnchorSideTop.Side = asrBottom
Left = 10
Height = 105
Top = 117
Width = 424
BorderSpacing.Top = 6
Caption = 'General options'
ClientHeight = 87
ClientWidth = 420
TabOrder = 1
object cbDropReadOnlyFlag: TCheckBox
Left = 14
Height = 19
Top = 6
Width = 112
Caption = 'Drop readonly flag'
TabOrder = 0
end
end
end
end
object pnlCaption: TPanel
Left = 1
@ -1316,12 +1367,10 @@ object frmOptions: TfrmOptions
end
end
object dlgFnt: TFontDialog
Title = 'Âûáðàòü øðèôò'
left = 48
top = 320
end
object optColorDialog: TColorDialog
Title = 'Âûáðàòü öâåò'
left = 83
top = 320
end
@ -1653,7 +1702,6 @@ object frmOptions: TfrmOptions
}
end
object odOpenDialog: TOpenDialog
Title = 'Îòêðûòü ñóùåñòâóþùèé ôàéë'
FilterIndex = 0
left = 120
top = 320

View file

@ -14,7 +14,6 @@ TFRMOPTIONS.CBSHORTFILESIZEFORMAT.CAPTION=Short Filesize format
TFRMOPTIONS.CBSEPARATEEXT.CAPTION=Separate extension
TFRMOPTIONS.LBLICONSSIZE.CAPTION=Icons Size:
TFRMOPTIONS.CBICONSSIZE.TEXT=16x16
TFRMOPTIONS.CBDROPREADONLYFLAG.CAPTION=Drop readonly flag
TFRMOPTIONS.CBSHOWICONS.CAPTION=Show icons
TFRMOPTIONS.PGTOOLS.CAPTION=pgTools
TFRMOPTIONS.CBEXTEDITOR.CAPTION=External editor
@ -88,4 +87,9 @@ TFRMOPTIONS.CBTWODISKPANELS.CAPTION=Show two drive button bars (fixed width, abo
TFRMOPTIONS.CBSHOWTABS.CAPTION=Sho&w folder tabs
TFRMOPTIONS.CBFLATINTERFACE.CAPTION=Flat interface
TFRMOPTIONS.CBFLATTOOLBAR.CAPTION=Flat buttons
TFRMOPTIONS.PGFILEOP.CAPTION=pgFileOp
TFRMOPTIONS.GBCOPYBUFFERSIZE.CAPTION=&Buffer size for files:
TFRMOPTIONS.LBLCOPYBUFFERSIZE.CAPTION=Buffer size (Kb):
TFRMOPTIONS.GBGENERALOPTIONS.CAPTION=General options
TFRMOPTIONS.CBDROPREADONLYFLAG.CAPTION=Drop readonly flag
TFRMOPTIONS.PNLCAPTION.CAPTION=Language

View file

@ -67,6 +67,7 @@ type
cbActions: TComboBox;
cbCaseSensitiveSort: TCheckBox;
cbDirSelect: TCheckBox;
cbDropReadOnlyFlag: TCheckBox;
cbEditorFont: TComboBox;
cbExtDiffer: TCheckBox;
cbExtEditor: TCheckBox;
@ -79,7 +80,6 @@ type
cbViewerFont: TComboBox;
cbExt: TComboBox;
cbWCXPath: TComboBox;
cbDropReadOnlyFlag: TCheckBox;
cbFlatInterface: TCheckBox;
cbFlatToolBar: TCheckBox;
cbShowIcons: TCheckBox;
@ -94,6 +94,7 @@ type
cTextLabel: TLabel;
dlgFnt: TFontDialog;
edHotKey: TEdit;
edtCopyBufferSize: TEdit;
edtCategoryName: TEdit;
edtCategoryMask: TEdit;
edtEditorSize: TSpinEdit;
@ -123,7 +124,10 @@ type
cbShowTabHeader: TCheckBox;
cbShowTabs: TCheckBox;
cbTwoDiskPanels: TCheckBox;
gbCopyBufferSize: TGroupBox;
gbGeneralOptions: TGroupBox;
ilTreeView: TImageList;
lblCopyBufferSize: TLabel;
lblIconsSize: TLabel;
lblInstalledPlugins: TLabel;
lblCategoryColor: TLabel;
@ -148,6 +152,7 @@ type
nbNotebook: TNotebook;
odOpenDialog: TOpenDialog;
optColorDialog: TColorDialog;
pgFileOp: TPage;
pbExample: TPaintBox;
pcPluginsTypes: TPageControl;
pcPluginsType: TPageControl;
@ -269,7 +274,6 @@ begin
cbExtViewer.Checked:=gUseExtView;
cbExtDiffer.Checked:=gUseExtDiff;
cbSeparateExt.Checked:=gSeparateExt;
cbDropReadOnlyFlag.Checked := gDropReadOnlyFlag;
edtExtEditor.Text:= gExtEdit;
edtExtViewer.Text:=gExtView;
@ -304,6 +308,10 @@ begin
cbShowIcons.Checked := gShowIcons;
{ File operations }
edtCopyBufferSize.Text:= IntToStr(gCopyBlockSize div 1024);
cbDropReadOnlyFlag.Checked := gDropReadOnlyFlag;
{ Icons sizes in file panels }
cbIconsSize.Text := IntToStr(gIconsSize) + 'x' + IntToStr(gIconsSize);
// ToDo lang to tsColor tsHotKey
@ -482,7 +490,6 @@ begin
gUseExtView:=cbExtViewer.Checked;
gUseExtDiff:=cbExtDiffer.Checked;
gSeparateExt:=cbSeparateExt.Checked;
gDropReadOnlyFlag := cbDropReadOnlyFlag.Checked;
gExtEdit:= edtExtEditor.Text;
gExtView:= edtExtViewer.Text;
@ -511,6 +518,10 @@ begin
gCursorText := cbCursorText.Color;
gShowIcons := cbShowIcons.Checked;
{ File operations }
gCopyBlockSize := StrToIntDef(edtCopyBufferSize.Text, gCopyBlockSize) * 1024;
gDropReadOnlyFlag := cbDropReadOnlyFlag.Checked;
frmMain.UpdateWindowView;
frmMain.Repaint; // for panels repaint

View file

@ -1230,6 +1230,22 @@ msgstr ""
msgid "Language"
msgstr ""
#: TFRMOPTIONS.PGFILEOP.CAPTION
msgid "pgFileOp"
msgstr ""
#: TFRMOPTIONS.GBCOPYBUFFERSIZE.CAPTION
msgid "&Buffer size for files:"
msgstr ""
#: TFRMOPTIONS.LBLCOPYBUFFERSIZE.CAPTION
msgid "Buffer size (Kb):"
msgstr ""
#: TFRMOPTIONS.GBGENERALOPTIONS.CAPTION
msgid "General options"
msgstr ""
#: TFRMABOUT.CAPTION
msgid "About"
msgstr ""

View file

@ -1,4 +1,4 @@
#: ulng.rsmsgnotdelete
#: ulng.rsmsgnotdelete
msgid "Can not delete file \%s"
msgstr "Не могу удалить файл %s"
@ -1222,6 +1222,22 @@ msgstr "Плоские"
msgid "Language"
msgstr ""
#: TFRMOPTIONS.PGFILEOP.CAPTION
msgid "pgFileOp"
msgstr ""
#: TFRMOPTIONS.GBCOPYBUFFERSIZE.CAPTION
msgid "&Buffer size for files:"
msgstr "&Размер буфера для файлов:"
#: TFRMOPTIONS.LBLCOPYBUFFERSIZE.CAPTION
msgid "Buffer size (Kb):"
msgstr "Размер буфера (Кб):"
#: TFRMOPTIONS.GBGENERALOPTIONS.CAPTION
msgid "General options"
msgstr "Основные настройки"
#: TFRMABOUT.CAPTION
msgid "About"
msgstr "О программе..."

View file

@ -31,9 +31,6 @@ implementation
uses
SysUtils, Classes, uLng, uGlobs, uShowMsg, uFileProcs, uFindEx, uDCUtils, uOSUtils;
const
cBlockSize=16384; // size of block if copyfile
procedure TCopyThread.MainExecute;
var
pr:PFileRecItem;
@ -155,7 +152,7 @@ begin
Result:=False;
writeln('CopyFile:',sSrc,' ',sDst);
GetMem(Buffer, cBlockSize+1);
GetMem(Buffer, gCopyBlockSize+1);
dst:=nil; // for safety exception handling
try
try
@ -177,22 +174,22 @@ begin
// writeln(FFileOpDlg.iProgress1Max);
Synchronize(@FFileOpDlg.UpdateDlg);
while (dst.Size+cBlockSize)<= (src.Size+iDstBeg) do
while (dst.Size+gCopyBlockSize)<= (src.Size+iDstBeg) do
begin
if Terminated then
Exit;
Src.ReadBuffer(Buffer^, cBlockSize);
Src.ReadBuffer(Buffer^, gCopyBlockSize);
repeat
try
bRetry := False;
dst.WriteBuffer(Buffer^, cBlockSize);
dst.WriteBuffer(Buffer^, gCopyBlockSize);
except
on EWriteError do
begin
{Check disk free space}
GetDiskFreeSpace(sDstPath, iFreeDiskSize, iTotalDiskSize);
if cBlockSize > iFreeDiskSize then
if gCopyBlockSize > iFreeDiskSize then
case MsgBoxForThread(Self, rsMsgNoFreeSpaceRetry, [msmbYes, msmbNo,msmbSkip], msmbYes, msmbNo) of
mmrYes:
bRetry := True;

View file

@ -65,7 +65,6 @@ var
gShortFileSizeFormat:Boolean=True;
gSeparateExt:Boolean=False; // draw filename and extension separate
gDropReadOnlyFlag : Boolean = True;
{Tools page}
@ -105,6 +104,12 @@ var
gDirTabLimit : Integer;
gUseMmapInSearch : Boolean;
gCustomDriveIcons : Boolean; // for use custom drive icons under windows
{File operations page}
gCopyBlockSize : Integer;
gDropReadOnlyFlag : Boolean = True;
const
{ Tabs options }
tb_always_visible = 1;
@ -245,7 +250,6 @@ begin
gUseExtView := gIni.ReadBool('Configuration', 'UseExtView', False);
gUseExtDiff := gIni.ReadBool('Configuration', 'UseExtDiff', False);
gSeparateExt := gIni.ReadBool('Configuration', 'SeparateExt', True);
gDropReadOnlyFlag := gIni.ReadBool('Configuration', 'DropReadOnlyFlag', True);
gExtEdit := gIni.ReadString('Configuration', 'ExtEdit', '');
gExtView := gIni.ReadString('Configuration', 'ExtView', '');
@ -270,6 +274,9 @@ begin
gCursorColor := gIni.ReadInteger('Colors', 'CursorColor', clHighlight);
gCursorText := gIni.ReadInteger('Colors', 'CursorText', clHighlightedText);
gCopyBlockSize := gIni.ReadInteger('Configuration', 'CopyBlockSize', 16384);
gDropReadOnlyFlag := gIni.ReadBool('Configuration', 'DropReadOnlyFlag', True);
gShowIcons := gIni.ReadBool('Configuration', 'ShowIcons', True);
gIconsSize := gIni.ReadInteger('Configuration', 'IconsSize', 16);
@ -360,7 +367,6 @@ begin
gIni.WriteBool('Configuration', 'UseExtView', gUseExtView);
gIni.WriteBool('Configuration', 'UseExtDiff', gUseExtDiff);
gIni.WriteBool('Configuration', 'SeparateExt', gSeparateExt);
gIni.WriteBool('Configuration', 'DropReadOnlyFlag', gDropReadOnlyFlag);
gIni.WriteString('Configuration', 'ExtEdit', gExtEdit);
gIni.WriteString('Configuration', 'ExtView', gExtView);
@ -383,6 +389,8 @@ begin
gIni.WriteInteger('Colors', 'CursorColor', gCursorColor);
gIni.WriteInteger('Colors', 'CursorText', gCursorText);
gIni.WriteInteger('Configuration', 'CopyBlockSize', gCopyBlockSize);
gIni.WriteBool('Configuration', 'DropReadOnlyFlag', gDropReadOnlyFlag);
gIni.WriteBool('Configuration', 'ShowIcons', gShowIcons);
gIni.WriteInteger('Configuration', 'IconsSize', gIconsSize);