Exemple #1
0
        protected override bool ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData)
        {
            if ((keyData == (Keys.Control | Keys.V)) || keyData == (Keys.Shift | Keys.Insert))
            {
                // have the ability for the plugin processor to intercept this
                string data = Clipboard.GetText(TextDataFormat.UnicodeText);

                PluginArgs args = new PluginArgs(FormMain.Instance.InputPanel.CurrentConnection)
                {
                    Extra   = this.Text,
                    Message = data    // add the clipboard data to the clipboard
                };

                foreach (Plugin p in FormMain.Instance.LoadedPlugins)
                {
                    IceChatPlugin ipc = p as IceChatPlugin;
                    if (ipc != null)
                    {
                        if (ipc.plugin.Enabled == true)
                        {
                            args = ipc.plugin.HotKey(args, new KeyEventArgs(Keys.Control | Keys.V));
                        }
                    }
                }

                if (args.Message.Length == 0)
                {
                    // dont paste, exit
                    return(true);
                }

                string[] lines = data.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
                if (lines.Length > 1)
                {
                    if (base.Multiline == true)
                    {
                        this.AppendText(data);
                    }
                    else
                    {
                        OnCommand(this, data);
                    }
                    return(true);
                }
            }

            if (keyData == Keys.Tab)
            {
                NickComplete();
                return(true);
            }
            else
            {
                _nickNumber = -1;
            }

            return(false);
        }
Exemple #2
0
        private void FormEditor_Activated(object sender, EventArgs e)
        {
            //load any plugin addons
            foreach (Plugin p in FormMain.Instance.LoadedPlugins)
            {
                IceChatPlugin ipc = p as IceChatPlugin;
                if (ipc != null)
                {
                    if (ipc.plugin.Enabled == true)
                    {
                        ipc.plugin.LoadEditorForm(this.tabControlEditor, this.menuStripMain);
                    }
                }
            }

            this.Activated -= FormEditor_Activated;
        }
Exemple #3
0
        private void OnActivated(object sender, EventArgs e)
        {
            //load any plugin addons
            foreach (Plugin p in FormMain.Instance.LoadedPlugins)
            {
                IceChatPlugin ipc = p as IceChatPlugin;
                if (ipc != null)
                {
                    if (ipc.plugin.Enabled == true)
                    {
                        ipc.plugin.LoadSettingsForm(this.tabControlOptions);
                    }
                }
            }

            this.Activated -= OnActivated;
        }
