Exemplo n.º 1
0
 protected override void onOk(Action finished, bool closeDialogOnFinish)
 {
     store.storeParameter(DEACTIVATE_ISSUE_LOG_WORK_CHECKED, checkBoxLogWork.Checked ? 1 : 0);
     store.storeParameter(DEACTIVATE_ISSUE_RUN_ACTION_CHECKED, checkBoxRunAction.Checked ? 1 : 0);
     if (checkBoxLogWork.Checked && !checkBoxRunAction.Checked)
     {
         base.onOk(onFinished, true);
     }
     else if (checkBoxLogWork.Checked && checkBoxRunAction.Checked)
     {
         base.onOk(() => {
             checkBoxLogWork.Checked = false;
             ButtonCancel.Enabled    = true;
             ButtonOk.Enabled        = true;
             runDeactivateIssueAction();
         }, false);
     }
     else if (checkBoxRunAction.Checked)
     {
         runDeactivateIssueAction();
     }
     else
     {
         Close();
         onFinished();
     }
 }
        private void saveColumnWidths()
        {
            statusWidth  = colStatus.Width;
            updatedWidth = colUpdated.Width;

            ParameterStore store = ParameterStoreManager.Instance.getStoreFor(ParameterStoreManager.StoreType.SETTINGS);

            store.storeParameter(JIRA_STATUS_COLUMN_WIDTH, statusWidth);
            store.storeParameter(JIRA_UPDATED_COLUMN_WIDTH, updatedWidth);
        }
Exemplo n.º 3
0
        protected override void saveCustomServerParameters(ParameterStore store, BambooServer server)
        {
            store.storeParameter(USE_FAVOURITES + "_" + server.GUID, server.UseFavourites ? 1 : 0);
            store.storeParameter(SHOW_BRANCHES + "_" + server.GUID, server.ShowBranches ? 1 : 0);
            store.storeParameter(MY_BRANCHES_ONLY + "_" + server.GUID, server.ShowMyBranchesOnly ? 1 : 0);

            string planKeys = getPlanKeysStringFromPlans(server);

            store.storeParameter(PLAN_KEYS + "_" + server.GUID, planKeys.Trim());
        }
Exemplo n.º 4
0
        private void saveSelectedValues()
        {
            ParameterStore store = ParameterStoreManager.Instance.getStoreFor(ParameterStoreManager.StoreType.SETTINGS);

            store.storeParameter(PROJECT + server.GUID, comboProjects.SelectedIndex);
            store.storeParameter(ISSUE_TYPE + server.GUID, comboTypes.SelectedIndex);
            store.storeParameter(PRIORITY + server.GUID, comboPriorities.SelectedIndex);
            store.storeParameter(COMPS_SIZE + server.GUID, listComponents.SelectedIndices.Count);
            int i = 0;

            foreach (int index in listComponents.SelectedIndices)
            {
                store.storeParameter(COMPS_SEL + (i++) + "_" + server.GUID, index);
            }

            store.storeParameter(AFFECTS_SIZE + server.GUID, listAffectsVersions.SelectedIndices.Count);
            i = 0;
            foreach (int index in listAffectsVersions.SelectedIndices)
            {
                store.storeParameter(AFFECTS_SEL + (i++) + "_" + server.GUID, index);
            }
            store.storeParameter(FIXES_SIZE + server.GUID, listFixVersions.SelectedIndices.Count);
            i = 0;
            foreach (int index in listFixVersions.SelectedIndices)
            {
                store.storeParameter(FIXES_SEL + (i++) + "_" + server.GUID, index);
            }
        }
Exemplo n.º 5
0
        private static void storeStatuses(ParameterStore store, Guid key, JiraCustomFilter f)
        {
            int i = 0;

            store.storeParameter(getParamKey(key, FILTER_STATUSES_COUNT), f.Statuses.Count);
            foreach (JiraNamedEntity status in f.Statuses)
            {
                store.storeParameter(getParamKey(key, FILTER_STATUSES_ID + i), status.Id);
                store.storeParameter(getParamKey(key, FILTER_STATUSES_NAME + i), status.Name);
                ++i;
            }
        }
