fixed bug at48201

This commit is contained in:
Christian Hammacher 2006-12-09 18:23:52 +00:00
parent c5dc780635
commit 0c345ceebc
4 changed files with 39 additions and 22 deletions

Binary file not shown.

View File

@ -3,7 +3,7 @@ unit UnitInstall;
interface interface
uses SysUtils, Classes, Windows, Graphics, Forms, ShellAPI, Controls, Messages, uses SysUtils, Classes, Windows, Graphics, Forms, ShellAPI, Controls, Messages,
TlHelp32, IdFTPCommon, ComCtrls, JclFileUtils, Dialogs; TlHelp32, IdFTPCommon, ComCtrls, Dialogs, JclFileUtils;
type TMod = (modNone, modCS, modDoD, modTFC, modNS, modTS, modESF); type TMod = (modNone, modCS, modDoD, modTFC, modNS, modTS, modESF);
type TOS = (osWindows, osLinux32, osLinux64); type TOS = (osWindows, osLinux32, osLinux64);
@ -614,10 +614,12 @@ begin
ePath := '/'; ePath := '/';
CurNode := frmMain.trvDirectories.Selected; CurNode := frmMain.trvDirectories.Selected;
repeat if (Assigned(CurNode)) then begin
ePath := '/' + CurNode.Text + ePath; repeat
CurNode := CurNode.Parent; ePath := '/' + CurNode.Text + ePath;
until (not Assigned(CurNode)); CurNode := CurNode.Parent;
until (not Assigned(CurNode));
end;
Screen.Cursor := crAppStart; Screen.Cursor := crAppStart;
frmMain.cmdCancel.Show; frmMain.cmdCancel.Show;

View File

@ -6340,11 +6340,12 @@ object frmMain: TfrmMain
BorderStyle = bsNone BorderStyle = bsNone
Images = ilImages Images = ilImages
Indent = 19 Indent = 19
ReadOnly = True
TabOrder = 0 TabOrder = 0
OnChange = trvDirectoriesChange
OnCollapsing = trvDirectoriesCollapsing OnCollapsing = trvDirectoriesCollapsing
OnExpanding = trvDirectoriesExpanding OnExpanding = trvDirectoriesExpanding
OnExpanded = trvDirectoriesExpanded OnExpanded = trvDirectoriesExpanded
OnMouseDown = trvDirectoriesMouseDown
end end
end end
object cboGameAddon: TFlatComboBox object cboGameAddon: TFlatComboBox
@ -6769,6 +6770,7 @@ object frmMain: TfrmMain
object IdFTP: TIdFTP object IdFTP: TIdFTP
Intercept = IdLogFile Intercept = IdLogFile
MaxLineAction = maException MaxLineAction = maException
ReadTimeout = 0
RecvBufferSize = 1024 RecvBufferSize = 1024
SendBufferSize = 1024 SendBufferSize = 1024
OnWork = IdFTPWork OnWork = IdFTPWork

View File

@ -123,7 +123,6 @@ type
procedure cmdProxySettingsClick(Sender: TObject); procedure cmdProxySettingsClick(Sender: TObject);
procedure txtPortChange(Sender: TObject); procedure txtPortChange(Sender: TObject);
procedure trvDirectoriesExpanded(Sender: TObject; Node: TTreeNode); procedure trvDirectoriesExpanded(Sender: TObject; Node: TTreeNode);
procedure trvDirectoriesChange(Sender: TObject; Node: TTreeNode);
procedure FormDestroy(Sender: TObject); procedure FormDestroy(Sender: TObject);
procedure IdFTPWork(Sender: TObject; AWorkMode: TWorkMode; procedure IdFTPWork(Sender: TObject; AWorkMode: TWorkMode;
const AWorkCount: Integer); const AWorkCount: Integer);
@ -137,6 +136,8 @@ type
procedure frbFTPClick(Sender: TObject); procedure frbFTPClick(Sender: TObject);
procedure frbLocalClick(Sender: TObject); procedure frbLocalClick(Sender: TObject);
procedure trvModsClick(Sender: TObject); procedure trvModsClick(Sender: TObject);
procedure trvDirectoriesMouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
private private
OldProgress: Integer; OldProgress: Integer;
CurrProgress: Integer; CurrProgress: Integer;
@ -214,10 +215,12 @@ begin
eStr := TStringList.Create; eStr := TStringList.Create;
ePath := '/'; ePath := '/';
CurNode := trvDirectories.Selected; CurNode := trvDirectories.Selected;
repeat if (Assigned(CurNode)) then begin
ePath := '/' + CurNode.Text + ePath; repeat
CurNode := CurNode.Parent; ePath := '/' + CurNode.Text + ePath;
until (not Assigned(CurNode)); CurNode := CurNode.Parent;
until (not Assigned(CurNode));
end;
try try
IdFTP.ChangeDir(ePath); IdFTP.ChangeDir(ePath);
@ -236,6 +239,7 @@ begin
if eStr.IndexOf('liblist.gam') = -1 then begin if eStr.IndexOf('liblist.gam') = -1 then begin
MessageBox(Handle, 'Invalid directory. Please select your mod directory and try again.', PChar(Application.Title), MB_ICONWARNING); MessageBox(Handle, 'Invalid directory. Please select your mod directory and try again.', PChar(Application.Title), MB_ICONWARNING);
eStr.Free; eStr.Free;
Screen.Cursor := crDefault;
exit; exit;
end end
else else
@ -639,6 +643,7 @@ begin
cmdConnect.Enabled := True; cmdConnect.Enabled := True;
cmdConnect.Caption := 'Disconnect'; cmdConnect.Caption := 'Disconnect';
cmdCancel.Caption := '&Close'; cmdCancel.Caption := '&Close';
cmdNext.Enabled := True;
CurNode := nil; CurNode := nil;
if eStr.Count <> 0 then begin if eStr.Count <> 0 then begin
@ -816,10 +821,12 @@ begin
// get complete path // get complete path
ePath := '/'; ePath := '/';
CurNode := Node; CurNode := Node;
repeat if (Assigned(CurNode)) then begin
ePath := '/' + CurNode.Text + ePath; repeat
CurNode := CurNode.Parent; ePath := '/' + CurNode.Text + ePath;
until (not Assigned(CurNode)); CurNode := CurNode.Parent;
until (not Assigned(CurNode));
end;
// change dir and add directories in it // change dir and add directories in it
try try
Repaint; Repaint;
@ -838,11 +845,6 @@ begin
end; end;
end; end;
procedure TfrmMain.trvDirectoriesChange(Sender: TObject; Node: TTreeNode);
begin
cmdNext.Enabled := Assigned(trvDirectories.Selected);
end;
procedure TfrmMain.FormDestroy(Sender: TObject); procedure TfrmMain.FormDestroy(Sender: TObject);
begin begin
FileList.Free; FileList.Free;
@ -936,4 +938,15 @@ begin
cmdNext.Enabled := (Assigned(trvMods.Selected)); cmdNext.Enabled := (Assigned(trvMods.Selected));
end; end;
procedure TfrmMain.trvDirectoriesMouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var Node: TTreeNode;
begin
Node := trvDirectories.GetNodeAt(X, Y);
if (Assigned(Node)) then begin
if (Node.DisplayRect(True).Right < X) then
trvDirectories.Selected := nil;
end;
end;
end. end.