Exemple #4
0
        private void SaveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //save all the settings
            try
            {
                textAliases.Text = ReplaceCharsXml(textAliases.Text);

                //parse out all the aliases

                aliasList.listAliases.Clear();

                string[] aliases = textAliases.Text.Trim().Split(new String[] { Environment.NewLine }, StringSplitOptions.None);

                bool      isMultiLine    = false;
                AliasItem multiLineAlias = null;
                string    aliasCommands  = "";

                foreach (string alias in aliases)
                {
                    if (alias.Length > 0)
                    {
                        //check if it is a multilined alias
                        if (alias.EndsWith("{") && !isMultiLine)
                        {
                            //start of a multilined alias
                            isMultiLine    = true;
                            multiLineAlias = new AliasItem
                            {
                                AliasName = alias.Substring(0, alias.IndexOf(' '))
                            };
                            aliasCommands = "";
                        }
                        else if (alias == "}")
                        {
                            //end of multiline alias
                            isMultiLine            = false;
                            multiLineAlias.Command = aliasCommands.Split(new String[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
                            aliasList.AddAlias(multiLineAlias);
                            multiLineAlias = null;
                        }
                        else if (!isMultiLine)
                        {
                            //just a normal alias
                            AliasItem a = new AliasItem
                            {
                                AliasName = alias.Substring(0, alias.IndexOf(' ')),
                                Command   = new String[] { alias.Substring(alias.IndexOf(' ') + 1) }
                            };
                            aliasList.AddAlias(a);
                            a = null;
                        }
                        else
                        {
                            //add a line to the multiline alias
                            aliasCommands += alias + Environment.NewLine;
                        }
                    }
                }

                FormMain.Instance.IceChatAliases = aliasList;

                //save the current popup menu
                UpdateCurrentPopupMenus();

                //save any plugin addons for the Script Editor
                foreach (Plugin p in  FormMain.Instance.LoadedPlugins)
                {
                    IceChatPlugin ipc = p as IceChatPlugin;
                    if (ipc != null)
                    {
                        if (ipc.plugin.Enabled == true)
                        {
                            ipc.plugin.SaveEditorForm();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                FormMain.Instance.WindowMessage(FormMain.Instance.InputPanel.CurrentConnection, "Console", "\x000304SaveEditor Error:" + ex.Message + ":" + ex.Source, "", true);
            }
            finally
            {
                this.Close();
            }
        }
Exemple #5
0
        private void buttonSave_Click(object sender, EventArgs e)
        {
            //set all the options accordingly

            iceChatOptions.SaveWindowPosition = checkSaveWindowPosition.Checked;
            iceChatOptions.TimeStamp          = textTimeStamp.Text.Replace(((char)3).ToString(), "").Replace(((char)2).ToString(), "");;
            iceChatOptions.ShowTimeStamp      = checkTimeStamp.Checked;
            iceChatOptions.AutoJoinInvite     = checkJoinInvite.Checked;

            iceChatOptions.LogConsole   = checkLogConsole.Checked;
            iceChatOptions.LogChannel   = checkLogChannel.Checked;
            iceChatOptions.LogQuery     = checkLogQuery.Checked;
            iceChatOptions.LogWindow    = checkLogWindow.Checked;
            iceChatOptions.SeperateLogs = checkSeperateLogs.Checked;
            iceChatOptions.LogFormat    = comboLogFormat.Text;
            iceChatOptions.LogFolder    = labelCurrentLogFolder.Text;
            iceChatOptions.LogReload    = checkReloadLogs.Checked;

            iceChatOptions.WindowedMode       = checkWindowedMode.Checked;
            iceChatOptions.ShowEmoticons      = checkEmoticons.Checked;
            iceChatOptions.ShowEmoticonPicker = checkEmoticonPicker.Checked;
            iceChatOptions.ShowColorPicker    = checkColorPicker.Checked;
            iceChatOptions.ShowBasicCommands  = checkBasicCommands.Checked;
            iceChatOptions.ShowSendButton     = checkShowSend.Checked;
            iceChatOptions.ShowStatusBar      = checkStatusBar.Checked;
            iceChatOptions.DisableQueries     = checkDisableQueries.Checked;
            iceChatOptions.NewQueryForegound  = checkNewQueryForegound.Checked;
            iceChatOptions.WhoisNewQuery      = checkWhoisNewQuery.Checked;
            iceChatOptions.AskQuit            = checkAskQuit.Checked;
            iceChatOptions.SingleRowTabBar    = checkSingleRowCB.Checked;
            iceChatOptions.Transparency       = trackTransparency.Value;
            iceChatOptions.NickListSort       = checkSortNickList.Checked;
            //iceChatOptions.LineSpacing = (float)Convert.ToDouble( comboLineSpacing.Text );

            iceChatOptions.FlashTaskBarChannel       = checkFlashChannelMessage.Checked;
            iceChatOptions.FlashTaskBarChannelAction = checkFlashChannelAction.Checked;
            iceChatOptions.FlashTaskBarPrivate       = checkFlashPrivateMessage.Checked;
            iceChatOptions.FlashTaskBarPrivateAction = checkFlashPrivateAction.Checked;

            iceChatOptions.FlashTaskBarNumber          = Convert.ToInt32(textFlashTaskbarNumber.Text);
            iceChatOptions.FlashServerTreeIcons        = checkFlashChannel.Checked;
            iceChatOptions.FlashServerTreeIconsPrivate = checkFlashPrivate.Checked;

            iceChatOptions.MaximumTextLines           = Convert.ToInt32(textMaximumLines.Text);
            iceChatOptions.NickCompleteAfter          = textNickComplete.Text.Replace(((char)3).ToString(), "").Replace(((char)2).ToString(), "");
            iceChatOptions.ShowNickHost               = checkShowNickHost.Checked;
            iceChatOptions.ShowNickButtons            = checkNickShowButtons.Checked;
            iceChatOptions.ShowServerButtons          = checkServerShowButtons.Checked;
            iceChatOptions.ChannelOpenKick            = checkKickChannelOpen.Checked;
            iceChatOptions.ShowUnreadLine             = checkShowUnreadLine.Checked;
            iceChatOptions.MinimizeToTray             = checkMinimizeTray.Checked;
            iceChatOptions.ShowSytemTrayIcon          = checkShowTrayIcon.Checked;
            iceChatOptions.ShowSytemTrayNotifications = checkShowTrayNotifications.Checked;
            iceChatOptions.SystemTrayText             = textSystemTrayText.Text;
            iceChatOptions.SystemTrayIcon             = textSystemTrayIcon.Text;

            iceChatOptions.SystemTrayServerMessage = checkTrayServerMessage.Checked;
            iceChatOptions.SystemTrayBuddyOnline   = checkTrayBuddyOnline.Checked;

            iceChatOptions.Language  = ((LanguageItem)comboBoxLanguage.SelectedItem).LanguageName;
            iceChatOptions.ShowTopic = checkTopicBar.Checked;

            //set all the fonts
            iceChatFonts.FontSettings[0].FontName = textConsoleFont.Text;
            iceChatFonts.FontSettings[0].FontSize = float.Parse(textConsoleFontSize.Text);

            iceChatFonts.FontSettings[1].FontName = textChannelFont.Text;
            iceChatFonts.FontSettings[1].FontSize = float.Parse(textChannelFontSize.Text);

            iceChatFonts.FontSettings[2].FontName = textQueryFont.Text;
            iceChatFonts.FontSettings[2].FontSize = float.Parse(textQueryFontSize.Text);

            iceChatFonts.FontSettings[3].FontName = textNickListFont.Text;
            iceChatFonts.FontSettings[3].FontSize = float.Parse(textNickListFontSize.Text);

            iceChatFonts.FontSettings[4].FontName = textServerListFont.Text;
            iceChatFonts.FontSettings[4].FontSize = float.Parse(textServerListFontSize.Text);

            iceChatFonts.FontSettings[5].FontName = textInputFont.Text;
            iceChatFonts.FontSettings[5].FontSize = float.Parse(textInputFontSize.Text);

            iceChatFonts.FontSettings[6].FontName = textDockTabFont.Text;
            iceChatFonts.FontSettings[6].FontSize = float.Parse(textDockTabSize.Text);

            iceChatFonts.FontSettings[7].FontName = textMenuBarFont.Text;
            iceChatFonts.FontSettings[7].FontSize = float.Parse(textMenuBarSize.Text);

            iceChatFonts.FontSettings[8].FontName = textChannelBarFont.Text;
            iceChatFonts.FontSettings[8].FontSize = float.Parse(textChannelBarSize.Text);

            //dcc settings
            iceChatOptions.DCCChatAutoAccept          = checkAutoDCCChat.Checked;
            iceChatOptions.DCCFileAutoAccept          = checkAutoDCCFile.Checked;
            iceChatOptions.DCCChatAutoAcceptBuddyOnly = checkAutoDCCChatBuddy.Checked;
            iceChatOptions.DCCFileAutoAcceptBuddyOnly = checkAutoDCCFileBuddy.Checked;

            iceChatOptions.DCCChatIgnore      = checkIgnoreDCCChat.Checked;
            iceChatOptions.DCCFileIgnore      = checkIgnoreDCCFile.Checked;
            iceChatOptions.DCCChatTimeOut     = Convert.ToInt32(textDCCChatTimeout.Text);
            iceChatOptions.DCCPortLower       = Convert.ToInt32(textDCCPortLow.Text);
            iceChatOptions.DCCPortUpper       = Convert.ToInt32(textDCCPortHigh.Text);
            iceChatOptions.DCCReceiveFolder   = textDCCReceiveFolder.Text;
            iceChatOptions.DCCSendFolder      = textDCCSendFolder.Text;
            iceChatOptions.DCCLocalIP         = textDCCLocalIP.Text;
            iceChatOptions.DCCBufferSize      = Convert.ToInt32(comboBufferSize.Text);
            iceChatOptions.DCCAutogetRouterIP = checkAutoGetLocalIP.Checked;

            //save the emoticons
            iceChatEmoticons.listEmoticons.Clear();
            //re-add them all back in
            int i = 0;

            foreach (ListViewItem lvi in listViewEmot.Items)
            {
                EmoticonItem ei = new EmoticonItem();
                ei.EmoticonImage = lvi.SubItems[1].Text;
                ei.Trigger       = lvi.Text;
                ei.ID            = i++;
                iceChatEmoticons.AddEmoticon(ei);
            }

            FormMain.Instance.IceChatEmoticons = iceChatEmoticons;

            // apply language change
            FormMain.Instance.IceChatCurrentLanguageFile = (LanguageItem)comboBoxLanguage.SelectedItem;

            //Event Settings
            iceChatOptions.JoinEventLocation           = comboJoinEvent.SelectedIndex;
            iceChatOptions.PartEventLocation           = comboPartEvent.SelectedIndex;
            iceChatOptions.QuitEventLocation           = comboQuitEvent.SelectedIndex;
            iceChatOptions.ModeEventLocation           = comboModeEvent.SelectedIndex;
            iceChatOptions.KickEventLocation           = comboKickEvent.SelectedIndex;
            iceChatOptions.TopicEventLocation          = comboTopicEvent.SelectedIndex;
            iceChatOptions.ChannelMessageEventLocation = comboChannelMessageEvent.SelectedIndex;
            iceChatOptions.ChannelActionEventLocation  = comboChannelActionEvent.SelectedIndex;
            iceChatOptions.ChannelNoticeEventLocation  = comboChannelNoticeEvent.SelectedIndex;
            iceChatOptions.WhoisEventLocation          = comboWhoisEvent.SelectedIndex;
            iceChatOptions.NickChangeEventLocation     = comboNickEvent.SelectedIndex;

            iceChatOptions.ServerMessageEventLocation = comboServerMessageEvent.SelectedIndex;
            iceChatOptions.ServerNoticeEventLocation  = comboServerNoticeEvent.SelectedIndex;
            iceChatOptions.ServerErrorEventLocation   = comboServerErrorEvent.SelectedIndex;
            iceChatOptions.UserNoticeEventLocation    = comboUserNoticeEvent.SelectedIndex;

            iceChatOptions.SoundUseExternalCommand = checkExternalPlayCommand.Checked;
            iceChatOptions.SoundExternalCommand    = textExternalPlayCommand.Text;
            iceChatOptions.SoundPlayActive         = checkPlayActive.Checked;

            //away settings
            iceChatOptions.AwayCommand            = textAwayCommand.Text;
            iceChatOptions.ReturnCommand          = textReturnCommand.Text;
            iceChatOptions.SendAwayCommands       = checkSendAwayReturn.Checked;
            iceChatOptions.SendAwayPrivateMessage = checkAwayMessagePrivate.Checked;
            iceChatOptions.PrivateAwayMessage     = textAwayPrivateMessage.Text;
            iceChatOptions.AutoAway   = checkAutoAway.Checked;
            iceChatOptions.AutoReturn = checkAutoReturn.Checked;

            if (textAutoAwayMinutes.Text.Length == 0)
            {
                iceChatOptions.AutoAwayTime = 0;
                iceChatOptions.AutoAway     = false;
            }
            else
            {
                //check if value is an integer
                int result;
                if (Int32.TryParse(textAutoAwayMinutes.Text, out result))
                {
                    iceChatOptions.AutoAwayTime = result;
                }
                else
                {
                    iceChatOptions.AutoAwayTime = 0;
                    iceChatOptions.AutoAway     = false;
                }
            }

            iceChatOptions.AutoAwaySystemTray = checkAutoAwayTray.Checked;
            iceChatOptions.AutoAwayMessage    = textAutoAwayMessage.Text;

            iceChatOptions.AutoPerformStartupEnable = checkAutoPerformStartup.Checked;
            iceChatOptions.AutoPerformStartup       = textAutoPerformStartup.Text.Trim().Split(new String[] { Environment.NewLine }, StringSplitOptions.None);

            foreach (Plugin p in  FormMain.Instance.LoadedPlugins)
            {
                IceChatPlugin ipc = p as IceChatPlugin;
                if (ipc != null)
                {
                    if (ipc.plugin.Enabled == true)
                    {
                        ipc.plugin.SaveSettingsForm();
                    }
                }
            }

            if (SaveOptions != null)
            {
                SaveOptions();
            }

            this.Close();
        }