Exemplo n.º 6
0
        private static void storePriorities(ParameterStore store, Guid key, JiraCustomFilter f)
        {
            int i = 0;

            store.storeParameter(getParamKey(key, FILTER_PRIORITIES_COUNT), f.Priorities.Count);
            foreach (JiraNamedEntity priority in f.Priorities)
            {
                store.storeParameter(getParamKey(key, FILTER_PRIORITIES_ID + i), priority.Id);
                store.storeParameter(getParamKey(key, FILTER_PRIORITIES_NAME + i), priority.Name);
                ++i;
            }
        }
Exemplo n.º 7
0
        private static void storeComponents(ParameterStore store, Guid key, JiraCustomFilter f)
        {
            int i = 0;

            store.storeParameter(getParamKey(key, FILTER_COMPONENTS_COUNT), f.Components.Count);
            foreach (JiraNamedEntity comp in f.Components)
            {
                store.storeParameter(getParamKey(key, FILTER_COMPONENTS_ID + i), comp.Id);
                store.storeParameter(getParamKey(key, FILTER_COMPONENTS_NAME + i), comp.Name);
                ++i;
            }
        }
Exemplo n.º 8
0
        private static void storeFixVersions(ParameterStore store, Guid key, JiraCustomFilter f)
        {
            int i = 0;

            store.storeParameter(getParamKey(key, FILTER_FIXFORVERSIONS_COUNT), f.FixForVersions.Count);
            foreach (JiraNamedEntity version in f.FixForVersions)
            {
                store.storeParameter(getParamKey(key, FILTER_FIXFORVERSIONS_ID + i), version.Id);
                store.storeParameter(getParamKey(key, FILTER_FIXFORVERSIONS_NAME + i), version.Name);
                ++i;
            }
        }
Exemplo n.º 9
0
        private static void storeIssueTypes(ParameterStore store, Guid key, JiraCustomFilter f)
        {
            int i = 0;

            store.storeParameter(getParamKey(key, FILTER_ISSUE_TYPE_COUNT), f.IssueTypes.Count);
            foreach (JiraNamedEntity issueType in f.IssueTypes)
            {
                store.storeParameter(getParamKey(key, FILTER_ISSUE_TYPE_ID + i), issueType.Id);
                store.storeParameter(getParamKey(key, FILTER_ISSUE_TYPE_NAME + i), issueType.Name);
                ++i;
            }
        }
Exemplo n.º 10
0
        private static void storeProjects(ParameterStore store, Guid key, JiraCustomFilter f)
        {
            store.storeParameter(getParamKey(key, FILTER_PROJECT_COUNT), f.Projects.Count);
            int i = 0;

            foreach (JiraProject project in f.Projects)
            {
                store.storeParameter(getParamKey(key, FILTER_PROJECT_ID + i), project.Id);
                store.storeParameter(getParamKey(key, FILTER_PROJECT_KEY + i), project.Key);
                ++i;
            }
        }
Exemplo n.º 11
0
        private static void storeResolutions(ParameterStore store, Guid key, JiraCustomFilter f)
        {
            int i = 0;

            store.storeParameter(getParamKey(key, FILTER_RESOLUTIONS_COUNT), f.Resolutions.Count);
            foreach (JiraNamedEntity resolution in f.Resolutions)
            {
                store.storeParameter(getParamKey(key, FILTER_RESOLUTIONS_ID + i), resolution.Id);
                store.storeParameter(getParamKey(key, FILTER_RESOLUTIONS_NAME + i), resolution.Name);
                ++i;
            }
        }
