1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-29 04:22:16 -05:00

Extension changes

This commit is contained in:
Merlijn Wajer 2010-07-16 02:10:01 +02:00
parent 8160f7c0fa
commit 6e08942bed
2 changed files with 35 additions and 30 deletions

View File

@ -38,10 +38,10 @@ var
DeContents : string; DeContents : string;
Failed : boolean; Failed : boolean;
begin begin
Memo.Lines.Add('Downloading Reflection...'); Memo.Lines.Add('Downloading Reflection...');
Contents := GetPage('http://wizzup.org/static/srl/srlref.tar.bz2'); Contents := GetPage('http://wizzup.org/static/srl/srlref.tar.bz2');
Failed := True; Failed := True;
Memo.Lines.Add('Uncompressing Reflection...'); Memo.Lines.Add('Uncompressing Reflection...');
if DecompressBZip2(Contents,DeContents,4096) then if DecompressBZip2(Contents,DeContents,4096) then
if UnTarEx(DeContents,IncludePath,true) then if UnTarEx(DeContents,IncludePath,true) then
Failed := False; Failed := False;
@ -77,9 +77,6 @@ begin
Exit; Exit;
Updating := True; Updating := True;
GetLocalVersion(LocalR);
GetOnlineVersion(OnlineR);
if (LocalR < OnlineR) then if (LocalR < OnlineR) then
begin begin
case MessageDlg('Reflection Updater', 'Updates are available. '+ case MessageDlg('Reflection Updater', 'Updates are available. '+
@ -98,7 +95,6 @@ begin
f.ShowModal; f.ShowModal;
end else end else
begin begin
MessageDlg('Reflection Updater', 'No Reflection update' ,mtConfirmation, [mbYes],0);
writeln('No Reflection update'); writeln('No Reflection update');
end; end;
@ -132,7 +128,13 @@ end;
procedure OnReflectionUpdateClick(Sender: TObject); procedure OnReflectionUpdateClick(Sender: TObject);
begin begin
Update; GetLocalVersion(LocalR);
GetOnlineVersion(OnlineR);
if (OnlineR <= LocalR) then
MessageDlg('Reflection Updater', 'No Reflection update' ,mtConfirmation, [mbYes],0);
else
Update;
end; end;
procedure OnUpdateTimer(Sender: TObject); procedure OnUpdateTimer(Sender: TObject);

View File

@ -65,15 +65,15 @@ begin
Failed := not UnTarEx(DeContents,PluginPath,false); Failed := not UnTarEx(DeContents,PluginPath,false);
end; end;
if Failed then if Failed then
begin begin
Writeln('Failed to update the plugins'); Writeln('Failed to update the plugins');
Memo.Lines.Add('Failed to update the plugins'); Memo.Lines.Add('Failed to update the plugins');
end end
else else
begin begin
Writeln('Succesfully updated your plugins.'); Writeln('Succesfully updated your plugins.');
Memo.Lines.Add('Succesfully updated your plugins.'); Memo.Lines.Add('Succesfully updated your plugins.');
end; end;
DeContents := ''; DeContents := '';
Contents := ''; Contents := '';
Result := Failed; Result := Failed;
@ -87,10 +87,10 @@ var
DeContents : string; DeContents : string;
Failed : boolean; Failed : boolean;
begin begin
Memo.Lines.Add('Downloading SRL...'); Memo.Lines.Add('Downloading SRL...');
Contents := GetPage('http://wizzup.org/static/srl/srl.tar.bz2'); Contents := GetPage('http://wizzup.org/static/srl/srl.tar.bz2');
Failed := True; Failed := True;
Memo.Lines.Add('Uncompressing SRL...'); Memo.Lines.Add('Uncompressing SRL...');
if DecompressBZip2(Contents,DeContents,4096) then if DecompressBZip2(Contents,DeContents,4096) then
if UnTarEx(DeContents,IncludePath,true) then if UnTarEx(DeContents,IncludePath,true) then
Failed := False; Failed := False;
@ -99,10 +99,10 @@ begin
if Result then if Result then
Result := Failed; Result := Failed;
if not Failed then if not Failed then
begin begin
Memo.Lines.Add('Succesfully updated your SRL!'); Memo.Lines.Add('Succesfully updated your SRL!');
Writeln('Succesfully updated your SRL!'); Writeln('Succesfully updated your SRL!');
end; end;
end; end;
procedure DoUpdate(Sender: TObject); procedure DoUpdate(Sender: TObject);
@ -132,18 +132,16 @@ begin
Exit; Exit;
Updating := True; Updating := True;
GetLocalVersion(LocalP,LocalS);
GetOnlineVersion(OnlineP,OnlineS);
if (LocalP < OnlineP) or (LocalS < OnlineS) then if (LocalP < OnlineP) or (LocalS < OnlineS) then
begin begin
case MessageDlg('SRL Updater', 'Updates are available. '+ case MessageDlg('SRL Updater', 'Updates are available. '+
'Do you want to open the Updater now?', 'Do you want to open the Updater now?',
mtConfirmation, [mbNo,mbYes],0) of mtConfirmation, [mbNo,mbYes],0) of
mrYes : OpenForm := True; mrYes : OpenForm := True;
else else
OpenForm := False; OpenForm := False;
end; end;
if not OpenForm then if not OpenForm then
begin begin
Updating := False; Updating := False;
@ -153,7 +151,6 @@ begin
f.ShowModal; f.ShowModal;
end else end else
begin begin
MessageDlg('SRL Updater', 'No SRL update / Plugins update available!' ,mtConfirmation, [mbYes],0);
writeln('No SRL update / Plugins update available!'); writeln('No SRL update / Plugins update available!');
end; end;
@ -183,9 +180,15 @@ begin
else else
Settings.SetKeyValue('AutoUpdate', 'True'); Settings.SetKeyValue('AutoUpdate', 'True');
end; end;
procedure OnSRLUpdateClick(Sender: TObject); procedure OnSRLUpdateClick(Sender: TObject);
begin begin
Update; GetLocalVersion(LocalP,LocalS);
GetOnlineVersion(OnlineP,OnlineS);
if (OnlineP <= LocalP) and (OnlineS <= LocalS) then
MessageDlg('SRL Updater', 'No SRL update / Plugins update available!', mtConfirmation, [mbYes], 0);
else
Update;
end; end;
procedure OnUpdateTimer(Sender: TObject); procedure OnUpdateTimer(Sender: TObject);
@ -289,4 +292,4 @@ begin;
result := '1.0'; result := '1.0';
end; end;
begin begin
end. end.