From 6f57da172a8cadfc9b870544b0c0d35f84152790 Mon Sep 17 00:00:00 2001 From: naru Date: Mon, 25 Aug 2003 04:44:31 +0000 Subject: [PATCH] Added ConfirmOnTabClose --- bottleclient/BottleDef.pas | 10 ++++++++++ bottleclient/LogForm.pas | 7 +++++++ bottleclient/SettingForm.dfm | 20 +++++++++++++++----- bottleclient/SettingForm.pas | 3 +++ 4 files changed, 35 insertions(+), 5 deletions(-) diff --git a/bottleclient/BottleDef.pas b/bottleclient/BottleDef.pas index 0528f79..cafbc79 100755 --- a/bottleclient/BottleDef.pas +++ b/bottleclient/BottleDef.pas @@ -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); diff --git a/bottleclient/LogForm.pas b/bottleclient/LogForm.pas index 81616bf..2652c98 100755 --- a/bottleclient/LogForm.pas +++ b/bottleclient/LogForm.pas @@ -911,7 +911,14 @@ end; procedure TfrmLog.mnCloseTabClick(Sender: TObject); var PrevSelection: TBottleLogList; // •Â‚¶‚½‚Æ‚«ƒ^ƒu‚ª‚¸‚ê‚È‚¢‚悤‚É‚·‚鏈——p i: integer; + Confirm: String; begin + if Pref.ConfirmOnTabClose then + begin + Confirm := Format('ƒ^ƒu"%s"‚ð•Â‚¶‚Ü‚·‚©?', [(FBottleLogList[i] as TBottleLogList).Title]); + if MessageDlg(Confirm, mtConfirmation, mbOkCancel, 0) = mrCancel then + Exit; + end; PrevSelection := SelectedBottleLog; FBottleLogList.Delete(tabBottleLog.Tag); UpdateTab; diff --git a/bottleclient/SettingForm.dfm b/bottleclient/SettingForm.dfm index 00d2e8b..bb8fa24 100755 --- a/bottleclient/SettingForm.dfm +++ b/bottleclient/SettingForm.dfm @@ -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 diff --git a/bottleclient/SettingForm.pas b/bottleclient/SettingForm.pas index a9725fe..823e5bd 100755 --- a/bottleclient/SettingForm.pas +++ b/bottleclient/SettingForm.pas @@ -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 -- 2.11.0