4 \83A
\83v
\83\8a\83P
\81[
\83V
\83\87\83\93\91S
\91Ì
\82Å
\8eg
\82¤
\82³
\82Ü
\82´
\82Ü
\82È
\83f
\81[
\83^
\82ð
\92è
\8b`
9 uses Windows, IniFiles, BRegExp, Graphics, SysUtils, Forms, Dialogs, Classes,
10 ComCtrls, Contnrs, SsPlayTime;
13 TReturnKeyFunction = (kfYenN, kfReturn, kfYenNReturn, kfConstText);
14 TSoundArrived = (saFalse, saTrue, saParent);
15 TLogWindowPreviewStyle = (psConversation, psImageConversation,
16 psScript, psScriptWithLineBreak);
17 TLogListPreviewStyle = (psNoColor, psNormal, psTagStripped);
18 TSurfacePreviewOnScriptPointPosition = (spspMainWindowLeft, spspMainWindowRight);
20 //SSTP Bottle
\82Ì
\90Ý
\92è
21 TBottlePrefs = class(TObject)
25 FIgnoreTimeCritical: boolean;
27 FShowConstBar: boolean;
29 FDblClkInsert: boolean;
30 FShowToolBar: boolean;
31 FDefaultScript: TStringList;
33 FMetaWordColor: TColor;
35 FMarkErrorColor: TColor;
40 FWhenCtrlReturn: TReturnKeyFunction;
41 FWhenShiftReturn: TReturnKeyFunction;
42 FWhenReturn: TReturnKeyFunction;
43 FNoTranslate: boolean;
48 FSilentWhenHidden: boolean;
50 FSenderWindowPosition: TRect;
51 FTabPosition: TTabPosition;
52 FLogWindowPosition: TRect;
54 FIgnoreFrequentYenS: boolean;
55 FWaitScriptEnd: integer;
56 FCgiNameGhost: String;
59 FLogWindowDividerPos: integer;
61 FUseHttpProxy: boolean;
63 FProxyAddress: String;
64 FConfirmOnExit: boolean;
65 FFixMessySurface: boolean;
66 FResetIfGhostAfterSend: boolean;
67 FGhostDropDownCount: integer;
68 FLogWindowPreviewStyle: TLogWindowPreviewStyle;
71 FLogWindowColumnWidth: String;
72 FClearAfterSend: boolean;
73 FAutoJoinChannels: TStrings;
75 FHUTagTo01Tag: boolean;
76 FWarnYenTNotExist: boolean;
77 FWarnScopeChangeInSynchronize: boolean;
78 FNeedConfirmBeforeSend: boolean;
81 FVisibleGhostsList: TStringList;
82 FSurfacePreviewOnHint: boolean;
83 FSurfacePreviewOnScriptPoint: boolean;
84 FSurfacePreviewOnScriptPointPosition: TSurfacePreviewOnScriptPointPosition;
85 FNoExtraSSTPHeaders: boolean;
86 FLogListPreviewStyle: TLogListPreviewStyle;
87 FEditorPreviewWindowPosition: TRect;
89 FConfirmOnTabClose: boolean;
90 FReconnectWait: integer;
91 FPartialConfirmFormat: String;
92 FAutoPartialConfirm: boolean;
93 FPlayTimeParams: TSsPlayTimeParams;
94 FBottleServerPort: integer;
95 FBottleServer: String;
96 procedure SetDblClkInsert(const Value: boolean);
97 procedure SetDefaultScript(const Value: String);
98 procedure SetIgnoreTimeCritical(const Value: boolean);
99 procedure SetMarkErrorColor(const Value: TColor);
100 procedure SetMarkUpColor(const Value: TColor);
101 procedure SetMetaWordColor(const Value: TColor);
102 procedure SetTextColor(const Value: TColor);
103 procedure SetNoConfirm(const Value: boolean);
104 procedure SetShowConstBar(const Value: boolean);
105 procedure SetShowToolBar(const Value: boolean);
106 procedure SetStayOnTop(const Value: boolean);
107 procedure SetTalkColorH(const Value: TColor);
108 procedure SetTalkColorU(const Value: TColor);
109 procedure SetAutoStart(const Value: boolean);
110 procedure SetWhenCtrlReturn(const Value: TReturnKeyFunction);
111 procedure SetWhenReturn(const Value: TReturnKeyFunction);
112 procedure SetWhenShiftReturn(const Value: TReturnKeyFunction);
113 procedure SetNoTranslate(const Value: boolean);
114 procedure SetNoDescript(const Value: boolean);
115 procedure SetBgColor(const Value: TColor);
116 procedure SetServerPort(const Value: integer);
117 procedure SetSilentWhenHidden(const Value: boolean);
118 procedure SetLUID(const Value: String);
119 procedure SetSenderWindowPosition(const Value: TRect);
120 procedure SetTabPosition(const Value: TTabPosition);
121 procedure SetLogWindowPosition(const Value: TRect);
122 procedure SetIgnoreFrequentYenS(const Value: boolean);
123 procedure SetNoTransUrl(const Value: boolean);
124 procedure SetWaitScriptEnd(const Value: integer);
125 procedure SetLogWindowDividerPos(const Value: integer);
126 procedure SetProxyAddress(const Value: String);
127 procedure SetProxyPort(const Value: integer);
128 procedure SetUseHttpProxy(const Value: boolean);
129 procedure SetConfirmOnExit(const Value: boolean);
130 procedure SetFixMessySurface(const Value: boolean);
131 procedure SetResetIfGhostAfterSend(const Value: boolean);
132 procedure SetGhostDropDownCount(const Value: integer);
133 procedure SetLogWindowPreviewStyle(const Value: TLogWindowPreviewStyle);
134 procedure SetTalkColorS(const Value: TColor);
135 procedure SetLogWindowColumnWidth(const Value: String);
136 procedure SetClearAfterSend(const Value: boolean);
137 procedure SetAutoJoinChannels(const Value: TStrings);
138 procedure SetFMOName(const Value: TStrings);
139 function GetDefaultScript: String;
140 procedure SetHUTagTo01Tag(const Value: boolean);
141 procedure SetWarnScopeChangeInSynchronize(const Value: boolean);
142 procedure SetWarnYenTNotExist(const Value: boolean);
143 procedure SetNeedConfirmBeforeSend(const Value: boolean);
144 procedure SetShowRuler(const Value: boolean);
145 procedure SetHideGhosts(const Value: boolean);
146 procedure SetVisibleGhostsList(const Value: TStringList);
147 procedure SetSurfacePreviewOnHint(const Value: boolean);
148 procedure SetSurfacePreviewOnScriptPoint(const Value: boolean);
149 procedure SetSurfacePreviewOnScriptPointPosition(
150 const Value: TSurfacePreviewOnScriptPointPosition);
151 procedure SetNoExtraSSTPHeaders(const Value: boolean);
152 procedure SetLogListPreviewStyle(const Value: TLogListPreviewStyle);
153 procedure SetEditorPreviewWindowPosition(const Value: TRect);
154 procedure SetAutoClip(const Value: boolean);
155 procedure SetConfirmOnTabClose(const Value: boolean);
156 procedure SetReconnectWait(const Value: integer);
157 procedure SetPartialConfirmFormat(const Value: String);
158 procedure SetAutoPartialConfirm(const Value: boolean);
159 procedure SetPlayTimeParams(const Value: TSsPlayTimeParams);
161 function InScreen(ARect: TRect): boolean;
163 property BottleServer: String read FBottleServer;
164 property BottleServerPort: integer read FBottleServerPort;
165 property PartialConfirmFormat: String read FPartialConfirmFormat write SetPartialConfirmFormat;
166 property AutoPartialConfirm: boolean read FAutoPartialConfirm write SetAutoPartialConfirm;
167 property ConfirmOnExit: boolean read FConfirmOnExit write SetConfirmOnExit;
168 property ConfirmOnTabClose: boolean read FConfirmOnTabClose write SetConfirmOnTabClose;
169 property AutoClip: boolean read FAutoClip write SetAutoClip;
170 property AutoStart: boolean read FAutoStart write SetAutoStart;
171 property TabPosition: TTabPosition read FTabPosition write SetTabPosition;
172 property GhostDropDownCount: integer read FGhostDropDownCount write SetGhostDropDownCount;
173 property NoTranslate: boolean read FNoTranslate write SetNoTranslate;
174 property NoDescript: boolean read FNoDescript write SetNoDescript;
175 property NoTransUrl: boolean read FNoTransUrl write SetNoTransUrl;
176 property SilentWhenHidden: boolean read FSilentWhenHidden write SetSilentWhenHidden;
177 property FixMessySurface: boolean read FFixMessySurface write SetFixMessySurface;
178 property HUTagTo01Tag: boolean read FHUTagTo01Tag write SetHUTagTo01Tag;
179 property ResetIfGhostAfterSend: boolean read FResetIfGhostAfterSend write SetResetIfGhostAfterSend;
180 property ClearAfterSend: boolean read FClearAfterSend write SetClearAfterSend;
181 property NeedConfirmBeforeSend: boolean read FNeedConfirmBeforeSend write SetNeedConfirmBeforeSend;
182 property IgnoreFrequentYenS: boolean read FIgnoreFrequentYenS write SetIgnoreFrequentYenS;
183 property WarnYenTNotExist: boolean read FWarnYenTNotExist write SetWarnYenTNotExist;
184 property WarnScopeChangeInSynchronize: boolean read FWarnScopeChangeInSynchronize write SetWarnScopeChangeInSynchronize;
185 property WaitScriptEnd: integer read FWaitScriptEnd write SetWaitScriptEnd;
186 property StayOnTop: boolean read FStayOnTop write SetStayOnTop;
187 property IgnoreTimeCritical: boolean read FIgnoreTimeCritical write SetIgnoreTimeCritical;
188 property TalkColorH: TColor read FTalkColorH write SetTalkColorH;
189 property TalkColorU: TColor read FTalkColorU write SetTalkColorU;
190 property TalkColorS: TColor read FTalkColorS write SetTalkColorS;
191 property MarkUpColor: TColor read FMarkUpColor write SetMarkUpColor;
192 property MetaWordColor: TColor read FMetaWordColor write SetMetaWordColor;
193 property MarkErrorColor: TColor read FMarkErrorColor write SetMarkErrorColor;
194 property BgColor: TColor read FBgColor write SetBgColor;
195 property TextColor: TColor read FTextColor write SetTextColor;
196 property DefaultScript: String read GetDefaultScript write SetDefaultScript;
197 property ShowRuler: boolean read FShowRuler write SetShowRuler;
198 property DblClkInsert: boolean read FDblClkInsert write SetDblClkInsert;
199 property ShowToolBar: boolean read FShowToolBar write SetShowToolBar;
200 property ShowConstBar: boolean read FShowConstBar write SetShowConstBar;
201 property NoConfirm: boolean read FNoConfirm write SetNoConfirm;
202 property HomePage: string read FHomePage;
203 property WhenReturn: TReturnKeyFunction read FWhenReturn write SetWhenReturn;
204 property WhenShiftReturn: TReturnKeyFunction read FWhenShiftReturn write SetWhenShiftReturn;
205 property WhenCtrlReturn: TReturnKeyFunction read FWhenCtrlReturn write SetWhenCtrlReturn;
206 property ServerPort: integer read FServerPort write SetServerPort;
208 property CgiName: string read FCgiName;
209 property CgiNameGhost: String read FCgiNameGhost;
210 property CgiFetchLog: String read FCgiFetchLog;
211 property GLogPage: String read FGLogPage;
212 property VotePage: String read FVotePage;
213 property HelpPage: String read FHelpPage;
215 //
\83`
\83\83\83\93\83l
\83\8b\8aÖ
\8cW
216 property AutoJoinChannels: TStrings read FAutoJoinChannels write SetAutoJoinChannels;
218 property LUID: String read FLUID write SetLUID;
220 //
\83E
\83B
\83\93\83h
\83E
\88Ê
\92u
221 property SenderWindowPosition: TRect
222 read FSenderWindowPosition write SetSenderWindowPosition;
223 property LogWindowPosition: TRect read FLogWindowPosition write SetLogWindowPosition;
224 property LogWindowDividerPos: integer
225 read FLogWindowDividerPos write SetLogWindowDividerPos;
226 property LogWindowColumnWidth: String
227 read FLogWindowColumnWidth write SetLogWindowColumnWidth;
228 property EditorPreviewWindowPosition: TRect read FEditorPreviewWindowPosition write SetEditorPreviewWindowPosition;
229 //
\83v
\83\8d\83L
\83V
\8aÖ
\8cW
230 property UseHttpProxy: boolean read FUseHttpProxy write SetUseHttpProxy;
231 property ProxyAddress: String read FProxyAddress write SetProxyAddress;
232 property ProxyPort: integer read FProxyPort write SetProxyPort;
234 property ReconnectWait: integer read FReconnectWait write SetReconnectWait;
235 //
\83\8d\83O
\83E
\83B
\83\93\83h
\83E
\8aÖ
\8cW
236 property LogWindowPreviewStyle: TLogWindowPreviewStyle
237 read FLogWindowPreviewStyle write SetLogWindowPreviewStyle;
238 property LogListPreviewStyle: TLogListPreviewStyle
239 read FLogListPreviewStyle write SetLogListPreviewStyle;
241 property FMOName: TStrings read FFMOName write SetFMOName;
242 property HideGhosts: boolean read FHideGhosts write SetHideGhosts;
243 property VisibleGhostsList: TStringList read FVisibleGhostsList write SetVisibleGhostsList;
244 property NoExtraSSTPHeaders: boolean read FNoExtraSSTPHeaders write SetNoExtraSSTPHeaders;
245 //
\83T
\81[
\83t
\83B
\83X
\83v
\83\8c\83r
\83\85\81[
246 property SurfacePreviewOnHint: boolean
247 read FSurfacePreviewOnHint write SetSurfacePreviewOnHint;
248 property SurfacePreviewOnScriptPoint: boolean
249 read FSurfacePreviewOnScriptPoint write SetSurfacePreviewOnScriptPoint;
250 property SurfacePreviewOnScriptPointPosition: TSurfacePreviewOnScriptPointPosition
251 read FSurfacePreviewOnScriptPointPosition write SetSurfacePreviewOnScriptPointPosition;
252 //
\8dÄ
\90¶
\8e\9e\8aÔ
\97\
\91ª
253 property PlayTimeParams: TSsPlayTimeParams read FPlayTimeParams write SetPlayTimeParams;
254 //
\83R
\83\93\83X
\83g
\83\89\83N
\83^
\81E
\83f
\83X
\83g
\83\89\83N
\83^
\81E
\95Û
\91¶
256 destructor Destroy; override;
257 procedure SaveSettings;
260 TChannelListItem = class(TObject)
268 procedure SetGhost(const Value: String);
269 procedure SetInfo(const Value: String);
270 procedure SetMembers(const Value: integer);
271 procedure SetName(const Value: String);
272 procedure SetNoPost(const Value: boolean);
273 procedure SetWarnPost(const Value: boolean);
275 property Name: String read FName write SetName;
276 property Info: String read FInfo write SetInfo;
277 property Ghost: String read FGhost write SetGhost;
278 property Members: integer read FMembers write SetMembers;
279 property NoPost: boolean read FNoPost write SetNoPost;
280 property WarnPost: boolean read FWarnPost write SetWarnPost;
283 TChannelList = class(TList)
285 function GetChannel(Name: String): TChannelListItem;
286 function GetChannelItem(Index: integer): TChannelListItem;
288 procedure Clear; override;
289 property Channel[Name: String]: TChannelListItem read GetChannel;
290 property ChannelItem[Index: integer]: TChannelListItem read GetChannelItem;
293 TScriptTransOption = (
294 toIgnoreTimeCritical,
297 toIgnoreFrequentYenS,
305 TScriptTransOptions = set of TScriptTransOption;
310 ChannelList: TChannelList; //
\83`
\83\83\83\93\83l
\83\8b\83\8a\83X
\83g
\82ð
\95Û
\8e\9d\82·
\82é
311 JoinChannels: TStringList; //
\8c»
\8dÝ
\8eQ
\89Á
\82µ
\82Ä
\82¢
\82é
\83`
\83\83\83\93\83l
\83\8b
314 DefaultBottleServer = 'bottle.mikage.to';
315 DefaultBottleServerPort = 9871;
316 DefaultCGI = '/bottle2.cgi';
317 DefaultCGIGhost = '/glog/bottleglog.cgi';
318 DefaultCGIFetchLog = '/fetchlog.cgi';
321 DefaultHomePage = 'http://bottle.mikage.to/';
322 DefaultGLogPage = 'http://bottle.mikage.to/glog/glogview.cgi';
323 DefaultVotePage = 'http://bottle.mikage.to/viewvotes.cgi';
324 DefaultHelpPage = 'http://bottle.mikage.to/clihelp/index.html';
329 VersionString = 'SSTP Bottle Client ver ' + Version + 'a NO MUTEX VERSION';
331 VersionString = 'SSTP Bottle Client ver ' + Version;
334 SentLogFile = 'sent.log';
336 BottleDisclaimer = '(C)2001-2004 WinBottle Project'#13#10 +
337 'naru, C.Ponapalt, Yune Kotomi, yese, Mikage Sawatari'#13#10 +
340 ChannelDefault = '(CH
\90\84\8f§)';
341 ClipChannel = '(
\83N
\83\8a\83b
\83v)';
343 function ParamsEncode(const ASrc: string): string;
344 function XMLEntity(From: String): String;
345 function SafeFileName(From: String; ChangePathDelimiters: boolean = true): String;
346 function ComponentToString(Component: TComponent): string;
347 function StringToComponent(Value: string): TComponent;
349 // m//k
\82È
\82Ç
\82Å
\88Í
\82Ü
\82ê
\82Ä
\82¢
\82È
\82¢
\90³
\8bK
\95\
\8c»
\82ð
\90³
\82µ
\82
\88Í
\82ñ
\82Å
350 // BRegExp
\83G
\83\89\81[
\82Ì
\94
\90¶
\82ð
\96h
\82®
351 function SafeRegExp(const Expression: String): String;
353 //
\90³
\8bK
\95\
\8c»
\83G
\83\89\81[
\82ð
\83`
\83F
\83b
\83N
354 function CheckRegExp(const Expression: String): boolean;
358 function ParamsEncode(const ASrc: string): string;
362 UnsafeChars = ['*', '#', '%', '<', '>', ' ', '[', ']', '+'];
364 Result := ''; {Do not Localize}
365 for i := 1 to Length(ASrc) do
367 if (ASrc[i] in UnsafeChars) or (not (ord(ASrc[i])in [33..128])) then
368 begin {do not localize}
369 Result := Result + '%' + IntToHex(Ord(ASrc[i]), 2); {do not localize}
373 Result := Result + ASrc[i];
378 // XML
\8eÀ
\91Ì
\8eQ
\8fÆ
\82É
\92u
\82«
\8a·
\82¦
\82é
379 function XMLEntity(From: String): String;
386 for i := 1 to Length(From) do
391 Result := Result + From[i];
392 end else if From[i] in LeadBytes then
395 Result := Result + From[i];
399 60: Result := Result + '<'; // Less than
400 62: Result := Result + '>'; // Greater than
401 38: Result := Result + '&'; // Ampersand
402 39: Result := Result + '''; // Single quote
403 34: Result := Result + '"'; // Double quote
405 Result := Result + From[i];
411 // Escape characters which can not be used as a filename
412 function SafeFileName(From: String; ChangePathDelimiters: boolean = true): String;
414 Result := StringReplace(From, '*', '
\81\96', [rfReplaceAll]);
415 Result := StringReplace(Result, '|', '
\81b', [rfReplaceAll]);
416 Result := StringReplace(Result, '"', '''''', [rfReplaceAll]);
417 Result := StringReplace(Result, '<', '
\81\83', [rfReplaceAll]);
418 Result := StringReplace(Result, '>', '
\81\84', [rfReplaceAll]);
419 Result := StringReplace(Result, '?', '
\81H', [rfReplaceAll]);
420 if ChangePathDelimiters then
422 Result := StringReplace(Result, '\', '
\81\8f', [rfReplaceAll]);
423 Result := StringReplace(Result, ':', '
\81F', [rfReplaceAll]);
424 Result := StringReplace(Result, '/', '
\81^', [rfReplaceAll]);
428 function ComponentToString(Component: TComponent): string;
430 BinStream:TMemoryStream;
431 StrStream: TStringStream;
434 BinStream := TMemoryStream.Create;
436 StrStream := TStringStream.Create(s);
438 BinStream.WriteComponent(Component);
439 BinStream.Seek(0, soFromBeginning);
440 ObjectBinaryToText(BinStream, StrStream);
441 StrStream.Seek(0, soFromBeginning);
442 Result:= StrStream.DataString;
451 function StringToComponent(Value: string): TComponent;
453 StrStream:TStringStream;
454 BinStream: TMemoryStream;
456 StrStream := TStringStream.Create(Value);
458 BinStream := TMemoryStream.Create;
460 ObjectTextToBinary(StrStream, BinStream);
461 BinStream.Seek(0, soFromBeginning);
462 Result := BinStream.ReadComponent(nil);
471 function SafeRegExp(const Expression: String): String;
473 Result := Expression;
475 //Perl
\82Ì
\90³
\8bK
\95\
\8c»
\8d\
\95¶
\82É
\83}
\83b
\83`
\82·
\82é
\90³
\8bK
\95\
\8c»
\82Å
\83`
\83F
\83b
\83N
476 //k
\83I
\83v
\83V
\83\87\83\93\82Í
\8a¿
\8e\9a\91Î
\89\9e
477 //#255(0xFF)
\82Í
\82 \82è
\82¦
\82È
\82¢
\82Ì
\82Å
\82±
\82±
\82Å
\97\98\97p
478 if not RegExp.Match('m'#255'^(/|m[/#({\[]).+[/#)}\]][ikms]{1,4}$'#255'k', Result) then
479 Result := 'm'#255 + Result + #255'k';
486 function CheckRegExp(const Expression: String): boolean;
490 RegExp.Match(Expression,' ');
492 on E: EBRegExpError do begin
493 ShowMessage('
\97L
\8cø
\82È
\90³
\8bK
\95\
\8c»
\82Å
\82Í
\82 \82è
\82Ü
\82¹
\82ñ
\81B'#13#10 + E.Message);
501 constructor TBottlePrefs.Create;
505 FAutoJoinChannels := TStringList.Create;
506 FDefaultScript := TStringList.Create;
507 FFMOName := TStringList.Create;
508 FVisibleGhostsList := TStringList.Create;
510 FIni := TIniFile.Create(ChangeFileExt(Application.ExeName, '.ini'));
512 PartialConfirmFormat := FIni.ReadString('System', 'PartialConfirmFormat', '\t|\e');
513 AutoPartialConfirm := FIni.ReadBool('System', 'AutoPartialConfirm', false);
514 ConfirmOnExit := FIni.ReadBool('System', 'ConfirmOnExit', false);
515 ConfirmOnExit := FIni.ReadBool('System', 'ConfirmOnExit', false);
516 ConfirmOnTabClose := FIni.ReadBool('System', 'ConfirmOnTabClose', false);
517 AutoClip := FIni.ReadBool('System', 'AutoClip', false);
518 AutoStart := FIni.ReadBool('System', 'AutoStart', false);
519 TabPosition := TTabPosition(FIni.ReadInteger('System', 'TabPosition', 0));
520 GhostDropDownCount := FIni.ReadInteger('System', 'GhostDropDownCount', 30);
522 NoTranslate := FIni.ReadBool('System', 'NoTranslate', true);
523 NoDescript := FIni.ReadBool('System', 'NoDescript', false);
524 NoTransUrl := FIni.ReadBool('System', 'NoTransUrl', false);
525 SilentWhenHidden:= FIni.ReadBool('System', 'SilentWhenHidden', true);
526 FixMessySurface := FIni.ReadBool('System', 'FixMessySurface', false);
527 HUTagTo01Tag := FIni.ReadBool('System', 'HUTagTo01Tag', false);
528 ResetIfGhostAfterSend := FIni.ReadBool('System', 'ResetIfGhostAfterSend', false);
529 ClearAfterSend := FIni.ReadBool('System', 'ClearAfterSend', false);
530 NeedConfirmBeforeSend := FIni.ReadBool('System', 'NeedConfirmBeforeSend', false);
531 WarnYenTNotExist := FIni.ReadBool('System', 'WarnYenTNotExist', false);
532 WarnScopeChangeInSynchronize := FIni.ReadBool('System', 'WarnScopeChangeInSynchronize', false);
534 IgnoreFrequentYenS := FIni.ReadBool('System', 'IgnoreFrequentYenS', false);
535 WaitScriptEnd := FIni.ReadInteger('System', 'WaitScriptEnd', 0);
536 StayOnTop := FIni.ReadBool('System', 'StayOnTop', false);
537 ShowConstBar := FIni.ReadBool('System', 'ShowConstBar', true);
538 ShowToolBar := FIni.ReadBool('System', 'ShowToolBar', true);
539 NoConfirm := FIni.ReadBool('System', 'NoConfirm', false);
540 IgnoreTimeCritical := FIni.ReadBool('System', 'IgnoreTimeCritical', false);
541 FDefaultScript.CommaText := FIni.ReadString('System', 'DefaultScript', '\t\u\s[10]\h\s[0]|\e');
542 ShowRuler := FIni.ReadBool('System', 'ShowRuler', false);
545 TalkColorH := StringToColor(FIni.ReadString('System', 'TalkColorH', 'clBlack'));
546 TalkColorU := StringToColor(FIni.ReadString('System', 'TalkColorU', 'clMaroon'));
547 TalkColorS := StringToColor(FIni.ReadString('System', 'TalkColorS', 'clPurple'));
548 MarkUpColor := StringToColor(FIni.ReadString('System', 'MarkUpColor', 'clGreen'));
549 MetaWordColor := StringToColor(FIni.ReadString('System', 'MetaWordColor', 'clBlue'));
550 MarkErrorColor := StringToColor(FIni.ReadString('System', 'MarkErrorColor', 'clRed'));
551 TextColor := StringToColor(FIni.ReadString('System', 'TextColor', ColorToString(TalkColorH)));
552 BgColor := StringToColor(FIni.ReadString('System', 'BgColor', 'clWhite'));
554 on EConvertError do begin
555 ShowMessage('
\83J
\83\89\81[
\82Ì
\90Ý
\92è
\93Ç
\82Ý
\8d\9e\82Ý
\83G
\83\89\81[');
556 FTalkColorH := clBlack;
557 FTalkColorU := clMaroon;
558 FMarkUpColor := clGreen;
559 FMetaWordColor := clBlue;
560 FMarkErrorColor := clRed;
561 FTextColor := clBlack;
566 if FIni.ReadString('System', 'PlayTimeParams', '') = '' then
568 FPlayTimeParams := TSsPlayTimeParams.Create(nil);
569 FPlayTimeParams.ProfileName := '
\83f
\83t
\83H
\83\8b\83g';
572 Strs := TStringList.Create;
574 Strs.CommaText := FIni.ReadString('System', 'PlayTimeParams', '');
575 FPlayTimeParams := StringToComponent(Strs.Text) as TSsPlayTimeParams;
583 ShowMessage('
\8dÄ
\90¶
\8e\9e\8aÔ
\97\
\91ª
\90Ý
\92è
\82Ì
\93Ç
\82Ý
\8d\9e\82Ý
\83G
\83\89\81[' + E.Message);
584 if FPlayTimeParams = nil then
585 FPlayTimeParams := TSsPlayTimeParams.Create(nil);
589 WhenReturn := TReturnKeyFunction(FIni.ReadInteger('System', 'WhenReturn', 0));
590 WhenShiftReturn := TReturnKeyFunction(FIni.ReadInteger('System', 'WhenShiftReturn', 0));
591 WhenCtrlReturn := TReturnKeyFunction(FIni.ReadInteger('System', 'WhenCtrlReturn', 0));
592 //
\83\
\83P
\83b
\83g
\82ð
\83{
\83g
\83\8b\94z
\91\97\82ÌSSTP
\92Ê
\90M
\82É
\8eg
\97p
\82·
\82é
\8fê
\8d\87\82Ì
\90Ý
\92è
593 ServerPort := FIni.ReadInteger('System', 'ServerPort', 11000);
595 FBottleServer := FIni.ReadString('System', 'BottleServer', DefaultBottleServer);
596 FBottleServerPort := FIni.ReadInteger('System', 'BottleServerPort', DefaultBottleServerPort);
597 FCgiName := FIni.ReadString('System', 'CgiName', DefaultCGI);
598 FCgiFetchLog := FIni.ReadString('System', 'CgiFetchLog', DefaultCGIFetchLog);
599 FHomePage := FIni.ReadString('System', 'HomePage', DefaultHomePage);
600 FGLogPage := FIni.ReadString('System', 'GLogPage', DefaultGLogPage);
601 FVotePage := FIni.ReadString('System', 'VotePage', DefaultVotePage);
602 FHelpPage := FIni.ReadString('System', 'HelpPage', DefaultHelpPage);
603 FCgiNameGhost := FIni.ReadString('System', 'GHOST', DefaultCGIGhost);
604 FLUID := FIni.ReadString('System', 'LUID', '');
605 FAutoJoinChannels.CommaText := FIni.ReadString('System', 'AutoJoinChannels', '');
607 ARect.Top := FIni.ReadInteger('System', 'SenderWindowPositionTop', 100);
608 ARect.Left := FIni.ReadInteger('System', 'SenderWindowPositionLeft', 100);
609 ARect.Bottom := FIni.ReadInteger('System', 'SenderWindowPositionBottom', 500);
610 ARect.Right := FIni.ReadInteger('System', 'SenderWindowPositionRight', 500);
611 if not InScreen(ARect) then
612 ARect := Rect(100, 100, 500, 500);
613 SenderWindowPosition := ARect;
614 ARect.Top := FIni.ReadInteger('System', 'LogWindowPositionTop', 200);
615 ARect.Left := FIni.ReadInteger('System', 'LogWindowPositionLeft', 200);
616 ARect.Bottom := FIni.ReadInteger('System', 'LogWindowPositionBottom', 600);
617 ARect.Right := FIni.ReadInteger('System', 'LogWindowPositionRight', 400);
618 LogWindowDividerPos := FIni.ReadInteger('System', 'LogWindowDividerPos', 150);
619 LogWindowColumnWidth := FIni.ReadString('System', 'LogWindowColumnWidth', '');
620 if not InScreen(ARect) then begin
621 ARect := Rect(200, 200, 600, 400);
622 LogWindowDividerPos := 150;
624 LogWindowPosition := ARect;
625 Strs := TStringList.Create;
627 Strs.CommaText := FIni.ReadString('System', 'EditorPreviewWindowPosition', '500,100,800,500');
629 ARect.Left := StrToInt(Strs[0]);
630 ARect.Top := StrToInt(Strs[1]);
631 ARect.Right := StrToInt(Strs[2]);
632 ARect.Bottom := StrToInt(Strs[3]);
634 ARect := Rect(500, 100, 800, 500);
636 EditorPreviewWindowPosition := ARect;
641 UseHttpProxy := FIni.ReadBool('System', 'UseHttpProxy', false);
642 ProxyAddress := FIni.ReadString('System', 'ProxyAddress', '');
643 ProxyPort := FIni.ReadInteger('System', 'ProxyPort', 0);
645 ReconnectWait := FIni.ReadInteger('System', 'ReconnectWait', 6);
646 //
\83\8d\83O
\83E
\83B
\83\93\83h
\83E
\8aÖ
\8cW
647 LogWindowPreviewStyle := TLogWindowPreviewStyle(
648 FIni.ReadInteger('System', 'LogWindowPreviewStyle', 0));
649 LogListPreviewStyle := TLogListPreviewStyle(
650 FIni.ReadInteger('System', 'LogListPreviewStyle', 0));
652 FMOName.CommaText := FIni.ReadString('System', 'FMOName', 'Sakura');
653 HideGhosts := FIni.ReadBool('System', 'HideGhosts', false);
654 VisibleGhostsList.CommaText := FIni.ReadString('System', 'VisibleGhostsList', '');
655 NoExtraSSTPHeaders := FIni.ReadBool('System', 'NoExtraSSTPHeaders', false);
656 //
\83T
\81[
\83t
\83B
\83X
\83v
\83\8c\83r
\83\85\81[
657 SurfacePreviewOnHint := FIni.ReadBool('System', 'SurfacePreviewOnHint', false);
658 SurfacePreviewOnScriptPoint := FIni.ReadBool('System', 'SurfacePreviewOnScriptPoint', false);
659 SurfacePreviewOnScriptPointPosition :=
660 TSurfacePreviewOnScriptPointPosition(FIni.ReadInteger('System', 'SurfacePreviewOnScriptPointPosition', 0));
662 ShowMessage('INI
\83t
\83@
\83C
\83\8b\93Ç
\82Ý
\8d\9e\82Ý
\83G
\83\89\81[');
663 Application.Terminate;
667 destructor TBottlePrefs.Destroy;
673 if FAutoJoinChannels <> nil then
674 FAutoJoinChannels.Free;
675 if FDefaultScript <> nil then
677 if FFMOName <> nil then
679 if FVisibleGhostsList <> nil then
680 FVisibleGhostsList.Free;
681 if FPlayTimeParams <> nil then
682 FPlayTimeParams.Free;
685 procedure TBottlePrefs.SetAutoStart(const Value: boolean);
690 procedure TBottlePrefs.SetBgColor(const Value: TColor);
695 procedure TBottlePrefs.SetConfirmOnExit(const Value: boolean);
697 FConfirmOnExit := Value;
700 procedure TBottlePrefs.SetDblClkInsert(const Value: boolean);
702 FDblClkInsert := Value;
705 procedure TBottlePrefs.SetDefaultScript(const Value: String);
707 FDefaultScript.Text := Value;
710 procedure TBottlePrefs.SetFixMessySurface(const Value: boolean);
712 FFixMessySurface := Value;
715 procedure TBottlePrefs.SetGhostDropDownCount(const Value: integer);
717 FGhostDropDownCount := Value;
720 procedure TBottlePrefs.SetIgnoreFrequentYenS(const Value: boolean);
722 FIgnoreFrequentYenS := Value;
725 procedure TBottlePrefs.SetIgnoreTimeCritical(const Value: boolean);
727 FIgnoreTimeCritical := Value;
730 procedure TBottlePrefs.SetLogWindowDividerPos(const Value: integer);
732 FLogWindowDividerPos := Value;
735 procedure TBottlePrefs.SetLogWindowPosition(const Value: TRect);
737 FLogWindowPosition := Value;
740 procedure TBottlePrefs.SetLUID(const Value: String);
745 procedure TBottlePrefs.SetMarkErrorColor(const Value: TColor);
747 FMarkErrorColor := Value;
750 procedure TBottlePrefs.SetTextColor(const Value: TColor);
755 procedure TBottlePrefs.SetMarkUpColor(const Value: TColor);
757 FMarkUpColor := Value;
760 procedure TBottlePrefs.SetMetaWordColor(const Value: TColor);
762 FMetaWordColor := Value;
765 procedure TBottlePrefs.SetNoConfirm(const Value: boolean);
770 procedure TBottlePrefs.SetNoDescript(const Value: boolean);
772 FNoDescript := Value;
775 procedure TBottlePrefs.SetNoTranslate(const Value: boolean);
777 FNoTranslate := Value;
780 procedure TBottlePrefs.SetNoTransUrl(const Value: boolean);
782 FNoTransUrl := Value;
785 procedure TBottlePrefs.SetLogWindowPreviewStyle(
786 const Value: TLogWindowPreviewStyle);
788 FLogWindowPreviewStyle := Value;
791 procedure TBottlePrefs.SetProxyAddress(const Value: String);
793 FProxyAddress := Value;
796 procedure TBottlePrefs.SetProxyPort(const Value: integer);
801 procedure TBottlePrefs.SetResetIfGhostAfterSend(const Value: boolean);
803 FResetIfGhostAfterSend := Value;
806 procedure TBottlePrefs.SetSenderWindowPosition(const Value: TRect);
808 FSenderWindowPosition := Value;
811 procedure TBottlePrefs.SetServerPort(const Value: integer);
813 if Value > 0 then FServerPort := Value;
816 procedure TBottlePrefs.SetShowConstBar(const Value: boolean);
818 FShowConstBar := Value;
821 procedure TBottlePrefs.SetShowToolBar(const Value: boolean);
823 FShowToolBar := Value;
826 procedure TBottlePrefs.SetSilentWhenHidden(const Value: boolean);
828 FSilentWhenHidden := Value;
831 procedure TBottlePrefs.SetStayOnTop(const Value: boolean);
836 procedure TBottlePrefs.SetTabPosition(const Value: TTabPosition);
838 FTabPosition := Value;
841 procedure TBottlePrefs.SetTalkColorH(const Value: TColor);
843 FTalkColorH := Value;
846 procedure TBottlePrefs.SetTalkColorU(const Value: TColor);
848 FTalkColorU := Value;
851 procedure TBottlePrefs.SetUseHttpProxy(const Value: boolean);
853 FUseHttpProxy := Value;
856 procedure TBottlePrefs.SetWaitScriptEnd(const Value: integer);
858 if Value > 0 then FWaitScriptEnd := Value;
861 procedure TBottlePrefs.SetWhenCtrlReturn(const Value: TReturnKeyFunction);
863 FWhenCtrlReturn := Value;
866 procedure TBottlePrefs.SetWhenReturn(const Value: TReturnKeyFunction);
868 FWhenReturn := Value;
871 procedure TBottlePrefs.SetWhenShiftReturn(const Value: TReturnKeyFunction);
873 FWhenShiftReturn := Value;
876 procedure TBottlePrefs.SetTalkColorS(const Value: TColor);
878 FTalkColorS := Value;
881 procedure TBottlePrefs.SetLogWindowColumnWidth(const Value: String);
883 FLogWindowColumnWidth := Value;
886 procedure TBottlePrefs.SetClearAfterSend(const Value: boolean);
888 FClearAfterSend := Value;
891 procedure TBottlePrefs.SetAutoJoinChannels(const Value: TStrings);
893 FAutoJoinChannels.Assign(Value);
896 procedure TBottlePrefs.SetFMOName(const Value: TStrings);
898 FFMOName.Assign(Value);
901 procedure TBottlePrefs.SaveSettings;
905 FIni.WriteString('System', 'PartialConfirmFormat', PartialConfirmFormat);
906 FIni.WriteBool('System', 'AutoPartialConfirm', AutoPartialConfirm);
907 FIni.WriteBool('System', 'ConfirmOnExit', ConfirmOnExit);
908 FIni.WriteBool('System', 'ConfirmOnTabClose', ConfirmOnTabClose);
909 FIni.WriteBool('System', 'AutoClip', AutoClip);
910 FIni.WriteBool('System', 'AutoStart', AutoStart);
911 FIni.WriteInteger('System', 'TabPosition', Ord(TabPosition));
912 FIni.WriteInteger('System', 'GhostDropDownCount', GhostDropDownCount);
914 FIni.WriteBool('System', 'NoTranslate', NoTranslate);
915 FIni.WriteBool('System', 'NoDescript', NoDescript);
916 FIni.WriteBool('System', 'NoTransUrl', NoTransUrl);
917 FIni.WriteBool('System', 'SilentWhenHidden', SilentWhenHidden);
918 FIni.WriteBool('System', 'FixMessySurface', FixMessySurface);
919 FIni.WriteBool('System', 'HUTagTo01Tag', HUTagTo01Tag);
920 FIni.WriteBool('System', 'ResetIfGhostAfterSend', ResetIfGhostAfterSend);
921 FIni.WriteBool('System', 'ClearAfterSend', ClearAfterSend);
922 FIni.WriteBool('System', 'NeedConfirmBeforeSend', NeedConfirmBeforeSend);
923 FIni.WriteBool('System', 'WarnYenTNotExist', WarnYenTNotExist);
924 FIni.WriteBool('System', 'WarnScopeChangeInSynchronize', WarnScopeChangeInSynchronize);
926 FIni.WriteBool('System', 'IgnoreFrequentYenS', IgnoreFrequentYenS);
927 FIni.WriteInteger('System', 'WaitScriptEnd', WaitScriptEnd);
928 FIni.WriteBool('System', 'StayOnTop', StayOnTop);
929 FIni.WriteBool('System', 'NoConfirm', NoConfirm);
930 FIni.WriteBool('System', 'IgnoreTimeCritical', IgnoreTimeCritical);
931 FIni.WriteString('System', 'TalkColorH', ColorToString(TalkColorH));
932 FIni.WriteString('System', 'TalkColorU', ColorToString(TalkColorU));
933 FIni.WriteString('System', 'TalkColorS', ColorToString(TalkColorS));
934 FIni.WriteString('System', 'MarkUpColor', ColorToString(MarkUpColor));
935 FIni.WriteString('System', 'MetaWordColor', ColorToString(MetaWordColor));
936 FIni.WriteString('System', 'MarkErrorColor', ColorToString(MarkErrorColor));
937 FIni.WriteString('System', 'TextColor', ColorToString(TextColor));
939 Strs := TStringList.Create;
941 Strs.Text := ComponentToString(FPlayTimeParams);
942 FIni.WriteString('System', 'PlayTimeParams', Strs.CommaText);
947 FIni.WriteString('System', 'BgColor', ColorToString(BgColor));
948 FIni.WriteBool('System', 'ShowToolBar', ShowToolBar);
949 FIni.WriteBool('System', 'ShowConstBar', ShowConstBar);
950 FIni.WriteString('System', 'DefaultScript', FDefaultScript.CommaText);
951 FIni.WriteBool('System', 'ShowRuler', ShowRuler);
952 FIni.WriteInteger('System', 'WhenReturn', Ord(WhenReturn));
953 FIni.WriteInteger('System', 'WhenShiftReturn', Ord(WhenShiftReturn));
954 FIni.WriteInteger('System', 'WhenCtrlReturn', Ord(WhenCtrlReturn));
955 FIni.WriteInteger('System', 'ServerPort', ServerPort);
956 FIni.WriteString('System', 'LUID', LUID);
957 FIni.WriteString('System', 'AutoJoinChannels', FAutoJoinChannels.CommaText);
959 FIni.WriteInteger('System', 'SenderWindowPositionLeft', SenderWindowPosition.Left);
960 FIni.WriteInteger('System', 'SenderWindowPositionTop', SenderWindowPosition.Top);
961 FIni.WriteInteger('System', 'SenderWindowPositionRight', SenderWindowPosition.Right);
962 FIni.WriteInteger('System', 'SenderWindowPositionBottom', SenderWindowPosition.Bottom);
963 FIni.WriteInteger('System', 'LogWindowPositionLeft', LogWindowPosition.Left);
964 FIni.WriteInteger('System', 'LogWindowPositionTop', LogWindowPosition.Top);
965 FIni.WriteInteger('System', 'LogWindowPositionRight', LogWindowPosition.Right);
966 FIni.WriteInteger('System', 'LogWindowPositionBottom', LogWindowPosition.Bottom);
967 FIni.WriteInteger('System', 'LogWindowDividerPos', LogWindowDividerPos);
968 FIni.WriteString('System', 'LogWindowColumnWidth', LogWindowColumnWidth);
969 with EditorPreviewWindowPosition do
970 FIni.WriteString('System', 'EditorPreviewWindowPosition',
971 Format('%d,%d,%d,%d', [Left, Top, Right, Bottom]));
973 FIni.WriteBool('System', 'UseHttpProxy', UseHttpProxy);
974 FIni.WriteString('System', 'ProxyAddress', ProxyAddress);
975 FIni.WriteInteger('System', 'ProxyPort', ProxyPort);
977 FIni.WriteInteger('System', 'ReconnectWait', ReconnectWait);
979 FIni.WriteInteger('System', 'LogWindowPreviewStyle', Ord(LogWindowPreviewStyle));
980 FIni.WriteInteger('System', 'LogListPreviewStyle', Ord(LogListPreviewStyle));
981 FIni.WriteString('System', 'FMOName', FFMOName.CommaText);
982 FIni.WriteBool('System', 'HideGhosts', HideGhosts);
983 FIni.WriteString('System', 'VisibleGhostsList', VisibleGhostsList.CommaText);
984 FIni.WriteBool('System', 'NoExtraSSTPHeaders', NoExtraSSTPHeaders);
986 FIni.WriteBool('System', 'SurfacePreviewOnHint', SurfacePreviewOnHint);
987 FIni.WriteBool('System', 'SurfacePreviewOnScriptPoint', SurfacePreviewOnScriptPoint);
988 FIni.WriteInteger('System', 'SurfacePreviewOnScriptPointPosition', Ord(SurfacePreviewOnScriptPointPosition));
991 function TBottlePrefs.GetDefaultScript: String;
993 Result := FDefaultScript.Text;
996 procedure TBottlePrefs.SetHUTagTo01Tag(const Value: boolean);
998 FHUTagTo01Tag := Value;
1001 procedure TBottlePrefs.SetWarnScopeChangeInSynchronize(
1002 const Value: boolean);
1004 FWarnScopeChangeInSynchronize := Value;
1007 procedure TBottlePrefs.SetWarnYenTNotExist(const Value: boolean);
1009 FWarnYenTNotExist := Value;
1012 procedure TBottlePrefs.SetNeedConfirmBeforeSend(const Value: boolean);
1014 FNeedConfirmBeforeSend := Value;
1017 procedure TBottlePrefs.SetShowRuler(const Value: boolean);
1019 FShowRuler := Value;
1022 procedure TBottlePrefs.SetHideGhosts(const Value: boolean);
1024 FHideGhosts := Value;
1027 procedure TBottlePrefs.SetVisibleGhostsList(const Value: TStringList);
1029 FVisibleGhostsList.Assign(Value);
1032 procedure TBottlePrefs.SetSurfacePreviewOnHint(const Value: boolean);
1034 FSurfacePreviewOnHint := Value;
1037 procedure TBottlePrefs.SetSurfacePreviewOnScriptPoint(
1038 const Value: boolean);
1040 FSurfacePreviewOnScriptPoint := Value;
1043 procedure TBottlePrefs.SetSurfacePreviewOnScriptPointPosition(
1044 const Value: TSurfacePreviewOnScriptPointPosition);
1046 FSurfacePreviewOnScriptPointPosition := Value;
1049 procedure TBottlePrefs.SetNoExtraSSTPHeaders(const Value: boolean);
1051 FNoExtraSSTPHeaders := Value;
1054 procedure TBottlePrefs.SetLogListPreviewStyle(
1055 const Value: TLogListPreviewStyle);
1057 FLogListPreviewStyle := Value;
1060 procedure TBottlePrefs.SetEditorPreviewWindowPosition(const Value: TRect);
1062 FEditorPreviewWindowPosition := Value;
1065 function TBottlePrefs.InScreen(ARect: TRect): boolean;
1070 for i := 0 to Screen.MonitorCount-1 do
1072 if IntersectRect(dum, ARect, Screen.Monitors[i].WorkareaRect) then
1080 procedure TBottlePrefs.SetAutoClip(const Value: boolean);
1085 procedure TBottlePrefs.SetConfirmOnTabClose(const Value: boolean);
1087 FConfirmOnTabClose := Value;
1090 procedure TBottlePrefs.SetReconnectWait(const Value: integer);
1092 FReconnectWait := Value;
1094 raise Exception.Create('Reconnect wait must be >=6');
1097 procedure TBottlePrefs.SetPartialConfirmFormat(const Value: String);
1099 FPartialConfirmFormat := Value;
1102 procedure TBottlePrefs.SetAutoPartialConfirm(const Value: boolean);
1104 FAutoPartialConfirm := Value;
1107 procedure TBottlePrefs.SetPlayTimeParams(const Value: TSsPlayTimeParams);
1109 FPlayTimeParams.Assign(Value);
1112 { TChannelListItem }
1114 procedure TChannelListItem.SetGhost(const Value: String);
1119 procedure TChannelListItem.SetInfo(const Value: String);
1124 procedure TChannelListItem.SetMembers(const Value: integer);
1129 procedure TChannelListItem.SetName(const Value: String);
1134 procedure TChannelListItem.SetNoPost(const Value: boolean);
1139 procedure TChannelListItem.SetWarnPost(const Value: boolean);
1146 procedure TChannelList.Clear;
1149 for i := Self.Count-1 downto 0 do begin
1150 TChannelListItem(Self[i]).Free;
1155 function TChannelList.GetChannel(Name: String): TChannelListItem;
1159 for i := 0 to Count-1 do
1160 if TChannelListItem(Self[i]).Name = Name then begin
1161 Result := TChannelListItem(Self[i]);
1166 function TChannelList.GetChannelItem(Index: integer): TChannelListItem;
1168 Result := TChannelListItem(Self[Index]);
1174 RegExp := TBRegExp.Create;
1176 ShowMessage('RegExp
\8aJ
\8en
\83G
\83\89\81[');
1177 Application.Terminate;
1180 Classes.RegisterClass(TSsPlayTimeParams);
1182 Pref := TBottlePrefs.Create;
1183 ChannelList := TChannelList.Create;
1184 JoinChannels := TStringList.Create;