OSDN Git Service

・スレタイにタブ文字があるスレッドをHTML化して保存できない問題を修正
[gikonavigoeson/gikonavi.git] / NewBoard.pas
index f39269b..1cf9497 100644 (file)
@@ -18,58 +18,90 @@ type
                Label1: TLabel;
                MessageMemo: TMemo;
                UpdateButton: TButton;
-    CloseButton: TButton;
+       CloseButton: TButton;
                Indy: TIdHTTP;
                IdAntiFreeze: TIdAntiFreeze;
                StopButton: TButton;
-               Label2: TLabel;
-    BoardURLComboBox: TComboBox;
-    Label13: TLabel;
+       BoardURLComboBox: TComboBox;
+       Label13: TLabel;
+       EditIgnoreListsButton: TButton;
+       Label2: TLabel;
+    SakuCheckBox: TCheckBox;
                procedure UpdateButtonClick(Sender: TObject);
                procedure StopButtonClick(Sender: TObject);
                procedure CloseButtonClick(Sender: TObject);
                procedure FormCreate(Sender: TObject);
+       procedure EditIgnoreListsButtonClick(Sender: TObject);
+       procedure FormClose(Sender: TObject; var Action: TCloseAction);
        private
                { Private \90é\8c¾ }
+               IgnoreLists : TStringList;
                FAbort: Boolean;
-               function BoardDownload: TNewBoardItem;
-               procedure UpdateURL(s: string);
+               function BoardDownload(const URL: String): TNewBoardItem;
+               function BoardLoardFromFile(const FilePath: String): String;
+               function UpdateURL(s: string): boolean;
+               procedure SetIgnoreCategory(b: boolean);
+               procedure EditIgnoreList(Sender: TObject);
+               procedure UpdateIgnoreList(Sender: TObject);
+        function CheckDeleteItem(ini: TMemIniFile): Boolean;
        public
                { Public \90é\8c¾ }
+        class procedure InitHTTPClient(client : TIdHTTP);
        end;
 
 var
        NewBoardDialog: TNewBoardDialog;
 
+
 implementation
 
-uses Giko, IdHeaderList;
+uses Giko, IdHeaderList, MojuUtils, GikoDataModule;
 
 {$R *.dfm}
 
 procedure TNewBoardDialog.UpdateButtonClick(Sender: TObject);
 var
        Item: TNewBoardItem;
+       URL : String;
+       protocol, host, path, document, port, bookmark: String;
+    TabURLs: TStringList;
 begin
        try
-        GikoSys.Setting.BoardURLSelected := BoardURLComboBox.ItemIndex + 1;
+               MessageMemo.Clear;
+               GikoSys.Setting.BoardURLSelected := BoardURLComboBox.ItemIndex + 1;
                FAbort := False;
                UpdateButton.Enabled := False;
                StopButton.Enabled := True;
                CloseButton.Enabled := False;
-               Item := BoardDownload;
+               EditIgnoreListsButton.Enabled := False;
+               URL := BoardURLComboBox.Text;
+               GikoSys.ParseURI(URL, protocol, host, path, document, port, bookmark);
+               if (protocol = '') then begin
+                       Item.FContent := BoardLoardFromFile(URL);
+               end else if (AnsiPos('http', protocol) > 0) then begin
+                       Item := BoardDownload(URL);
+               end;
                StopButton.Enabled := False;
                if FAbort then
                        Exit;
                if Item.FContent <> '' then begin
-                       UpdateURL(Item.FContent);
-                       GikoForm.ReloadBBS;
+            TabURLs := TStringList.Create;
+            try
+                GikoDM.GetTabURLs(TabURLs);
+                       if (UpdateURL(Item.FContent)) then begin
+                               GikoForm.ReloadBBS;
+                           end;
+                GikoDM.OpenURLs(TabURLs);
+            finally
+                       TabURLs.Free;
+            end;
                end else
                        MessageMemo.Lines.Add('\83_\83E\83\93\83\8d\81[\83h\82ª\8e¸\94s\82µ\82Ü\82µ\82½[' + IntToStr(Item.FResponseCode) + ']');
        finally
                UpdateButton.Enabled := True;
                StopButton.Enabled := False;
                CloseButton.Enabled := True;
+               EditIgnoreListsButton.Enabled := True;
        end;
 end;
 
