• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-cqtcocoa誰得pythonphprubygameguibathyscaphec翻訳計画中(planning stage)omegatframeworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

ギコナビ


Commit MetaInfo

Revision1acca271ac91006889d012ef5011266bf7d58634 (tree)
Time2009-04-26 20:47:41
Authorh677 <h677>
Commiterh677

Log Message

close #16234,#16235
人柱版のボタンもdisableにするように修正。
タイムアウト時間は0に設定して、キャンセルボタンを追加。

Change Summary

Incremental Difference

--- a/UpdateCheck.dfm
+++ b/UpdateCheck.dfm
@@ -40,6 +40,35 @@ object UpdateCheckForm: TUpdateCheckForm
4040 TabOrder = 1
4141 OnClick = NightBuildCheckButtonClick
4242 end
43+ object CancelBitBtn: TBitBtn
44+ Left = 96
45+ Top = 8
46+ Width = 97
47+ Height = 25
48+ Cancel = True
49+ Caption = #12461#12515#12531#12475#12523
50+ Enabled = False
51+ TabOrder = 2
52+ OnClick = CancelBitBtnClick
53+ Glyph.Data = {
54+ DE010000424DDE01000000000000760000002800000024000000120000000100
55+ 0400000000006801000000000000000000001000000000000000000000000000
56+ 80000080000000808000800000008000800080800000C0C0C000808080000000
57+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
58+ 333333333333333333333333000033338833333333333333333F333333333333
59+ 0000333911833333983333333388F333333F3333000033391118333911833333
60+ 38F38F333F88F33300003339111183911118333338F338F3F8338F3300003333
61+ 911118111118333338F3338F833338F3000033333911111111833333338F3338
62+ 3333F8330000333333911111183333333338F333333F83330000333333311111
63+ 8333333333338F3333383333000033333339111183333333333338F333833333
64+ 00003333339111118333333333333833338F3333000033333911181118333333
65+ 33338333338F333300003333911183911183333333383338F338F33300003333
66+ 9118333911183333338F33838F338F33000033333913333391113333338FF833
67+ 38F338F300003333333333333919333333388333338FFF830000333333333333
68+ 3333333333333333333888330000333333333333333333333333333333333333
69+ 0000}
70+ NumGlyphs = 2
71+ end
4372 end
4473 object Panel2: TPanel
4574 Left = 0
--- a/UpdateCheck.pas
+++ b/UpdateCheck.pas
@@ -5,7 +5,7 @@ interface
55 uses
66 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
77 Dialogs, IdAntiFreezeBase, IdAntiFreeze, IdBaseComponent, IdComponent,
8- IdTCPConnection, IdTCPClient, IdHTTP, StdCtrls, ExtCtrls;
8+ IdTCPConnection, IdTCPClient, IdHTTP, StdCtrls, ExtCtrls, Buttons;
99
1010 type
1111 TUpdateCheckForm = class(TForm)
@@ -16,14 +16,17 @@ type
1616 IdHTTP: TIdHTTP;
1717 IdAntiFreeze: TIdAntiFreeze;
1818 NightBuildCheckButton: TButton;
19+ CancelBitBtn: TBitBtn;
1920 procedure UpdateButtonClick(Sender: TObject);
2021 procedure FormCreate(Sender: TObject);
2122 procedure NightBuildCheckButtonClick(Sender: TObject);
23+ procedure CancelBitBtnClick(Sender: TObject);
2224 private
2325 { Private éŒ¾ }
2426 FExecPath : string;
2527 FExecArgs : string;
2628 FAllowshutdown : Boolean;
29+ FCanceled : Boolean;
2730 function GetDesktopDir:string;
2831 function GetDownloadFilePath(FileName: String): String;
2932 function CreateShortCut(FileName, Argment, SavePath :string):boolean;
@@ -92,6 +95,7 @@ begin
9295 ResultMemo.Lines.Clear;
9396 Screen.Cursor := crHourGlass;
9497 UpdateButton.Enabled := False;
98+ NightBuildCheckButton.Enabled := False;
9599
96100 try
97101 ResStream := TMemoryStream.Create;
@@ -102,6 +106,7 @@ begin
102106
103107 IdHTTP.Request.CacheControl := 'no-cache';
104108 IdHTTP.Request.CustomHeaders.Add('Pragma: no-cache');
109+ IdHTTP.ReadTimeout := 0;
105110 IdHTTP.HandleRedirects := true;
106111 downResult := TStringList.Create;
107112 newest := TStringList.Create;
@@ -110,7 +115,13 @@ begin
110115 try
111116 try
112117 ResStream.Clear;
118+ FCanceled := False;
119+ CancelBitBtn.Enabled := True;
113120 IdHTTP.Get(CHECK_URL, ResStream);
121+ CancelBitBtn.Enabled := False;
122+ if (FCanceled) then begin
123+ raise Exception.Create('ƒ_ƒEƒ“ƒ[ƒh‚ªƒLƒƒƒ“ƒZƒ‹‚³‚ê‚Ü‚µ‚½B');
124+ end;
114125 value := GikoSys.GzipDecompress(ResStream,
115126 IdHTTP.Response.ContentEncoding);
116127 downResult.Text := value;
@@ -169,6 +180,7 @@ begin
169180 ResStream.Free;
170181 end;
171182 finally
183+ NightBuildCheckButton.Enabled := True;
172184 UpdateButton.Enabled := True;
173185 Screen.Cursor := crDefault;
174186 end;
@@ -184,7 +196,12 @@ begin
184196 filename := GetDownloadFilePath(Copy(url, LastDelimiter('/', url) + 1, Length(url)));
185197 fileStrem := TFileStream.Create(filename, fmCreate);
186198 try
199+ CancelBitBtn.Enabled := True;
187200 IdHTTP.Get(url, fileStrem);
201+ CancelBitBtn.Enabled := False;
202+ if (FCanceled) then begin
203+ raise Exception.Create('ƒ_ƒEƒ“ƒ[ƒh‚ªƒLƒƒƒ“ƒZƒ‹‚³‚ê‚Ü‚µ‚½B');
204+ end;
188205 ResultMemo.Lines.Add(
189206 IdHttp.ResponseText + '(' + IntToStr(IdHttp.ResponseCode) + ')');
190207 FExecPath := filename;
@@ -268,5 +285,14 @@ begin
268285 FExecArgs := '';
269286 FAllowshutdown := False;
270287 end;
288+//! ƒLƒƒƒ“ƒZƒ‹ƒ{ƒ^ƒ“‰Ÿ‰º
289+procedure TUpdateCheckForm.CancelBitBtnClick(Sender: TObject);
290+begin
291+ CancelBitBtn.Enabled := False;
292+ FCanceled := True;
293+ if IdHTTP.Connected then begin
294+ IdHTTP.Disconnect;
295+ end;
296+end;
271297
272298 end.