6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
7 ComCtrls, StdCtrls, ExtCtrls, BottleDef, Spin,
8 CPCConfigTreeView, ColorSettingFrame, BottleChainListFrame, SakuraSeekerInstance,
9 ImgList, StrListEditor;
12 TfrmSetting = class(TForm)
13 PageControl: TPageControl;
15 tstGeneral: TTabSheet;
18 rgpWhenReturn: TRadioGroup;
19 rgpWhenShiftReturn: TRadioGroup;
20 rgpWhenCtrlReturn: TRadioGroup;
21 memDefaultScript: TMemo;
22 lblDefaultScript: TLabel;
23 grpLocalConfirm: TGroupBox;
24 cbxIgnoreTimeCritical: TCheckBox;
25 tstReceive: TTabSheet;
26 rgpTabPosition: TRadioGroup;
27 OpenDialog: TOpenDialog;
28 spnWaitScriptEnd: TSpinEdit;
29 lblWaitScriptEnd: TLabel;
30 cbxNoSendGhostList: TCheckBox;
31 cbxConfirmOnExit: TCheckBox;
32 ctvBottle: TCPCConfigTreeView;
33 lblGhostDropDownCount: TLabel;
34 spnGhostDropDownCount: TSpinEdit;
36 frmColorSetting: TfrmColorSetting;
38 frmRuleList: TfrmBottleChainList;
39 tstDetailed: TTabSheet;
43 lblProxyAddress: TLabel;
45 edtProxyAddress: TEdit;
47 cbxUseHttpProxy: TCheckBox;
48 tstChannel: TTabSheet;
49 lblAutoJoinChannels: TLabel;
50 memAutoJoinChannels: TMemo;
51 cbxAutoStart: TCheckBox;
52 btnUseCurrentJoinChannels: TButton;
54 ImageList: TImageList;
55 cbxShowRuler: TCheckBox;
56 cbxHideGhosts: TCheckBox;
57 btnVisibleGhosts: TButton;
58 procedure FormClose(Sender: TObject; var Action: TCloseAction);
59 procedure edtProxyPortKeyPress(Sender: TObject; var Key: Char);
60 procedure ctvBottleNodeChecked(Sender: TObject;
61 Node: TCPCConfigItemNode);
62 procedure ctvBottleNodeChecking(Sender: TObject;
63 Node: TCPCConfigItemNode; var Allow: Boolean);
64 procedure tstRuleShow(Sender: TObject);
65 procedure btnUseCurrentJoinChannelsClick(Sender: TObject);
66 procedure btnVisibleGhostsClick(Sender: TObject);
75 frmSetting: TfrmSetting;
79 ChannelDefaultGhost = '(
\83`
\83\83\83\93\83l
\83\8b\90\84\8f§
\83S
\81[
\83X
\83g)';
87 procedure TfrmSetting.Execute;
89 PageControl.ActivePage := tstGeneral;
90 memDefaultScript.Text := Pref.DefaultScript;
91 cbxShowRuler.Checked := Pref.ShowRuler;
92 cbxIgnoreTimeCritical.Checked := Pref.IgnoreTimeCritical;
93 cbxNoSendGhostList.Checked := Pref.NoSendGhostList;
94 cbxConfirmOnExit.Checked := Pref.ConfirmOnExit;
96 with frmColorSetting do begin
97 Color['H'] := Pref.TalkColorH;
98 Color['U'] := Pref.TalkColorU;
99 Color['Synchro'] := Pref.TalkColorS;
100 Color['Tag'] := Pref.MarkUpColor;
101 Color['Meta'] := Pref.MetaWordColor;
102 Color['Error'] := Pref.MarkErrorColor;
103 Color['Background'] := Pref.BgColor;
106 cbxAutoStart.Checked := Pref.AutoStart;
107 rgpTabPosition.ItemIndex := Ord(Pref.TabPosition);
108 spnGhostDropDownCount.Value := Pref.GhostDropDownCount;
110 with ctvBottle do begin
111 (GetNodeFromKeyPath('Arrive\NoTranslate') as TCPCCheckBoxNode).Checked := Pref.NoTranslate;
112 (GetNodeFromKeyPath('Arrive\NoDescript') as TCPCCheckBoxNode).Checked := Pref.NoDescript;
113 if Pref.NoTransUrl then
114 (GetNodeFromKeyPath('Arrive\UrlTag\NoSelection') as TCPCRadioNode).Check
116 (GetNodeFromKeyPath('Arrive\UrlTag\WithSelection') as TCPCRadioNode).Check;
117 (GetNodeFromKeyPath('Arrive\SilentWhenHidden') as TCPCCheckBoxNode).Checked := Pref.SilentWhenHidden;
118 (GetNodeFromKeyPath('Arrive\FixMessySurface') as TCPCCheckBoxNode).Checked := Pref.FixMessySurface;
119 (GetNodeFromKeyPath('Arrive\HUTagTo01Tag') as TCPCCheckBoxNode).Checked := Pref.HUTagTo01Tag;
120 (GetNodeFromKeyPath('Out\ResetIfGhostAfterSend') as TCPCCheckBoxNode).Checked := Pref.ResetIfGhostAfterSend;
121 (GetNodeFromKeyPath('Out\ClearAfterSend') as TCPCCheckBoxNode).Checked := Pref.ClearAfterSend;
122 (GetNodeFromKeyPath('Out\NeedConfirmBeforeSend') as TCPCCheckBoxNode).Checked := Pref.NeedConfirmBeforeSend;
123 (GetNodeFromKeyPath('Out\Confirm') as TCPCCheckBoxNode).Checked := not Pref.NoConfirm;
124 (GetNodeFromKeyPath('Out\Warn\ScopeChangeInSynchronize') as TCPCCheckBoxNode).Checked := Pref.WarnScopeChangeInSynchronize;
125 (GetNodeFromKeyPath('Out\Warn\YenTNotExist') as TCPCCheckBoxNode).Checked := Pref.WarnYenTNotExist;
128 on E: Exception do ShowMessage(E.Message);
130 //cbxIgnoreFrequentYenS.Checked := Pref.IgnoreFrequentYenS;
131 spnWaitScriptEnd.Value := Pref.WaitScriptEnd;
133 rgpWhenReturn.ItemIndex := Ord(Pref.WhenReturn);
134 rgpWhenShiftReturn.ItemIndex := Ord(Pref.WhenShiftReturn);
135 rgpWhenCtrlReturn.ItemIndex := Ord(Pref.WhenCtrlReturn);
137 cbxUseHttpProxy.Checked := Pref.UseHttpProxy;
138 edtProxyAddress.Text := Pref.ProxyAddress;
139 edtProxyPort.Text := IntToStr(Pref.ProxyPort);
141 memFMOName.Lines := Pref.FMOName;
142 cbxHideGhosts.Checked := Pref.HideGhosts;
143 memAutoJoinChannels.Lines := Pref.AutoJoinChannels;
148 procedure TfrmSetting.FormClose(Sender: TObject; var Action: TCloseAction);
150 Pref.DefaultScript := memDefaultScript.Text;
151 Pref.ShowRuler := cbxShowRuler.Checked;
152 Pref.IgnoreTimeCritical := cbxIgnoreTimeCritical.Checked;
153 Pref.NoSendGhostList := cbxNoSendGhostList.Checked;
154 Pref.ConfirmOnExit := cbxConfirmOnExit.Checked;
156 with frmColorSetting do begin
157 Pref.TalkColorH := Color['H'];
158 Pref.TalkColorU := Color['U'];
159 Pref.TalkColorS := Color['Synchro'];
160 Pref.MarkUpColor := Color['Tag'];
161 Pref.MetaWordColor := Color['Meta'];
162 Pref.MarkErrorColor := Color['Error'];
163 Pref.BgColor := Color['Background'];
166 Pref.AutoStart := cbxAutoStart.Checked;
167 Pref.TabPosition := TTabPosition(rgpTabPosition.ItemIndex);
168 Pref.GhostDropDownCount := spnGhostDropDownCount.Value;
170 with ctvBottle do begin
171 Pref.NoTranslate := (GetNodeFromKeyPath('Arrive\NoTranslate') as TCPCCheckBoxNode).Checked;
172 Pref.NoDescript := (GetNodeFromKeyPath('Arrive\NoDescript') as TCPCCheckBoxNode).Checked;
173 Pref.NoTransUrl := (GetNodeFromKeyPath('Arrive\UrlTag\NoSelection') as TCPCRadioNode).Checked;
174 Pref.SilentWhenHidden := (GetNodeFromKeyPath('Arrive\SilentWhenHidden') as TCPCCheckBoxNode).Checked;
175 Pref.FixMessySurface := (GetNodeFromKeyPath('Arrive\FixMessySurface') as TCPCCheckBoxNode).Checked;
176 Pref.HUTagTo01Tag := (GetNodeFromKeyPath('Arrive\HUTagTo01Tag') as TCPCCheckBoxNode).Checked;
177 Pref.ResetIfGhostAfterSend := (GetNodeFromKeyPath('Out\ResetIfGhostAfterSend') as TCPCCheckBoxNode).Checked;
178 Pref.ClearAfterSend := (GetNodeFromKeyPath('Out\ClearAfterSend') as TCPCCheckBoxNode).Checked;
179 Pref.NeedConfirmBeforeSend := (GetNodeFromKeyPath('Out\NeedConfirmBeforeSend') as TCPCCheckBoxNode).Checked;
180 Pref.NoConfirm := not (GetNodeFromKeyPath('Out\Confirm') as TCPCCheckBoxNode).Checked;
181 Pref.WarnYenTNotExist := (GetNodeFromKeyPath('Out\Warn\YenTNotExist') as TCPCCheckBoxNode).Checked;
182 Pref.WarnScopeChangeInSynchronize := (GetNodeFromKeyPath('Out\Warn\ScopeChangeInSynchronize') as TCPCCheckBoxNode).Checked;
185 on E: Exception do ShowMessage(E.Message);
187 //Pref.IgnoreFrequentYenS := cbxIgnoreFrequentYenS.Checked;
188 Pref.WaitScriptEnd := spnWaitScriptEnd.Value;
190 Pref.WhenReturn := TReturnKeyFunction(rgpWhenReturn.ItemIndex);
191 Pref.WhenShiftReturn := TReturnKeyFunction(rgpWhenShiftReturn.ItemIndex);
192 Pref.WhenCtrlReturn := TReturnKeyFunction(rgpWhenCtrlReturn.ItemIndex);
194 Pref.UseHttpProxy := cbxUseHttpProxy.Checked;
195 Pref.ProxyAddress := edtProxyAddress.Text;
196 Pref.ProxyPort := StrToInt(edtProxyPort.Text);
198 Pref.FMOName := memFMOName.Lines;
199 SakuraSeeker.FileMappingTarget := Pref.FMOName;
200 Pref.HideGhosts := cbxHideGhosts.Checked;
202 Pref.AutoJoinChannels := memAutoJoinChannels.Lines;
205 procedure TfrmSetting.edtProxyPortKeyPress(Sender: TObject; var Key: Char);
207 if not(Key in ['0'..'9']) then Key := Char(0);
210 procedure TfrmSetting.ctvBottleNodeChecked(Sender: TObject;
211 Node: TCPCConfigItemNode);
213 //ShowMessage(ctvBottle.GetFullKeyPath(Node));
216 procedure TfrmSetting.ctvBottleNodeChecking(Sender: TObject;
217 Node: TCPCConfigItemNode; var Allow: Boolean);
219 if Node.KeyName = 'IgnoreBottle' then begin
220 MessageDlg('
\82±
\82Ì
\8b@
\94\
\82Í
\8eÀ
\91\95\82³
\82ê
\82Ä
\82¢
\82Ü
\82¹
\82ñ', mtError, [mbOk], 0);
225 procedure TfrmSetting.tstRuleShow(Sender: TObject);
227 frmRuleList.UpdateDisplay;
230 procedure TfrmSetting.btnUseCurrentJoinChannelsClick(Sender: TObject);
232 memAutoJoinChannels.Lines := JoinChannels;
235 procedure TfrmSetting.btnVisibleGhostsClick(Sender: TObject);
237 FullGhosts: TStringList;
239 FullGhosts := TStringList.Create;
240 SakuraSeeker.BeginDetect;
242 for i := 0 to SakuraSeeker.Count-1 do
243 FullGhosts.Add(SakuraSeeker[i].Name);
244 StrListEdit(Pref.VisibleGhostsList, '
\83S
\81[
\83X
\83g
\82ð
\8ew
\92è', true, FullGhosts);