OSDN Git Service

全てを解除することができるようにした。
authorh677 <h677>
Fri, 5 Nov 2004 16:54:07 +0000 (16:54 +0000)
committerh677 <h677>
Fri, 5 Nov 2004 16:54:07 +0000 (16:54 +0000)
Giko.dfm
Giko.pas
IndividualAbon.dfm
IndividualAbon.pas

index 1f93771..1835e53 100644 (file)
--- a/Giko.dfm
+++ b/Giko.dfm
@@ -5906,8 +5906,10 @@ object GikoForm: TGikoForm
         GroupIndex = 1
       end
       object N42: TMenuItem
-        Caption = #20491#21029#12354#12412#12540#12435#35299#38500
+        Action = AntiIndividualAbonDlgAction
+        Caption = #20491#21029#12354#12412#65374#12435#35299#38500
         GroupIndex = 1
+        Hint = #20491#21029#12354#12412#65374#12435#35299#38500
       end
     end
     object FavoriteMenu: TMenuItem
index 8752102..1eb3de9 100644 (file)
--- a/Giko.pas
+++ b/Giko.pas
@@ -11911,7 +11911,7 @@ begin
                ThreadItem.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document)).Body.ScrollTop;
                // \83X\83p\83\80\82É\90Ý\92è
                ReadList.LoadFromFile( ThreadItem.GetThreadFileName );
-               GikoSys.SpamCountWord( ReadList[ KokoPopupMenu.Tag - 1 ], wordCount );
+               GikoSys.SpamCountWord( ReadList[ ATag - 1 ], wordCount );
                GikoSys.SpamForget( wordCount, False ); // \83n\83\80\82ð\89ð\8f\9c
                GikoSys.SpamLearn( wordCount, True );           // \83X\83p\83\80\82É\90Ý\92è
                // \82 \82Ú\81[\82ñ\82É\90Ý\92è
@@ -11972,6 +11972,7 @@ var
        msg : String;
        ReadList                : TStringList;
        wordCount               : TWordCount;
+       i : Integer;
 begin
        IndividualForm := TIndividualAbonForm.Create(Self);
        try
@@ -11979,15 +11980,17 @@ begin
                ThreadItem.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document)).Body.ScrollTop;
                if (ThreadItem <> nil) and (ThreadItem.IsLogFile) then begin
                        if IndividualForm.SetThreadLogFileName(ThreadItem.GetThreadFileName) then begin
-                               if IndividualForm.ShowModal = mrOK then begin
+                               if (IndividualForm.ShowModal = mrOK) then begin
                                        ReadList                := TStringList.Create;
                                        wordCount               := TWordCount.Create;
                                        try
                                                // \83X\83p\83\80\82ð\89ð\8f\9c
                                                ReadList.LoadFromFile( ThreadItem.GetThreadFileName );
-                                               GikoSys.SpamCountWord( ReadList[ KokoPopupMenu.Tag - 1 ], wordCount );
-                                               GikoSys.SpamForget( wordCount, True );  // \83X\83p\83\80\82ð\89ð\8f\9c
-                                               GikoSys.SpamLearn( wordCount, False );  // \83n\83\80\82É\90Ý\92è
+                                               for i := 0 to IndividualForm.DeleteList.Count - 1 do begin
+                                                       GikoSys.SpamCountWord( ReadList[ StrToInt(IndividualForm.DeleteList[i]) - 1 ], wordCount );
+                                                       GikoSys.SpamForget( wordCount, True );  // \83X\83p\83\80\82ð\89ð\8f\9c
+                                                       GikoSys.SpamLearn( wordCount, False );  // \83n\83\80\82É\90Ý\92è
+                                               end;
                                                if IndividualForm.FRepaint then begin
                                                        FActiveContent.Repaint := true;
                                                        InsertBrowserTab( ThreadItem, True );
@@ -12040,7 +12043,7 @@ begin
                        // \83X\83p\83\80\82É\90Ý\92è
                        ReadList.LoadFromFile( ThreadItem.GetThreadFileName );
                        for i := 0 to body.Count - 1 do begin
-                               GikoSys.SpamCountWord( ReadList[ KokoPopupMenu.Tag - 1 ], wordCount );
+                               GikoSys.SpamCountWord( ReadList[ i ], wordCount );
                                GikoSys.SpamForget( wordCount, False ); // \83n\83\80\82ð\89ð\8f\9c
                                GikoSys.SpamLearn( wordCount, True );           // \83X\83p\83\80\82É\90Ý\92è
                                // \82 \82Ú\81[\82ñ\82É\90Ý\92è
index ff6cc02..424c47b 100644 (file)
@@ -1,8 +1,8 @@
 object IndividualAbonForm: TIndividualAbonForm
   Left = 476
   Top = 363
-  Width = 219
-  Height = 123
+  Width = 281
+  Height = 112
   Caption = #20491#21029#12354#12412#12540#12435#35299#38500
   Color = clBtnFace
   Font.Charset = SHIFTJIS_CHARSET
@@ -11,11 +11,13 @@ object IndividualAbonForm: TIndividualAbonForm
   Font.Name = #65325#65331' '#65328#12468#12471#12483#12463
   Font.Style = []
   OldCreateOrder = False
+  OnCreate = FormCreate
+  OnDestroy = FormDestroy
   PixelsPerInch = 96
   TextHeight = 12
   object Label1: TLabel
-    Left = 24
-    Top = 16
+    Left = 6
+    Top = 8
     Width = 156
     Height = 13
     Caption = #20491#21029#12354#12412#12540#12435#12373#12428#12390#12356#12427#12524#12473
@@ -27,15 +29,15 @@ object IndividualAbonForm: TIndividualAbonForm
     ParentFont = False
   end
   object ComboBox1: TComboBox