@@ -84,40 +116,14 @@ begin
        Close;
 end;
 
-function TNewBoardDialog.BoardDownload: TNewBoardItem;
+function TNewBoardDialog.BoardDownload(const URL: String): TNewBoardItem;
 var
-       URL: string;
        Stream: TMemoryStream;
        s: string;
        i: Integer;
 begin
-       MessageMemo.Clear;
-       Indy.Request.Clear;
-       Indy.RecvBufferSize := Gikosys.Setting.RecvBufferSize;
-       Indy.ProxyParams.BasicAuthentication := False;
-       if GikoSys.Setting.ReadProxy then begin
-               if GikoSys.Setting.ProxyProtocol then
-                       Indy.ProtocolVersion := pv1_1
-               else
-                       Indy.ProtocolVersion := pv1_0;
-               Indy.ProxyParams.ProxyServer := GikoSys.Setting.ReadProxyAddress;
-               Indy.ProxyParams.ProxyPort := GikoSys.Setting.ReadProxyPort;
-               Indy.ProxyParams.ProxyUsername := GikoSys.Setting.ReadProxyUserID;
-               Indy.ProxyParams.ProxyPassword := GikoSys.Setting.ReadProxyPassword;
-               if GikoSys.Setting.ReadProxyUserID <> '' then
-                       Indy.ProxyParams.BasicAuthentication := True;
-       end else begin
-               if GikoSys.Setting.Protocol then
-                       Indy.ProtocolVersion := pv1_1
-               else
-                       Indy.ProtocolVersion := pv1_0;
-               Indy.ProxyParams.ProxyServer := '';
-               Indy.ProxyParams.ProxyPort := 80;
-               Indy.ProxyParams.ProxyUsername := '';
-               Indy.ProxyParams.ProxyPassword := '';
-       end;
-       //URL := GikoSys.Setting.BoardURL2ch;
-    URL := BoardURLComboBox.Text;
+    InitHTTPClient( Indy );
+
        Indy.Request.UserAgent := GikoSys.GetUserAgent;
        Indy.Request.Referer := '';
        Indy.Request.AcceptEncoding := 'gzip';
@@ -131,9 +137,14 @@ begin
                try
                        MessageMemo.Lines.Add('\88È\89º\82Ì\8fê\8f\8a\82©\82ç\8eæ\93¾\82µ\82Ü\82·');
                        //MessageMemo.Lines.Add(GikoSys.Setting.BoardURL2ch);
-            MessageMemo.Lines.Add(URL);
+                       MessageMemo.Lines.Add(URL);
                        MessageMemo.Lines.Add('\83_\83E\83\93\83\8d\81[\83h\82ð\8aJ\8en\82µ\82Ü\82·');
-                       Indy.Get(URL, Stream);
+                       IdAntiFreeze.Active := True;
+                       try
+                               Indy.Get(URL, Stream);
+                       finally
+                               IdAntiFreeze.Active := False;
+                       end;
                        Result.FContent := GikoSys.GzipDecompress(Stream, Indy.Response.ContentEncoding);
                        MessageMemo.Lines.Add('\83_\83E\83\93\83\8d\81[\83h\82ª\8a®\97¹\82µ\82Ü\82µ\82½');
                except
@@ -167,7 +178,7 @@ begin
        end;
 end;
 
-procedure TNewBoardDialog.UpdateURL(s: string);
+function TNewBoardDialog.UpdateURL(s: string): boolean;
 var
        i: Integer;
        idx: Integer;
@@ -179,112 +190,334 @@ var
        cate: string;
        Board: TBoard;
        Change: Boolean;
+       Ignore: Boolean;
        ini: TMemIniFile;
+       oldURLs : TStringList;
+       newURLs : TStringList;
+    SakuIdx: Integer;
 begin
        Change := False;
        MessageMemo.Lines.Add('\90V\94Â\81A\94ÂURL\95Ï\8dX\83`\83F\83b\83N\82ð\8aJ\8en\82µ\82Ü\82·');
        MessageMemo.Lines.Add('');
