• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

ギコナビ


Commit MetaInfo

Revision72c96cdd04ac2a6952f1c03beac5d06ffba4b817 (tree)
Time2011-02-20 15:47:14
Authorh677 <h677>
Commiterh677

Log Message

冒険の書のエラーでもCookieを更新
冒険の書を設定画面で削除・設定できるようにした。

Change Summary

Incremental Difference

--- a/Editor.pas
+++ b/Editor.pas
@@ -22,7 +22,7 @@ uses
2222 type
2323 // TSetLayeredWindowAttributes = function(wnd: HWND; crKey: DWORD; bAlpha: BYTE; dwFlag: DWORD): Boolean; stdcall;
2424 //‘‚«ž‚Ý–ß‚è’lƒ^ƒCƒv
25- TGikoResultType = (grtOK, grtCookie, grtCheck, grtError, grtBouken);
25+ TGikoResultType = (grtOK, grtCookie, grtCheck, grtError, grtBouken, grtBoukenErr);
2626
2727 TEditorForm = class(TForm)
2828 MainMenu: TMainMenu;
@@ -841,14 +841,6 @@ begin
841841 MB_YESNO or MB_ICONQUESTION);
842842
843843 if MsgResult = IDYES then begin
844- {
845- for count := 0 to Indy.CookieManager.CookieCollection.Count - 1 do begin
846- cookie := Indy.CookieManager.CookieCollection.Items[count];
847- if ( cookie.CookieName = 'HAP' ) then begin
848- GikoSys.Setting.SetBoukenCookie(cookie.Value, cookie.Domain);
849- end;
850- end;
851- }
852844 GetCookie(Indy.CookieManager, Board);
853845 if (Board.Is2ch) then begin
854846 GetHiddenParameter(ResponseText, Board);
@@ -879,15 +871,6 @@ begin
879871 MB_YESNO or MB_ICONQUESTION);
880872
881873 if MsgResult = IDYES then begin
882- {
883- for count := 0 to Indy.CookieManager.CookieCollection.Count - 1 do begin
884- cookie := Indy.CookieManager.CookieCollection.Items[count];
885- if ( cookie.CookieName = 'HAP' ) then begin
886- GikoSys.Setting.SetBoukenCookie(cookie.Value, cookie.Domain);
887- end;
888- end;
889- }
890-
891874 GetCookie(Indy.CookieManager, Board);
892875 if (Board.Is2ch) then begin
893876 GetHiddenParameter(ResponseText, Board);
@@ -912,15 +895,16 @@ begin
912895 Board.SPID := '';
913896 Board.Cookie := '';
914897 GetCookie(Indy.CookieManager, Board);
915- // –`Œ¯‚̏‘‚Ì•Û‘¶
916- GikoSys.Setting.WriteBoukenSettingFile;
917898 Exit;
918899 end else begin
919900 if (GikoSys.Setting.UseSamba) and (FSambaTimer.Enabled) then
920901 begin
921902 FSambaTimer.WriteSambaTime(Now());
922903 end;
923-
904+ // –`Œ¯‚̏‘ƒGƒ‰[‚ÍCookie‚ðXV‚·‚é
905+ if ResultType = grtBoukenErr then begin
906+ GetCookie(Indy.CookieManager, Board);
907+ end;
924908 State := gdsError;
925909 raise Exception.Create('');
926910 end;
@@ -1002,7 +986,7 @@ begin
1002986 else if ( (AnsiPos('‚d‚q‚q‚n‚qFCs‚ª‘«‚è‚Ü‚¹‚ñ', ResponseText) > 0) or // ƒGƒ‰[ˆµ‚¢
1003987 (AnsiPos('‚d‚q‚q‚n‚qFLv‚ª‘«‚è‚È‚­‚ăXƒŒƒbƒh—§‚Ä', ResponseText) > 0) ) // ƒGƒ‰[ˆµ‚¢
1004988 and (AnsiPos(RES2CH_COOKIE, ResponseText) > 0) then
1005- Result := grtError
989+ Result := grtBoukenErr
1006990 else if ( AnsiPos('ƒNƒbƒL[‚ª‚È‚¢‚©ŠúŒÀØ‚ê‚Å‚·', ResponseText) > 0) or
1007991 (AnsiPos('<title>ƒNƒbƒL[Šm”FI</title>', ResponseText) > 0) or
1008992 (AnsiPos('<title>¡ƒNƒbƒL[Šm”FI¡</title>', ResponseText) > 0) or
@@ -1944,6 +1928,8 @@ begin
19441928 ABoard.Expires := GMTToLocalDateTime(Cookie.Expires);
19451929 end else if ( Cookie.CookieName = VAL_HAP ) then begin
19461930 GikoSys.SetBoukenCookie(Cookie.Value, Cookie.Domain);
1931+ // –`Œ¯‚̏‘‚Ì•Û‘¶
1932+ GikoSys.Setting.WriteBoukenSettingFile;
19471933 end else begin
19481934 if Length( curCookies.Values[ Cookie.CookieName ] ) > 0 then begin
19491935 // Šù‘¶’l‚Ì•t‚¯‘Ö‚¦
--- a/GikoSystem.pas
+++ b/GikoSystem.pas
@@ -259,7 +259,10 @@ type
259259 function GetBoukenCookie(AURL: String): String;
260260 //! –`Œ¯‚̏‘CookieÝ’è
261261 procedure SetBoukenCookie(ACookieValue, ADomain: String);
262-
262+ //! –`Œ¯‚̏‘Cookieíœ
263+ procedure DelBoukenCookie(ADomain: String);
264+ //! –`Œ¯‚̏‘Domainˆê——Žæ“¾
265+ procedure GetBoukenDomain(var ADomain: TStringList);
263266 end;
264267
265268 var
@@ -3464,8 +3467,34 @@ begin
34643467 end;
34653468 procedure TGikoSys.SetBoukenCookie(ACookieValue, ADomain: String);
34663469 begin
3467- Setting.SetBoukenCookie(ACookieValue, ADomain);
3470+ if ( Length(ADomain) > 0 ) then begin
3471+ Setting.SetBoukenCookie(ACookieValue, ADomain);
3472+ end;
3473+end;
3474+//! –`Œ¯‚̏‘Domainˆê——Žæ“¾
3475+procedure TGikoSys.GetBoukenDomain(var ADomain: TStringList);
3476+var
3477+ i : Integer;
3478+begin
3479+ ADomain.Clear;
3480+ for i := 0 to Setting.BoukenCookieList.Count - 1 do begin
3481+ ADomain.Add( Setting.BoukenCookieList.Names[i] );
3482+ end;
34683483 end;
3484+//! –`Œ¯‚̏‘Cookieíœ
3485+procedure TGikoSys.DelBoukenCookie(ADomain: String);
3486+var
3487+ i : Integer;
3488+begin
3489+ for i := 0 to Setting.BoukenCookieList.Count - 1 do begin
3490+ if ( Setting.BoukenCookieList.Names[i] = ADomain ) then begin
3491+ Setting.BoukenCookieList.Delete(i);
3492+ Break;
3493+ end;
3494+ end;
3495+end;
3496+
3497+
34693498 initialization
34703499 GikoSys := TGikoSys.Create;
34713500
--- a/Option.dfm
+++ b/Option.dfm
@@ -61,9 +61,9 @@ object OptionDialog: TOptionDialog
6161 Top = 4
6262 Width = 509
6363 Height = 389
64- ActivePage = CSSTabSheet
64+ ActivePage = UserIDSheet
6565 MultiLine = True
66- TabIndex = 2
66+ TabIndex = 11
6767 TabOrder = 3
6868 OnChange = OptionTabChange
6969 object ConnectSheet: TTabSheet
@@ -253,7 +253,7 @@ object OptionDialog: TOptionDialog
253253 Top = 43
254254 Width = 417
255255 Height = 20
256- ItemHeight = 12
256+ ItemHeight = 0
257257 TabOrder = 0
258258 Text = 'BoardURLComboBox'
259259 end
@@ -1558,7 +1558,7 @@ object OptionDialog: TOptionDialog
15581558 Left = 12
15591559 Top = 8
15601560 Width = 477
1561- Height = 153
1561+ Height = 145
15621562 Caption = #35469#35388
15631563 TabOrder = 0
15641564 object Label9: TLabel
@@ -1579,14 +1579,14 @@ object OptionDialog: TOptionDialog
15791579 end
15801580 object ForcedLoginLabel: TLabel
15811581 Left = 136
1582- Top = 104
1582+ Top = 97
15831583 Width = 89
15841584 Height = 12
15851585 Caption = 'ForcedLoginLabel'
15861586 end
15871587 object Tora3URLLabel: TLabel
15881588 Left = 329
1589- Top = 133
1589+ Top = 126
15901590 Width = 104
15911591 Height = 12
15921592 Caption = 'http://2ch.tora3.net/'
@@ -1600,7 +1600,7 @@ object OptionDialog: TOptionDialog
16001600 end
16011601 object Label12: TLabel
16021602 Left = 237
1603- Top = 133
1603+ Top = 126
16041604 Width = 83
16051605 Height = 12
16061606 Caption = #12518#12540#12470'ID'#12398#21462#24471
@@ -1622,7 +1622,7 @@ object OptionDialog: TOptionDialog
16221622 end
16231623 object AutoLoginCheckBox: TCheckBox
16241624 Left = 12
1625- Top = 80
1625+ Top = 73
16261626 Width = 193
16271627 Height = 17
16281628 Caption = #36215#21205#26178#12395#33258#21205#12525#12464#12452#12531#12377#12427'(&S)'
@@ -1630,7 +1630,7 @@ object OptionDialog: TOptionDialog
16301630 end
16311631 object ForcedLoginCheckBox: TCheckBox
16321632 Left = 12
1633- Top = 102
1633+ Top = 95
16341634 Width = 125
16351635 Height = 19
16361636 Caption = #24375#21046#12525#12464#12452#12531#12514#12540#12489
@@ -1638,10 +1638,10 @@ object OptionDialog: TOptionDialog
16381638 end
16391639 end
16401640 object GroupBox11: TGroupBox
1641- Left = 16
1642- Top = 176
1643- Width = 473
1644- Height = 121
1641+ Left = 12
1642+ Top = 157
1643+ Width = 477
1644+ Height = 94
16451645 Caption = 'Be 2ch'
16461646 TabOrder = 1
16471647 object Label7: TLabel
@@ -1653,7 +1653,7 @@ object OptionDialog: TOptionDialog
16531653 end
16541654 object Label8: TLabel
16551655 Left = 18
1656- Top = 59
1656+ Top = 48
16571657 Width = 54
16581658 Height = 12
16591659 Caption = #35469#35388#12467#12540#12489
@@ -1667,7 +1667,7 @@ object OptionDialog: TOptionDialog
16671667 end
16681668 object BeCodeEdit: TEdit
16691669 Left = 88
1670- Top = 56
1670+ Top = 45
16711671 Width = 369
16721672 Height = 20
16731673 PasswordChar = '*'
@@ -1675,13 +1675,63 @@ object OptionDialog: TOptionDialog
16751675 end
16761676 object BeAutoLoginCheckBox: TCheckBox
16771677 Left = 12
1678- Top = 88
1678+ Top = 71
16791679 Width = 193
16801680 Height = 17
16811681 Caption = #36215#21205#26178#12395#33258#21205#12525#12464#12452#12531#12377#12427'(&S)'
16821682 TabOrder = 2
16831683 end
16841684 end
1685+ object GroupBox25: TGroupBox
1686+ Left = 12
1687+ Top = 256
1688+ Width = 477
1689+ Height = 81
1690+ Caption = #20882#38522#12398#26360
1691+ TabOrder = 2
1692+ object Label25: TLabel
1693+ Left = 40
1694+ Top = 24
1695+ Width = 37
1696+ Height = 12
1697+ Caption = #12489#12513#12452#12531
1698+ end
1699+ object BoukenComboBox: TComboBox
1700+ Left = 88
1701+ Top = 20
1702+ Width = 140
1703+ Height = 20
1704+ ItemHeight = 12
1705+ TabOrder = 0
1706+ Text = 'BoukenComboBox'
1707+ OnChange = BoukenComboBoxChange
1708+ end
1709+ object BoukenModButton: TButton
1710+ Left = 231
1711+ Top = 42
1712+ Width = 50
1713+ Height = 25
1714+ Caption = #22793#26356
1715+ TabOrder = 3
1716+ OnClick = BoukenModButtonClick
1717+ end
1718+ object BoukenDelButton: TButton
1719+ Left = 88
1720+ Top = 43
1721+ Width = 50
1722+ Height = 25
1723+ Caption = #21066#38500
1724+ TabOrder = 2
1725+ OnClick = BoukenDelButtonClick
1726+ end
1727+ object BoukenEdit: TEdit
1728+ Left = 230
1729+ Top = 19
1730+ Width = 227
1731+ Height = 20
1732+ TabOrder = 1
1733+ end
1734+ end
16851735 end
16861736 end
16871737 object OkBotton: TButton
--- a/Option.pas
+++ b/Option.pas
@@ -219,6 +219,12 @@ type
219219 gppRighBottomRB: TRadioButton;
220220 ResAnchorCheckBox: TCheckBox;
221221 IgnoreLimitResCountCheckBox: TCheckBox;
222+ GroupBox25: TGroupBox;
223+ Label25: TLabel;
224+ BoukenComboBox: TComboBox;
225+ BoukenModButton: TButton;
226+ BoukenDelButton: TButton;
227+ BoukenEdit: TEdit;
222228 procedure FormCreate(Sender: TObject);
223229 procedure FormDestroy(Sender: TObject);
224230 procedure ApplyButtonClick(Sender: TObject);
@@ -268,6 +274,9 @@ type
268274 procedure ResRangeHoldCheckBoxClick(Sender: TObject);
269275 procedure CroutOptionClick(Sender: TObject);
270276 procedure MaxRecordCountEditExit(Sender: TObject);
277+ procedure BoukenDelButtonClick(Sender: TObject);
278+ procedure BoukenComboBoxChange(Sender: TObject);
279+ procedure BoukenModButtonClick(Sender: TObject);
271280 private
272281 { Private éŒ¾ }
273282 FClose: Boolean;
@@ -572,7 +581,8 @@ var
572581 Item: TListItem;
573582 // s: string;
574583 idx: Integer;
575- FileList: TStringList;
584+ FileList : TStringList;
585+ DomainList : TStringList;
576586 begin
577587
578588 //“ǂݍž‚Ý—pƒvƒƒLƒV
@@ -886,6 +896,18 @@ begin
886896 LoopBrowserTabsCB.Checked := GikoSys.Setting.LoopBrowserTabs;
887897 //
888898 IgnoreContextCheckBox.Checked := GikoSys.Setting.GestureIgnoreContext;
899+
900+ // –`Œ¯‚̏‘ƒhƒƒCƒ“ˆê——Žæ“¾
901+ BoukenComboBox.Text := '';
902+ BoukenComboBox.Items.Clear;
903+ DomainList := TStringList.Create;
904+ GikoSys.GetBoukenDomain(DomainList);
905+ for i := 0 to DomainList.Count - 1 do begin
906+ BoukenComboBox.Items.Add( DomainList[i] ) ;
907+ end;
908+ DomainList.Free;
909+ BoukenComboBox.ItemIndex := 0;
910+ BoukenComboBox.OnChange(nil);
889911 end;
890912
891913 procedure TOptionDialog.SaveSetting;
@@ -1175,6 +1197,7 @@ begin
11751197 GikoSys.Setting.LoopBrowserTabs := LoopBrowserTabsCB.Checked;
11761198
11771199 GikoSys.Setting.GestureIgnoreContext := IgnoreContextCheckBox.Checked;
1200+
11781201 end;
11791202
11801203 procedure TOptionDialog.SettingApply;
@@ -1698,5 +1721,58 @@ begin
16981721 MaxRecordCountEdit.Text := '1';
16991722 end;
17001723
1724+procedure TOptionDialog.BoukenDelButtonClick(Sender: TObject);
1725+begin
1726+ if ( BoukenComboBox.Items.IndexOf( BoukenComboBox.Text ) <> -1 ) then begin
1727+ if MsgBox(Self.Handle, BoukenComboBox.Text + ' ‚ðíœ‚µ‚Ü‚·B'#13#10 +
1728+ 'íœ‚·‚é‚Æ•œŒ³‚Å‚«‚Ü‚¹‚ñB‚æ‚낵‚¢‚Å‚·‚©H', '–`Œ¯‚̏‘@ƒhƒƒCƒ“íœ', MB_YESNO or MB_ICONQUESTION) = IDYES then begin
1729+ GikoSys.DelBoukenCookie(BoukenComboBox.Text);
1730+ GikoSys.Setting.WriteBoukenSettingFile;
1731+ BoukenComboBox.Items.Delete(BoukenComboBox.ItemIndex);
1732+ if ( BoukenComboBox.Items.Count = 0 ) then begin
1733+ BoukenComboBox.Text := '';
1734+ end;
1735+ BoukenComboBox.OnChange(nil);
1736+ end
1737+ end else begin
1738+ BoukenComboBox.Text := '';
1739+ end;
1740+end;
1741+
1742+procedure TOptionDialog.BoukenComboBoxChange(Sender: TObject);
1743+begin
1744+ BoukenEdit.Text := GikoSys.GetBoukenCookie('http://*' +BoukenComboBox.Text);
1745+end;
1746+
1747+procedure TOptionDialog.BoukenModButtonClick(Sender: TObject);
1748+var
1749+ DomainList : TStringList;
1750+ i : Integer;
1751+ s : String;
1752+begin
1753+ if ( Length(BoukenComboBox.Text) > 0 ) then begin
1754+ s := BoukenComboBox.Text;
1755+ GikoSys.SetBoukenCookie(BoukenEdit.Text, s);
1756+ GikoSys.Setting.WriteBoukenSettingFile;
1757+ // –`Œ¯‚̏‘ƒhƒƒCƒ“ˆê——Žæ“¾
1758+ BoukenComboBox.Text := '';
1759+ BoukenComboBox.Items.Clear;
1760+ DomainList := TStringList.Create;
1761+ GikoSys.GetBoukenDomain(DomainList);
1762+ for i := 0 to DomainList.Count - 1 do begin
1763+ BoukenComboBox.Items.Add( DomainList[i] ) ;
1764+ end;
1765+ DomainList.Free;
1766+ BoukenComboBox.ItemIndex := 0;
1767+ for i := 0 to BoukenComboBox.Items.Count - 1 do begin
1768+ if ( BoukenComboBox.Items[i] = s) then begin
1769+ BoukenComboBox.ItemIndex := i;
1770+ Break;
1771+ end;
1772+ end;
1773+ BoukenComboBox.OnChange(nil);
1774+ end;
1775+end;
1776+
17011777 end.
17021778
--- a/Setting.pas
+++ b/Setting.pas
@@ -844,7 +844,9 @@ type
844844 property RespopupWait: Integer read FRespopupWait write FRespopupWait;
845845 property RespopupMailTo: Boolean read FRespopupMailTo write FRespopupMailTo;
846846 //! Œë”šƒ`ƒFƒbƒN
847- property UseGobakuCheck: Boolean read FUseGobakuCheck write FUseGobakuCheck;
847+ property UseGobakuCheck: Boolean read FUseGobakuCheck write FUseGobakuCheck;
848+ //! –`Œ¯‚̏‘
849+ property BoukenCookieList: TStringList read FBoukenCookieList write FBoukenCookieList;
848850 end;
849851
850852
Binary files a/gikoNavi.res and b/gikoNavi.res differ