OSDN Git Service

Removed All Channel Preference Codes
authornaru <bottle@mikage.to>
Sat, 4 Jan 2003 05:56:34 +0000 (05:56 +0000)
committernaru <bottle@mikage.to>
Sat, 4 Jan 2003 05:56:34 +0000 (05:56 +0000)
bottleclient/BottleDef.pas
bottleclient/LogForm.pas
bottleclient/MainForm.dfm
bottleclient/MainForm.pas

index 43348a3..aa76d49 100755 (executable)
@@ -14,53 +14,11 @@ type
   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;
@@ -113,6 +71,7 @@ type
     FTalkColorS: TColor;
     FLogWindowColumnWidth: String;
     FClearAfterSend: boolean;
+    FAutoJoinChannels: TStrings;
     procedure SetColorScript(const Value: boolean);
     procedure SetColorTimeLagValue(const Value: integer);
     procedure SetDblClkInsert(const Value: boolean);
@@ -137,10 +96,6 @@ type
     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);
@@ -161,8 +116,7 @@ type
     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;
@@ -209,13 +163,10 @@ type
     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;
@@ -288,6 +239,8 @@ type
 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Ô
 
@@ -326,27 +279,14 @@ implementation
 
 { 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);
@@ -407,21 +347,8 @@ begin
     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);
@@ -452,35 +379,6 @@ begin
   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
@@ -523,11 +421,8 @@ 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);
@@ -545,36 +440,7 @@ begin
   //
   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);
@@ -785,71 +651,6 @@ begin
   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;
@@ -865,6 +666,11 @@ begin
   FClearAfterSend := Value;
 end;
 
+procedure TBottlePrefs.SetAutoJoinChannels(const Value: TStrings);
+begin
+  FAutoJoinChannels.Assign(Value);
+end;
+
 { TChannelListItem }
 
 procedure TChannelListItem.SetGhost(const Value: String);
@@ -955,12 +761,6 @@ begin
     end;
 end;
 
-procedure TChannelPrefs.SetWarnPost(const Value: boolean);
-begin
-  FWarnPost := Value;
-end;
-
-
 initialization
 
 try
@@ -970,10 +770,13 @@ except
   Application.Terminate;
 end;
 Pref := TBottlePrefs.Create;
+ChannelList := TChannelList.Create;
 
 finalization
 
 Pref.Free;
 RegExp.Free;
+ChannelList.Clear;
+ChannelList.Free;
 
 end.
index 5fb1c07..cb54d37 100755 (executable)
@@ -295,14 +295,10 @@ begin
   if Pref.FixMessySurface then Opt := Opt + [toFixMessySurface];
   frmSender.DoTrans(Script, Opt);
 
-  Ghost := frmSender.GetChannelPrefs(Log.Channel).TargetGhost;
-  if Ghost = '' then //\83`\83\83\83\93\83l\83\8b\8ew\92è\83S\81[\83X\83g
-    if frmSender.ChannelList.Channel[Log.Channel] <> nil then
-      Ghost := frmSender.ChannelList.Channel[Log.Channel].Ghost;
+  if ChannelList.Channel[Log.Channel] <> nil then
+    Ghost := ChannelList.Channel[Log.Channel].Ghost;
   //\96Ú\95W\83S\81[\83X\83g\8c\88\92è
   if Log.Ghost <> '' then Ghost := Log.Ghost;
-  if frmSender.GetChannelPrefs(Log.Channel).IgnoreIfGhost then
-    Ghost := frmSender.GetChannelPrefs(Log.Channel).TargetGhost;
   //\83^\81[\83Q\83b\83g\83S\81[\83X\83g\8am\92è
   Ghost := frmSender.SetHWndToFavoriteGhost(Ghost);
   frmSender.DirectSstp.SstpSender := 'SSTP Bottle -\81y\83\8d\83O\8dÄ\90\81z';
index cb75979..51630be 100755 (executable)
@@ -2187,14 +2187,6 @@ object frmSender: TfrmSender
       Caption = #12371#12398#12481#12515#12531#12493#12523#12363#12425#25244#12369#12427
       OnClick = mnLeaveThisChannelClick
     end
-    object mnCanAutoAdd: TMenuItem
-      Caption = #12371#12398#12481#12515#12531#12493#12523#12399#33258#21205#21152#20837#12398#23550#35937
-      OnClick = mnCanAutoAddClick
-    end
-    object mnWarnPost: TMenuItem
-      Caption = #12371#12398#12481#12515#12531#12493#12523#12395#25237#31295#12377#12427#12392#12365#30906#35469#12377#12427
-      OnClick = mnWarnPostClick
-    end
   end
   object IdSLPP20: TIdSLPP20
     MaxLineAction = maException
index ff79fc0..b0a08a2 100755 (executable)
@@ -119,7 +119,6 @@ type
     actVoteMessage: TAction;
     mnPopUpChannelTab: TPopupMenu;
     mnLeaveThisChannel: TMenuItem;
-    mnCanAutoAdd: TMenuItem;
     N4: TMenuItem;
     mnGotoVote: TMenuItem;
     mnGotoGLog: TMenuItem;
@@ -127,7 +126,6 @@ type
     btnSend: TButton;
     btnConfirm: TButton;
     btnClear: TButton;
-    mnWarnPost: TMenuItem;
     mnExitAllChannels: TMenuItem;
     actAgreeMessage: TAction;
     IdSLPP20: TIdSLPP20;
@@ -202,7 +200,6 @@ type
     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,
@@ -216,7 +213,6 @@ type
     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);
@@ -246,7 +242,6 @@ type
     //
     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
@@ -284,7 +279,6 @@ type
     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;
@@ -292,7 +286,6 @@ type
     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;
@@ -369,7 +362,7 @@ begin
     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';
@@ -456,7 +449,6 @@ begin
   end;
 
   //\83`\83\83\83\93\83l\83\8b\83\8a\83X\83g
-  FChannelList := TChannelList.Create;
   FJoinChannels := TStringList.Create;
   FCueGhost := TID2Ghost.Create;
 
@@ -476,10 +468,6 @@ begin
     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;
@@ -544,7 +532,7 @@ begin
       '\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;
@@ -555,11 +543,8 @@ begin
     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]);
@@ -725,13 +710,13 @@ begin
             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;
@@ -1313,7 +1298,7 @@ begin
       end;
       etChannelCount: begin
         try
-          FChannelList.Channel[HeadValue['Channel']].Members := StrToInt(HeadValue['Num']);
+          ChannelList.Channel[HeadValue['Channel']].Members := StrToInt(HeadValue['Num']);
         except
         end;
       end;
@@ -1344,7 +1329,6 @@ begin
                       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
@@ -1443,19 +1427,11 @@ 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])];
@@ -1464,18 +1440,7 @@ begin
     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;
@@ -1545,7 +1510,7 @@ begin
     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;
@@ -1663,9 +1628,8 @@ begin
   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;
 
@@ -1835,19 +1799,11 @@ begin
   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
@@ -1906,8 +1862,6 @@ begin
     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;
 
@@ -1949,15 +1903,6 @@ begin
   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);
@@ -1976,7 +1921,7 @@ begin
   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;
 
@@ -2077,16 +2022,6 @@ begin
   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
@@ -2095,7 +2030,6 @@ begin
                 mbOkCancel, 0) = mrCancel then CanClose := false;
 end;
 
-
 procedure TfrmSender.UpdateIfGhostBox;
 var
   Selected: String;