OSDN Git Service

最小送信バイト数の設定を追加(主にポカミス防止用 ToDo ID=380)
authorC.Ponapalt <ponapalt@shillest.net>
Tue, 12 Jul 2005 06:44:27 +0000 (06:44 +0000)
committerC.Ponapalt <ponapalt@shillest.net>
Tue, 12 Jul 2005 06:44:27 +0000 (06:44 +0000)
bottleclient/BottleDef.pas
bottleclient/MainForm.pas
bottleclient/SettingForm.dfm
bottleclient/SettingForm.pas

index f53d668..bc640ac 100755 (executable)
@@ -53,6 +53,7 @@ type
     FNoTransUrl: boolean;
     FIgnoreFrequentYenS: boolean;
     FWaitScriptEnd: integer;
+    FMinScriptLength: integer;
     FCgiNameGhost: String;
     FGLogPage: String;
     FVotePage: String;
@@ -131,6 +132,7 @@ type
     procedure SetIgnoreFrequentYenS(const Value: boolean);
     procedure SetNoTransUrl(const Value: boolean);
     procedure SetWaitScriptEnd(const Value: integer);
+    procedure SetMinScriptLength(const Value: integer);
     procedure SetLogWindowDividerPos(const Value: integer);
     procedure SetProxyAddress(const Value: String);
     procedure SetProxyPort(const Value: integer);
@@ -199,6 +201,7 @@ type
     property WarnYenTNotExist: boolean read FWarnYenTNotExist write SetWarnYenTNotExist;
     property WarnScopeChangeInSynchronize: boolean read FWarnScopeChangeInSynchronize write SetWarnScopeChangeInSynchronize;
     property WaitScriptEnd: integer read FWaitScriptEnd write SetWaitScriptEnd;
+    property MinScriptLength: integer read FMinScriptLength write SetMinScriptLength;
     property StayOnTop: boolean read FStayOnTop write SetStayOnTop;
     property IgnoreTimeCritical: boolean read FIgnoreTimeCritical write SetIgnoreTimeCritical;
     property TalkColorH: TColor read FTalkColorH write SetTalkColorH;
@@ -350,6 +353,8 @@ const
   DefaultVotePage = 'http://bottle.mikage.to/viewvotes.cgi';
   DefaultHelpPage = 'http://bottle.mikage.to/clihelp/index.html';
 
+  DefaultMinScriptLength = 20;
+
   Version = '2.72';
 
   {$IFDEF NOMUTEX}
@@ -562,6 +567,7 @@ begin
 
     IgnoreFrequentYenS := FIni.ReadBool('System', 'IgnoreFrequentYenS', false);
     WaitScriptEnd := FIni.ReadInteger('System', 'WaitScriptEnd', 0);
+    MinScriptLength := FIni.ReadInteger('System', 'MinScriptLength', DefaultMinScriptLength);
     StayOnTop := FIni.ReadBool('System', 'StayOnTop', false);
     ShowConstBar := FIni.ReadBool('System', 'ShowConstBar', true);
     ShowToolBar := FIni.ReadBool('System', 'ShowToolBar', true);
@@ -938,6 +944,11 @@ begin
   if Value > 0 then FWaitScriptEnd := Value;
 end;
 
+procedure TBottlePrefs.SetMinScriptLength(const Value: integer);
+begin
+  if Value >= DefaultMinScriptLength then FMinScriptLength := Value;
+end;
+
 procedure TBottlePrefs.SetWhenCtrlReturn(const Value: TReturnKeyFunction);
 begin
   FWhenCtrlReturn := Value;
@@ -1006,6 +1017,7 @@ begin
 
   FIni.WriteBool('System', 'IgnoreFrequentYenS', IgnoreFrequentYenS);
   FIni.WriteInteger('System', 'WaitScriptEnd', WaitScriptEnd);
+  FIni.WriteInteger('System', 'MinScriptLength', MinScriptLength);
   FIni.WriteBool('System', 'StayOnTop', StayOnTop);
   FIni.WriteBool('System', 'NoConfirm', NoConfirm);
   FIni.WriteBool('System', 'IgnoreTimeCritical', IgnoreTimeCritical);
index 7fbc879..a834d9d 100755 (executable)
@@ -724,6 +724,12 @@ begin
     Exit;
   end;
 
+  if Length(Talk) < Pref.MinScriptLength then
+  begin
+    MessageDlg('\8dÅ\8f¬\91\97\90M\83o\83C\83g\90\94\88È\89º\82Å\82·\81B', mtError, [mbOk], 0);
+    Exit;
+  end;
+
   if not Pref.NoConfirm then begin
     if not SendConfirmDialog(FNowChannel, cbxTargetGhost.Text) then Exit;
   end;
index a5699d3..36e4db9 100755 (executable)
@@ -36,7 +36,7 @@ object frmSetting: TfrmSetting
     Top = 32
     Width = 440
     Height = 291
-    ActivePage = tstConnection
+    ActivePage = tstReceive
     Anchors = [akLeft, akTop, akRight, akBottom]
     MultiLine = True
     TabOrder = 0
