summaryrefslogtreecommitdiff
path: root/tools/iceit/Unit1.pas
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2013-01-18 09:05:25 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2013-01-18 09:05:25 +0000
commite8084995ccc9379b805c700e3aba6a0e633367e3 (patch)
tree2730f7ae979c1a96ce6825775ac13f9f0b99da97 /tools/iceit/Unit1.pas
parentc8e5289d64b3de8ca4db62c944d9823c38553821 (diff)
- iceit patcher fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@3152 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'tools/iceit/Unit1.pas')
-rw-r--r--tools/iceit/Unit1.pas33
1 files changed, 15 insertions, 18 deletions
diff --git a/tools/iceit/Unit1.pas b/tools/iceit/Unit1.pas
index e49f9f40d8..0381147e42 100644
--- a/tools/iceit/Unit1.pas
+++ b/tools/iceit/Unit1.pas
@@ -28,7 +28,6 @@ type
procedure SelectNoneClick(Sender: TObject);
procedure IceItClick(Sender: TObject);
procedure MirandaPathClick(Sender: TObject);
- procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
function FillCombo(typ:string):integer;
@@ -360,7 +359,7 @@ begin
raise;
end;
if not EndUpdateResource(H, False) then
- ErrorWithLastError('EndUpdateResource failed');
+ ErrorWithLastError('EndUpdateResource failed');
Result := False;
finally
FreeMem(Ico);
@@ -410,14 +409,19 @@ var
xTemp: String;
MaxCount: Integer;
res:String;
+ size:Integer;
begin
if FileExists(Edit1.Text) then
begin
+ AssignFile(Log, 'iceit.log');
+ Rewrite(Log);
+
MaxCount := 0;
for n := 0 to CheckListBox1.Items.Count - 1 do
+ begin
if CheckListBox1.Checked[n] then inc(MaxCount);
- for n := 0 to CheckListBox1.Items.Count - 1 do
CheckListBox1.Items[n] := SetValue(CheckListBox1.Items[n], 1, 'NONE');
+ end;
MirandaPath := ExtractFileDir(Edit1.Text);
ProgressBar1.Min := 0;
ProgressBar1.Max := MaxCount;
@@ -430,8 +434,8 @@ begin
S := LowerCase(S);
// keep the order as for FillCombo function (atm Core<Plugins<Icons)
if n < PluginsItem then F := '\core'
- else if n < IconsItem then F := '\plugins'
- else F := '\icons';
+ else if n < IconsItem then F := '\icons'
+ else F := '\plugins';
StatusBar1.Panels[0].Text := ' Processing: ' + S;
if (S = 'miranda32') or (S = 'miranda64') then
@@ -457,7 +461,7 @@ begin
xTemp := xFilePath + '.temp';
CopyFile(PChar(xFilePath), Pchar(xTemp), False);
- if not ProgressUpdate(xTemp, xIcoPath) then
+ if ProgressUpdate(xTemp, xIcoPath) then
res := 'ERROR'
else
begin
@@ -469,7 +473,11 @@ begin
end;
if FileExists(xTemp) then DeleteFile(xTemp);
end;
- end // for
+ end; // for
+
+ size:=FileSize(Log);
+ CloseFile(Log);
+ if size = 0 then DeleteFile('iceit.log');
end
else
begin
@@ -558,8 +566,6 @@ end;
procedure TForm1.FormCreate(Sender: TObject);
begin
- AssignFile(Log, 'iceit.log');
- Rewrite(Log);
IcePath := ExtractFilePath(ParamStr(0));
CoreItem := FillCombo('core');
@@ -567,15 +573,6 @@ begin
IconsItem := FillCombo('plugins');
end;
-procedure TForm1.FormDestroy(Sender: TObject);
-var
- size:integer;
-begin
- size:=FileSize(Log);
- CloseFile(Log);
- if size = 0 then DeleteFile('iceit.log');
-end;
-
function TForm1.ProgressUpdate(const FileName, IcoName: String): Boolean;
var
IconGroups: TStringList;