public FormSettings(IceChatOptions Options, IceChatFontSetting Fonts, IceChatEmoticon Emoticons, IceChatSounds Sounds) { InitializeComponent(); this.iceChatOptions = Options; this.iceChatFonts = Fonts; this.iceChatEmoticons = Emoticons; this.iceChatSounds = Sounds; LoadSettings(); this.Activated += new EventHandler(OnActivated); this.textNickComplete.KeyDown += new KeyEventHandler(OnKeyDown); pictureTSHelp.Image = StaticMethods.LoadResourceImage("help.png"); pictureTSHelp.Click += new EventHandler(pictureTSHelp_Click); }
public FormSettings(IceChatOptions Options, IceChatFontSetting Fonts, IceChatEmoticon Emoticons, IceChatSounds Sounds, bool showFonts) { InitializeComponent(); this.iceChatOptions = Options; this.iceChatFonts = Fonts; this.iceChatEmoticons = Emoticons; this.iceChatSounds = Sounds; LoadSettings(); this.Activated += new EventHandler(OnActivated); if (showFonts == true) { tabControlOptions.SelectedTab = tabFonts; } }
private void LoadOptions() { if (File.Exists(optionsFile)) { XmlSerializer deserializer = new XmlSerializer(typeof(IceChatOptions)); TextReader textReader = new StreamReader(optionsFile); iceChatOptions = (IceChatOptions)deserializer.Deserialize(textReader); textReader.Close(); textReader.Dispose(); } else { //create default settings iceChatOptions = new IceChatOptions(); SaveOptions(); } }
/* private enum FontType { Console = 0, Channel = 1, Query = 2, NickList = 3, ServerList = 4, InputBox = 5, ChannelBar = 6 } */ public FormSettings(IceChatOptions Options, IceChatFontSetting Fonts, IceChatEmoticon Emoticons, IceChatSounds Sounds) { InitializeComponent(); /* listBoxSounds.Items.Add("New Message in Console"); listBoxSounds.Items.Add("New Channel Message"); listBoxSounds.Items.Add("New Private Message"); listBoxSounds.Items.Add("New User Notice"); listBoxSounds.Items.Add("Your Nickname is said in a Channel"); listBoxSounds.Items.Add("Your Nickname is said in a Private Message"); listBoxSounds.Items.Add("A Buddy has come Online"); listBoxSounds.Items.Add("Server Disconnection"); */ foreach(IceChatSounds.SoundEntry x in Sounds.soundList) { listBoxSounds.Items.Add(x.Description); } this.iceChatOptions = Options; this.iceChatFonts = Fonts; this.iceChatEmoticons = Emoticons; this.iceChatSounds = Sounds; this.listViewEmot.MouseDown += new MouseEventHandler(listViewEmot_MouseDown); this.listViewEmot.MouseUp += new MouseEventHandler(listViewEmot_MouseUp); //populate the font settings textConsoleFont.Font = new Font(iceChatFonts.FontSettings[0].FontName, 10); textConsoleFont.Text = iceChatFonts.FontSettings[0].FontName; textConsoleFontSize.Text = iceChatFonts.FontSettings[0].FontSize.ToString(); textChannelFont.Font = new Font(iceChatFonts.FontSettings[1].FontName, 10); textChannelFont.Text = iceChatFonts.FontSettings[1].FontName; textChannelFontSize.Text = iceChatFonts.FontSettings[1].FontSize.ToString(); textQueryFont.Font = new Font(iceChatFonts.FontSettings[2].FontName, 10); textQueryFont.Text = iceChatFonts.FontSettings[2].FontName; textQueryFontSize.Text = iceChatFonts.FontSettings[2].FontSize.ToString(); textNickListFont.Font = new Font(iceChatFonts.FontSettings[3].FontName, 10); textNickListFont.Text = iceChatFonts.FontSettings[3].FontName; textNickListFontSize.Text= iceChatFonts.FontSettings[3].FontSize.ToString(); textServerListFont.Font = new Font(iceChatFonts.FontSettings[4].FontName, 10); textServerListFont.Text = iceChatFonts.FontSettings[4].FontName; textServerListFontSize.Text = iceChatFonts.FontSettings[4].FontSize.ToString(); textInputFont.Font = new Font(iceChatFonts.FontSettings[5].FontName, 10); textInputFont.Text = iceChatFonts.FontSettings[5].FontName; textInputFontSize.Text = iceChatFonts.FontSettings[5].FontSize.ToString(); textDockTabFont.Font = new Font(iceChatFonts.FontSettings[6].FontName, 10); textDockTabFont.Text = iceChatFonts.FontSettings[6].FontName; textDockTabSize.Text = iceChatFonts.FontSettings[6].FontSize.ToString(); textMenuBarFont.Font = new Font(iceChatFonts.FontSettings[7].FontName, 10); textMenuBarFont.Text = iceChatFonts.FontSettings[7].FontName; textMenuBarSize.Text = iceChatFonts.FontSettings[7].FontSize.ToString(); //populate the settings textTimeStamp.Text = iceChatOptions.TimeStamp; checkSaveWindowPosition.Checked = iceChatOptions.SaveWindowPosition; checkLogConsole.Checked = iceChatOptions.LogConsole; checkLogChannel.Checked = iceChatOptions.LogChannel; checkLogQuery.Checked = iceChatOptions.LogQuery; checkSeperateLogs.Checked = iceChatOptions.SeperateLogs; comboLogFormat.Text = iceChatOptions.LogFormat; checkExternalPlayCommand.Checked = iceChatOptions.SoundUseExternalCommand; textExternalPlayCommand.Text = iceChatOptions.SoundExternalCommand; if (iceChatEmoticons != null) { //load in the emoticons foreach (EmoticonItem emot in iceChatEmoticons.listEmoticons) { Bitmap bm = new Bitmap(FormMain.Instance.EmoticonsFolder + System.IO.Path.DirectorySeparatorChar + emot.EmoticonImage); int i = imageListEmoticons.Images.Add(bm, Color.Fuchsia); ListViewItem lvi = new ListViewItem(emot.Trigger, i); lvi.SubItems.Add(emot.EmoticonImage); listViewEmot.Items.Add(lvi); } } checkEmoticons.Checked = iceChatOptions.ShowEmoticons; checkEmoticonPicker.Checked = iceChatOptions.ShowEmoticonPicker; checkColorPicker.Checked = iceChatOptions.ShowColorPicker; checkStatusBar.Checked = iceChatOptions.ShowStatusBar; checkDisableQueries.Checked = iceChatOptions.DisableQueries; checkNewQueryForegound.Checked = iceChatOptions.NewQueryForegound; checkWhoisNewQuery.Checked = iceChatOptions.WhoisNewQuery; checkShowUnreadLine.Checked = iceChatOptions.ShowUnreadLine; checkMinimizeTray.Checked = iceChatOptions.MinimizeToTray; textMaximumLines.Text = iceChatOptions.MaximumTextLines.ToString(); checkShowNickHost.Checked = iceChatOptions.ShowNickHost; checkNickShowButtons.Checked = iceChatOptions.ShowNickButtons; checkServerShowButtons.Checked = iceChatOptions.ShowServerButtons; checkKickChannelOpen.Checked = iceChatOptions.ChannelOpenKick; //dcc settings checkAutoDCCChat.Checked = iceChatOptions.DCCChatAutoAccept; checkAutoDCCFile.Checked = iceChatOptions.DCCFileAutoAccept; checkIgnoreDCCChat.Checked = iceChatOptions.DCCChatIgnore; checkIgnoreDCCFile.Checked = iceChatOptions.DCCFileIgnore; textDCCChatTimeout.Text = iceChatOptions.DCCChatTimeOut.ToString(); textDCCPortLow.Text = iceChatOptions.DCCPortLower.ToString(); textDCCPortHigh.Text = iceChatOptions.DCCPortUpper.ToString(); textDCCReceiveFolder.Text = iceChatOptions.DCCReceiveFolder; textDCCSendFolder.Text = iceChatOptions.DCCSendFolder; textDCCLocalIP.Text = iceChatOptions.DCCLocalIP; comboBufferSize.Text = iceChatOptions.DCCBufferSize.ToString(); checkAutoGetLocalIP.Checked = iceChatOptions.DCCAutogetRouterIP; //load any plugin addons foreach (IPluginIceChat ipc in FormMain.Instance.IceChatPlugins) { if (ipc.Enabled == true) ipc.LoadSettingsForm(this.tabControlOptions); } comboBoxLanguage.DataSource = FormMain.Instance.IceChatLanguageFiles; comboBoxLanguage.SelectedItem = FormMain.Instance.IceChatCurrentLanguageFile; //Event Settings comboJoinEvent.SelectedIndex = iceChatOptions.JoinEventLocation; comboPartEvent.SelectedIndex = iceChatOptions.PartEventLocation; comboQuitEvent.SelectedIndex = iceChatOptions.QuitEventLocation; comboModeEvent.SelectedIndex = iceChatOptions.ModeEventLocation; comboKickEvent.SelectedIndex = iceChatOptions.KickEventLocation; comboTopicEvent.SelectedIndex = iceChatOptions.TopicEventLocation; comboChannelMessageEvent.SelectedIndex = iceChatOptions.ChannelMessageEventLocation; comboChannelActionEvent.SelectedIndex = iceChatOptions.ChannelActionEventLocation; comboWhoisEvent.SelectedIndex = iceChatOptions.WhoisEventLocation; trackTransparency.Value = Convert.ToInt32(FormMain.Instance.Opacity * 100); ApplyLanguage(); player = new System.Media.SoundPlayer(); }