OSDN Git Service

誤爆チェックのオプションを追加。
authorh677 <h677>
Tue, 2 Jun 2009 16:00:22 +0000 (16:00 +0000)
committerh677 <h677>
Tue, 2 Jun 2009 16:00:22 +0000 (16:00 +0000)
表示しているスレッド/スレッド一覧などと、投稿するレス/スレッドが異なる場合に、
警告を表示するようにした。

Editor.pas
KuroutSetting.dfm
KuroutSetting.pas
Option.dfm
Setting.pas

index ce58e15..583e13e 100644 (file)
@@ -281,6 +281,8 @@ type
         function FusianaMsgBox: Integer;
         //! sent.ini\83t\83@\83C\83\8b\82Ì\90\90¬
         function CreateSentIniFile: TMemIniFile;
+        //! \8cë\94\9a\83`\83F\83b\83N
+        function isGobaku: Boolean;
        protected
                procedure CreateParams(var Params: TCreateParams); override;
        public
@@ -801,6 +803,11 @@ begin
                     CancelSend( Board, SysMenu );
                     Exit;
                 end;
+                // \8cë\94\9a\83`\83F\83b\83N
+                if (isGobaku) then begin
+                    CancelSend( Board, SysMenu );
+                    Exit;
+                end;
                        end;
 
                        GetSendData(Source);
@@ -2547,5 +2554,66 @@ begin
         GikoForm.DownloadList(GetBoard);
     end;
 end;
+//! \8cë\94\9a\83`\83F\83b\83N
+function TEditorForm.isGobaku: Boolean;
+const
+       MSG_GOBAKU : string =
+        '\95\\8e¦\82µ\82Ä\82¢\82é%s\82Æ\93\8a\8de\90æ\82Ì%s\82ª\88Ù\82È\82è\82Ü\82·\81B'#13#10 +
+               '\82±\82Ì\82Ü\82Ü\8f\91\82«\8d\9e\82Ý\82Ü\82·\82©\81H';
+var
+    ThreadItem : TThreadItem;
+    msg : String;
+
+begin
+    Result := False;
+    // \83I\83v\83V\83\87\83\93\97L\8cø\82©\82Â\83\8c\83X\91\97\90M\82Å\82Ì\82Ý\97L\8cø
+    if (GikoSys.Setting.UseGobakuCheck) then begin
+        // \83\8c\83X\91\97\90M
+        if (FThreadItem <> nil) then begin
+            ThreadItem := GikoForm.GetActiveContent(False);
+            if (ThreadItem <> nil) then begin
+                if (FThreadItem <> ThreadItem) then begin
+                    msg := Format(MSG_GOBAKU, ['\83X\83\8c\83b\83h', '\83X\83\8c\83b\83h']);
+                    Result := MsgBox(Handle, msg, '\8fî\95ñ', MB_YESNO or MB_ICONQUESTION) = IDNO;
+                end;
+            end else begin
+                if GikoForm.ActiveList is TBBS then begin
+                    if TBBS(GikoForm.ActiveList) <> FThreadItem.ParentBoard.ParentCategory.ParenTBBS then begin
+                        msg := Format(MSG_GOBAKU, ['BBS', '\83X\83\8c\83b\83h\82Ì\8f\8a\91®\82·\82éBBS']);
+                        Result := MsgBox(Handle, msg, '\8fî\95ñ', MB_YESNO or MB_ICONQUESTION) = IDNO;
+                    end;
+                end else if GikoForm.ActiveList is TCategory then begin
+                    if TCategory(GikoForm.ActiveList).FindThreadFromURL(FThreadItem.URL) = nil then begin
+                        msg := Format(MSG_GOBAKU, ['\83J\83e\83S\83\8a', '\83X\83\8c\83b\83h\82Ì\8f\8a\91®\82·\82é\83J\83e\83S\83\8a']);
+                        Result := MsgBox(Handle, msg, '\8fî\95ñ', MB_YESNO or MB_ICONQUESTION) = IDNO;
+                    end;
+                end else if GikoForm.ActiveList is TBoard then begin
+                    if TBoard(GikoForm.ActiveList) <> FThreadItem.ParentBoard then begin
+                        msg := Format(MSG_GOBAKU, ['\94Â', '\83X\83\8c\83b\83h\82Ì\8f\8a\91®\82·\82é\94Â']);
+                        Result := MsgBox(Handle, msg, '\8fî\95ñ', MB_YESNO or MB_ICONQUESTION) = IDNO;
+                    end;
+                end;
+            end;
+        end else begin
+            // \83X\83\8c\82½\82Ä
+            if GikoForm.ActiveList is TBBS then begin
+                if TBBS(GikoForm.ActiveList) <> FBoard.ParentCategory.ParenTBBS then begin
+                    msg := Format(MSG_GOBAKU, ['BBS', '\94Â\82Ì\8f\8a\91®\82·\82éBBS']);
+                    Result := MsgBox(Handle, msg, '\8fî\95ñ', MB_YESNO or MB_ICONQUESTION) = IDNO;
+                end;
+            end else if GikoForm.ActiveList is TCategory then begin
+                if TCategory(GikoForm.ActiveList).FindBoardFromURL(FBoard.URL) = nil then begin
+                    msg := Format(MSG_GOBAKU, ['\83J\83e\83S\83\8a', '\94Â\82Ì\8f\8a\91®\82·\82é\83J\83e\83S\83\8a']);
+                    Result := MsgBox(Handle, msg, '\8fî\95ñ', MB_YESNO or MB_ICONQUESTION) = IDNO;
+                end;
+            end else if GikoForm.ActiveList is TBoard then begin
+                if TBoard(GikoForm.ActiveList) <> FBoard then begin
+                    msg := Format(MSG_GOBAKU, ['\94Â', '\94Â']);
+                    Result := MsgBox(Handle, msg, '\8fî\95ñ', MB_YESNO or MB_ICONQUESTION) = IDNO;
+                end;
+            end;
+        end;
+    end;
+end;
 
 end.
