ギコナビ
修订版 | 72c96cdd04ac2a6952f1c03beac5d06ffba4b817 (tree) |
---|---|
时间 | 2011-02-20 15:47:14 |
作者 | h677 <h677> |
Commiter | h677 |
冒険の書のエラーでもCookieを更新
冒険の書を設定画面で削除・設定できるようにした。
@@ -22,7 +22,7 @@ uses | ||
22 | 22 | type |
23 | 23 | // TSetLayeredWindowAttributes = function(wnd: HWND; crKey: DWORD; bAlpha: BYTE; dwFlag: DWORD): Boolean; stdcall; |
24 | 24 | //«Ýßèl^Cv |
25 | - TGikoResultType = (grtOK, grtCookie, grtCheck, grtError, grtBouken); | |
25 | + TGikoResultType = (grtOK, grtCookie, grtCheck, grtError, grtBouken, grtBoukenErr); | |
26 | 26 | |
27 | 27 | TEditorForm = class(TForm) |
28 | 28 | MainMenu: TMainMenu; |
@@ -841,14 +841,6 @@ begin | ||
841 | 841 | MB_YESNO or MB_ICONQUESTION); |
842 | 842 | |
843 | 843 | 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 | - } | |
852 | 844 | GetCookie(Indy.CookieManager, Board); |
853 | 845 | if (Board.Is2ch) then begin |
854 | 846 | GetHiddenParameter(ResponseText, Board); |
@@ -879,15 +871,6 @@ begin | ||
879 | 871 | MB_YESNO or MB_ICONQUESTION); |
880 | 872 | |
881 | 873 | 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 | - | |
891 | 874 | GetCookie(Indy.CookieManager, Board); |
892 | 875 | if (Board.Is2ch) then begin |
893 | 876 | GetHiddenParameter(ResponseText, Board); |
@@ -912,15 +895,16 @@ begin | ||
912 | 895 | Board.SPID := ''; |
913 | 896 | Board.Cookie := ''; |
914 | 897 | GetCookie(Indy.CookieManager, Board); |
915 | - // `¯ÌÌÛ¶ | |
916 | - GikoSys.Setting.WriteBoukenSettingFile; | |
917 | 898 | Exit; |
918 | 899 | end else begin |
919 | 900 | if (GikoSys.Setting.UseSamba) and (FSambaTimer.Enabled) then |
920 | 901 | begin |
921 | 902 | FSambaTimer.WriteSambaTime(Now()); |
922 | 903 | end; |
923 | - | |
904 | + // `¯ÌG[ÍCookieðXV·é | |
905 | + if ResultType = grtBoukenErr then begin | |
906 | + GetCookie(Indy.CookieManager, Board); | |
907 | + end; | |
924 | 908 | State := gdsError; |
925 | 909 | raise Exception.Create(''); |
926 | 910 | end; |
@@ -1002,7 +986,7 @@ begin | ||
1002 | 986 | else if ( (AnsiPos('dqqnqFCsª«èܹñ', ResponseText) > 0) or // G[µ¢ |
1003 | 987 | (AnsiPos('dqqnqFLvª«èÈÄXbh§Ä', ResponseText) > 0) ) // G[µ¢ |
1004 | 988 | and (AnsiPos(RES2CH_COOKIE, ResponseText) > 0) then |
1005 | - Result := grtError | |
989 | + Result := grtBoukenErr | |
1006 | 990 | else if ( AnsiPos('NbL[ªÈ¢©úÀØêÅ·', ResponseText) > 0) or |
1007 | 991 | (AnsiPos('<title>NbL[mFI</title>', ResponseText) > 0) or |
1008 | 992 | (AnsiPos('<title>¡NbL[mFI¡</title>', ResponseText) > 0) or |
@@ -1944,6 +1928,8 @@ begin | ||
1944 | 1928 | ABoard.Expires := GMTToLocalDateTime(Cookie.Expires); |
1945 | 1929 | end else if ( Cookie.CookieName = VAL_HAP ) then begin |
1946 | 1930 | GikoSys.SetBoukenCookie(Cookie.Value, Cookie.Domain); |
1931 | + // `¯ÌÌÛ¶ | |
1932 | + GikoSys.Setting.WriteBoukenSettingFile; | |
1947 | 1933 | end else begin |
1948 | 1934 | if Length( curCookies.Values[ Cookie.CookieName ] ) > 0 then begin |
1949 | 1935 | // ù¶lÌt¯Ö¦ |
@@ -259,7 +259,10 @@ type | ||
259 | 259 | function GetBoukenCookie(AURL: String): String; |
260 | 260 | //! `¯ÌCookieÝè |
261 | 261 | procedure SetBoukenCookie(ACookieValue, ADomain: String); |
262 | - | |
262 | + //! `¯ÌCookieí | |
263 | + procedure DelBoukenCookie(ADomain: String); | |
264 | + //! `¯ÌDomainêæ¾ | |
265 | + procedure GetBoukenDomain(var ADomain: TStringList); | |
263 | 266 | end; |
264 | 267 | |
265 | 268 | var |
@@ -3464,8 +3467,34 @@ begin | ||
3464 | 3467 | end; |
3465 | 3468 | procedure TGikoSys.SetBoukenCookie(ACookieValue, ADomain: String); |
3466 | 3469 | 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; | |
3468 | 3483 | 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 | + | |
3469 | 3498 | initialization |
3470 | 3499 | GikoSys := TGikoSys.Create; |
3471 | 3500 |
@@ -61,9 +61,9 @@ object OptionDialog: TOptionDialog | ||
61 | 61 | Top = 4 |
62 | 62 | Width = 509 |
63 | 63 | Height = 389 |
64 | - ActivePage = CSSTabSheet | |
64 | + ActivePage = UserIDSheet | |
65 | 65 | MultiLine = True |
66 | - TabIndex = 2 | |
66 | + TabIndex = 11 | |
67 | 67 | TabOrder = 3 |
68 | 68 | OnChange = OptionTabChange |
69 | 69 | object ConnectSheet: TTabSheet |
@@ -253,7 +253,7 @@ object OptionDialog: TOptionDialog | ||
253 | 253 | Top = 43 |
254 | 254 | Width = 417 |
255 | 255 | Height = 20 |
256 | - ItemHeight = 12 | |
256 | + ItemHeight = 0 | |
257 | 257 | TabOrder = 0 |
258 | 258 | Text = 'BoardURLComboBox' |
259 | 259 | end |
@@ -1558,7 +1558,7 @@ object OptionDialog: TOptionDialog | ||
1558 | 1558 | Left = 12 |
1559 | 1559 | Top = 8 |
1560 | 1560 | Width = 477 |
1561 | - Height = 153 | |
1561 | + Height = 145 | |
1562 | 1562 | Caption = #35469#35388 |
1563 | 1563 | TabOrder = 0 |
1564 | 1564 | object Label9: TLabel |
@@ -1579,14 +1579,14 @@ object OptionDialog: TOptionDialog | ||
1579 | 1579 | end |
1580 | 1580 | object ForcedLoginLabel: TLabel |
1581 | 1581 | Left = 136 |
1582 | - Top = 104 | |
1582 | + Top = 97 | |
1583 | 1583 | Width = 89 |
1584 | 1584 | Height = 12 |
1585 | 1585 | Caption = 'ForcedLoginLabel' |
1586 | 1586 | end |
1587 | 1587 | object Tora3URLLabel: TLabel |
1588 | 1588 | Left = 329 |
1589 | - Top = 133 | |
1589 | + Top = 126 | |
1590 | 1590 | Width = 104 |
1591 | 1591 | Height = 12 |
1592 | 1592 | Caption = 'http://2ch.tora3.net/' |
@@ -1600,7 +1600,7 @@ object OptionDialog: TOptionDialog | ||
1600 | 1600 | end |
1601 | 1601 | object Label12: TLabel |
1602 | 1602 | Left = 237 |
1603 | - Top = 133 | |
1603 | + Top = 126 | |
1604 | 1604 | Width = 83 |
1605 | 1605 | Height = 12 |
1606 | 1606 | Caption = #12518#12540#12470'ID'#12398#21462#24471 |
@@ -1622,7 +1622,7 @@ object OptionDialog: TOptionDialog | ||
1622 | 1622 | end |
1623 | 1623 | object AutoLoginCheckBox: TCheckBox |
1624 | 1624 | Left = 12 |
1625 | - Top = 80 | |
1625 | + Top = 73 | |
1626 | 1626 | Width = 193 |
1627 | 1627 | Height = 17 |
1628 | 1628 | Caption = #36215#21205#26178#12395#33258#21205#12525#12464#12452#12531#12377#12427'(&S)' |
@@ -1630,7 +1630,7 @@ object OptionDialog: TOptionDialog | ||
1630 | 1630 | end |
1631 | 1631 | object ForcedLoginCheckBox: TCheckBox |
1632 | 1632 | Left = 12 |
1633 | - Top = 102 | |
1633 | + Top = 95 | |
1634 | 1634 | Width = 125 |
1635 | 1635 | Height = 19 |
1636 | 1636 | Caption = #24375#21046#12525#12464#12452#12531#12514#12540#12489 |
@@ -1638,10 +1638,10 @@ object OptionDialog: TOptionDialog | ||
1638 | 1638 | end |
1639 | 1639 | end |
1640 | 1640 | 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 | |
1645 | 1645 | Caption = 'Be 2ch' |
1646 | 1646 | TabOrder = 1 |
1647 | 1647 | object Label7: TLabel |
@@ -1653,7 +1653,7 @@ object OptionDialog: TOptionDialog | ||
1653 | 1653 | end |
1654 | 1654 | object Label8: TLabel |
1655 | 1655 | Left = 18 |
1656 | - Top = 59 | |
1656 | + Top = 48 | |
1657 | 1657 | Width = 54 |
1658 | 1658 | Height = 12 |
1659 | 1659 | Caption = #35469#35388#12467#12540#12489 |
@@ -1667,7 +1667,7 @@ object OptionDialog: TOptionDialog | ||
1667 | 1667 | end |
1668 | 1668 | object BeCodeEdit: TEdit |
1669 | 1669 | Left = 88 |
1670 | - Top = 56 | |
1670 | + Top = 45 | |
1671 | 1671 | Width = 369 |
1672 | 1672 | Height = 20 |
1673 | 1673 | PasswordChar = '*' |
@@ -1675,13 +1675,63 @@ object OptionDialog: TOptionDialog | ||
1675 | 1675 | end |
1676 | 1676 | object BeAutoLoginCheckBox: TCheckBox |
1677 | 1677 | Left = 12 |
1678 | - Top = 88 | |
1678 | + Top = 71 | |
1679 | 1679 | Width = 193 |
1680 | 1680 | Height = 17 |
1681 | 1681 | Caption = #36215#21205#26178#12395#33258#21205#12525#12464#12452#12531#12377#12427'(&S)' |
1682 | 1682 | TabOrder = 2 |
1683 | 1683 | end |
1684 | 1684 | 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 | |
1685 | 1735 | end |
1686 | 1736 | end |
1687 | 1737 | object OkBotton: TButton |
@@ -219,6 +219,12 @@ type | ||
219 | 219 | gppRighBottomRB: TRadioButton; |
220 | 220 | ResAnchorCheckBox: TCheckBox; |
221 | 221 | IgnoreLimitResCountCheckBox: TCheckBox; |
222 | + GroupBox25: TGroupBox; | |
223 | + Label25: TLabel; | |
224 | + BoukenComboBox: TComboBox; | |
225 | + BoukenModButton: TButton; | |
226 | + BoukenDelButton: TButton; | |
227 | + BoukenEdit: TEdit; | |
222 | 228 | procedure FormCreate(Sender: TObject); |
223 | 229 | procedure FormDestroy(Sender: TObject); |
224 | 230 | procedure ApplyButtonClick(Sender: TObject); |
@@ -268,6 +274,9 @@ type | ||
268 | 274 | procedure ResRangeHoldCheckBoxClick(Sender: TObject); |
269 | 275 | procedure CroutOptionClick(Sender: TObject); |
270 | 276 | procedure MaxRecordCountEditExit(Sender: TObject); |
277 | + procedure BoukenDelButtonClick(Sender: TObject); | |
278 | + procedure BoukenComboBoxChange(Sender: TObject); | |
279 | + procedure BoukenModButtonClick(Sender: TObject); | |
271 | 280 | private |
272 | 281 | { Private é¾ } |
273 | 282 | FClose: Boolean; |
@@ -572,7 +581,8 @@ var | ||
572 | 581 | Item: TListItem; |
573 | 582 | // s: string; |
574 | 583 | idx: Integer; |
575 | - FileList: TStringList; | |
584 | + FileList : TStringList; | |
585 | + DomainList : TStringList; | |
576 | 586 | begin |
577 | 587 | |
578 | 588 | //ÇÝÝpvLV |
@@ -886,6 +896,18 @@ begin | ||
886 | 896 | LoopBrowserTabsCB.Checked := GikoSys.Setting.LoopBrowserTabs; |
887 | 897 | // |
888 | 898 | IgnoreContextCheckBox.Checked := GikoSys.Setting.GestureIgnoreContext; |
899 | + | |
900 | + // `¯ÌhCêæ¾ | |
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); | |
889 | 911 | end; |
890 | 912 | |
891 | 913 | procedure TOptionDialog.SaveSetting; |
@@ -1175,6 +1197,7 @@ begin | ||
1175 | 1197 | GikoSys.Setting.LoopBrowserTabs := LoopBrowserTabsCB.Checked; |
1176 | 1198 | |
1177 | 1199 | GikoSys.Setting.GestureIgnoreContext := IgnoreContextCheckBox.Checked; |
1200 | + | |
1178 | 1201 | end; |
1179 | 1202 | |
1180 | 1203 | procedure TOptionDialog.SettingApply; |
@@ -1698,5 +1721,58 @@ begin | ||
1698 | 1721 | MaxRecordCountEdit.Text := '1'; |
1699 | 1722 | end; |
1700 | 1723 | |
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', '`¯Ì@hCí', 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 | + // `¯ÌhCêæ¾ | |
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 | + | |
1701 | 1777 | end. |
1702 | 1778 |
@@ -844,7 +844,9 @@ type | ||
844 | 844 | property RespopupWait: Integer read FRespopupWait write FRespopupWait; |
845 | 845 | property RespopupMailTo: Boolean read FRespopupMailTo write FRespopupMailTo; |
846 | 846 | //! ë`FbN |
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; | |
848 | 850 | end; |
849 | 851 | |
850 | 852 |