Fix: Bug [ 1661820 ] Copy, move, delete threads is not working on Linux

This commit is contained in:
Alexander Koblov 2007-03-20 23:07:24 +00:00
commit f3a132272c
4 changed files with 67 additions and 61 deletions

View file

@ -1,41 +1,42 @@
object frmCopyDlg: TfrmCopyDlg
inherited frmCopyDlg: TfrmCopyDlg
Left = 255
Height = 162
Top = 198
Width = 345
HorzScrollBar.Page = 344
HorzScrollBar.Range = 337
VertScrollBar.Page = 161
VertScrollBar.Range = 143
ActiveControl = btnOK
BorderIcons = [biSystemMenu, biMinimize]
BorderStyle = bsSingle
Caption = 'frmCopyDlg'
OnKeyPress = frmCopyDlgKeyPress
OnShow = frmCopyDlgShow
PixelsPerInch = 96
Position = poScreenCenter
TextHeight = 16
HorzScrollBar.Page = 344
HorzScrollBar.Range = 337
VertScrollBar.Page = 161
VertScrollBar.Range = 143
Left = 160
Height = 162
Top = 539
Width = 345
object lblCopySrc: TLabel
Caption = 'lblCopySrc'
Color = clNone
ParentColor = False
Left = 8
Height = 14
Top = 8
Width = 51
end
object lblFileType: TLabel
Caption = 'lblFileType'
Caption = 'lblCopySrc'
Color = clNone
ParentColor = False
end
object lblFileType: TLabel
Left = 8
Height = 14
Top = 64
Width = 51
Caption = 'lblFileType'
Color = clNone
ParentColor = False
end
object btnOK: TBitBtn
Anchors = [akTop, akRight]
Left = 176
Height = 23
Top = 120
Width = 75
BorderSpacing.InnerBorder = 2
Caption = '&OK'
Default = True
@ -43,13 +44,12 @@ object frmCopyDlg: TfrmCopyDlg
ModalResult = 1
NumGlyphs = 0
TabOrder = 0
Left = 176
end
object btnCancel: TBitBtn
Left = 264
Height = 23
Top = 120
Width = 75
end
object btnCancel: TBitBtn
Anchors = [akTop, akRight]
BorderSpacing.InnerBorder = 2
Cancel = True
Caption = 'Cancel'
@ -57,29 +57,24 @@ object frmCopyDlg: TfrmCopyDlg
ModalResult = 2
NumGlyphs = 0
TabOrder = 1
Left = 262
Height = 23
Top = 120
Width = 75
end
object edtDst: TEdit
TabOrder = 2
Text = 'edtDst'
Left = 8
Height = 24
Top = 32
Width = 329
TabOrder = 2
end
object cmbFileType: TComboBox
Left = 8
Height = 21
Top = 88
Width = 329
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending]
Enabled = False
ItemHeight = 18
MaxLength = 0
ParentCtl3D = False
TabOrder = 3
Left = 8
Height = 21
Top = 88
Width = 329
end
end

View file

