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;
97 FBrowserExeName: string;
99 procedure SetDblClkInsert(const Value: boolean);
100 procedure SetDefaultScript(const Value: String);
101 procedure SetIgnoreTimeCritical(const Value: boolean);
102 procedure SetMarkErrorColor(const Value: TColor);
103 procedure SetMarkUpColor(const Value: TColor);
104 procedure SetMetaWordColor(const Value: TColor);
105 procedure SetTextColor(const Value: TColor);
106 procedure SetNoConfirm(const Value: boolean);
107 procedure SetShowConstBar(const Value: boolean);
108 procedure SetShowToolBar(const Value: boolean);
109 procedure SetStayOnTop(const Value: boolean);
110 procedure SetTalkColorH(const Value: TColor);
111 procedure SetTalkColorU(const Value: TColor);
112 procedure SetAutoStart(const Value: boolean);
113 procedure SetWhenCtrlReturn(const Value: TReturnKeyFunction);
114 procedure SetWhenReturn(const Value: TReturnKeyFunction);
115 procedure SetWhenShiftReturn(const Value: TReturnKeyFunction);
116 procedure SetNoTranslate(const Value: boolean);
117 procedure SetNoDescript(const Value: boolean);
118 procedure SetBgColor(const Value: TColor);
119 procedure SetServerPort(const Value: integer);
120 procedure SetSilentWhenHidden(const Value: boolean);
121 procedure SetLUID(const Value: String);
122 procedure SetSenderWindowPosition(const Value: TRect);
123 procedure SetTabPosition(const Value: TTabPosition);
124 procedure SetLogWindowPosition(const Value: TRect);
125 procedure SetIgnoreFrequentYenS(const Value: boolean);
126 procedure SetNoTransUrl(const Value: boolean);
127 procedure SetWaitScriptEnd(const Value: integer);
128 procedure SetLogWindowDividerPos(const Value: integer);
129 procedure SetProxyAddress(const Value: String);
130 procedure SetProxyPort(const Value: integer);
131 procedure SetUseHttpProxy(const Value: boolean);
132 procedure SetConfirmOnExit(const Value: boolean);
133 procedure SetFixMessySurface(const Value: boolean);
134 procedure SetResetIfGhostAfterSend(const Value: boolean);
135 procedure SetGhostDropDownCount(const Value: integer);
136 procedure SetLogWindowPreviewStyle(const Value: TLogWindowPreviewStyle);
137 procedure SetTalkColorS(const Value: TColor);
138 procedure SetLogWindowColumnWidth(const Value: String);
139 procedure SetClearAfterSend(const Value: boolean);
140 procedure SetAutoJoinChannels(const Value: TStrings);
141 procedure SetFMOName(const Value: TStrings);
142 function GetDefaultScript: String;
143 procedure SetHUTagTo01Tag(const Value: boolean);
144 procedure SetWarnScopeChangeInSynchronize(const Value: boolean);
145 procedure SetWarnYenTNotExist(const Value: boolean);
146 procedure SetNeedConfirmBeforeSend(const Value: boolean);
147 procedure SetShowRuler(const Value: boolean);
148 procedure SetHideGhosts(const Value: boolean);
149 procedure SetVisibleGhostsList(const Value: TStringList);
150 procedure SetSurfacePreviewOnHint(const Value: boolean);
151 procedure SetSurfacePreviewOnScriptPoint(const Value: boolean);
152 procedure SetSurfacePreviewOnScriptPointPosition(
153 const Value: TSurfacePreviewOnScriptPointPosition);
154 procedure SetNoExtraSSTPHeaders(const Value: boolean);
155 procedure SetLogListPreviewStyle(const Value: TLogListPreviewStyle);
156 procedure SetEditorPreviewWindowPosition(const Value: TRect);
157 procedure SetAutoClip(const Value: boolean);
158 procedure SetConfirmOnTabClose(const Value: boolean);
159 procedure SetReconnectWait(const Value: integer);
160 procedure SetPartialConfirmFormat(const Value: String);
161 procedure SetAutoPartialConfirm(const Value: boolean);
162 procedure SetPlayTimeParams(const Value: TSsPlayTimeParams);
163 procedure SetTabWidth(const Value: integer);
165 function InScreen(ARect: TRect): boolean;
167 property BottleServer: String read FBottleServer;
168 property BottleServerPort: integer read FBottleServerPort;
169 property PartialConfirmFormat: String read FPartialConfirmFormat write SetPartialConfirmFormat;
170 property AutoPartialConfirm: boolean read FAutoPartialConfirm write SetAutoPartialConfirm;
171 property ConfirmOnExit: boolean read FConfirmOnExit write SetConfirmOnExit;
172 property ConfirmOnTabClose: boolean read FConfirmOnTabClose write SetConfirmOnTabClose;
173 property AutoClip: boolean read FAutoClip write SetAutoClip;
174 property AutoStart: boolean read FAutoStart write SetAutoStart;
175 property TabPosition: TTabPosition read FTabPosition write SetTabPosition;
176 property TabWidth: integer read FTabWidth write SetTabWidth;
177 property GhostDropDownCount: integer read FGhostDropDownCount write SetGhostDropDownCount;
178 property NoTranslate: boolean read FNoTranslate write SetNoTranslate;
179 property NoDescript: boolean read FNoDescript write SetNoDescript;
180 property NoTransUrl: boolean read FNoTransUrl write SetNoTransUrl;
181 property SilentWhenHidden: boolean read FSilentWhenHidden write SetSilentWhenHidden;
182 property FixMessySurface: boolean read FFixMessySurface write SetFixMessySurface;
183 property HUTagTo01Tag: boolean read FHUTagTo01Tag write SetHUTagTo01Tag;
184 property ResetIfGhostAfterSend: boolean read FResetIfGhostAfterSend write SetResetIfGhostAfterSend;
185 property ClearAfterSend: boolean read FClearAfterSend write SetClearAfterSend;
186 property NeedConfirmBeforeSend: boolean read FNeedConfirmBeforeSend write SetNeedConfirmBeforeSend;
187 property IgnoreFrequentYenS: boolean read FIgnoreFrequentYenS write SetIgnoreFrequentYenS;
188 property WarnYenTNotExist: boolean read FWarnYenTNotExist write SetWarnYenTNotExist;
189 property WarnScopeChangeInSynchronize: boolean read FWarnScopeChangeInSynchronize write SetWarnScopeChangeInSynchronize;
190 property WaitScriptEnd: integer read FWaitScriptEnd write SetWaitScriptEnd;
191 property StayOnTop: boolean read FStayOnTop write SetStayOnTop;
192 property IgnoreTimeCritical: boolean read FIgnoreTimeCritical write SetIgnoreTimeCritical;
193 property TalkColorH: TColor read FTalkColorH write SetTalkColorH;
194 property TalkColorU: TColor read FTalkColorU write SetTalkColorU;
195 property TalkColorS: TColor read FTalkColorS write SetTalkColorS;
196 property MarkUpColor: TColor read FMarkUpColor write SetMarkUpColor;
197 property MetaWordColor: TColor read FMetaWordColor write SetMetaWordColor;
198 property MarkErrorColor: TColor read FMarkErrorColor write SetMarkErrorColor;
199 property BgColor: TColor read FBgColor write SetBgColor;
200 property TextColor: TColor read FTextColor write SetTextColor;
201 property DefaultScript: String read GetDefaultScript write SetDefaultScript;
202 property ShowRuler: boolean read FShowRuler write SetShowRuler;
203 property DblClkInsert: boolean read FDblClkInsert write SetDblClkInsert;
204 property ShowToolBar: boolean read FShowToolBar write SetShowToolBar;
205 property ShowConstBar: boolean read FShowConstBar write SetShowConstBar;
206 property NoConfirm: boolean read FNoConfirm write SetNoConfirm;
207 property HomePage: string read FHomePage;
208 property WhenReturn: TReturnKeyFunction read FWhenReturn write SetWhenReturn;
209 property WhenShiftReturn: TReturnKeyFunction read FWhenShiftReturn write SetWhenShiftReturn;
210 property WhenCtrlReturn: TReturnKeyFunction read FWhenCtrlReturn write SetWhenCtrlReturn;
211 property ServerPort: integer read FServerPort write SetServerPort;
213 property CgiName: string read FCgiName;
214 property CgiNameGhost: String read FCgiNameGhost;
215 property CgiFetchLog: String read FCgiFetchLog;
216 property GLogPage: String read FGLogPage;
217 property VotePage: String read FVotePage;
218 property HelpPage: String read FHelpPage;
220 //
\83`
\83\83\83\93\83l
\83\8b\8aÖ
\8cW
221 property AutoJoinChannels: TStrings read FAutoJoinChannels write SetAutoJoinChannels;
223 property LUID: String read FLUID write SetLUID;
225 //
\83E
\83B
\83\93\83h
\83E
\88Ê
\92u
226 property SenderWindowPosition: TRect
227 read FSenderWindowPosition write SetSenderWindowPosition;
228 property LogWindowPosition: TRect read FLogWindowPosition write SetLogWindowPosition;
229 property LogWindowDividerPos: integer
230 read FLogWindowDividerPos write SetLogWindowDividerPos;
231 property LogWindowColumnWidth: String
232 read FLogWindowColumnWidth write SetLogWindowColumnWidth;
233 property EditorPreviewWindowPosition: TRect read FEditorPreviewWindowPosition write SetEditorPreviewWindowPosition;
234 //
\83v
\83\8d\83L
\83V
\8aÖ
\8cW
235 property UseHttpProxy: boolean read FUseHttpProxy write SetUseHttpProxy;
236 property ProxyAddress: String read FProxyAddress write SetProxyAddress;
237 property ProxyPort: integer read FProxyPort write SetProxyPort;
239 property ReconnectWait: integer read FReconnectWait write SetReconnectWait;
240 //
\83\8d\83O
\83E
\83B
\83\93\83h
\83E
\8aÖ
\8cW
241 property LogWindowPreviewStyle: TLogWindowPreviewStyle
242 read FLogWindowPreviewStyle write SetLogWindowPreviewStyle;
243 property LogListPreviewStyle: TLogListPreviewStyle
244 read FLogListPreviewStyle write SetLogListPreviewStyle;
246 property FMOName: TStrings read FFMOName write SetFMOName;
247 property HideGhosts: boolean read FHideGhosts write SetHideGhosts;
248 property VisibleGhostsList: TStringList read FVisibleGhostsList write SetVisibleGhostsList;
249 property NoExtraSSTPHeaders: boolean read FNoExtraSSTPHeaders write SetNoExtraSSTPHeaders;
250 //
\83T
\81[
\83t
\83B
\83X
\83v
\83\8c\83r
\83\85\81[
251 property SurfacePreviewOnHint: boolean
252 read FSurfacePreviewOnHint write SetSurfacePreviewOnHint;
253 property SurfacePreviewOnScriptPoint: boolean
254 read FSurfacePreviewOnScriptPoint write SetSurfacePreviewOnScriptPoint;
255 property SurfacePreviewOnScriptPointPosition: TSurfacePreviewOnScriptPointPosition
256 read FSurfacePreviewOnScriptPointPosition write SetSurfacePreviewOnScriptPointPosition;
257 //
\8dÄ
\90¶
\8e\9e\8aÔ
\97\
\91ª
258 property PlayTimeParams: TSsPlayTimeParams read FPlayTimeParams write SetPlayTimeParams;
259 //URL
\83I
\81[
\83v
\83\93\8e\9e\82É
\8eg
\82¤
\83u
\83\89\83E
\83U
\82Ì
\8eÀ
\8ds
\83t
\83@
\83C
\83\8b\96¼
260 property BrowserExeName: string read FBrowserExeName write FBrowserExeName;
262 //
\83R
\83\93\83X
\83g
\83\89\83N
\83^
\81E
\83f
\83X
\83g
\83\89\83N
\83^
\81E
\95Û
\91¶
264 destructor Destroy; override;
265 procedure SaveSettings;
268 TChannelListItem = class(TObject)
276 procedure SetGhost(const Value: String);
277 procedure SetInfo(const Value: String);
278 procedure SetMembers(const Value: integer);
279 procedure SetName(const Value: String);
280 procedure SetNoPost(const Value: boolean);
281 procedure SetWarnPost(const Value: boolean);
283 property Name: String read FName write SetName;
284 property Info: String read FInfo write SetInfo;
285 property Ghost: String read FGhost write SetGhost;
286 property Members: integer read FMembers write SetMembers;
287 property NoPost: boolean read FNoPost write SetNoPost;
288 property WarnPost: boolean read FWarnPost write SetWarnPost;
291 TChannelList = class(TList)
293 function GetChannel(Name: String): TChannelListItem;
294 function GetChannelItem(Index: integer): TChannelListItem;
296 procedure Clear; override;
297 property Channel[Name: String]: TChannelListItem read GetChannel;
298 property ChannelItem[Index: integer]: TChannelListItem read GetChannelItem;
301 TScriptTransOption = (
302 toIgnoreTimeCritical,
305 toIgnoreFrequentYenS,
313 TScriptTransOptions = set of TScriptTransOption;
317 ChannelList: TChannelList; //
\83`
\83\83\83\93\83l
\83\8b\83\8a\83X
\83g
\82ð
\95Û
\8e\9d\82·
\82é
318 JoinChannels: TStringList; //
\8c»
\8dÝ
\8eQ
\89Á
\82µ
\82Ä
\82¢
\82é
\83`
\83\83\83\93\83l
\83\8b
321 DefaultBottleServer = 'bottle.mikage.to';
322 DefaultBottleServerPort = 9871;
323 DefaultCGI = '/bottle2.cgi';
324 DefaultCGIGhost = '/glog/bottleglog.cgi';
325 DefaultCGIFetchLog = '/fetchlog.cgi';
328 DefaultHomePage = 'http://bottle.mikage.to/';
329 DefaultGLogPage = 'http://bottle.mikage.to/glog/glogview.cgi';
330 DefaultVotePage = 'http://bottle.mikage.to/viewvotes.cgi';
331 DefaultHelpPage = 'http://bottle.mikage.to/clihelp/index.html';
336 VersionString = 'SSTP Bottle Client ver ' + Version + 'a NO MUTEX VERSION';
338 VersionString = 'SSTP Bottle Client ver ' + Version;
341 SentLogFile = 'sent.log';
343 BottleDisclaimer = '(C)2001-2004 WinBottle Project'#13#10 +
344 'naru, C.Ponapalt, Yune Kotomi, yese, Mikage Sawatari'#13#10 +
347 ChannelDefault = '(CH
\90\84\8f§)';
348 ClipChannel = '(
\83N
\83\8a\83b
\83v)';
350 function ParamsEncode(const ASrc: string): string;
351 function XMLEntity(From: String): String;
352 function SafeFileName(From: String; ChangePathDelimiters: boolean = true): String;
353 function ComponentToString(Component: TComponent): string;
354 function StringToComponent(Value: string): TComponent;
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);
473 constructor TBottlePrefs.Create;
477 FAutoJoinChannels := TStringList.Create;
478 FDefaultScript := TStringList.Create;
479 FFMOName := TStringList.Create;
480 FVisibleGhostsList := TStringList.Create;
482 FIni := TIniFile.Create(ChangeFileExt(Application.ExeName, '.ini'));
484 PartialConfirmFormat := FIni.ReadString('System', 'PartialConfirmFormat', '\t|\e');
485 AutoPartialConfirm := FIni.ReadBool('System', 'AutoPartialConfirm', false);
486 ConfirmOnExit := FIni.ReadBool('System', 'ConfirmOnExit', false);
487 ConfirmOnExit := FIni.ReadBool('System', 'ConfirmOnExit', false);
488 ConfirmOnTabClose := FIni.ReadBool('System', 'ConfirmOnTabClose', false);
489 AutoClip := FIni.ReadBool('System', 'AutoClip', false);
490 AutoStart := FIni.ReadBool('System', 'AutoStart', false);
491 TabPosition := TTabPosition(FIni.ReadInteger('System', 'TabPosition', 0));
492 TabWidth := FIni.ReadInteger('System', 'TabWidth', 0);
493 GhostDropDownCount := FIni.ReadInteger('System', 'GhostDropDownCount', 30);
495 NoTranslate := FIni.ReadBool('System', 'NoTranslate', true);
496 NoDescript := FIni.ReadBool('System', 'NoDescript', false);
497 NoTransUrl := FIni.ReadBool('System', 'NoTransUrl', false);
498 SilentWhenHidden:= FIni.ReadBool('System', 'SilentWhenHidden', true);
499 FixMessySurface := FIni.ReadBool('System', 'FixMessySurface', false);
500 HUTagTo01Tag := FIni.ReadBool('System', 'HUTagTo01Tag', false);
501 ResetIfGhostAfterSend := FIni.ReadBool('System', 'ResetIfGhostAfterSend', false);
502 ClearAfterSend := FIni.ReadBool('System', 'ClearAfterSend', true);
503 NeedConfirmBeforeSend := FIni.ReadBool('System', 'NeedConfirmBeforeSend', true);
504 WarnYenTNotExist := FIni.ReadBool('System', 'WarnYenTNotExist', false);
505 WarnScopeChangeInSynchronize := FIni.ReadBool('System', 'WarnScopeChangeInSynchronize', false);
507 IgnoreFrequentYenS := FIni.ReadBool('System', 'IgnoreFrequentYenS', false);
508 WaitScriptEnd := FIni.ReadInteger('System', 'WaitScriptEnd', 0);
509 StayOnTop := FIni.ReadBool('System', 'StayOnTop', false);
510 ShowConstBar := FIni.ReadBool('System', 'ShowConstBar', true);
511 ShowToolBar := FIni.ReadBool('System', 'ShowToolBar', true);
512 NoConfirm := FIni.ReadBool('System', 'NoConfirm', false);
513 IgnoreTimeCritical := FIni.ReadBool('System', 'IgnoreTimeCritical', false);
514 FDefaultScript.CommaText := FIni.ReadString('System', 'DefaultScript', '\t\u\s[10]\h\s[0]|\e');
515 ShowRuler := FIni.ReadBool('System', 'ShowRuler', false);
518 TalkColorH := StringToColor(FIni.ReadString('System', 'TalkColorH', 'clBlack'));
519 TalkColorU := StringToColor(FIni.ReadString('System', 'TalkColorU', 'clMaroon'));
520 TalkColorS := StringToColor(FIni.ReadString('System', 'TalkColorS', 'clPurple'));
521 MarkUpColor := StringToColor(FIni.ReadString('System', 'MarkUpColor', 'clGreen'));
522 MetaWordColor := StringToColor(FIni.ReadString('System', 'MetaWordColor', 'clBlue'));
523 MarkErrorColor := StringToColor(FIni.ReadString('System', 'MarkErrorColor', 'clRed'));
524 TextColor := StringToColor(FIni.ReadString('System', 'TextColor', ColorToString(TalkColorH)));
525 BgColor := StringToColor(FIni.ReadString('System', 'BgColor', 'clWhite'));
527 on EConvertError do begin
528 ShowMessage('
\83J
\83\89\81[
\82Ì
\90Ý
\92è
\93Ç
\82Ý
\8d\9e\82Ý
\83G
\83\89\81[');
529 FTalkColorH := clBlack;
530 FTalkColorU := clMaroon;
531 FMarkUpColor := clGreen;
532 FMetaWordColor := clBlue;
533 FMarkErrorColor := clRed;
534 FTextColor := clBlack;
539 if FIni.ReadString('System', 'PlayTimeParams', '') = '' then
541 FPlayTimeParams := TSsPlayTimeParams.Create(nil);
542 FPlayTimeParams.ProfileName := '
\83f
\83t
\83H
\83\8b\83g';
545 Strs := TStringList.Create;
547 Strs.CommaText := FIni.ReadString('System', 'PlayTimeParams', '');
548 FPlayTimeParams := StringToComponent(Strs.Text) as TSsPlayTimeParams;
556 ShowMessage('
\8dÄ
\90¶
\8e\9e\8aÔ
\97\
\91ª
\90Ý
\92è
\82Ì
\93Ç
\82Ý
\8d\9e\82Ý
\83G
\83\89\81[' + E.Message);
557 if FPlayTimeParams = nil then
558 FPlayTimeParams := TSsPlayTimeParams.Create(nil);
562 WhenReturn := TReturnKeyFunction(FIni.ReadInteger('System', 'WhenReturn', 0));
563 WhenShiftReturn := TReturnKeyFunction(FIni.ReadInteger('System', 'WhenShiftReturn', 0));
564 WhenCtrlReturn := TReturnKeyFunction(FIni.ReadInteger('System', 'WhenCtrlReturn', 0));
565 //
\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è
566 ServerPort := FIni.ReadInteger('System', 'ServerPort', 11000);
568 FBottleServer := FIni.ReadString('System', 'BottleServer', DefaultBottleServer);
569 FBottleServerPort := FIni.ReadInteger('System', 'BottleServerPort', DefaultBottleServerPort);
570 FCgiName := FIni.ReadString('System', 'CgiName', DefaultCGI);
571 FCgiFetchLog := FIni.ReadString('System', 'CgiFetchLog', DefaultCGIFetchLog);
572 FHomePage := FIni.ReadString('System', 'HomePage', DefaultHomePage);
573 FGLogPage := FIni.ReadString('System', 'GLogPage', DefaultGLogPage);
574 FVotePage := FIni.ReadString('System', 'VotePage', DefaultVotePage);
575 FHelpPage := FIni.ReadString('System', 'HelpPage', DefaultHelpPage);
576 FCgiNameGhost := FIni.ReadString('System', 'GHOST', DefaultCGIGhost);
577 FLUID := FIni.ReadString('System', 'LUID', '');
578 FAutoJoinChannels.CommaText := FIni.ReadString('System', 'AutoJoinChannels', '');
580 ARect.Top := FIni.ReadInteger('System', 'SenderWindowPositionTop', 100);
581 ARect.Left := FIni.ReadInteger('System', 'SenderWindowPositionLeft', 100);
582 ARect.Bottom := FIni.ReadInteger('System', 'SenderWindowPositionBottom', 500);
583 ARect.Right := FIni.ReadInteger('System', 'SenderWindowPositionRight', 500);
584 if not InScreen(ARect) then
585 ARect := Rect(100, 100, 500, 500);
586 SenderWindowPosition := ARect;
587 ARect.Top := FIni.ReadInteger('System', 'LogWindowPositionTop', 200);
588 ARect.Left := FIni.ReadInteger('System', 'LogWindowPositionLeft', 200);
589 ARect.Bottom := FIni.ReadInteger('System', 'LogWindowPositionBottom', 600);
590 ARect.Right := FIni.ReadInteger('System', 'LogWindowPositionRight', 400);
591 LogWindowDividerPos := FIni.ReadInteger('System', 'LogWindowDividerPos', 150);
592 LogWindowColumnWidth := FIni.ReadString('System', 'LogWindowColumnWidth', '');
593 if not InScreen(ARect) then begin
594 ARect := Rect(200, 200, 600, 400);
595 LogWindowDividerPos := 150;
597 LogWindowPosition := ARect;
598 Strs := TStringList.Create;
600 Strs.CommaText := FIni.ReadString('System', 'EditorPreviewWindowPosition', '500,100,800,500');
602 ARect.Left := StrToInt(Strs[0]);
603 ARect.Top := StrToInt(Strs[1]);
604 ARect.Right := StrToInt(Strs[2]);
605 ARect.Bottom := StrToInt(Strs[3]);
607 ARect := Rect(500, 100, 800, 500);
609 EditorPreviewWindowPosition := ARect;
614 UseHttpProxy := FIni.ReadBool('System', 'UseHttpProxy', false);
615 ProxyAddress := FIni.ReadString('System', 'ProxyAddress', '');
616 ProxyPort := FIni.ReadInteger('System', 'ProxyPort', 0);
618 ReconnectWait := FIni.ReadInteger('System', 'ReconnectWait', 6);
619 //
\83\8d\83O
\83E
\83B
\83\93\83h
\83E
\8aÖ
\8cW
620 LogWindowPreviewStyle := TLogWindowPreviewStyle(
621 FIni.ReadInteger('System', 'LogWindowPreviewStyle', 0));
622 LogListPreviewStyle := TLogListPreviewStyle(
623 FIni.ReadInteger('System', 'LogListPreviewStyle', 0));
625 FMOName.CommaText := FIni.ReadString('System', 'FMOName', 'Sakura');
626 HideGhosts := FIni.ReadBool('System', 'HideGhosts', false);
627 VisibleGhostsList.CommaText := FIni.ReadString('System', 'VisibleGhostsList', '');
628 NoExtraSSTPHeaders := FIni.ReadBool('System', 'NoExtraSSTPHeaders', false);
629 //
\83T
\81[
\83t
\83B
\83X
\83v
\83\8c\83r
\83\85\81[
630 SurfacePreviewOnHint := FIni.ReadBool('System', 'SurfacePreviewOnHint', false);
631 SurfacePreviewOnScriptPoint := FIni.ReadBool('System', 'SurfacePreviewOnScriptPoint', false);
632 SurfacePreviewOnScriptPointPosition :=
633 TSurfacePreviewOnScriptPointPosition(FIni.ReadInteger('System', 'SurfacePreviewOnScriptPointPosition', 0));
635 //URL
\82ð
\8aJ
\82
\83u
\83\89\83E
\83U
636 FBrowserExeName:= FIni.ReadString('System', 'BrowserExeName', '');
639 ShowMessage('INI
\83t
\83@
\83C
\83\8b\93Ç
\82Ý
\8d\9e\82Ý
\83G
\83\89\81[');
640 Application.Terminate;
644 destructor TBottlePrefs.Destroy;
650 if FAutoJoinChannels <> nil then
651 FAutoJoinChannels.Free;
652 if FDefaultScript <> nil then
654 if FFMOName <> nil then
656 if FVisibleGhostsList <> nil then
657 FVisibleGhostsList.Free;
658 if FPlayTimeParams <> nil then
659 FPlayTimeParams.Free;
662 procedure TBottlePrefs.SetAutoStart(const Value: boolean);
667 procedure TBottlePrefs.SetBgColor(const Value: TColor);
672 procedure TBottlePrefs.SetConfirmOnExit(const Value: boolean);
674 FConfirmOnExit := Value;
677 procedure TBottlePrefs.SetDblClkInsert(const Value: boolean);
679 FDblClkInsert := Value;
682 procedure TBottlePrefs.SetDefaultScript(const Value: String);
684 FDefaultScript.Text := Value;
687 procedure TBottlePrefs.SetFixMessySurface(const Value: boolean);
689 FFixMessySurface := Value;
692 procedure TBottlePrefs.SetGhostDropDownCount(const Value: integer);
694 FGhostDropDownCount := Value;
697 procedure TBottlePrefs.SetIgnoreFrequentYenS(const Value: boolean);
699 FIgnoreFrequentYenS := Value;
702 procedure TBottlePrefs.SetIgnoreTimeCritical(const Value: boolean);
704 FIgnoreTimeCritical := Value;
707 procedure TBottlePrefs.SetLogWindowDividerPos(const Value: integer);
709 FLogWindowDividerPos := Value;
712 procedure TBottlePrefs.SetLogWindowPosition(const Value: TRect);
714 FLogWindowPosition := Value;
717 procedure TBottlePrefs.SetLUID(const Value: String);
722 procedure TBottlePrefs.SetMarkErrorColor(const Value: TColor);
724 FMarkErrorColor := Value;
727 procedure TBottlePrefs.SetTextColor(const Value: TColor);
732 procedure TBottlePrefs.SetMarkUpColor(const Value: TColor);
734 FMarkUpColor := Value;
737 procedure TBottlePrefs.SetMetaWordColor(const Value: TColor);
739 FMetaWordColor := Value;
742 procedure TBottlePrefs.SetNoConfirm(const Value: boolean);
747 procedure TBottlePrefs.SetNoDescript(const Value: boolean);
749 FNoDescript := Value;
752 procedure TBottlePrefs.SetNoTranslate(const Value: boolean);
754 FNoTranslate := Value;
757 procedure TBottlePrefs.SetNoTransUrl(const Value: boolean);
759 FNoTransUrl := Value;
762 procedure TBottlePrefs.SetLogWindowPreviewStyle(
763 const Value: TLogWindowPreviewStyle);
765 FLogWindowPreviewStyle := Value;
768 procedure TBottlePrefs.SetProxyAddress(const Value: String);
770 FProxyAddress := Value;
773 procedure TBottlePrefs.SetProxyPort(const Value: integer);
778 procedure TBottlePrefs.SetResetIfGhostAfterSend(const Value: boolean);
780 FResetIfGhostAfterSend := Value;
783 procedure TBottlePrefs.SetSenderWindowPosition(const Value: TRect);
785 FSenderWindowPosition := Value;
788 procedure TBottlePrefs.SetServerPort(const Value: integer);
790 if Value > 0 then FServerPort := Value;
793 procedure TBottlePrefs.SetShowConstBar(const Value: boolean);
795 FShowConstBar := Value;
798 procedure TBottlePrefs.SetShowToolBar(const Value: boolean);
800 FShowToolBar := Value;
803 procedure TBottlePrefs.SetSilentWhenHidden(const Value: boolean);
805 FSilentWhenHidden := Value;
808 procedure TBottlePrefs.SetStayOnTop(const Value: boolean);
813 procedure TBottlePrefs.SetTabPosition(const Value: TTabPosition);
815 FTabPosition := Value;
818 procedure TBottlePrefs.SetTalkColorH(const Value: TColor);
820 FTalkColorH := Value;
823 procedure TBottlePrefs.SetTalkColorU(const Value: TColor);
825 FTalkColorU := Value;
828 procedure TBottlePrefs.SetUseHttpProxy(const Value: boolean);
830 FUseHttpProxy := Value;
833 procedure TBottlePrefs.SetWaitScriptEnd(const Value: integer);
835 if Value > 0 then FWaitScriptEnd := Value;
838 procedure TBottlePrefs.SetWhenCtrlReturn(const Value: TReturnKeyFunction);
840 FWhenCtrlReturn := Value;
843 procedure TBottlePrefs.SetWhenReturn(const Value: TReturnKeyFunction);
845 FWhenReturn := Value;
848 procedure TBottlePrefs.SetWhenShiftReturn(const Value: TReturnKeyFunction);
850 FWhenShiftReturn := Value;
853 procedure TBottlePrefs.SetTalkColorS(const Value: TColor);
855 FTalkColorS := Value;
858 procedure TBottlePrefs.SetLogWindowColumnWidth(const Value: String);
860 FLogWindowColumnWidth := Value;
863 procedure TBottlePrefs.SetClearAfterSend(const Value: boolean);
865 FClearAfterSend := Value;
868 procedure TBottlePrefs.SetAutoJoinChannels(const Value: TStrings);
870 FAutoJoinChannels.Assign(Value);
873 procedure TBottlePrefs.SetFMOName(const Value: TStrings);
875 FFMOName.Assign(Value);
878 procedure TBottlePrefs.SaveSettings;
882 FIni.WriteString('System', 'PartialConfirmFormat', PartialConfirmFormat);
883 FIni.WriteBool('System', 'AutoPartialConfirm', AutoPartialConfirm);
884 FIni.WriteBool('System', 'ConfirmOnExit', ConfirmOnExit);
885 FIni.WriteBool('System', 'ConfirmOnTabClose', ConfirmOnTabClose);
886 FIni.WriteBool('System', 'AutoClip', AutoClip);
887 FIni.WriteBool('System', 'AutoStart', AutoStart);
888 FIni.WriteInteger('System', 'TabPosition', Ord(TabPosition));
889 FIni.WriteInteger('System', 'TabWidth', TabWidth);
890 FIni.WriteInteger('System', 'GhostDropDownCount', GhostDropDownCount);
892 FIni.WriteBool('System', 'NoTranslate', NoTranslate);
893 FIni.WriteBool('System', 'NoDescript', NoDescript);
894 FIni.WriteBool('System', 'NoTransUrl', NoTransUrl);
895 FIni.WriteBool('System', 'SilentWhenHidden', SilentWhenHidden);
896 FIni.WriteBool('System', 'FixMessySurface', FixMessySurface);
897 FIni.WriteBool('System', 'HUTagTo01Tag', HUTagTo01Tag);
898 FIni.WriteBool('System', 'ResetIfGhostAfterSend', ResetIfGhostAfterSend);
899 FIni.WriteBool('System', 'ClearAfterSend', ClearAfterSend);
900 FIni.WriteBool('System', 'NeedConfirmBeforeSend', NeedConfirmBeforeSend);
901 FIni.WriteBool('System', 'WarnYenTNotExist', WarnYenTNotExist);
902 FIni.WriteBool('System', 'WarnScopeChangeInSynchronize', WarnScopeChangeInSynchronize);
904 FIni.WriteBool('System', 'IgnoreFrequentYenS', IgnoreFrequentYenS);
905 FIni.WriteInteger('System', 'WaitScriptEnd', WaitScriptEnd);
906 FIni.WriteBool('System', 'StayOnTop', StayOnTop);
907 FIni.WriteBool('System', 'NoConfirm', NoConfirm);
908 FIni.WriteBool('System', 'IgnoreTimeCritical', IgnoreTimeCritical);
909 FIni.WriteString('System', 'TalkColorH', ColorToString(TalkColorH));
910 FIni.WriteString('System', 'TalkColorU', ColorToString(TalkColorU));
911 FIni.WriteString('System', 'TalkColorS', ColorToString(TalkColorS));
912 FIni.WriteString('System', 'MarkUpColor', ColorToString(MarkUpColor));
913 FIni.WriteString('System', 'MetaWordColor', ColorToString(MetaWordColor));
914 FIni.WriteString('System', 'MarkErrorColor', ColorToString(MarkErrorColor));
915 FIni.WriteString('System', 'TextColor', ColorToString(TextColor));
917 Strs := TStringList.Create;
919 Strs.Text := ComponentToString(FPlayTimeParams);
920 FIni.WriteString('System', 'PlayTimeParams', Strs.CommaText);
925 FIni.WriteString('System', 'BgColor', ColorToString(BgColor));
926 FIni.WriteBool('System', 'ShowToolBar', ShowToolBar);
927 FIni.WriteBool('System', 'ShowConstBar', ShowConstBar);
928 FIni.WriteString('System', 'DefaultScript', FDefaultScript.CommaText);
929 FIni.WriteBool('System', 'ShowRuler', ShowRuler);
930 FIni.WriteInteger('System', 'WhenReturn', Ord(WhenReturn));
931 FIni.WriteInteger('System', 'WhenShiftReturn', Ord(WhenShiftReturn));
932 FIni.WriteInteger('System', 'WhenCtrlReturn', Ord(WhenCtrlReturn));
933 FIni.WriteInteger('System', 'ServerPort', ServerPort);
934 FIni.WriteString('System', 'LUID', LUID);
935 FIni.WriteString('System', 'AutoJoinChannels', FAutoJoinChannels.CommaText);
937 FIni.WriteInteger('System', 'SenderWindowPositionLeft', SenderWindowPosition.Left);
938 FIni.WriteInteger('System', 'SenderWindowPositionTop', SenderWindowPosition.Top);
939 FIni.WriteInteger('System', 'SenderWindowPositionRight', SenderWindowPosition.Right);
940 FIni.WriteInteger('System', 'SenderWindowPositionBottom', SenderWindowPosition.Bottom);
941 FIni.WriteInteger('System', 'LogWindowPositionLeft', LogWindowPosition.Left);
942 FIni.WriteInteger('System', 'LogWindowPositionTop', LogWindowPosition.Top);
943 FIni.WriteInteger('System', 'LogWindowPositionRight', LogWindowPosition.Right);
944 FIni.WriteInteger('System', 'LogWindowPositionBottom', LogWindowPosition.Bottom);
945 FIni.WriteInteger('System', 'LogWindowDividerPos', LogWindowDividerPos);
946 FIni.WriteString('System', 'LogWindowColumnWidth', LogWindowColumnWidth);
947 with EditorPreviewWindowPosition do
948 FIni.WriteString('System', 'EditorPreviewWindowPosition',
949 Format('%d,%d,%d,%d', [Left, Top, Right, Bottom]));
951 FIni.WriteBool('System', 'UseHttpProxy', UseHttpProxy);
952 FIni.WriteString('System', 'ProxyAddress', ProxyAddress);
953 FIni.WriteInteger('System', 'ProxyPort', ProxyPort);
955 FIni.WriteInteger('System', 'ReconnectWait', ReconnectWait);
957 FIni.WriteInteger('System', 'LogWindowPreviewStyle', Ord(LogWindowPreviewStyle));
958 FIni.WriteInteger('System', 'LogListPreviewStyle', Ord(LogListPreviewStyle));
959 FIni.WriteString('System', 'FMOName', FFMOName.CommaText);
960 FIni.WriteBool('System', 'HideGhosts', HideGhosts);
961 FIni.WriteString('System', 'VisibleGhostsList', VisibleGhostsList.CommaText);
962 FIni.WriteBool('System', 'NoExtraSSTPHeaders', NoExtraSSTPHeaders);
964 FIni.WriteBool('System', 'SurfacePreviewOnHint', SurfacePreviewOnHint);
965 FIni.WriteBool('System', 'SurfacePreviewOnScriptPoint', SurfacePreviewOnScriptPoint);
966 FIni.WriteInteger('System', 'SurfacePreviewOnScriptPointPosition', Ord(SurfacePreviewOnScriptPointPosition));
968 FIni.WriteString('System', 'BrowserExeName', FBrowserExeName);
971 function TBottlePrefs.GetDefaultScript: String;
973 Result := FDefaultScript.Text;
976 procedure TBottlePrefs.SetHUTagTo01Tag(const Value: boolean);
978 FHUTagTo01Tag := Value;
981 procedure TBottlePrefs.SetWarnScopeChangeInSynchronize(
982 const Value: boolean);
984 FWarnScopeChangeInSynchronize := Value;
987 procedure TBottlePrefs.SetWarnYenTNotExist(const Value: boolean);
989 FWarnYenTNotExist := Value;
992 procedure TBottlePrefs.SetNeedConfirmBeforeSend(const Value: boolean);
994 FNeedConfirmBeforeSend := Value;
997 procedure TBottlePrefs.SetShowRuler(const Value: boolean);
1002 procedure TBottlePrefs.SetHideGhosts(const Value: boolean);
1004 FHideGhosts := Value;
1007 procedure TBottlePrefs.SetVisibleGhostsList(const Value: TStringList);
1009 FVisibleGhostsList.Assign(Value);
1012 procedure TBottlePrefs.SetSurfacePreviewOnHint(const Value: boolean);
1014 FSurfacePreviewOnHint := Value;
1017 procedure TBottlePrefs.SetSurfacePreviewOnScriptPoint(
1018 const Value: boolean);
1020 FSurfacePreviewOnScriptPoint := Value;
1023 procedure TBottlePrefs.SetSurfacePreviewOnScriptPointPosition(
1024 const Value: TSurfacePreviewOnScriptPointPosition);
1026 FSurfacePreviewOnScriptPointPosition := Value;
1029 procedure TBottlePrefs.SetNoExtraSSTPHeaders(const Value: boolean);
1031 FNoExtraSSTPHeaders := Value;
1034 procedure TBottlePrefs.SetLogListPreviewStyle(
1035 const Value: TLogListPreviewStyle);
1037 FLogListPreviewStyle := Value;
1040 procedure TBottlePrefs.SetEditorPreviewWindowPosition(const Value: TRect);
1042 FEditorPreviewWindowPosition := Value;
1045 function TBottlePrefs.InScreen(ARect: TRect): boolean;
1050 for i := 0 to Screen.MonitorCount-1 do
1052 if IntersectRect(dum, ARect, Screen.Monitors[i].WorkareaRect) then
1060 procedure TBottlePrefs.SetAutoClip(const Value: boolean);
1065 procedure TBottlePrefs.SetConfirmOnTabClose(const Value: boolean);
1067 FConfirmOnTabClose := Value;
1070 procedure TBottlePrefs.SetReconnectWait(const Value: integer);
1072 FReconnectWait := Value;
1074 raise Exception.Create('Reconnect wait must be >=6');
1077 procedure TBottlePrefs.SetPartialConfirmFormat(const Value: String);
1079 FPartialConfirmFormat := Value;
1082 procedure TBottlePrefs.SetAutoPartialConfirm(const Value: boolean);
1084 FAutoPartialConfirm := Value;
1087 procedure TBottlePrefs.SetPlayTimeParams(const Value: TSsPlayTimeParams);
1089 FPlayTimeParams.Assign(Value);
1092 procedure TBottlePrefs.SetTabWidth(const Value: integer);
1097 { TChannelListItem }
1099 procedure TChannelListItem.SetGhost(const Value: String);
1104 procedure TChannelListItem.SetInfo(const Value: String);
1109 procedure TChannelListItem.SetMembers(const Value: integer);
1114 procedure TChannelListItem.SetName(const Value: String);
1119 procedure TChannelListItem.SetNoPost(const Value: boolean);
1124 procedure TChannelListItem.SetWarnPost(const Value: boolean);
1131 procedure TChannelList.Clear;
1134 for i := Self.Count-1 downto 0 do begin
1135 TChannelListItem(Self[i]).Free;
1140 function TChannelList.GetChannel(Name: String): TChannelListItem;
1144 for i := 0 to Count-1 do
1145 if TChannelListItem(Self[i]).Name = Name then begin
1146 Result := TChannelListItem(Self[i]);
1151 function TChannelList.GetChannelItem(Index: integer): TChannelListItem;
1153 Result := TChannelListItem(Self[Index]);
1158 Classes.RegisterClass(TSsPlayTimeParams);
1160 Pref := TBottlePrefs.Create;
1161 ChannelList := TChannelList.Create;
1162 JoinChannels := TStringList.Create;