TSoundArrived = (saFalse, saTrue, saParent);
TLogWindowPreviewStyle = (psConversation, psScript, psScriptWithLineBreak);
- //SSTP Bottle\82Ì\83`\83\83\83\93\83l\83\8b\82²\82Æ\82Ì\90Ý\92è
- TChannelPrefs = class(TObject)
- private
- FSoundArrived: TSoundArrived;
- FUseChannelPrefs: boolean;
- FChannelName: String;
- FSoundFile: String;
- FIgnoreIfGhost: boolean;
- FTargetGhost: String;
- FCanAutoAdd: boolean;
- FWarnPost: boolean;
- procedure SetChannelName(const Value: String);
- procedure SetSoundArrived(const Value: TSoundArrived);
- procedure SetSoundFile(const Value: String);
- procedure SetUseChannelPrefs(const Value: boolean);
- procedure SetIgnoreIfGhost(const Value: boolean);
- procedure SetTargetGhost(const Value: String);
- procedure SetCanAutoAdd(const Value: boolean);
- procedure SetWarnPost(const Value: boolean);
- public
- //\83`\83\83\83\93\83l\83\8b\96¼(\91å\8e\96)
- property ChannelName: String read FChannelName write SetChannelName;
- //\82±\82Ì\90Ý\92è\82ð\8eg\82¤\82©\82Ç\82¤\82©
- property UseChannelPrefs: boolean read FUseChannelPrefs write SetUseChannelPrefs;
- //\93\9e\92\85\8e\9e\82É\89¹\82ð\96Â\82ç\82·
- property SoundArrived: TSoundArrived read FSoundArrived write SetSoundArrived;
- //\89¹\90º\83t\83@\83C\83\8b
- property SoundFile: String read FSoundFile write SetSoundFile;
- //\91\97\90M\90æ\83S\81[\83X\83g(\8bó\95¶\8e\9a\97ñ\82È\82ç\83`\83\83\83\93\83l\83\8b\90\84\8f§\83S\81[\83X\83g)
- property TargetGhost: String read FTargetGhost write SetTargetGhost;
- //IfGhost\82ð\96³\8e\8b
- property IgnoreIfGhost: boolean read FIgnoreIfGhost write SetIgnoreIfGhost;
- //\83`\83\83\83\93\83l\83\8b\82Ì\8e©\93®\93o\98^\82Ì\91Î\8fÛ\82É\82·\82é
- property CanAutoAdd: boolean read FCanAutoAdd write SetCanAutoAdd;
- //\83`\83\83\83\93\83l\83\8b\93\8a\8de\82Ì\8dÛ\82É\83`\83\83\83\93\83l\83\8b\82ð\8am\94F\82·\82é
- property WarnPost: boolean read FWarnPost write SetWarnPost;
- //\95Û\91¶\81E\93Ç\82Ý\8d\9e\82Ý
- procedure Save(AnIni: TIniFile; Default: boolean = false);
- procedure Load(AnIni: TIniFile; ChannelName: String; Default: boolean = false);
- end;
-
//SSTP Bottle\82Ì\90Ý\92è
TBottlePrefs = class(TObject)
private
FIni: TIniFile;
FChannelList: TList;
- FDefChannelPref: TChannelPrefs;
//
FColorScript: boolean;
FIgnoreTimeCritical: boolean;
FTalkColorS: TColor;
FLogWindowColumnWidth: String;
FClearAfterSend: boolean;
+ FAutoJoinChannels: TStrings;
procedure SetColorScript(const Value: boolean);
procedure SetColorTimeLagValue(const Value: integer);
procedure SetDblClkInsert(const Value: boolean);
procedure SetBgColor(const Value: TColor);
procedure SetServerPort(const Value: integer);
procedure SetSilentWhenHidden(const Value: boolean);
- function GetChannelPref(ChannelName: String): TChannelPrefs;
- function GetDefChannelPref: TChannelPrefs;
- function GetChannelPrefIndex(Index: integer): TChannelPrefs;
- function GetChannelPrefCount: integer;
procedure SetLUID(const Value: String);
procedure SetSenderWindowPosition(const Value: TRect);
procedure SetTabPosition(const Value: TTabPosition);
procedure SetTalkColorS(const Value: TColor);
procedure SetLogWindowColumnWidth(const Value: String);
procedure SetClearAfterSend(const Value: boolean);
- protected
- procedure ClearList; virtual;
+ procedure SetAutoJoinChannels(const Value: TStrings);
public
property NoSendGhostList: boolean read FNoSendGhostList write SetNoSendGhostList;
property ConfirmOnExit: boolean read FConfirmOnExit write SetConfirmOnExit;
property HelpPage: String read FHelpPage;
//\83`\83\83\83\93\83l\83\8b\8aÖ\8cW
- property DefChannelPref: TChannelPrefs read GetDefChannelPref;
- property ChannelPrefIndex[Index: integer]: TChannelPrefs read GetChannelPrefIndex;
- property ChannelPrefCount: integer read GetChannelPrefCount;
- property ChannelPref[ChannelName: String]: TChannelPrefs read GetChannelPref;
+ property AutoJoinChannels: TStrings read FAutoJoinChannels write SetAutoJoinChannels;
+
property LUID: String read FLUID write SetLUID;
- procedure DeleteChannelPref(ChannelName: String);
- function CreateChannelPref(ChannelName: String): TChannelPrefs;
+
//\83E\83B\83\93\83h\83E\88Ê\92u
property SenderWindowPosition: TRect read FSenderWindowPosition write SetSenderWindowPosition;
property LogWindowPosition: TRect read FLogWindowPosition write SetLogWindowPosition;
var
RegExp: TBRegExp;
Pref: TBottlePrefs;
+ ChannelList: TChannelList; //\83`\83\83\83\93\83l\83\8b\83\8a\83X\83g\82ð\95Û\8e\9d\82·\82é
+
const
BottleServerTimeOut = 400000; // \83^\83C\83\80\83A\83E\83g\82·\82é\82Ü\82Å\82Ì\8e\9e\8aÔ
{ TBottlePrefs }
-procedure TBottlePrefs.ClearList;
-var i: integer;
-begin
- for i := FChannelList.Count-1 downto 0 do begin
- TChannelPrefs(FChannelList[i]).Free;
- end;
- FChannelList.Clear;
-end;
-
constructor TBottlePrefs.Create;
var Sections: TStringList;
i: integer;
- ChPref: TChannelPrefs;
ARect, Dum: TRect;
begin
+ FAutoJoinChannels := TStringList.Create;
try
FIni := TIniFile.Create(ChangeFileExt(Application.ExeName, '.ini'));
- FChannelList := TList.Create;
- FDefChannelPref := TChannelPrefs.Create;
- FDefChannelPref.Load(FIni, '\83f\83t\83H\83\8b\83g', true);
- FDefChannelPref.UseChannelPrefs := true;
//
NoSendGhostList := FIni.ReadBool('System', 'NoSendGhostList', false);
ConfirmOnExit := FIni.ReadBool('System', 'ConfirmOnExit', false);
FHelpPage := FIni.ReadString('System', 'HelpPage', DefaultHelpPage);
FCgiNameGhost := FIni.ReadString('System', 'GHOST', DefaultCGIGhost);
FLUID := FIni.ReadString('System', 'LUID', '');
+ FAutoJoinChannels.CommaText := FIni.ReadString('System', 'AutoJoinChannels', '');
//
- Sections := nil;
- try
- Sections := TStringList.Create;
- FIni.ReadSections(Sections);
- for i := 0 to Sections.Count-1 do begin
- if Pos('CH_', Sections[i]) = 1 then begin
- ChPref := TChannelPrefs.Create;
- ChPref.Load(Fini, Copy(Sections[i], 4, High(integer)));
- FChannelList.Add(ChPref);
- end;
- end;
- finally
- Sections.Free;
- end;
ARect.Top := FIni.ReadInteger('System', 'SenderWindowPositionTop', 100);
ARect.Left := FIni.ReadInteger('System', 'SenderWindowPositionLeft', 100);
ARect.Bottom := FIni.ReadInteger('System', 'SenderWindowPositionBottom', 500);
end;
end;
-function TBottlePrefs.CreateChannelPref(ChannelName: String): TChannelPrefs;
-begin
- if ChannelPref[ChannelName] <> nil then begin
- //\82·\82Å\82É\82 \82é\83`\83\83\83\93\83l\83\8b\96¼\82¾\82Á\82½\8fê\8d\87
- Result := ChannelPref[ChannelName];
- Exit;
- end;
- try
- Result := TChannelPrefs.Create;
- Result.SoundArrived := saParent;
- Result.ChannelName := ChannelName;
- FChannelList.Add(Result);
- except
- Result := nil;
- end;
-end;
-
-procedure TBottlePrefs.DeleteChannelPref(ChannelName: String);
-var i: integer;
-begin
- for i := FChannelList.Count-1 downto 0 do begin
- if TChannelPrefs(FChannelList[i]).ChannelName = ChannelName then begin
- TChannelPrefs(FChannelList[i]).Free;
- FChannelList.Delete(i);
- FIni.EraseSection('CH_' + ChannelName);
- end;
- end;
-end;
-
destructor TBottlePrefs.Destroy;
var i: integer;
begin
FIni.WriteInteger('System', 'WhenCtrlReturn', Ord(WhenCtrlReturn));
FIni.WriteInteger('System', 'ServerPort', ServerPort);
FIni.WriteString('System', 'LUID', LUID);
+ FIni.WriteString('System', 'AutoJoinChannels', FAutoJoinChannels.CommaText);
//
- DefChannelPref.Save(FIni, true);
- for i := 0 to FChannelList.Count-1 do begin
- ChannelPrefIndex[i].Save(FIni);
- end;
FIni.WriteInteger('System', 'SenderWindowPositionLeft', SenderWindowPosition.Left);
FIni.WriteInteger('System', 'SenderWindowPositionTop', SenderWindowPosition.Top);
FIni.WriteInteger('System', 'SenderWindowPositionRight', SenderWindowPosition.Right);
//
FIni.WriteInteger('System', 'LogWindowPreviewStyle', Ord(LogWindowPreviewStyle));
FIni.Free;
- ClearList;
- FDefChannelPref.Free;
- FChannelList.Free;
-end;
-
-function TBottlePrefs.GetChannelPref(ChannelName: String): TChannelPrefs;
-var i: integer;
-begin
- Result := nil;
- for i := 0 to FChannelList.Count-1 do begin
- if TChannelPrefs(FChannelList[i]).ChannelName = ChannelName then begin
- Result := TChannelPrefs(FChannelList[i]);
- Exit;
- end;
- end;
-end;
-
-function TBottlePrefs.GetChannelPrefCount: integer;
-begin
- Result := FChannelList.Count;
-end;
-
-function TBottlePrefs.GetChannelPrefIndex(Index: integer): TChannelPrefs;
-begin
- Result := TChannelPrefs(FChannelList[Index]);
-end;
-
-function TBottlePrefs.GetDefChannelPref: TChannelPrefs;
-begin
- Result := FDefChannelPref;
+ FAutoJoinChannels.Free;
end;
procedure TBottlePrefs.SetAutoStart(const Value: boolean);
FWhenShiftReturn := Value;
end;
-{ TChannnelPrefs }
-
-procedure TChannelPrefs.Load(AnIni: TIniFile; ChannelName: String;
- Default: boolean = false);
-var S: String;
-begin
- if not Default then S := 'CH_' + ChannelName else S := ChannelName;
- Self.ChannelName := ChannelName;
- UseChannelPrefs := AnIni.ReadBool(S, 'UseChannelPrefs', false);
- SoundArrived := TSoundArrived(AnIni.ReadInteger(S, 'SoundArrived', 0));
- SoundFile := AnIni.ReadString(S, 'SoundFile', '');
- TargetGhost := AnIni.ReadString(S, 'TargetGhost', '');
- IgnoreIfGhost := AnIni.ReadBool(S, 'IgnoreIfGhost', false);
- CanAutoAdd := AnIni.ReadBool(S, 'CanAutoAdd', false);
- WarnPost := AnIni.ReadBool(S, 'WarnPost', false);
-end;
-
-procedure TChannelPrefs.Save(AnIni: TIniFile; Default: boolean = false);
-var S: String;
-begin
- if not Default then S := 'CH_' + ChannelName else S := ChannelName;
- AnIni.WriteBool(S, 'UseChannelPrefs', UseChannelPrefs);
- AnIni.WriteInteger(S, 'SoundArrived', Ord(SoundArrived));
- AnIni.WriteString(s, 'SoundFile', SoundFile);
- AnIni.WriteString(S, 'TargetGhost', TargetGhost);
- AnIni.WriteBool(S, 'IgnoreIfGhost', IgnoreIfGhost);
- AnIni.WriteBool(S, 'CanAutoAdd', CanAutoAdd);
- AnIni.WriteBool(S, 'WarnPost', WarnPost);
-end;
-
-procedure TChannelPrefs.SetCanAutoAdd(const Value: boolean);
-begin
- FCanAutoAdd := Value;
-end;
-
-procedure TChannelPrefs.SetChannelName(const Value: String);
-begin
- FChannelName := Value;
-end;
-
-procedure TChannelPrefs.SetIgnoreIfGhost(const Value: boolean);
-begin
- FIgnoreIfGhost := Value;
-end;
-
-procedure TChannelPrefs.SetSoundArrived(const Value: TSoundArrived);
-begin
- FSoundArrived := Value;
-end;
-
-procedure TChannelPrefs.SetSoundFile(const Value: String);
-begin
- FSoundFile := Value;
-end;
-
-procedure TChannelPrefs.SetTargetGhost(const Value: String);
-begin
- FTargetGhost := Value;
-end;
-
-procedure TChannelPrefs.SetUseChannelPrefs(const Value: boolean);
-begin
- FUseChannelPrefs := Value;
-end;
-
procedure TBottlePrefs.SetTalkColorS(const Value: TColor);
begin
FTalkColorS := Value;
FClearAfterSend := Value;
end;
+procedure TBottlePrefs.SetAutoJoinChannels(const Value: TStrings);
+begin
+ FAutoJoinChannels.Assign(Value);
+end;
+
{ TChannelListItem }
procedure TChannelListItem.SetGhost(const Value: String);
end;
end;
-procedure TChannelPrefs.SetWarnPost(const Value: boolean);
-begin
- FWarnPost := Value;
-end;
-
-
initialization
try
Application.Terminate;
end;
Pref := TBottlePrefs.Create;
+ChannelList := TChannelList.Create;
finalization
Pref.Free;
RegExp.Free;
+ChannelList.Clear;
+ChannelList.Free;
end.
actVoteMessage: TAction;
mnPopUpChannelTab: TPopupMenu;
mnLeaveThisChannel: TMenuItem;
- mnCanAutoAdd: TMenuItem;
N4: TMenuItem;
mnGotoVote: TMenuItem;
mnGotoGLog: TMenuItem;
btnSend: TButton;
btnConfirm: TButton;
btnClear: TButton;
- mnWarnPost: TMenuItem;
mnExitAllChannels: TMenuItem;
actAgreeMessage: TAction;
IdSLPP20: TIdSLPP20;
procedure tabChannelContextPopup(Sender: TObject; MousePos: TPoint;
var Handled: Boolean);
procedure mnLeaveThisChannelClick(Sender: TObject);
- procedure mnCanAutoAddClick(Sender: TObject);
procedure mnGotoVoteClick(Sender: TObject);
procedure mnGotoGLogClick(Sender: TObject);
procedure tabChannelMouseMove(Sender: TObject; Shift: TShiftState; X,
procedure tabChannelEndDrag(Sender, Target: TObject; X, Y: Integer);
procedure cbxTargetGhostDrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
- procedure mnWarnPostClick(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure actAgreeMessageExecute(Sender: TObject);
procedure actPrevGhostExecute(Sender: TObject);
//
FMutex: THandle; //Mutex\83I\83u\83W\83F\83N\83g\81c\93ñ\8fd\8bN\93®\96h\8e~\97p
//
- FChannelList: TChannelList; //\83`\83\83\83\93\83l\83\8b\83\8a\83X\83g\82ð\95Û\8e\9d\82·\82é
FJoinChannels: TStringList; //\8c»\8dÝ\93o\98^\82µ\82Ä\82¢\82é\83`\83\83\83\93\83l\83\8b
FJoinChannelsBackup: TStringList; //
FNowChannel: String; //\8c»\8dÝ\82Ì\83`\83\83\83\93\83l\83\8b
procedure BuildMenu(Root: TMenuItem; Event: TNotifyEvent; Simple: boolean);
procedure PlaySound(const FileName: String);
public
- function GetChannelPrefs(const ChannelName: String): TChannelPrefs;
function DoTrans(var Script: String;
Options: TScriptTransOptions): String;
procedure BeginConnect;
procedure EndConnect;
procedure ConstructMenu(Simple: boolean);
property Connecting: boolean read FConnecting write SetConnecting;
- property ChannelList: TChannelList read FChannelList;
function SetHWndToFavoriteGhost(const Ghost: String): String;
function GhostNameToSetName(const Ghost: String): String;
procedure PostCommand(const Command: array of String); overload;
Ghost := cbxTargetGhost.Text
end else begin
if FNowChannel <> '' then
- Ghost := FChannelList.Channel[FNowChannel].Ghost;
+ Ghost := ChannelList.Channel[FNowChannel].Ghost;
end;
Ghost := SetHWndToFavoriteGhost(Ghost);
DirectSstp.SstpSender := 'SSTP Bottle -\81y\8am\94F\81z';
end;
//\83`\83\83\83\93\83l\83\8b\83\8a\83X\83g
- FChannelList := TChannelList.Create;
FJoinChannels := TStringList.Create;
FCueGhost := TID2Ghost.Create;
Bottom := Self.Top + Self.Height - 1;
end;
- if FChannelList <> nil then begin
- FChannelList.Clear;
- FChannelList.Free;
- end;
if FJoinChannels <> nil then FJoinChannels.Free;
if FJoinChannelsBackup <> nil then FJoinChannelsBackup.Free;
if FCueGhost <> nil then FCueGhost.Free;
'\83\81\83j\83\85\81[\82©\82ç\81u\83`\83\83\83\93\83l\83\8b\8eQ\89Á\81v\82ð\8ds\82Á\82Ä\82\82¾\82³\82¢\81B');
Exit;
end;
- if FChannelList.Channel[FNowChannel].NoPost then begin
+ if ChannelList.Channel[FNowChannel].NoPost then begin
Beep;
ShowMessage(FNowChannel + ' \82Í\8eó\90M\90ê\97p\82Å\82·');
Exit;
if frmConfirmSend.cbxDontAlertAnyMore.Checked then Pref.NoConfirm := true;
frmConfirmSend.Release;
end;
- if Pref.ChannelPref[FNowChannel].WarnPost then begin
- if MessageDlg('''' + FNowChannel + '''\83`\83\83\83\93\83l\83\8b\82É\93\8a\8de\82µ\82æ\82¤\82Æ\82µ\82Ä\82¢\82Ü\82·\81B',
- mtConfirmation, mbOkCancel, 0) = mrCancel then
- Exit;
- end;
+ if MessageDlg(Format('\81u%s\81v\83`\83\83\83\93\83l\83\8b\82É\93\8a\8de\82µ\82æ\82¤\82Æ\82µ\82Ä\82¢\82Ü\82·\81B', [FNowChannel]),
+ mtConfirmation, mbOkCancel, 0) = mrCancel then Exit;
YenETrans;
Talk := GetScriptText;
Err := DoTrans(Talk, [toWarnMessySurface]);
SetChannel.Assign(FJoinChannelsBackup);
end else begin
//\8a®\91S\82É\8f\89\89ñ\8bN\93®\82Ì\8fê\8d\87\82Í\83v\83\8c\83t\83@\83\8c\83\93\83X\82©\82ç\93o\98^\95ª\82ð\8eæ\93¾
- for i := 0 to Pref.ChannelPrefCount-1 do begin
- if Pref.ChannelPrefIndex[i].CanAutoAdd then
- SetChannel.Add(Pref.ChannelPrefIndex[i].ChannelName);
+ for i := 0 to Pref.AutoJoinChannels.Count-1 do begin
+ if ChannelList.Channel[Pref.AutoJoinChannels[i]] <> nil then
+ SetChannel.Add(Pref.AutoJoinChannels[i]);
end;
end;
end else begin
- if frmChannelList.Execute(FChannelList, FJoinChannels) then begin
+ if frmChannelList.Execute(ChannelList, FJoinChannels) then begin
SetChannel := TStringList.Create;
SetChannel.Assign(frmChannelList.JoinList);
end;
end;
etChannelCount: begin
try
- FChannelList.Channel[HeadValue['Channel']].Members := StrToInt(HeadValue['Num']);
+ ChannelList.Channel[HeadValue['Channel']].Members := StrToInt(HeadValue['Num']);
except
end;
end;
WarningColor);
frmLog.AddCurrentSystemLog('SYSTEM', HeadValue['Channel'] + '\83`\83\83\83\93\83l\83\8b\82Í\94p\8e~\82³\82ê\82Ü\82µ\82½');
frmMessageBox.ShowMessage(HeadValue['Channel'] + '\83`\83\83\83\93\83l\83\8b\82Í\94p\8e~\82³\82ê\82Ü\82µ\82½');
- Pref.DeleteChannelPref(HeadValue['Channel']);
end;
etForceBroadcastInformation: begin
if HeadValue['Type'] = 'Vote' then begin
end;
end;
-function TfrmSender.GetChannelPrefs(
- const ChannelName: String): TChannelPrefs;
-begin
- Result := Pref.ChannelPref[ChannelName];
- if Result = nil then Result := Pref.DefChannelPref;
- if Result.UseChannelPrefs = false then Result := Pref.DefChannelPref;
-end;
-
procedure TfrmSender.UpdateChannelInfo(Dat: THeadValue);
var i: integer;
Ch: TChannelListItem;
begin
- FChannelList.Clear;
+ ChannelList.Clear;
for i := 1 to Dat.IntData['Count'] do begin
Ch := TChannelListItem.Create;
Ch.Name := Dat[Format('CH%d_name', [i])];
Ch.NoPost := Dat[Format('CH%d_nopost', [i])] = '1';
Ch.Members := Dat.IntData[Format('CH%d_count', [i])];
Ch.WarnPost:= Dat[Format('CH%d_warnpost', [i])] = '1';
- FChannelList.Add(Ch);
- end;
- for i := 0 to FChannelList.Count-1 do begin
- //\8eæ\93¾\82µ\82½\83`\83\83\83\93\83l\83\8b\82Ì\82¤\82¿\90V\8bK\82Ì\82à\82Ì\82ð\83`\83\83\83\93\83l\83\8b\90Ý\92è\83\8a\83X\83g\82Å\8dì\90¬
- if Pref.ChannelPref[FChannelList.ChannelItem[i].Name] = nil then begin
- Pref.CreateChannelPref(FChannelList.ChannelItem[i].Name);
- end;
- end;
- for i := Pref.ChannelPrefCount-1 downto 0 do begin
- //\8eæ\93¾\82µ\82½\83`\83\83\83\93\83l\83\8b\82É\82Í\91¶\8dÝ\82µ\82È\82¢\83`\83\83\83\93\83l\83\8b\90Ý\92è\82ð\8dí\8f\9c
- if FChannelList.Channel[Pref.ChannelPrefIndex[i].ChannelName] = nil then
- Pref.DeleteChannelPref(Pref.ChannelPrefIndex[i].ChannelName);
+ ChannelList.Add(Ch);
end;
UpdateLayout;
end;
Tabs.Clear;
for i := 0 to FJoinChannels.Count-1 do begin
//\8eó\90M\90ê\97p\83`\83\83\83\93\83l\83\8b\82Í\95\\8e¦\82µ\82È\82¢
- if not FChannelList.Channel[FJoinChannels[i]].NoPost then
+ if not ChannelList.Channel[FJoinChannels[i]].NoPost then
Tabs.Add(FJoinChannels[i]);
end;
Tabs.EndUpdate;
if Dat['IfGhost'] <> '' then begin
Ghost := Dat['IfGhost'];
end else begin
- Ghost := GetChannelPrefs(Channel).TargetGhost;
- if FChannelList.Channel[Channel] <> nil then
- Ghost := FChannelList.Channel[Channel].Ghost;
+ if ChannelList.Channel[Channel] <> nil then
+ Ghost := ChannelList.Channel[Channel].Ghost;
end;
Event.Data['TargetGhost'] := Ghost;
with tabChannel.Canvas do begin
FillRect(Rect);
if Active then begin
- //Font.Style := Font.Style + [fsBold];
- if Pref.ChannelPref[FNowChannel].WarnPost then
- Font.Color := clRed
- else
- Font.Color := clBlue;
+ Font.Color := clBlue;
end else begin
Font.Style := Font.Style - [fsBold];
Font.Color := clWindowText;
end;
- if Pref.ChannelPref[tabChannel.Tabs[TabIndex]].WarnPost then
- Font.Style := Font.Style + [fsUnderline]
- else
- Font.Style := Font.Style - [fsUnderline];
X := (Rect.Left + Rect.Right) div 2;
X := X - TextWidth(tabChannel.Tabs[TabIndex]) div 2;
if tabChannel.TabPosition = tpTop then
Tag := IndexOfTabAt(MousePos.X, MousePos.Y);
if Tag < 0 then Handled := true;
Ch := Tabs[Tag];
- mnCanAutoAdd.Checked := Pref.ChannelPref[Ch].CanAutoAdd;
- mnWarnPost.Checked := Pref.ChannelPref[Ch].WarnPost;
end;
end;
end;
end;
-procedure TfrmSender.mnCanAutoAddClick(Sender: TObject);
-var Ch: String;
-begin
- with tabChannel do begin
- Ch := Tabs[Tag];
- Pref.ChannelPref[Ch].CanAutoAdd := not mnCanAutoAdd.Checked;
- end;
-end;
-
procedure TfrmSender.mnGotoVoteClick(Sender: TObject);
begin
ShellExecute(Handle, 'open', PChar(Pref.VotePage), nil, nil, SW_SHOW);
with tabChannel do begin
Index := IndexOfTabAt(X, Y);
Ch := Tabs[Index];
- Hint := Ch + ': ' + IntToStr(FChannelList.Channel[Ch].Members) + '\90l';
+ Hint := Ch + ': ' + IntToStr(ChannelList.Channel[Ch].Members) + '\90l';
end;
end;
end;
end;
-procedure TfrmSender.mnWarnPostClick(Sender: TObject);
-var Ch: String;
-begin
- with tabChannel do begin
- Ch := Tabs[Tag];
- Pref.ChannelPref[Ch].WarnPost := not mnWarnPost.Checked;
- tabChannel.Repaint;
- end;
-end;
-
procedure TfrmSender.FormCloseQuery(Sender: TObject;
var CanClose: Boolean);
begin
mbOkCancel, 0) = mrCancel then CanClose := false;
end;
-
procedure TfrmSender.UpdateIfGhostBox;
var
Selected: String;