Example #1
0
        private void buttonEditServerAddress_Click(object sender, EventArgs e)
        {
            // Prevent the button from getting focus, place focus on the form instead
            mainForm.Focus();

            MainFormBlur mainFormBlur = new MainFormBlur(mainForm);

            mainFormBlur.Show(mainForm);

            using (GetTextValueDialog dialog = new GetTextValueDialog("Edit Server Address", "Server address (SDK)", "00.000.00.000:00000"))
            {
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    string hostname = dialog.Result.Split(':')[0];
                    string port     = dialog.Result.Split(':')[1];

                    labelServerAdress.Text = dialog.Result;

                    Properties.Settings.Default.ServerIP   = hostname;
                    Properties.Settings.Default.ServerPort = port;
                    Properties.Settings.Default.Save();
                }
            }

            mainFormBlur.Close();
        }
Example #2
0
        private void buttonEditNickname_Click(object sender, EventArgs e)
        {
            // Prevent the button from getting focus, place focus on the form instead
            mainForm.Focus();

            MainFormBlur mainFormBlur = new MainFormBlur(mainForm);

            mainFormBlur.Show(mainForm);

            using (GetTextValueDialog dialog = new GetTextValueDialog("Edit Nickname", "Nickname"))
            {
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    string nickname = dialog.Result;
                    labelClientNickname.Text = nickname;

                    Properties.Settings.Default.Username = nickname;
                    Properties.Settings.Default.Save();

                    tSClient.GetSelfClient().Nickname = nickname;
                }
            }

            mainFormBlur.Close();
        }
Example #3
0
        private void buttonWhisperHotkey_Click(object sender, EventArgs e)
        {
            // Prevent the button from getting focus, place focus on the form instead
            mainForm.Focus();

            MainFormBlur mainFormBlur = new MainFormBlur(mainForm);

            mainFormBlur.Show(mainForm);

            using (GetHotkeyKeyCodeDialog dialog = new GetHotkeyKeyCodeDialog())
            {
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    string hotkey = dialog.Result;
                    labelWhisperHotkey.Text = hotkey;

                    SetWhisperHotkey(hotkey);
                }
            }

            mainFormBlur.Close();
        }
Example #4
0
        private void buttonEditChatRoomUrl_Click(object sender, EventArgs e)
        {
            // Prevent the button from getting focus, place focus on the form instead
            mainForm.Focus();

            MainFormBlur mainFormBlur = new MainFormBlur(mainForm);

            mainFormBlur.Show(mainForm);

            using (GetTextValueDialog dialog = new GetTextValueDialog("Edit Chatroom URL", "Chatroom URL", allowEmptyImput: true))
            {
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    string url = dialog.Result;

                    labelChatRoomUrl.Text = url;

                    mainForm.SetChatroomUrl(channel, url);
                }
            }

            mainFormBlur.Close();
        }
Example #5
0
        private void buttonEditDefaultChannelPassword_Click(object sender, EventArgs e)
        {
            // Prevent the button from getting focus, place focus on the form instead
            mainForm.Focus();

            MainFormBlur mainFormBlur = new MainFormBlur(mainForm);

            mainFormBlur.Show(mainForm);

            using (GetTextValueDialog dialog = new GetTextValueDialog("Edit Default Channel Password", "Default channel password", allowEmptyImput: true))
            {
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    string password = dialog.Result;
                    labelDefaultChannelPassword.Text = password;

                    Properties.Settings.Default.DefaultChannelPassword = password;
                    Properties.Settings.Default.Save();
                }
            }

            mainFormBlur.Close();
        }
Example #6
0
        private void buttonEditMuteOutputHotkey_Click(object sender, EventArgs e)
        {
            // Prevent the button from getting focus, place focus on the form instead
            mainForm.Focus();

            MainFormBlur mainFormBlur = new MainFormBlur(mainForm);

            mainFormBlur.Show(mainForm);

            using (GetHotkeyKeyCodeDialog dialog = new GetHotkeyKeyCodeDialog())
            {
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    string hotkey = dialog.Result;
                    labelMuteOutputHotkey.Text = hotkey;

                    Properties.Settings.Default.MuteOutputHotkey = hotkey;
                    Properties.Settings.Default.Save();
                }
            }

            mainFormBlur.Close();
        }
Example #7
0
        private void buttonEditChannelName_Click(object sender, EventArgs e)
        {
            // Prevent the button from getting focus, place focus on the form instead
            mainForm.Focus();

            MainFormBlur mainFormBlur = new MainFormBlur(mainForm);

            mainFormBlur.Show(mainForm);

            using (GetTextValueDialog dialog = new GetTextValueDialog("Edit Channel Name", "Channel Name"))
            {
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    string name = dialog.Result;

                    labelChannelName.Text = name;

                    // Update channel name is list
                    foreach (ChannelListChannel channelListChannel in mainForm.channelList.channelListChannels)
                    {
                        if (channelListChannel.channel.Name == channel.Name)
                        {
                            channelListChannel.UpdateName(name);
                        }
                    }

                    // Update channelName on server
                    channel.Name = name;

                    // Update channelName on channelheader
                    mainForm.currentChannelHeader.UpdateName(name);
                }
            }

            mainFormBlur.Close();
        }