OSDN Git Service

Added ConfirmOnTabClose
authornaru <bottle@mikage.to>
Mon, 25 Aug 2003 04:44:31 +0000 (04:44 +0000)
committernaru <bottle@mikage.to>
Mon, 25 Aug 2003 04:44:31 +0000 (04:44 +0000)
bottleclient/BottleDef.pas
bottleclient/LogForm.pas
bottleclient/SettingForm.dfm
bottleclient/SettingForm.pas

index 0528f79..cafbc79 100755 (executable)
@@ -86,6 +86,7 @@ type
     FLogListPreviewStyle: TLogListPreviewStyle;
     FEditorPreviewWindowPosition: TRect;
     FAutoClip: boolean;
+    FConfirmOnTabClose: boolean;
     procedure SetDblClkInsert(const Value: boolean);
     procedure SetDefaultScript(const Value: String);
     procedure SetIgnoreTimeCritical(const Value: boolean);
@@ -145,11 +146,13 @@ type
     procedure SetLogListPreviewStyle(const Value: TLogListPreviewStyle);
     procedure SetEditorPreviewWindowPosition(const Value: TRect);
     procedure SetAutoClip(const Value: boolean);
+    procedure SetConfirmOnTabClose(const Value: boolean);
   protected
     function InScreen(ARect: TRect): boolean;
   public
     property NoSendGhostList: boolean read FNoSendGhostList write SetNoSendGhostList;
     property ConfirmOnExit: boolean read FConfirmOnExit write SetConfirmOnExit;
+    property ConfirmOnTabClose: boolean read FConfirmOnTabClose write SetConfirmOnTabClose;
     property AutoClip: boolean read FAutoClip write SetAutoClip;
     property AutoStart: boolean read FAutoStart write SetAutoStart;
     property TabPosition: TTabPosition read FTabPosition write SetTabPosition;
@@ -410,6 +413,7 @@ begin
     //
     NoSendGhostList := FIni.ReadBool('System', 'NoSendGhostList', false);
     ConfirmOnExit := FIni.ReadBool('System', 'ConfirmOnExit', false);
+    ConfirmOnTabClose := FIni.ReadBool('System', 'ConfirmOnTabClose', false);
     AutoClip := FIni.ReadBool('System', 'AutoClip', false);
     AutoStart := FIni.ReadBool('System', 'AutoStart', false);
     TabPosition := TTabPosition(FIni.ReadInteger('System', 'TabPosition', 0));
@@ -766,6 +770,7 @@ procedure TBottlePrefs.SaveSettings;
 begin
   FIni.WriteBool('System', 'NoSendGhostList', NoSendGhostList);
   FIni.WriteBool('System', 'ConfirmOnExit', ConfirmOnExit);
+  FIni.WriteBool('System', 'ConfirmOnTabClose', ConfirmOnTabClose);
   FIni.WriteBool('System', 'AutoClip', AutoClip);
   FIni.WriteBool('System', 'AutoStart', AutoStart);
   FIni.WriteInteger('System', 'TabPosition', Ord(TabPosition));
@@ -930,6 +935,11 @@ begin
   FAutoClip := Value;
 end;
 
+procedure TBottlePrefs.SetConfirmOnTabClose(const Value: boolean);
+begin
+  FConfirmOnTabClose := Value;
+end;
+
 { TChannelListItem }
 
 procedure TChannelListItem.SetGhost(const Value: String);
index 81616bf..2652c98 100755 (executable)
@@ -911,7 +911,14 @@ end;
 procedure TfrmLog.mnCloseTabClick(Sender: TObject);
 var PrevSelection: TBottleLogList; // \95Â\82\82½\82Æ\82«\83^\83u\82ª\82¸\82ê\82È\82¢\82æ\82¤\82É\82·\82é\8f\88\97\9d\97p
     i: integer;
+    Confirm: String;
 begin
+  if Pref.ConfirmOnTabClose then
+  begin
+    Confirm := Format('\83^\83u"%s"\82ð\95Â\82\82Ü\82·\82©?', [(FBottleLogList[i] as TBottleLogList).Title]);
+    if MessageDlg(Confirm, mtConfirmation, mbOkCancel, 0) = mrCancel then
+      Exit;
+  end;
   PrevSelection := SelectedBottleLog;
   FBottleLogList.Delete(tabBottleLog.Tag);
   UpdateTab;
