private void renameProfileButton_Click(object sender, EventArgs e)
        {
            if (selectedEmulator == null)
                return;
            updateProfile();
            if (selectedProfile == null)
                return;
            if (selectedProfile.IsDefault)
            {
                Logger.LogDebug("Default profile cannot be renamed");
                return;
            }

            using (Conf_NewProfile profileDlg = new Conf_NewProfile(selectedEmulator, selectedProfile))
            {
                if (profileDlg.ShowDialog() == DialogResult.OK)
                {
                    profileDlg.EmulatorProfile.Commit();
                    int index = profileComboBox.SelectedIndex;
                    profileComboBox.Items.Remove(selectedProfile);
                    profileComboBox.Items.Insert(index, profileDlg.EmulatorProfile);
                    profileComboBox.SelectedIndex = index;
                }
            }
        }
        void addProfileButton_Click(object sender, EventArgs e)
        {
            if (selectedGame == null)
                return;
            updatePCSettings();
            EmulatorProfile newProfile;
            using (Conf_NewProfile profileDlg = new Conf_NewProfile(selectedGame.ParentEmulator, null))
            {
                if (profileDlg.ShowDialog() != DialogResult.OK || profileDlg.EmulatorProfile == null)
                    return;
                newProfile = profileDlg.EmulatorProfile;
            }

            newProfile.SuspendMP = true;
            selectedGame.GameProfiles.Add(newProfile);
            saveSelectedGame = true;
            pcProfileComboBox.Items.Add(newProfile);
            pcProfileComboBox.SelectedItem = newProfile;
            loadProfileDropdown(selectedGame);
        }
        private void addProfileButton_Click(object sender, EventArgs e)
        {
            if (selectedEmulator == null)
                return;

            using (Conf_NewProfile profileDlg = new Conf_NewProfile(selectedEmulator, null))
            {
                if (profileDlg.ShowDialog() != DialogResult.OK || profileDlg.EmulatorProfile == null)
                    return;

                EmulatorProfile profile = profileDlg.EmulatorProfile;
                profile.Commit();
                selectedEmulator.EmulatorProfiles.Add(profile);
                saveSelectedEmulator = true;
                profileComboBox.Items.Add(profile);
                profileComboBox.SelectedItem = profile;
            }
        }
        void renameProfileButton_Click(object sender, EventArgs e)
        {
            if (selectedGame == null)
                return;
            updatePCSettings();
            if (currentPCProfile == null)
                return;
            if (currentPCProfile.IsDefault)
            {
                Logger.LogDebug("Default profile cannot be renamed");
                return;
            }

            using (Conf_NewProfile profileDlg = new Conf_NewProfile(selectedGame.ParentEmulator, currentPCProfile))
            {
                if (profileDlg.ShowDialog() == DialogResult.OK)
                {
                    profileDlg.EmulatorProfile.Commit();
                    int index = pcProfileComboBox.SelectedIndex;
                    pcProfileComboBox.Items.Remove(currentPCProfile);
                    pcProfileComboBox.Items.Insert(index, profileDlg.EmulatorProfile);
                    pcProfileComboBox.SelectedIndex = index;
                }
            }
            loadProfileDropdown(selectedGame);
        }