-       s := StringReplace(s, '<B>', '<b>', [rfReplaceAll, rfIgnoreCase]);
-       s := StringReplace(s, '<BR>', '<br>', [rfReplaceAll, rfIgnoreCase]);
-       s := StringReplace(s, '</B>', '</b>', [rfReplaceAll, rfIgnoreCase]);
-       s := StringReplace(s, '<A HREF', '<a href', [rfReplaceAll, rfIgnoreCase]);
-       s := StringReplace(s, '</A', '</a', [rfReplaceAll, rfIgnoreCase]);
+       s := CustomStringReplace(s, '<B>', '<b>', true);
+       s := CustomStringReplace(s, '<BR>', '<br>', true);
+       s := CustomStringReplace(s, '</B>', '</b>', true);
+       s := CustomStringReplace(s, '<A HREF', '<a href', true);
+       s := CustomStringReplace(s, '</A', '</a', true);
        cate := '';
-       GikoSys.ForceDirectoriesEx(GikoSys.GetConfigDir);
-       ini := TMemIniFile.Create(GikoSys.GetBoardFileName);
+
+       oldURLs := TStringList.Create;
+       newURLs := TStringList.Create;
+
        try
-               //
-               //\8dí\8f\9c\83I\83v\83V\83\87\83\93\82ª\91I\91ð\82³\82ê\82Ä\82¢\82é\8fê\8d\87\82Í\83N\83\8a\83A
 
-               ini.Clear;
-               while True do begin
-                       idx1 := AnsiPos('<b>', s);
-                       idx2 := AnsiPos('<a', s);
-                       if (idx1 = 0) and (idx2 = 0) then Break;
+               GikoSys.ForceDirectoriesEx(GikoSys.GetConfigDir);
+               ini := TMemIniFile.Create(GikoSys.GetBoardFileName);
+               try
+                       //
+                       //\8dí\8f\9c\83I\83v\83V\83\87\83\93\82ª\91I\91ð\82³\82ê\82Ä\82¢\82é\8fê\8d\87\82Í\83N\83\8a\83A
 
-                       if idx1 < idx2 then begin
-                               //<br>
-                               idx := AnsiPos('</b>', s);
-                               if idx = 0 then begin
-                                       s := Copy(s, idx1 + 4, Length(s));
-                                       continue;
-                               end;
-                               tmp := Copy(s, idx1, (idx - idx1) + 4);
-                               tmp := StringReplace(tmp, '<b>', '', [rfReplaceAll]);
-                               tmp := StringReplace(tmp, '</b>', '', [rfReplaceAll]);
+                       ini.Clear;
 
-                               if (tmp = '\82¨\82·\82·\82ß') or
-                                        (tmp = '\93Á\95Ê\8aé\89æ') or
-                                        (tmp = '\82Ü\82¿\82a\82a\82r') or
-                                        (tmp = '\83`\83\83\83b\83g') or
-                                        (tmp = '\82¨\8aG\82©\82«') or
-                                        (tmp = '\89^\89c') or
-                                        (tmp = '\83c\81[\83\8b\97Þ') or
-                                        (tmp = '\91¼\82Ì\83T\83C\83g') then begin
-                                       cate := '';
+                       while True do begin
+                               idx1 := AnsiPos('<b>', s);
+                               idx2 := AnsiPos('<a', s);
+                               if (idx1 = 0) and (idx2 = 0) then Break;
+
+                               if idx1 < idx2 then begin
+                                       //<br>
+                                       idx := AnsiPos('</b>', s);
+                                       if idx = 0 then begin
+                                               s := Copy(s, idx1 + 4, Length(s));
+                                               continue;
+                                       end;
+                                       tmp := Copy(s, idx1, (idx - idx1) + 4);
+                                       tmp := CustomStringReplace(tmp, '<b>', '');
+                                       tmp := CustomStringReplace(tmp, '</b>', '');
+                                       Ignore := false;
+                                       for i := 0 to IgnoreLists.Count - 1 do begin
+                                               if tmp = Trim(IgnoreLists[i]) then begin
+                                                       cate := '';
+                                                       s := Copy(s, idx + 5, Length(s));
+                                                       Ignore := True;
+                                                       break;
+                                               end;
+                                       end;
+                                       if Ignore then
+                                               Continue;
+                                       {
+                                       if (tmp = '\82¨\82·\82·\82ß') or
+                                                (tmp = '\93Á\95Ê\8aé\89æ') or
+                                                (tmp = '\82Ü\82¿\82a\82a\82r') or
+                                                (tmp = '\83`\83\83\83b\83g') or
+                                                (tmp = '\82¨\8aG\82©\82«') or
+                                                (tmp = '\89^\89c\88Ä\93à') or
+                                                (tmp = '\83c\81[\83\8b\97Þ') or
+                                                (tmp = '\91¼\82Ì\83T\83C\83g') then begin
+                                               cate := '';
+                                               s := Copy(s, idx + 5, Length(s));
+                                               Continue;
+                                       end;
+                                       }
                                        s := Copy(s, idx + 5, Length(s));
