Пример #1
0
        private void btnRemoveProfile_Click(object sender, EventArgs e)
        {
            if (lvUserProfiles.SelectedItems.Count > 0)
            {
                UserProfileListViewItem itemBeingEdited = (UserProfileListViewItem)lvUserProfiles.SelectedItems[0];
                UserProfile             userBeingEdited = itemBeingEdited.UserProfile;

                if (MessageBox.Show(this, $"Delete user ({userBeingEdited.Name}), are you sure?", "Deletion Confirmation", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    try
                    {
                        ZAMsettings.BeginCachedConfiguration();

                        ZAMsettings.Settings.DeleteUserProfile(userBeingEdited);

                        ZAMsettings.CommitCachedConfiguration();

                        lvUserProfiles.BeginUpdate();
                        lvUserProfiles.Items.Remove(itemBeingEdited);

                        if (lvUserProfiles.Items.Count > 0)
                        {
                            lvUserProfiles.Items[0].Focused  = true;
                            lvUserProfiles.Items[0].Selected = true;
                        }
                        lvUserProfiles.EndUpdate();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("Exception occurred: " + ex.ToString(), "Error deleting User Profile", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
            }
        }
        private void btnAccept_Click(object sender, EventArgs e)
        {
            if (cbTheme.SelectedItem == null || cbTransparency.SelectedItem == null || cbFonts.SelectedItem == null)
            {
                MessageBox.Show(this.ParentForm, "Please make sure to select a valid theme, transparency, and font before saving.", "Unable to save", MessageBoxButtons.OK);
                return;
            }

            Logger.LogDebug($"Theme: {cbTheme.SelectedValue}, ManagedColor: {btnColor.SelectedColor}, Font: {cbFonts.SelectedItem} Transparency: {cbTransparency.SelectedValue}");

            ZAMsettings.BeginCachedConfiguration();

            ZAMsettings.Settings.Appearance.ThemeSetting        = ((KeyValuePair <ThemeType, string>)cbTheme.SelectedItem).Key;
            ZAMsettings.Settings.Appearance.TransparencySetting = ((KeyValuePair <TransparencyType, string>)cbTransparency.SelectedItem).Key;
            ZAMsettings.Settings.Appearance.ManagedColor        = btnColor.SelectedColor;
            ZAMsettings.Settings.Appearance.FontFamily          = cbFonts.SelectedItem.ToString();
            ZAMsettings.Settings.Appearance.FontSize            = (float)nudFontSize.Value;
            ZAMsettings.Settings.Appearance.IsFontBold          = cbBold.Checked;
            ZAMsettings.Settings.Appearance.IsFontItalic        = cbItalic.Checked;

            ZAMsettings.CommitCachedConfiguration();

            ZAMappearance cs = ZAMsettings.Settings.Appearance;

            ColorsAndFontChangedEventArgs args = new(cs.ThemeSetting, cs.TransparencySetting, cs.ManagedColor, cs.FontFamily, cs.FontSize, cs.IsFontBold, cs.IsFontItalic);

            // The MainForm listens for this event so it can refresh all colors
            this.OnColorsAndFontChanged(args);

            this.sfToolTip.Show("Configuration saved.", Cursor.Position, 2000);
        }
Пример #3
0
        private void btnAddProfile_Click(object sender, EventArgs e)
        {
            UserProfileListViewItem item = new UserProfileListViewItem();

            lvUserProfiles.Items.Add(item);
            item.Selected = true;
            item.Focused  = true;

            ZAMsettings.BeginCachedConfiguration();
            EditingUserProfiles = true;
        }
Пример #4
0
        private void btnEditSettings_Click(object sender, EventArgs e)
        {
            if (ckbCustomized.Checked)
            {
                DialogResult result = MessageBox.Show(this.ParentForm, "Editing settings will overwrite all custom split goals when saved.  Continue?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
                if (result == DialogResult.No)
                {
                    return;
                }
            }

            ZAMsettings.BeginCachedConfiguration();
            EditingSystemSettings = true;
        }
Пример #5
0
 private void btnEditSettings_Click(object sender, EventArgs e)
 {
     ZAMsettings.BeginCachedConfiguration();
     EditingSystemSettings = true;
 }
Пример #6
0
 private void btnStatsEdit_Click(object sender, EventArgs e)
 {
     ZAMsettings.BeginCachedConfiguration();
     EditingCollectors = true;
 }
Пример #7
0
 private void btnEditProfile_Click(object sender, EventArgs e)
 {
     ZAMsettings.BeginCachedConfiguration();
     EditingUserProfiles = true;
 }