index 14a6f41..8c5c503 100644 (file)
@@ -22,8 +22,8 @@ object KuroutOption: TKuroutOption
     Top = 0
     Width = 517
     Height = 393
-    ActivePage = KakikomiTabSheet
-    TabIndex = 2
+    ActivePage = TabSheet2
+    TabIndex = 3
     TabOrder = 0
     object TabSheet1: TTabSheet
       Caption = #35443#32048#35373#23450#65297
@@ -548,11 +548,11 @@ object KuroutOption: TKuroutOption
         Left = 16
         Top = 16
         Width = 473
-        Height = 129
+        Height = 161
         Caption = #12475#12461#12517#12522#12486#12451
         TabOrder = 0
         object Label12: TLabel
-          Left = 25
+          Left = 23
           Top = 108
           Width = 374
           Height = 12
@@ -590,17 +590,25 @@ object KuroutOption: TKuroutOption
           Caption = #12475#12461#12517#12522#12486#12451#23550#31574#12477#12501#12488#12398#35492#21453#24540#23550#31574
           TabOrder = 1
         end
+        object UseGobakuCheckBox: TCheckBox
+          Left = 23
+          Top = 128
+          Width = 345
+          Height = 17
+          Caption = #34920#31034#26495'/'#12473#12524#12483#12489#12392#30064#12394#12427#26495'/'#12473#12524#12483#12489#12395#25237#31295#12377#12427#38555#12395#35686#21578#12377#12427#12290
+          TabOrder = 2
+        end
       end
       object LogGroupBox: TGroupBox
         Left = 16
-        Top = 160
-        Width = 465
-        Height = 65
+        Top = 179
+        Width = 473
+        Height = 49
         Caption = #12525#12464
         TabOrder = 1
         object CheckDatFileCheckBox: TCheckBox
           Left = 22
-          Top = 14
+          Top = 18
           Width = 369
           Height = 17
           Caption = #12473#12524#12483#12489#19968#35239#65288'Folder.idx'#65289#35501#12415#36796#12415#26178#12395'dat'#12501#12449#12452#12523#12434#12481#12455#12483#12463#12377#12427#12290
index 8117d10..32e7f62 100644 (file)
@@ -96,6 +96,7 @@ type
     RespopupMailToCheckBox: TCheckBox;
     ResRangeLabeledEdit: TLabeledEdit;
     ResRangeCountUpDown: TUpDown;
+    UseGobakuCheckBox: TCheckBox;
        procedure OkBottonClick(Sender: TObject);
        procedure FormCreate(Sender: TObject);
        procedure CDeleteButtonClick(Sender: TObject);
@@ -183,6 +184,8 @@ begin
     DeltaYUpDown.Position := GikoSys.Setting.RespopupDeltaY;
     RespopupWaitUpDown.Position := GikoSys.Setting.RespopupWait;
     RespopupMailToCheckBox.Checked := GikoSys.Setting.RespopupMailTo;
+    // \8cë\94\9a\83`\83F\83b\83N
+    UseGobakuCheckBox.Checked := GikoSys.Setting.UseGobakuCheck;
 end;
 
 procedure TKuroutOption.SaveSetting;
@@ -234,6 +237,9 @@ begin
     GikoSys.Setting.RespopupWait := StrToInt(RespopupWaitLabeledEdit.Text);
     GikoForm.ResPopupClearTimer.Interval := GikoSys.Setting.RespopupWait;
     GikoSys.Setting.RespopupMailTo := RespopupMailToCheckBox.Checked;