-                                       Continue;
-                               end;
-                               s := Copy(s, idx + 5, Length(s));
-                               cate := tmp;
-                       end else begin
-                               //<a href=
-                               if cate = '' then begin
-                                       s := Copy(s, idx2 + 2, Length(s));
+                                       cate := tmp;
                                end else begin
-                                       idx := AnsiPos('</a>', s);
-                                       tmp := Copy(s, idx2, (idx - idx2) + 4);
-                                       tmp := StringReplace(tmp, '<a href=', '', [rfReplaceAll]);
-                                       tmp := StringReplace(tmp, '</a>', '', [rfReplaceAll]);
-                                       i := AnsiPos('>', tmp);
-                                       if i <> 0 then begin
-                                               URL := Copy(tmp, 1, i - 1);
-                                               Title := Copy(tmp, i + 1, Length(tmp));
-                                               Board := BBS2ch.FindBoardFromTitle(Title);
-                                               if Board = nil then begin
-                                                       MessageMemo.Lines.Add('\90V\94Â\92Ç\89Á\81u' + Title + '(' + URL + ')\81v');
-                                                       ini.WriteString(cate, Title, URL);
-                                                       Change := True;
+                                       //<a href=
+                                       if cate = '' then begin
+                                               s := Copy(s, idx2 + 2, Length(s));
+                                       end else begin
+                                               idx := AnsiPos('</a>', s);
+                                               tmp := Copy(s, idx2, (idx - idx2) + 4);
+                                               tmp := CustomStringReplace(tmp, '<a href=', '');
+                                               tmp := CustomStringReplace(tmp, '</a>', '');
+                        tmp := CustomStringReplace(tmp, 'TARGET=_blank', '');
+                                               i := AnsiPos('>', tmp);
+                                               if i <> 0 then begin
+                                                       URL := Trim(Copy(tmp, 1, i - 1));
+                                                       Title := Copy(tmp, i + 1, Length(tmp));
+                            if (SakuCheckBox.Checked = True) and (Title = '\8dí\8f\9c\97v\90¿') then begin
+                                SakuIdx := Pos('.2ch.net/saku/', URL);
+                                if (SakuIdx > 0) then
+                                    URL := Copy(URL, 1, SakuIdx - 1) + '.2ch.net/saku2ch/';
+                            end;
+                            // BBSs\82ª\8bó\91Î\8dô
+                            if Length(BBSs) = 0 then begin
+                                Board := nil;
+                            end else begin
+                                Board := BBSs[ 0 ].FindBoardFromTitleAndCategory(cate, Title);
+                            end;
+                            if Board = nil then begin
+                               MessageMemo.Lines.Add('\90V\94Â\92Ç\89Á\81u' + Title + '(' + URL + ')\81v');
+                                ini.WriteString(cate, Title, URL);
+                                Change := True;
+                            end else begin
+                               if Board.URL <> URL then begin
+                                       MessageMemo.Lines.Add('URL\95Ï\8dX\81u' + Board.Title + '(' + URL +')\81v');
+                                    ini.WriteString(cate, Title, URL);
+                                    oldURLs.Add(Board.URL);
+                                    newURLs.Add(URL);
+                                    Change := True;
+                                end else begin
+                                       ini.WriteString(cate, Title, URL);
+                                end;
+                            end;
                                                end else begin
-                                                       if Board.URL <> URL then begin
-                                                               MessageMemo.Lines.Add('URL\95Ï\8dX\81u' + Board.Title + '(' + URL +')\81v');
-                                                               ini.WriteString(cate, Title, URL);
-                                                               Change := True;
-                                                       end else begin
-                                                               ini.WriteString(cate, Title, URL);
-                                                       end;
+                                                       s := Copy(s, idx2 + 2, Length(s));
+                                                       Continue;
                                                end;