@@ -311,16 +311,23 @@ object frmSetting: TfrmSetting
       ImageIndex = 4
       TabVisible = False
       object lblWaitScriptEnd: TLabel
-        Left = 16
-        Top = 216
+        Left = 8
+        Top = 208
         Width = 175
         Height = 12
         Caption = #12473#12463#12522#12503#12488#12398#26368#24460#12395#12454#12455#12452#12488#25407#20837'(&W)'
         FocusControl = spnWaitScriptEnd
       end
+      object lblMinScriptLength: TLabel
+        Left = 8
+        Top = 232
+        Width = 130
+        Height = 12
+        Caption = #26368#23567#36865#20449#21487#33021#12496#12452#12488#25968'(&B)'
+      end
       object spnWaitScriptEnd: TSpinEdit
-        Left = 208
-        Top = 210
+        Left = 200
+        Top = 202
         Width = 65
         Height = 21
         Hint = #21336#20301#12399'50ms'#12290'9'#12391'\w9'#12434#25407#20837#12377#12427
@@ -386,7 +393,7 @@ object frmSetting: TfrmSetting
       end
       object btnVisibleGhosts: TButton
         Left = 288
-        Top = 244
+        Top = 252
         Width = 123
         Height = 25
         Caption = #12468#12540#12473#12488#25351#23450'(&G)...'
@@ -395,13 +402,24 @@ object frmSetting: TfrmSetting
       end
       object cbxHideGhosts: TCheckBox
         Left = 8
-        Top = 248
+        Top = 256
         Width = 273
         Height = 17
         Hint = 'IfGhost'#36984#25246#12508#12483#12463#12473#12395#25351#23450#12375#12383#12468#12540#12473#12488#20197#22806#12364#29694#12428#12394#12356#12424#12358#12395#12375#12414#12377#12290#20182#12399#21463#20449#23554#29992#12468#12540#12473#12488#12395
         Caption = #25351#23450#12468#12540#12473#12488#20197#22806#12434#36984#25246#12508#12483#12463#12473#12363#12425#38560#12377'(&H)'
         TabOrder = 2
       end
+      object spnMinScriptLength: TSpinEdit
+        Left = 200
+        Top = 228
+        Width = 65
+        Height = 21
+        Hint = #36865#20449#21069#12395#35373#23450#12375#12383#12496#12452#12488#25968#20197#19978#12398#38263#12373#12398#12473#12463#12522#12503#12488#12363#12393#12358#12363#12481#12455#12483#12463#12375#12414#12377#12290#38263#12373#12395#12399#33258#21205#20184#21152#12373#12428#12427'\e'#12434#21547#12415#12414#12377#12290
+        MaxValue = 99999
+        MinValue = 20
+        TabOrder = 4
+        Value = 20
+      end
     end
     object tstChannel: TTabSheet
       Caption = #33258#21205#21442#21152': '#36215#21205#26178#12398#33258#21205#21442#21152#12481#12515#12531#12493#12523#38306#20418#12398#35373#23450
@@ -644,7 +662,7 @@ object frmSetting: TfrmSetting
         Height = 20
         Hint = #20104#28204#12497#12521#12513#12540#12479#12398#12463#12452#12483#12463#35373#23450
         Style = csDropDownList
-        ItemHeight = 12
+        ItemHeight = 0
         TabOrder = 0
         OnChange = cbxPlayTimeProfileChange
       end
index f76a538..277c028 100755 (executable)
@@ -114,6 +114,8 @@ type
     edtProxyPass: TEdit;
     lblProxyUser: TLabel;
     lblProxyPass: TLabel;
+    lblMinScriptLength: TLabel;
+    spnMinScriptLength: TSpinEdit;
     procedure FormClose(Sender: TObject; var Action: TCloseAction);
     procedure edtProxyPortKeyPress(Sender: TObject; var Key: Char);
     procedure ctvBottleNodeChecked(Sender: TObject;
@@ -233,6 +235,8 @@ begin
   end;
   //cbxIgnoreFrequentYenS.Checked := Pref.IgnoreFrequentYenS;
   spnWaitScriptEnd.Value := Pref.WaitScriptEnd;
+  spnMinScriptLength.Value := Pref.MinScriptLength;
+  spnMinScriptLength.MinValue := DefaultMinScriptLength;
   //
   rgpWhenReturn.ItemIndex := Ord(Pref.WhenReturn);
   rgpWhenShiftReturn.ItemIndex := Ord(Pref.WhenShiftReturn);
@@ -331,6 +335,7 @@ begin
   end;
   //Pref.IgnoreFrequentYenS := cbxIgnoreFrequentYenS.Checked;
   Pref.WaitScriptEnd := spnWaitScriptEnd.Value;
+  Pref.MinScriptLength := spnMinScriptLength.Value;
   //
   Pref.WhenReturn := TReturnKeyFunction(rgpWhenReturn.ItemIndex);
   Pref.WhenShiftReturn := TReturnKeyFunction(rgpWhenShiftReturn.ItemIndex);