-    Left = 24
-    Top = 32
+    Left = 6
+    Top = 24
     Width = 153
     Height = 20
     ItemHeight = 12
     TabOrder = 0
   end
   object Button1: TButton
-    Left = 24
+    Left = 6
     Top = 56
     Width = 75
     Height = 25
@@ -44,12 +46,40 @@ object IndividualAbonForm: TIndividualAbonForm
     TabOrder = 1
     OnClick = Button1Click
   end
-  object BitBtn1: TBitBtn
-    Left = 107
+  object BitBtn2: TBitBtn
+    Left = 86
     Top = 56
     Width = 89
     Height = 25
+    Caption = #12377#12409#12390'(&A)'
+    ModalResult = 1
     TabOrder = 2
+    OnClick = BitBtn2Click
+    Glyph.Data = {
+      F2010000424DF201000000000000760000002800000024000000130000000100
+      0400000000007C01000000000000000000001000000000000000000000000000
+      80000080000000808000800000008000800080800000C0C0C000808080000000
+      FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333334433333
+      3333333333388F3333333333000033334224333333333333338338F333333333
+      0000333422224333333333333833338F33333333000033422222243333333333
+      83333338F3333333000034222A22224333333338F33F33338F33333300003222
+      A2A2224333333338F383F3338F33333300003A2A222A222433333338F8333F33
+      38F33333000034A22222A22243333338833333F3338F333300004222A2222A22
+      2433338F338F333F3338F3330000222A3A2224A22243338F3838F338F3338F33
+      0000A2A333A2224A2224338F83338F338F3338F300003A33333A2224A2224338
+      333338F338F3338F000033333333A2224A2243333333338F338F338F00003333
+      33333A2224A2233333333338F338F83300003333333333A2224A333333333333
+      8F338F33000033333333333A222433333333333338F338F30000333333333333
+      A224333333333333338F38F300003333333333333A223333333333333338F8F3
+      000033333333333333A3333333333333333383330000}
+    NumGlyphs = 2
+  end
+  object BitBtn1: TBitBtn
+    Left = 184
+    Top = 56
+    Width = 81
+    Height = 25
+    TabOrder = 3
     Kind = bkCancel
   end
 end
index 9fb843e..d057d39 100644 (file)
@@ -11,18 +11,24 @@ type
     ComboBox1: TComboBox;
     Label1: TLabel;
     Button1: TButton;
+    BitBtn2: TBitBtn;
     BitBtn1: TBitBtn;
     procedure Button1Click(Sender: TObject);
+    procedure FormCreate(Sender: TObject);
+    procedure FormDestroy(Sender: TObject);
+    procedure BitBtn2Click(Sender: TObject);
   private
        { Private \90é\8c¾ }
        FThreadLogFileName: String;
        FNGFileName: String;
+       FDeleteList: TStringList;
   public
        { Public \90é\8c¾ }
        FRepaint : boolean;
        ResNumber : Integer;
        function SetThreadLogFileName(AFileName: String): boolean;
        function DeleteNG(AResNum: Integer): boolean;
+       property DeleteList : TStringList read FDeleteList write FDeleteList;
   end;
 
 var
@@ -53,9 +59,9 @@ begin
                                        end;
                                end;
 
-                               //i := NGFile.IndexOf(str);
                                if i >= 0 then begin
                                        FRepaint := true;
+                                       DeleteList.Add(Copy(str, 1, Length(str) - 1));
                                        NGFile.Delete(i);
                                        if NGFile.Count = 0 then
                                                DeleteFile(FNGFileName)
@@ -85,6 +91,7 @@ begin
                        try
                                NGFile.LoadFromFile(FNGFileName);
                                ComboBox1.Items.Clear;
+                ComboBox1.Sorted := true;
                                for i := 0 to NGFile.Count - 1do begin
                                        str := Copy(NGFile.Strings[i], 1, AnsiPos('-', NGFile.Strings[i]) - 1);
                                        if str <> '' then
@@ -92,6 +99,7 @@ begin
                                end;
                                if ComboBox1.Items.Count > 0 then
                                        Result := true;
+
                        except
                                Result := false;
                        end;
@@ -114,7 +122,7 @@ begin
                        try
                                NGFile.LoadFromFile(FNGFileName);
                                str := IntToStr(AResNum) + '-';
-                i := -1;
+                               i := -1;
                                for j := 0 to NGFile.Count - 1 do begin
                                        if AnsiPos(str, NGFile[j]) = 1 then begin
                                                i := j;
@@ -137,4 +145,44 @@ begin
        end;
 end;
 
+procedure TIndividualAbonForm.FormCreate(Sender: TObject);
+begin
+       FDeleteList := TStringList.Create;
+end;
+
+procedure TIndividualAbonForm.FormDestroy(Sender: TObject);
+begin
+       FDeleteList.Free;
+end;
+
+procedure TIndividualAbonForm.BitBtn2Click(Sender: TObject);
+var
+       NGFile: TStringList;
+       i, j: Integer;
+
+       str: String;
+begin
+       if (FileExists(FNGFileName)) then begin
+               NGFile := TStringList.Create;
+               try
+                       try
+                               FRepaint := false;
+                               NGFile.LoadFromFile(FNGFileName);
+                               for i := ComboBox1.Items.Count - 1 downto 0 do begin
+                                       str := ComboBox1.Items[i];
+                                       if( Length(str) > 0 ) then begin
+                                               FRepaint := true;
+                                               DeleteList.Add(str);
+                                               NGFile.Delete(i);
+                                       end;
+                               end;
+                DeleteFile(FNGFileName);
+                       except
+                       end;
+               finally
+                       NGFile.Free;
+               end;
+       end;
+end;
+
 end.