-                                       end else begin
-                                               s := Copy(s, idx2 + 2, Length(s));
-                                               Continue;
+                                               s := Copy(s, idx + 5, Length(s));
                                        end;
-                                       s := Copy(s, idx + 5, Length(s));
                                end;
                        end;
+            // \83J\83e\83S\83\8a/\94Â\82ª\8c¸\82Á\82½\82¾\82¯\82¾\82ÆChange\83t\83\89\83O\82ª\82½\82½\82È\82¢\82Æ\82«\82Ì\91Î\8dô
+            if not Change then begin
+                Change := CheckDeleteItem(ini);
+            end;
+               finally
+                       if Change then
+                               ini.UpdateFile;
+                       ini.Free;
                end;
-       finally
-               if Change then
-                       ini.UpdateFile;
-               ini.Free;
+               MessageMemo.Lines.Add('');
+           if Change then begin
+            GikoForm.FavoritesURLReplace(oldURLs, newURLs);
+            GikoForm.RoundListURLReplace(oldURLs, newURLs);
+            GikoForm.TabFileURLReplace(oldURLs, newURLs);
+                       MessageMemo.Lines.Add('\90V\94Â\81A\94ÂURL\95Ï\8dX\83`\83F\83b\83N\82ª\8a®\97¹\82µ\82Ü\82µ\82½');
+                       MessageMemo.Lines.Add('\81u\95Â\82\82é\81v\83{\83^\83\93\82ð\89\9f\82µ\82Ä\82­\82¾\82³\82¢');
+               end else
+                       MessageMemo.Lines.Add('\90V\94Â\81A\94ÂURL\95Ï\8dX\82Í \82 \82è\82Ü\82¹\82ñ\82Å\82µ\82½');
+    finally
+       oldURLs.Free;
+       newURLs.Free;
        end;
-       MessageMemo.Lines.Add('');
-       if Change then begin
-               MessageMemo.Lines.Add('\90V\94Â\81A\94ÂURL\95Ï\8dX\83`\83F\83b\83N\82ª\8a®\97¹\82µ\82Ü\82µ\82½');
-               MessageMemo.Lines.Add('\81u\95Â\82\82é\81v\83{\83^\83\93\82ð\89\9f\82µ\82Ä\82­\82¾\82³\82¢');
-       end else
-               MessageMemo.Lines.Add('\90V\94Â\81A\94ÂURL\95Ï\8dX\82Í \82 \82è\82Ü\82¹\82ñ\82Å\82µ\82½');
+       Result := Change;
 end;
-
-procedure TNewBoardDialog.FormCreate(Sender: TObject);
+//! \8dí\8f\9c\83J\83e\83S\83\8a/\94Â\83`\83F\83b\83N
+function TNewBoardDialog.CheckDeleteItem(ini: TMemIniFile): Boolean;
+var
+       URL: string;
+       Title: string;
+       orgini: TMemIniFile;
+    orgStrings, newStrings: TStringList;
+    i: Integer;
 begin
-       StopButton.Enabled := False;
-    BoardURLComboBox.Clear;
-    BoardURLComboBox.Items.AddStrings(GikoSys.Setting.BoardURLs);
+    orgini := TMemIniFile.Create(GikoSys.GetBoardFileName);
+    orgStrings := TStringList.Create;
+    newStrings := TStringList.Create;
     try