Exemplo n.º 12
0
        private void storeActiveIssue()
        {
            ParameterStore store = ParameterStoreManager.Instance.getStoreFor(ParameterStoreManager.StoreType.ACTIVE_ISSUES);

            if (CurrentActiveIssue != null)
            {
                store.storeParameter(ACTIVE_ISSUE_KEY, CurrentActiveIssue.Key);
                store.storeParameter(ACTIVE_ISSUE_SERVER_GUID, CurrentActiveIssue.ServerGuid);
            }
            else
            {
                store.storeParameter(ACTIVE_ISSUE_KEY, null);
                store.storeParameter(ACTIVE_ISSUE_SERVER_GUID, null);
            }
        }
        private void saveColumnWidths()
        {
            statusWidth    = colStatusAndKey.Width;
            testsWidth     = colTests.Width;
            completedWidth = colCompleted.Width;
            durationWidth  = colDuration.Width;
            serverWidth    = colServer.Width;

            ParameterStore store = ParameterStoreManager.Instance.getStoreFor(ParameterStoreManager.StoreType.SETTINGS);

            store.storeParameter(BAMBOO_STATUS_COLUMN_WIDTH, statusWidth);
            store.storeParameter(BAMBOO_TESTS_COLUMN_WIDTH, testsWidth);
            store.storeParameter(BAMBOO_COMPLETED_COLUMN_WIDTH, completedWidth);
            store.storeParameter(BAMBOO_DURATION_COLUMN_WIDTH, durationWidth);
            store.storeParameter(BAMBOO_SERVER_COLUMN_WIDTH, serverWidth);
        }
Exemplo n.º 14
0
        private void setProject(JiraProject p)
        {
            project = p;

            ParameterStore store = ParameterStoreManager.Instance.getStoreFor(ParameterStoreManager.StoreType.SETTINGS);

            string paramName = getSettingName();

            store.storeParameter(paramName, project != null ? project.Key : null);
            setNameAndProject();
        }
Exemplo n.º 15
0
        private void savePastActiveIssuesAndSetupDropDown()
        {
            ParameterStore store = ParameterStoreManager.Instance.getStoreFor(ParameterStoreManager.StoreType.ACTIVE_ISSUES);

            store.storeParameter(PAST_ACTIVE_ISSUE_COUNT, pastActiveIssues.Count);
            int i = 0;

            foreach (ActiveIssue issue in pastActiveIssues)
            {
                store.storeParameter(PAST_ACTIVE_ISSUE_KEY + i, issue.Key);
                store.storeParameter(PAST_ACTIVE_ISSUE_SERVER_GUID + i, issue.ServerGuid);
                ++i;
            }
            activeIssueDropDown.DropDown.Items.Clear();
            foreach (var issue in pastActiveIssues.Reverse().Where(issue => issue.Enabled))
            {
                activeIssueDropDown.DropDown.Items.Add(new PastActiveIssueMenuItem(this, issue));
            }
            loadPastActiveIssuesDetails();
        }
        public void rememberNodeState(object n)
        {
            TreeNodeRememberingCollapseState node = n as TreeNodeRememberingCollapseState;

            if (node == null)
            {
                return;
            }

            store.storeParameter(COLLAPSE_EXPAND_STATE + node.NodeKey, node.NodeExpanded ? 1 : 0);
        }
        private void buttonFailedOnly_CheckedChanged(object sender, EventArgs e)
        {
            ParameterStore store = ParameterStoreManager.Instance.getStoreFor(ParameterStoreManager.StoreType.SETTINGS);

            store.storeParameter(SHOW_FAILED_TESTS_ONLY, buttonFailedOnly.Checked ? 1 : 0);
            TestResultTreeModel model = testResultTree.Model as TestResultTreeModel;

            if (model == null)
            {
                return;
            }
            model.FailedOnly = buttonFailedOnly.Checked;
            testResultTree.ExpandAll();
        }
        public void save()
        {
            lock (this) {
                ParameterStore store = ParameterStoreManager.Instance.getStoreFor(ParameterStoreManager.StoreType.SETTINGS);

                try {
                    store.storeParameter(RECENTLY_VIEWED_COUNT, issues.Count);

                    int i = 1;
                    foreach (RecentlyViewedIssue issue in issues)
                    {
                        string var = RECENTLY_VIEWED_ISSUE_SERVER_GUID + i;
                        store.storeParameter(var, issue.ServerGuid.ToString());
                        var = RECENTLY_VIEWED_ISSUE_KEY + i;
                        store.storeParameter(var, issue.IssueKey);
                        ++i;
                    }
                }
                catch (Exception e) {
                    Debug.WriteLine(e);
                }
            }
        }
