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
Item: TNewBoardItem;
URL : String;
protocol, host, path, document, port, bookmark: String;
+ TabURLs: TStringList;
begin
try
MessageMemo.Clear;
if FAbort then
Exit;
if Item.FContent <> '' then begin
- GikoDM.TabsOpenAction.Tag := 1;
- GikoDM.TabsSaveAction.Execute;
- if (UpdateURL(Item.FContent)) then begin
- GikoForm.ReloadBBS;
- end;
- GikoDM.TabsOpenAction.Tag := 0;
+ 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
s: string;
i: Integer;
begin
- 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';
tmp := CustomStringReplace(tmp, 'TARGET=_blank', '');
i := AnsiPos('>', tmp);
if i <> 0 then begin
- URL := Copy(tmp, 1, i - 1);
+ URL := Trim(Copy(tmp, 1, i - 1));
Title := Copy(tmp, i + 1, Length(tmp));
- Board := BBSs[ 0 ].FindBoardFromTitle(Title);
+ // BBSs\82ª\8bó\91Î\8dô
+ if Length(BBSs) = 0 then begin
+ Board := nil;
+ end else begin
+ Board := BBSs[ 0 ].FindBoardFromTitle(Title);
+ end;
if Board = nil then begin
MessageMemo.Lines.Add('\90V\94Â\92Ç\89Á\81u' + Title + '(' + URL + ')\81v');
ini.WriteString(cate, Title, URL);
end;
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;
end;
Result := Change;
end;
-
+//! \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
+ orgini := TMemIniFile.Create(GikoSys.GetBoardFileName);
+ orgStrings := TStringList.Create;
+ newStrings := TStringList.Create;
+ try
+ 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);
begin
StopButton.Enabled := False;
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;
+
+ 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.