index 00d2e8b..bb8fa24 100755 (executable)
@@ -4,7 +4,7 @@ object frmSetting: TfrmSetting
   Anchors = [akLeft, akTop, akRight, akBottom]
   BorderStyle = bsDialog
   Caption = #35373#23450
-  ClientHeight = 348
+  ClientHeight = 357
   ClientWidth = 575
   Color = clBtnFace
   Font.Charset = SHIFTJIS_CHARSET
@@ -20,7 +20,7 @@ object frmSetting: TfrmSetting
   OnCreate = FormCreate
   DesignSize = (
     575
-    348)
+    357)
   PixelsPerInch = 96
   TextHeight = 12
   object Label1: TLabel
@@ -35,7 +35,8 @@ object frmSetting: TfrmSetting
     Left = 128
     Top = 32
     Width = 440
-    Height = 282
+    Height = 291
+    ActivePage = tstGeneral
     Anchors = [akLeft, akTop, akRight, akBottom]
     MultiLine = True
     TabOrder = 0
@@ -103,6 +104,15 @@ object frmSetting: TfrmSetting
         Caption = #12463#12522#12450#26178#12395#33258#21205#12391#12463#12522#12483#12503'(&L)'
         TabOrder = 4
       end
+      object cbxConfirmOnTabClose: TCheckBox
+        Left = 8
+        Top = 208
+        Width = 257
+        Height = 17
+        Hint = #12525#12464#12454#12451#12531#12489#12454#12391#12479#12502#12434#38281#12376#12427#26178#12395#30906#35469#12480#12452#12450#12525#12464#12434#34920#31034#12375#12414#12377
+        Caption = #12525#12464#12454#12451#12531#12489#12454#12398#12479#12502#12434#38281#12376#12427#26178#12395#30906#35469#12377#12427'(&C)'
+        TabOrder = 5
+      end
     end
     object tstDisplay: TTabSheet
       Caption = #34920#31034
@@ -601,7 +611,7 @@ object frmSetting: TfrmSetting
   end
   object btnClose: TButton
     Left = 495
-    Top = 319
+    Top = 328
     Width = 75
     Height = 25
     Anchors = [akRight, akBottom]
@@ -614,7 +624,7 @@ object frmSetting: TfrmSetting
     Left = 8
     Top = 24
     Width = 113
-    Height = 289
+    Height = 297
     Images = ImageList
     Indent = 19
     RowSelect = True
index a9725fe..823e5bd 100755 (executable)
@@ -72,6 +72,7 @@ type
     tvwCategory: TTreeView;
     Label1: TLabel;
     pnlHeading: TPanel;
+    cbxConfirmOnTabClose: TCheckBox;
     procedure FormClose(Sender: TObject; var Action: TCloseAction);
     procedure edtProxyPortKeyPress(Sender: TObject; var Key: Char);
     procedure ctvBottleNodeChecked(Sender: TObject;
@@ -118,6 +119,7 @@ begin
   cbxIgnoreTimeCritical.Checked := Pref.IgnoreTimeCritical;
   cbxNoSendGhostList.Checked := Pref.NoSendGhostList;
   cbxConfirmOnExit.Checked := Pref.ConfirmOnExit;
+  cbxConfirmOnTabClose.Checked := Pref.ConfirmOnTabClose;
   cbxAutoClip.Checked := Pref.AutoClip;
   //
   with frmColorSetting do begin
@@ -199,6 +201,7 @@ begin
   Pref.IgnoreTimeCritical := cbxIgnoreTimeCritical.Checked;
   Pref.NoSendGhostList := cbxNoSendGhostList.Checked;
   Pref.ConfirmOnExit := cbxConfirmOnExit.Checked;
+  Pref.ConfirmOnTabClose := cbxConfirmOnTabClose.Checked;
   Pref.AutoClip := cbxAutoClip.Checked;
   //
   with frmColorSetting do begin