Exemplo n.º 19
0
 private static void storeAssignee(ParameterStore store, Guid key, JiraCustomFilter f)
 {
     store.storeParameter(getParamKey(key, FILTER_ASSIGNEE), f.Assignee.ToString());
 }
Exemplo n.º 20
0
        public void rememberLastSelectedFilterItem()
        {
            ParameterStore store          = ParameterStoreManager.Instance.getStoreFor(ParameterStoreManager.StoreType.SETTINGS);
            bool           recentlyViewed = SelectedNode is RecentlyOpenIssuesTreeNode;

            store.storeParameter(FILTERS_TREE_RECENT_PARAM, recentlyViewed ? 1 : 0);

            TreeNodeWithJiraServer nodeWithJiraServer = SelectedNode as TreeNodeWithJiraServer;

            if (nodeWithJiraServer != null)
            {
                store.storeParameter(FILTERS_TREE_SERVER_PARAM, nodeWithJiraServer.Server.GUID.ToString());
            }
            JiraPresetFiltersGroupTreeNode pgtn = SelectedNode as JiraPresetFiltersGroupTreeNode;
            JiraCustomFiltersGroupTreeNode cgtn = SelectedNode as JiraCustomFiltersGroupTreeNode;
            JiraSavedFiltersGroupTreeNode  sgtn = SelectedNode as JiraSavedFiltersGroupTreeNode;
            GhSprintTreeNode ghtn = SelectedNode as GhSprintTreeNode;

            if (ghtn != null)
            {
                store.storeParameter(FILTERS_TREE_FILTER_GROUP_PARAM, GH_SPRINT_GROUP_NAME);
                store.storeParameter(FILTERS_TREE_FILTER_PARAM, ghtn.Sprint.BoardId + "/" + ghtn.Sprint.Id);
            }
            else if (pgtn != null)
            {
                store.storeParameter(FILTERS_TREE_FILTER_GROUP_PARAM, PRESET_FILTER_GROUP_NAME);
                store.storeParameter(FILTERS_TREE_FILTER_PARAM, null);
            }
            else
            {
                if (cgtn != null)
                {
                    store.storeParameter(FILTERS_TREE_FILTER_GROUP_PARAM, CUSTOM_FILTER_GROUP_NAME);
                    store.storeParameter(FILTERS_TREE_FILTER_PARAM, null);
                }
                else
                {
                    if (sgtn != null)
                    {
                        store.storeParameter(FILTERS_TREE_FILTER_GROUP_PARAM, SAVED_FILTER_GROUP_NAME);
                        store.storeParameter(FILTERS_TREE_FILTER_PARAM, null);
                    }
                    else
                    {
                        JiraPresetFilterTreeNode ptn = SelectedNode as JiraPresetFilterTreeNode;
                        JiraCustomFilterTreeNode ctn = SelectedNode as JiraCustomFilterTreeNode;
                        JiraSavedFilterTreeNode  stn = SelectedNode as JiraSavedFilterTreeNode;
                        if (ptn != null)
                        {
                            store.storeParameter(FILTERS_TREE_FILTER_GROUP_PARAM, PRESET_FILTER_GROUP_NAME);
                            store.storeParameter(FILTERS_TREE_FILTER_PARAM, ptn.Filter.GetType().ToString());
                        }
                        else if (ctn != null)
                        {
                            store.storeParameter(FILTERS_TREE_FILTER_GROUP_PARAM, CUSTOM_FILTER_GROUP_NAME);
                            store.storeParameter(FILTERS_TREE_FILTER_PARAM, ctn.Filter.Guid.ToString());
                        }
                        else if (stn != null)
                        {
                            store.storeParameter(FILTERS_TREE_FILTER_GROUP_PARAM, SAVED_FILTER_GROUP_NAME);
                            store.storeParameter(FILTERS_TREE_FILTER_PARAM, stn.Filter.Id);
                        }
                        else
                        {
                            store.storeParameter(FILTERS_TREE_FILTER_GROUP_PARAM, null);
                            store.storeParameter(FILTERS_TREE_FILTER_PARAM, null);
                        }
                    }
                }
            }
        }