@ -1,27 +1,25 @@
{ This is an automatically generated lazarus resource file }
LazarusResources.Add('TfrmCopyDlg','FORMDATA',[
'TPF0'#11'TfrmCopyDlg'#10'frmCopyDlg'#13'ActiveControl'#7#5'btnOK'#11'BorderI'
+'cons'#11#12'biSystemMenu'#10'biMinimize'#0#11'BorderStyle'#7#8'bsSingle'#7
+'Caption'#6#10'frmCopyDlg'#10'OnKeyPress'#7#18'frmCopyDlgKeyPress'#6'OnShow'
+#7#14'frmCopyDlgShow'#13'PixelsPerInch'#2'`'#8'Position'#7#14'poScreenCenter'
+#10'TextHeight'#2#16#18'HorzScrollBar.Page'#3'X'#1#19'HorzScrollBar.Range'#3
+'Q'#1#18'VertScrollBar.Page'#3#161#0#19'VertScrollBar.Range'#3#143#0#4'Left'
+#3#160#0#6'Height'#3#162#0#3'Top'#3#27#2#5'Width'#3'Y'#1#0#6'TLabel'#10'lblC'
+'opySrc'#7'Caption'#6#10'lblCopySrc'#5'Color'#7#6'clNone'#11'ParentColor'#8#4
+'Left'#2#8#6'Height'#2#14#3'Top'#2#8#5'Width'#2'3'#0#0#6'TLabel'#11'lblFileT'
+'ype'#7'Caption'#6#11'lblFileType'#5'Color'#7#6'clNone'#11'ParentColor'#8#4
+'Left'#2#8#6'Height'#2#14#3'Top'#2'@'#5'Width'#2'3'#0#0#7'TBitBtn'#5'btnOK'#7
+'Anchors'#11#5'akTop'#7'akRight'#0#25'BorderSpacing.InnerBorder'#2#2#7'Capti'
+'on'#6#3'&OK'#7'Default'#9#4'Kind'#7#4'bkOK'#11'ModalResult'#2#1#9'NumGlyphs'
+#2#0#8'TabOrder'#2#0#4'Left'#3#176#0#6'Height'#2#23#3'Top'#2'x'#5'Width'#2'K'
+#0#0#7'TBitBtn'#9'btnCancel'#7'Anchors'#11#5'akTop'#7'akRight'#0#25'BorderSp'
+'acing.InnerBorder'#2#2#6'Cancel'#9#7'Caption'#6#6'Cancel'#4'Kind'#7#8'bkCan'
+'cel'#11'ModalResult'#2#2#9'NumGlyphs'#2#0#8'TabOrder'#2#1#4'Left'#3#6#1#6'H'
+'eight'#2#23#3'Top'#2'x'#5'Width'#2'K'#0#0#5'TEdit'#6'edtDst'#8'TabOrder'#2#2
+#4'Text'#6#6'edtDst'#4'Left'#2#8#6'Height'#2#24#3'Top'#2' '#5'Width'#3'I'#1#0
+#0#9'TComboBox'#11'cmbFileType'#16'AutoCompleteText'#11#22'cbactEndOfLineCom'
+'plete'#20'cbactSearchAscending'#0#7'Enabled'#8#10'ItemHeight'#2#18#9'MaxLen'
+'gth'#2#0#11'ParentCtl3D'#8#8'TabOrder'#2#3#4'Left'#2#8#6'Height'#2#21#3'Top'
+#2'X'#5'Width'#3'I'#1#0#0#0
'TPF0'#241#11'TfrmCopyDlg'#10'frmCopyDlg'#4'Left'#3#255#0#6'Height'#3#162#0#3
+'Top'#3#198#0#5'Width'#3'Y'#1#18'HorzScrollBar.Page'#3'X'#1#19'HorzScrollBar'
+'.Range'#3'Q'#1#18'VertScrollBar.Page'#3#161#0#19'VertScrollBar.Range'#3#143
+#0#13'ActiveControl'#7#5'btnOK'#11'BorderIcons'#11#12'biSystemMenu'#10'biMin'
+'imize'#0#11'BorderStyle'#7#8'bsSingle'#7'Caption'#6#10'frmCopyDlg'#10'OnKey'
+'Press'#7#18'frmCopyDlgKeyPress'#6'OnShow'#7#14'frmCopyDlgShow'#8'Position'#7
+#14'poScreenCenter'#0#6'TLabel'#10'lblCopySrc'#4'Left'#2#8#6'Height'#2#14#3
+'Top'#2#8#5'Width'#2'3'#7'Caption'#6#10'lblCopySrc'#5'Color'#7#6'clNone'#11
+'ParentColor'#8#0#0#6'TLabel'#11'lblFileType'#4'Left'#2#8#6'Height'#2#14#3'T'
+'op'#2'@'#5'Width'#2'3'#7'Caption'#6#11'lblFileType'#5'Color'#7#6'clNone'#11
+'ParentColor'#8#0#0#7'TBitBtn'#5'btnOK'#4'Left'#3#176#0#6'Height'#2#23#3'Top'
+#2'x'#5'Width'#2'K'#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#3'&OK'#7
+'Default'#9#4'Kind'#7#4'bkOK'#11'ModalResult'#2#1#9'NumGlyphs'#2#0#8'TabOrde'
+'r'#2#0#0#0#7'TBitBtn'#9'btnCancel'#4'Left'#3#8#1#6'Height'#2#23#3'Top'#2'x'
+#5'Width'#2'K'#25'BorderSpacing.InnerBorder'#2#2#6'Cancel'#9#7'Caption'#6#6
+'Cancel'#4'Kind'#7#8'bkCancel'#11'ModalResult'#2#2#9'NumGlyphs'#2#0#8'TabOrd'
+'er'#2#1#0#0#5'TEdit'#6'edtDst'#4'Left'#2#8#6'Height'#2#24#3'Top'#2' '#5'Wid'
+'th'#3'I'#1#8'TabOrder'#2#2#0#0#9'TComboBox'#11'cmbFileType'#4'Left'#2#8#6'H'
+'eight'#2#21#3'Top'#2'X'#5'Width'#3'I'#1#16'AutoCompleteText'#11#22'cbactEnd'
+'OfLineComplete'#20'cbactSearchAscending'#0#7'Enabled'#8#10'ItemHeight'#2#18
+#9'MaxLength'#2#0#11'ParentCtl3D'#8#8'TabOrder'#2#3#0#0#0
]);