-       BoardURLComboBox.ItemIndex := GikoSys.Setting.BoardURLSelected - 1;
-    except
-        BoardURLComboBox.ItemIndex := 0;
+        ini.ReadSections(newStrings);
+        orgini.ReadSections(orgStrings);
+        if (newStrings.Count <> orgStrings.Count) then begin
+            //\83J\83e\83S\83\8a\92Ç\89Á\82Í\81A\94Â\82ª\92Ç\89Á\82É\82È\82é\82Ì\82Å\83`\83F\83b\83N\82µ\82È\82­\82Ä\82à\82¢\82¢
+            //\83J\83e\83S\83\8a\82Ì\8dí\8f\9c\83`\83F\83b\83N
+            for i := 0 to orgStrings.Count - 1 do begin
+                if (newStrings.IndexOf(orgStrings[i]) = -1) then begin
+                    MessageMemo.Lines.Add('\83J\83e\83S\83\8a\8dí\8f\9c\81u' + orgStrings[i] + '\81v');
+                end;
+            end;
+            Result := True;
+        end else begin
+            // \94Â\82Ì\90\94\83`\83F\83b\83N
+            ini.GetStrings(newStrings);
+            orgini.GetStrings(orgStrings);
+            if (newStrings.Count <> orgStrings.Count) then begin
+                // \94Â\82Ì\8dí\8f\9c\83`\83F\83b\83N
+                for i := 0 to orgStrings.Count - 1 do begin
+                    if (newStrings.IndexOf(orgStrings[i]) = -1) then begin
+                        Title := Copy(orgStrings[i], 1 , AnsiPos('=',orgStrings[i]) - 1);
+                        URL := Copy(orgStrings[i],
+                            AnsiPos('=',orgStrings[i]) + 1, Length(orgStrings[i]));
+                        MessageMemo.Lines.Add('\94Â\8dí\8f\9c\81u' + Title + '(' + URL +')\81v');
+                    end;
+                end;
+                Result := True;
+            end;
+        end;
+    finally
+        orgStrings.Free;
+        newStrings.Free;
+        orgini.Free;
     end;
 end;
+procedure TNewBoardDialog.FormCreate(Sender: TObject);
+var
+    CenterForm: TCustomForm;
+begin
+    CenterForm := TCustomForm(Owner);
+    if Assigned(CenterForm) then begin
+        Left := ((CenterForm.Width - Width) div 2) + CenterForm.Left;
+        Top := ((CenterForm.Height - Height) div 2) + CenterForm.Top;
+    end else begin
+        Left := (Screen.Width - Width) div 2;
+        Top := (Screen.Height - Height) div 2;
+    end;
 