Exemplo n.º 21
0
        private void savePausedState()
        {
            ParameterStore store = ParameterStoreManager.Instance.getStoreFor(ParameterStoreManager.StoreType.ACTIVE_ISSUES);

            store.storeParameter(ACTIVE_ISSUE_IS_PAUSED, paused ? 1 : 0);
        }
Exemplo n.º 22
0
        private void storeTimeSpent()
        {
            ParameterStore store = ParameterStoreManager.Instance.getStoreFor(ParameterStoreManager.StoreType.ACTIVE_ISSUES);

            store.storeParameter(ACTIVE_ISSUE_TIMER_VALUE, MinutesInProgress);
        }
        void selectedIndexChanged(object sender, EventArgs e)
        {
            ParameterStore store = ParameterStoreManager.Instance.getStoreFor(ParameterStoreManager.StoreType.SETTINGS);

            store.storeParameter(SELECTED_INDEX, SelectedIndex);
        }
Exemplo n.º 24
0
 private static void storeReporter(ParameterStore store, Guid key, JiraCustomFilter f)
 {
     store.storeParameter(getParamKey(key, FILTER_REPORTER), f.Reporter.ToString());
 }
Exemplo n.º 25
0
 protected override void saveCustomServerParameters(ParameterStore store, JiraServer server)
 {
     store.storeParameter(USE_OLDSKOOL_AUTH + "_" + server.GUID, server.OldSkoolAuth ? 1 : 0);
 }
        public void save()
        {
            try {
                ParameterStore store = ParameterStoreManager.Instance.getStoreFor(StoreType);

                store.storeParameter(DEFAULT_SERVER_GUID, defaultServerGuid.ToString());
                RegistryKey sharedServersRegistryKey = getSharedServersRegistryKey();

                using (sharedServersRegistryKey) {
                    int i = 0;
                    foreach (T s in getAllServers())
                    {
                        if (!s.IsShared)
                        {
                            ++i;
                            string var = SERVER_GUID + i;
                            store.storeParameter(var, s.GUID.ToString());
                            var = SERVER_NAME + "_" + s.GUID;
                            store.storeParameter(var, s.Name);
                            var = SERVER_URL + "_" + s.GUID;
                            store.storeParameter(var, s.Url);
                            var = SERVER_TYPE + s.GUID;
                            store.storeParameter(var, s.Type.ToString());
                            var = SERVER_DONT_USE_PROXY + "_" + s.GUID;
                            store.storeParameter(var, s.NoProxy ? 1 : 0);
                            var = SERVER_ENABLED + "_" + s.GUID;
                            store.storeParameter(var, s.Enabled ? 1 : 0);

                            saveCustomServerParameters(store, s);

                            // just in case
                            if (sharedServersRegistryKey != null)
                            {
                                try {
                                    sharedServersRegistryKey.DeleteSubKey(s.GUID.ToString());
// ReSharper disable EmptyGeneralCatchClause
                                } catch {
// ReSharper restore EmptyGeneralCatchClause
                                }
                            }
                        }
                        else
                        {
                            if (sharedServersRegistryKey == null)
                            {
                                continue;
                            }
                            using (RegistryKey subKey = sharedServersRegistryKey.CreateSubKey(s.GUID.ToString())) {
                                if (subKey == null)
                                {
                                    continue;
                                }

                                subKey.SetValue(SERVER_NAME, s.Name);
                                subKey.SetValue(SERVER_URL, s.Url);
                                subKey.SetValue(SERVER_DONT_USE_PROXY, s.NoProxy ? 1 : 0);
                                // enabled/disabled state is always per solution, even for shared servers
                                store.storeParameter(SERVER_ENABLED + s.GUID, s.Enabled ? 1 : 0);

                                saveCustomServerParameters(subKey, s);
                            }
                        }
                        CredentialsVault.Instance.saveCredentials(s);
                    }

                    store.storeParameter(SERVER_COUNT, i);
                }
            } catch (Exception e) {
                Debug.WriteLine(e);
            }
        }