+    // \8cë\94\9a\83`\83F\83b\83N
+    GikoSys.Setting.UseGobakuCheck := UseGobakuCheckBox.Checked;
+
 end;
 
 procedure TKuroutOption.RecvBufferSizeExit(Sender: TObject);
index 94429fc..f3eb215 100644 (file)
@@ -61,9 +61,9 @@ object OptionDialog: TOptionDialog
     Top = 4
     Width = 509
     Height = 389
-    ActivePage = ThreadSheet
+    ActivePage = CSSTabSheet
     MultiLine = True
-    TabIndex = 4
+    TabIndex = 2
     TabOrder = 3
     OnChange = OptionTabChange
     object ConnectSheet: TTabSheet
@@ -253,7 +253,7 @@ object OptionDialog: TOptionDialog
           Top = 43
           Width = 417
           Height = 20
-          ItemHeight = 0
+          ItemHeight = 12
           TabOrder = 0
           Text = 'BoardURLComboBox'
         end
index b35d36b..49c5730 100644 (file)
@@ -464,6 +464,8 @@ type
         FRespopupWait: Integer;
         //! \83\81\81[\83\8b\97\93\83\8c\83X\83|\83b\83v\83A\83b\83v
         FRespopupMailTo: Boolean;
+        //! \8cë\94\9a\83`\83F\83b\83N
+        FUseGobakuCheck: Boolean;
                function GetMainCoolSet(Index: Integer): TCoolSet;
                function GetBoardCoolSet(Index: Integer): TCoolSet;
                function GetBrowserCoolSet(Index: Integer): TCoolSet;
@@ -834,6 +836,8 @@ type
         //! \83\8c\83X\83|\83b\83v\83A\83b\83v\83^\83C\83}\81[
         property RespopupWait: Integer read FRespopupWait write FRespopupWait;
         property RespopupMailTo: Boolean read FRespopupMailTo write FRespopupMailTo;
+        //! \8cë\94\9a\83`\83F\83b\83N
+        property UseGobakuCheck: Boolean read FUseGobakuCheck write FUseGobakuCheck; 
 end;
 
 
@@ -1271,6 +1275,7 @@ begin
                // \83G\83f\83B\83^
                FSpaceToNBSP    := ini.ReadBool( 'Editor', 'SpaceToNBSP', False );
                FAmpToCharRef   := ini.ReadBool( 'Editor', 'AmpToCharRef', False );
+        FUseGobakuCheck := ini.ReadBool( 'Editor', 'UseGobakuCheck', True );
 
                //Tab\8e©\93®\95Û\91\81A\93Ç\82Ý\8d\9e\82Ý
                FTabAutoLoadSave    := ini.ReadBool('TabAuto', 'TabAutoLoadSave', False);
@@ -1334,6 +1339,8 @@ begin
         FCheckDatFile := ini.ReadBool('ThreadList', 'CheckDatFile', True);
         FLimitResCountMessage := ini.ReadBool('Thread', 'LimitResCountMessage', True);
 
+
+
         // \83M\83R\83i\83r\8dX\90V\82Å\97\98\97p\82µ\82½\83C\83\93\83X\83g\81[\83\89\82Ì\8dí\8f\9c
         s := ini.ReadString('Update', 'Remove0', '');
         if (FileExists(s)) then begin
@@ -1687,10 +1694,11 @@ begin
                // \83G\83f\83B\83^
                ini.WriteBool( 'Editor', 'SpaceToNBSP', FSpaceToNBSP );
                ini.WriteBool( 'Editor', 'AmpToCharRef', FAmpToCharRef );
+        ini.WriteBool( 'Editor', 'UseGobakuCheck', FUseGobakuCheck );
 
                 //\83^\83u\8e©\93®\95Û\91
                ini.WriteBool('TabAuto', 'TabAutoLoadSave', FTabAutoLoadSave);
-        ini.WriteString('Thread', 'LastCloseTabURL', FLastCloseTabURL); 
+        ini.WriteString('Thread', 'LastCloseTabURL', FLastCloseTabURL);
                 //\8fÚ\8d×\90Ý\92è
                ini.WriteInteger('OptionDialog', 'KuroutTabIndex', FKuroutSettingTabIndex);
 
@@ -1731,6 +1739,7 @@ begin
         ini.WriteString('Function', 'ExtList', FExtList);
         ini.WriteBool('ThreadList', 'CheckDatFile', FCheckDatFile);
         ini.WriteBool('Thread', 'LimitResCountMessage', FLimitResCountMessage);
+
                ini.UpdateFile;
        finally
                ini.Free;