View file

@ -1767,7 +1767,7 @@ try
end;
except
FreeAndNil(frmFileOp);
//FreeAndNil(frmFileOp);
end;
end;
@ -1832,8 +1832,9 @@ begin
end;
except
FreeAndNil(frmFileOp);
//frmFileOp.Free;
end;
end;
procedure TfrmMain.actShiftF5Execute(Sender: TObject);

View file

@ -22,6 +22,9 @@ uses
type
{$IFDEF NOFAKETHREAD}
{ TFileOpThread }
TFileOpThread = class(TThread) //check compilation
{$ELSE}
TFileOpThread = class(TFakeThread)
@ -55,6 +58,7 @@ type
Function CorrectDstName(const sName:String):String;
Function CorrectDstExt(const sExt:String):String;
procedure ShowDlgFileExist; //Alexx2000
procedure FileOpDlgEnabled;
public
FFileOpDlg: TfrmFileOp; // progress window
@ -209,7 +213,10 @@ try
finally
if UseForm then
FFileOpDlg.Close; // FreeAndNil(FFileOpDlg);
begin
Synchronize(@FFileOpDlg.Close);
WriteLN('TFileOpThread finally');
end;
if assigned(NewFileList) then
FreeAndNil(NewFileList);
end;
@ -251,11 +258,16 @@ begin
{ writeln(FloatToStr(Now));
writeln(sEstimated);}
UpdateDlg;
Synchronize(@FFileOpDlg.UpdateDlg);
end;
end;
procedure TFileOpThread.FileOpDlgEnabled;
begin
FFileOpDlg.Enabled := not FFileOpDlg.Enabled;
end;
procedure TFileOpThread.ShowDlgFileExist;
begin
@ -273,9 +285,9 @@ begin
{For pseudo modal window}
Synchronize(@ShowDlgFileExist);
FFileOpDlg.Enabled := False;
Synchronize(@FileOpDlgEnabled);
while (FDlgFileExist.iSelected) < 0 do Sleep(10);
FFileOpDlg.Enabled := True;
Synchronize(@FileOpDlgEnabled);
{/For pseudo modal window}
DlgResult:=TMyMsgResult(FMyMsgButtons[FDlgFileExist.iSelected]);