+       StopButton.Enabled := False;
+       BoardURLComboBox.Clear;
+       BoardURLComboBox.Items.AddStrings(GikoSys.Setting.BoardURLs);
+       try
+               BoardURLComboBox.ItemIndex := GikoSys.Setting.BoardURLSelected - 1;
+       except
+               BoardURLComboBox.ItemIndex := 0;
+       end;
+       SetIgnoreCategory(false);
+
+    SakuCheckBox.Checked := GikoSys.Setting.SakuBoard;
+end;
+//\94Â\8dX\90V\82Ì\8f\9c\8aO\83J\83e\83S\83\8a\83\8a\83X\83g\82Ì\93o\98^
+{['\82¨\82·\82·\82ß', '\93Á\95Ê\8aé\89æ', '\82Ü\82¿\82a\82a\82r', '\83`\83\83\83b\83g', '\82¨\8aG\82©\82«', '\89^\89c\88Ä\93à', '\83c\81[\83\8b\97Þ', '\91¼\82Ì\83T\83C\83g']}
+procedure TNewBoardDialog.SetIgnoreCategory(b: boolean);
+begin
+       IgnoreLists := TStringList.Create;
+       if not( FileExists(GikoSys.Setting.GetIgnoreFileName) ) or ( b )then begin
+               IgnoreLists.Add('\82¨\82·\82·\82ß');
+               IgnoreLists.Add('\93Á\95Ê\8aé\89æ');
+               IgnoreLists.Add('\82Ü\82¿\82a\82a\82r');
+               IgnoreLists.Add('\83`\83\83\83b\83g');
+               IgnoreLists.Add('\82¨\8aG\82©\82«');
+               IgnoreLists.Add('\89^\89c\88Ä\93à');
+               IgnoreLists.Add('\83c\81[\83\8b\97Þ');
+               IgnoreLists.Add('\91¼\82Ì\83T\83C\83g');
+       end else begin
+               try
+                       IgnoreLists.LoadFromFile(GikoSys.Setting.GetIgnoreFileName);
+               except
+                       IgnoreLists.Free;
+                       SetIgnoreCategory(true);
+               end;
+       end;
+end;
+
+procedure TNewBoardDialog.EditIgnoreListsButtonClick(Sender: TObject);
+begin
+       EditIgnoreList(Sender);
+       EditIgnoreListsButton.OnClick := UpdateIgnoreList;
+end;
+procedure TNewBoardDialog.EditIgnoreList(Sender: TObject);
+var
+       i: Integer;
+begin
+       EditIgnoreListsButton.Caption := '\8f\9c\8aO\83J\83e\83S\83\8a\81[\8dX\90V';
+       Label2.Caption := '\8ae\82P\8ds\82É\83J\83e\83S\83\8a\96¼\82ð\8bL\93ü\82µ\82Ä\82­\82¾\82³\82¢\81B\81i\89ü\8ds\82ÍCtrl+Enter\81j';
+       UpdateButton.Enabled := false;
+       //MessageMemo.ReadOnly := false;
+       MessageMemo.Clear;
+       for i := 0 to IgnoreLists.Count - 1 do
+               MessageMemo.Lines.Add(IgnoreLists[i]);
+end;
+procedure TNewBoardDialog.UpdateIgnoreList(Sender: TObject);
+var
+       i: Integer;
+begin
+       Label2.Caption := '';
+    UpdateButton.Enabled := true;
+       EditIgnoreListsButton.Caption := '\8f\9c\8aO\83J\83e\83S\83\8a\81[\95Ò\8fW';
+       IgnoreLists.Clear;
+       for i := 0 to MessageMemo.Lines.Count - 1 do
+               IgnoreLists.Add(MessageMemo.Lines[i]);
+       IgnoreLists.SaveToFile(GikoSys.Setting.GetIgnoreFileName);
+       IgnoreLists.Free;
+       SetIgnoreCategory(false);
+       //MessageMemo.ReadOnly := true;
+       MessageMemo.Clear;
+       EditIgnoreListsButton.OnClick := EditIgnoreListsButtonClick;
+end;
+
+procedure TNewBoardDialog.FormClose(Sender: TObject;
+  var Action: TCloseAction);
+begin
+    GikoSys.Setting.SakuBoard := SakuCheckBox.Checked;
+       IgnoreLists.Free;
+end;
+//! \83\8d\81[\83J\83\8b\83t\83@\83C\83\8b\82ð\83\8d\81[\83h\82·\82é
+function TNewBoardDialog.BoardLoardFromFile(const FilePath: String): String;
+var
+       html : TStringList;
+begin
+       Result := '';
+       // \83t\83@\83C\83\8b\82ª\91\8dÝ\82µ\82Ä\82¢\82é\82©\83`\83F\83b\83N
+       if (FileExists(FilePath)) then begin
+               html := TStringList.Create();
+               try
+                       html.LoadFromFile(FilePath);
+                       Result := html.Text;
+               finally
+                       html.Free;
+               end;
+       end;
+end;
+
+class procedure TNewBoardDialog.InitHTTPClient(client : TIdHTTP);
+begin
+       client.Request.Clear;
+    client.Request.CustomHeaders.Clear;
+       client.Request.UserAgent := GikoSys.GetUserAgent;
+       client.RecvBufferSize := Gikosys.Setting.RecvBufferSize;
+       client.ProxyParams.BasicAuthentication := False;
+       client.ReadTimeout := GikoSys.Setting.ReadTimeOut;
+    client.ConnectTimeout := GikoSys.Setting.ReadTimeOut;
+
+       if GikoSys.Setting.ReadProxy then begin
+               if GikoSys.Setting.ProxyProtocol then
+                       client.ProtocolVersion := pv1_1
+               else
+                       client.ProtocolVersion := pv1_0;
+               client.ProxyParams.ProxyServer := GikoSys.Setting.ReadProxyAddress;
+               client.ProxyParams.ProxyPort := GikoSys.Setting.ReadProxyPort;
+               client.ProxyParams.ProxyUsername := GikoSys.Setting.ReadProxyUserID;
+               client.ProxyParams.ProxyPassword := GikoSys.Setting.ReadProxyPassword;
+               if GikoSys.Setting.ReadProxyUserID <> '' then
+                       client.ProxyParams.BasicAuthentication := True;
+       end else begin
+               if GikoSys.Setting.Protocol then
+                       client.ProtocolVersion := pv1_1
+               else
+                       client.ProtocolVersion := pv1_0;
+               client.ProxyParams.ProxyServer := '';
+               client.ProxyParams.ProxyPort := 80;
+               client.ProxyParams.ProxyUsername := '';
+               client.ProxyParams.ProxyPassword := '';
+       end;
+end;
 end.