From 2b61c4abec180513487dde08952c030b2c24b488 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 21 Apr 2017 12:00:30 -0400 Subject: [PATCH 1/7] Added Folder column to grids on MainForm and ProjectListControl --- .../BusinessComponents/JenkinsService.cs | 8 +++-- JenkinsTray/Entities/Project.cs | 8 ++++- .../Controls/ProjectListControl.Designer.cs | 18 +++++++++-- JenkinsTray/UI/MainForm.Designer.cs | 31 +++++++++++++++---- JenkinsTray/UI/MainForm.cs | 5 +++ 5 files changed, 59 insertions(+), 11 deletions(-) diff --git a/JenkinsTray/BusinessComponents/JenkinsService.cs b/JenkinsTray/BusinessComponents/JenkinsService.cs index 05b1f25..1ddbe67 100644 --- a/JenkinsTray/BusinessComponents/JenkinsService.cs +++ b/JenkinsTray/BusinessComponents/JenkinsService.cs @@ -59,7 +59,7 @@ public IList LoadProjects(Server server) return projects; } - public List GetProjects(XmlNodeList jobElements, Server server) + public List GetProjects(XmlNodeList jobElements, Server server, string folder = "") { var projects = new List(); @@ -76,12 +76,16 @@ public List GetProjects(XmlNodeList jobElements, Server server) var xml = new XmlDocument(); xml.LoadXml(xmlStr); var nodes = xml.SelectNodes("/folder/job"); - projects.AddRange(GetProjects(nodes, server)); + projects.AddRange(GetProjects(nodes, server, projectName)); } else { var project = new Project(); project.Server = server; + if (!string.IsNullOrEmpty(folder)) + { + project.Folder = folder; + } project.Name = projectName; project.Url = projectUrl; diff --git a/JenkinsTray/Entities/Project.cs b/JenkinsTray/Entities/Project.cs index 9376848..6c6b6a6 100644 --- a/JenkinsTray/Entities/Project.cs +++ b/JenkinsTray/Entities/Project.cs @@ -14,6 +14,9 @@ public Project() public Server Server { get; set; } + [JsonProperty("folder")] + public string Folder { get; set; } + [JsonProperty("name")] public string Name { get; set; } @@ -128,8 +131,11 @@ public override bool Equals(object obj) var other = obj as Project; if (other == null) return false; + if (Server == null) + return false; return other.Server.Equals(Server) - && other.Name == Name; + && other.Name == Name + && other.Folder == Folder; } public override string ToString() diff --git a/JenkinsTray/UI/Controls/ProjectListControl.Designer.cs b/JenkinsTray/UI/Controls/ProjectListControl.Designer.cs index a594437..d787f7f 100644 --- a/JenkinsTray/UI/Controls/ProjectListControl.Designer.cs +++ b/JenkinsTray/UI/Controls/ProjectListControl.Designer.cs @@ -37,6 +37,7 @@ private void InitializeComponent() this.projectsGridView = new DevExpress.XtraGrid.Views.Grid.GridView(); this.projectSelectedGridColumn = new DevExpress.XtraGrid.Columns.GridColumn(); this.projectSelectedCheckEdit = new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit(); + this.folderNameGridColumn = new DevExpress.XtraGrid.Columns.GridColumn(); this.projectNameGridColumn = new DevExpress.XtraGrid.Columns.GridColumn(); this.barManager1 = new DevExpress.XtraBars.BarManager(this.components); this.bar2 = new DevExpress.XtraBars.Bar(); @@ -96,6 +97,7 @@ private void InitializeComponent() // this.projectsGridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { this.projectSelectedGridColumn, + this.folderNameGridColumn, this.projectNameGridColumn}); this.projectsGridView.GridControl = this.projectsGridControl; this.projectsGridView.Name = "projectsGridView"; @@ -104,7 +106,7 @@ private void InitializeComponent() this.projectsGridView.OptionsView.ShowGroupPanel = false; this.projectsGridView.OptionsView.ShowIndicator = false; this.projectsGridView.SortInfo.AddRange(new DevExpress.XtraGrid.Columns.GridColumnSortInfo[] { - new DevExpress.XtraGrid.Columns.GridColumnSortInfo(this.projectNameGridColumn, DevExpress.Data.ColumnSortOrder.Ascending)}); + new DevExpress.XtraGrid.Columns.GridColumnSortInfo(this.folderNameGridColumn, DevExpress.Data.ColumnSortOrder.Ascending)}); this.projectsGridView.CustomUnboundColumnData += new DevExpress.XtraGrid.Views.Base.CustomColumnDataEventHandler(this.projectsGridView_CustomUnboundColumnData); // // projectSelectedGridColumn @@ -123,6 +125,17 @@ private void InitializeComponent() this.projectSelectedCheckEdit.Name = "projectSelectedCheckEdit"; this.projectSelectedCheckEdit.EditValueChanged += new System.EventHandler(this.projectSelectedCheckEdit_EditValueChanged); // + // folderNameGridColumn + // + this.folderNameGridColumn.Caption = "Folder"; + this.folderNameGridColumn.FieldName = "Folder"; + this.folderNameGridColumn.Name = "folderNameGridColumn"; + this.folderNameGridColumn.OptionsColumn.AllowEdit = false; + this.folderNameGridColumn.SortMode = DevExpress.XtraGrid.ColumnSortMode.DisplayText; + this.folderNameGridColumn.Visible = true; + this.folderNameGridColumn.VisibleIndex = 1; + this.folderNameGridColumn.Width = 172; + // // projectNameGridColumn // this.projectNameGridColumn.Caption = "Projects"; @@ -131,7 +144,7 @@ private void InitializeComponent() this.projectNameGridColumn.OptionsColumn.AllowEdit = false; this.projectNameGridColumn.SortMode = DevExpress.XtraGrid.ColumnSortMode.DisplayText; this.projectNameGridColumn.Visible = true; - this.projectNameGridColumn.VisibleIndex = 1; + this.projectNameGridColumn.VisibleIndex = 2; this.projectNameGridColumn.Width = 302; // // barManager1 @@ -209,6 +222,7 @@ private void InitializeComponent() private DevExpress.XtraBars.BarDockControl barDockControlBottom; private DevExpress.XtraBars.BarDockControl barDockControlLeft; private DevExpress.XtraBars.BarDockControl barDockControlRight; + private DevExpress.XtraGrid.Columns.GridColumn folderNameGridColumn; private DevExpress.XtraGrid.Columns.GridColumn projectNameGridColumn; private DevExpress.XtraGrid.Columns.GridColumn projectSelectedGridColumn; private DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit projectSelectedCheckEdit; diff --git a/JenkinsTray/UI/MainForm.Designer.cs b/JenkinsTray/UI/MainForm.Designer.cs index cc5b127..484396d 100644 --- a/JenkinsTray/UI/MainForm.Designer.cs +++ b/JenkinsTray/UI/MainForm.Designer.cs @@ -61,6 +61,7 @@ private void InitializeComponent() this.serverGridColumn = new DevExpress.XtraGrid.Columns.GridColumn(); this.statusGridColumn = new DevExpress.XtraGrid.Columns.GridColumn(); this.repositoryItemPictureEdit3 = new DevExpress.XtraEditors.Repository.RepositoryItemPictureEdit(); + this.folderGridColumn = new DevExpress.XtraGrid.Columns.GridColumn(); this.nameGridColumn = new DevExpress.XtraGrid.Columns.GridColumn(); this.urlGridColumn = new DevExpress.XtraGrid.Columns.GridColumn(); this.buildDetailsGridColumn = new DevExpress.XtraGrid.Columns.GridColumn(); @@ -327,6 +328,7 @@ private void InitializeComponent() // projectsGridView // this.projectsGridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { + this.folderGridColumn, this.serverGridColumn, this.statusGridColumn, this.nameGridColumn, @@ -350,6 +352,7 @@ private void InitializeComponent() this.projectsGridView.OptionsView.ShowIndicator = false; this.projectsGridView.SortInfo.AddRange(new DevExpress.XtraGrid.Columns.GridColumnSortInfo[] { new DevExpress.XtraGrid.Columns.GridColumnSortInfo(this.serverGridColumn, DevExpress.Data.ColumnSortOrder.Ascending), + new DevExpress.XtraGrid.Columns.GridColumnSortInfo(this.folderGridColumn, DevExpress.Data.ColumnSortOrder.Ascending), new DevExpress.XtraGrid.Columns.GridColumnSortInfo(this.nameGridColumn, DevExpress.Data.ColumnSortOrder.Ascending)}); this.projectsGridView.CustomColumnSort += new DevExpress.XtraGrid.Views.Base.CustomColumnSortEventHandler(this.projectsGridView_CustomColumnSort); this.projectsGridView.CustomUnboundColumnData += new DevExpress.XtraGrid.Views.Base.CustomColumnDataEventHandler(this.projectsGridView_CustomUnboundColumnData); @@ -387,6 +390,21 @@ private void InitializeComponent() // this.repositoryItemPictureEdit3.Name = "repositoryItemPictureEdit3"; // + // folderGridColumn + // + this.folderGridColumn.AppearanceCell.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.folderGridColumn.AppearanceCell.Options.UseFont = true; + this.folderGridColumn.AppearanceHeader.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.folderGridColumn.AppearanceHeader.Options.UseFont = true; + this.folderGridColumn.Caption = "Folder"; + this.folderGridColumn.FieldName = "Folder"; + this.folderGridColumn.Name = "folderGridColumn"; + this.folderGridColumn.OptionsColumn.AllowEdit = false; + this.folderGridColumn.SortMode = DevExpress.XtraGrid.ColumnSortMode.DisplayText; + this.folderGridColumn.Visible = true; + this.folderGridColumn.VisibleIndex = 1; + this.folderGridColumn.Width = 137; + // // nameGridColumn // this.nameGridColumn.AppearanceCell.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); @@ -399,7 +417,7 @@ private void InitializeComponent() this.nameGridColumn.OptionsColumn.AllowEdit = false; this.nameGridColumn.SortMode = DevExpress.XtraGrid.ColumnSortMode.DisplayText; this.nameGridColumn.Visible = true; - this.nameGridColumn.VisibleIndex = 1; + this.nameGridColumn.VisibleIndex = 2; this.nameGridColumn.Width = 137; // // urlGridColumn @@ -420,7 +438,7 @@ private void InitializeComponent() this.buildDetailsGridColumn.OptionsColumn.AllowEdit = false; this.buildDetailsGridColumn.SortMode = DevExpress.XtraGrid.ColumnSortMode.DisplayText; this.buildDetailsGridColumn.Visible = true; - this.buildDetailsGridColumn.VisibleIndex = 2; + this.buildDetailsGridColumn.VisibleIndex = 3; this.buildDetailsGridColumn.Width = 200; // // lastBuildGridColumn @@ -433,7 +451,7 @@ private void InitializeComponent() this.lastBuildGridColumn.OptionsColumn.AllowEdit = false; this.lastBuildGridColumn.SortMode = DevExpress.XtraGrid.ColumnSortMode.Custom; this.lastBuildGridColumn.Visible = true; - this.lastBuildGridColumn.VisibleIndex = 3; + this.lastBuildGridColumn.VisibleIndex = 4; this.lastBuildGridColumn.Width = 121; // // lastSuccessGridColumn @@ -446,7 +464,7 @@ private void InitializeComponent() this.lastSuccessGridColumn.OptionsColumn.AllowEdit = false; this.lastSuccessGridColumn.SortMode = DevExpress.XtraGrid.ColumnSortMode.Custom; this.lastSuccessGridColumn.Visible = true; - this.lastSuccessGridColumn.VisibleIndex = 4; + this.lastSuccessGridColumn.VisibleIndex = 5; this.lastSuccessGridColumn.Width = 121; // // lastSuccessUserGridColumn @@ -467,7 +485,7 @@ private void InitializeComponent() this.lastFailureGridColumn.OptionsColumn.AllowEdit = false; this.lastFailureGridColumn.SortMode = DevExpress.XtraGrid.ColumnSortMode.Custom; this.lastFailureGridColumn.Visible = true; - this.lastFailureGridColumn.VisibleIndex = 5; + this.lastFailureGridColumn.VisibleIndex = 6; this.lastFailureGridColumn.Width = 124; // // lastFailureUserGridColumn @@ -477,7 +495,7 @@ private void InitializeComponent() this.lastFailureUserGridColumn.Name = "lastFailureUserGridColumn"; this.lastFailureUserGridColumn.OptionsColumn.AllowEdit = false; this.lastFailureUserGridColumn.Visible = true; - this.lastFailureUserGridColumn.VisibleIndex = 6; + this.lastFailureUserGridColumn.VisibleIndex = 7; this.lastFailureUserGridColumn.Width = 65; // // claimedByGridColumn @@ -532,6 +550,7 @@ private void InitializeComponent() private DevExpress.XtraBars.BarButtonItem aboutButtonItem; private DevExpress.XtraGrid.GridControl projectsGridControl; private DevExpress.XtraGrid.Views.Grid.GridView projectsGridView; + private DevExpress.XtraGrid.Columns.GridColumn folderGridColumn; private DevExpress.XtraGrid.Columns.GridColumn nameGridColumn; private DevExpress.XtraGrid.Columns.GridColumn urlGridColumn; private DevExpress.XtraGrid.Columns.GridColumn buildDetailsGridColumn; diff --git a/JenkinsTray/UI/MainForm.cs b/JenkinsTray/UI/MainForm.cs index 720268e..02da0dd 100644 --- a/JenkinsTray/UI/MainForm.cs +++ b/JenkinsTray/UI/MainForm.cs @@ -650,6 +650,11 @@ public string Server get { return Project.Server.DisplayText; } } + public string Folder + { + get { return Project.Folder; } + } + public string Name { get { return ShowDisplayname && string.IsNullOrEmpty(Project.DisplayName) ? Project.Name : Project.DisplayName; } From 173a47a8fe1e9951927b7dab84dad54c6faaa585 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 21 Apr 2017 13:07:31 -0400 Subject: [PATCH 2/7] Added Configuration Code for the SettingsForm --- .../ConfigurationService.cs | 9 +++++ .../BusinessComponents/JenkinsService.cs | 21 +++++++---- JenkinsTray/Entities/GeneralSettings.cs | 3 ++ JenkinsTray/UI/Controls/ProjectListControl.cs | 18 ++++++++++ JenkinsTray/UI/MainForm.cs | 7 ++++ JenkinsTray/UI/SettingsForm.cs | 35 +++++++++++++------ 6 files changed, 75 insertions(+), 18 deletions(-) diff --git a/JenkinsTray/BusinessComponents/ConfigurationService.cs b/JenkinsTray/BusinessComponents/ConfigurationService.cs index fe57df8..ba39183 100644 --- a/JenkinsTray/BusinessComponents/ConfigurationService.cs +++ b/JenkinsTray/BusinessComponents/ConfigurationService.cs @@ -301,5 +301,14 @@ public void SetBalloonNotifications(bool value) SaveConfiguration(); } } + + public void SetShowFolders(bool value) + { + if (GeneralSettings.ShowFolders != value) + { + GeneralSettings.ShowFolders = value; + SaveConfiguration(); + } + } } } \ No newline at end of file diff --git a/JenkinsTray/BusinessComponents/JenkinsService.cs b/JenkinsTray/BusinessComponents/JenkinsService.cs index 1ddbe67..4b13f93 100644 --- a/JenkinsTray/BusinessComponents/JenkinsService.cs +++ b/JenkinsTray/BusinessComponents/JenkinsService.cs @@ -37,6 +37,8 @@ public JenkinsService() public ClaimService ClaimService { get; set; } + public ConfigurationService ConfigurationService { get; set; } + public IList LoadProjects(Server server) { var url = NetUtils.ConcatUrls(server.Url, "/api/xml?tree=jobs[name,url,color]"); @@ -63,20 +65,25 @@ public List GetProjects(XmlNodeList jobElements, Server server, string { var projects = new List(); + var showFolders = ConfigurationService.GeneralSettings.ShowFolders; + foreach (XmlNode jobElement in jobElements) { var projectName = jobElement.SelectSingleNode("name").InnerText; var projectUrl = jobElement.SelectSingleNode("url").InnerText; var projectColor = jobElement.SelectSingleNode("color"); // If the job is a folder we need to recursively get the jobs within. - if (jobElement.SelectSingleNode("color") == null) + if (projectColor == null) //folders do not have a color node { - var url = NetUtils.ConcatUrls(projectUrl, "/api/xml?tree=jobs[name,url,color]"); - var xmlStr = DownloadString(server.Credentials, url, false, server.IgnoreUntrustedCertificate); - var xml = new XmlDocument(); - xml.LoadXml(xmlStr); - var nodes = xml.SelectNodes("/folder/job"); - projects.AddRange(GetProjects(nodes, server, projectName)); + if (showFolders) + { + var url = NetUtils.ConcatUrls(projectUrl, "/api/xml?tree=jobs[name,url,color]"); + var xmlStr = DownloadString(server.Credentials, url, false, server.IgnoreUntrustedCertificate); + var xml = new XmlDocument(); + xml.LoadXml(xmlStr); + var nodes = xml.SelectNodes("/folder/job"); + projects.AddRange(GetProjects(nodes, server, projectName)); + } } else { diff --git a/JenkinsTray/Entities/GeneralSettings.cs b/JenkinsTray/Entities/GeneralSettings.cs index aa6df02..7497391 100644 --- a/JenkinsTray/Entities/GeneralSettings.cs +++ b/JenkinsTray/Entities/GeneralSettings.cs @@ -30,6 +30,9 @@ public GeneralSettings() [JsonProperty("checkForUpdates")] public bool CheckForUpdates { get; set; } + [JsonProperty("showFolders")] + public bool ShowFolders { get; set; } + public ApplicationUpdateService ApplicationUpdateService { get; set; } } } \ No newline at end of file diff --git a/JenkinsTray/UI/Controls/ProjectListControl.cs b/JenkinsTray/UI/Controls/ProjectListControl.cs index f791e15..3e2162b 100644 --- a/JenkinsTray/UI/Controls/ProjectListControl.cs +++ b/JenkinsTray/UI/Controls/ProjectListControl.cs @@ -27,11 +27,17 @@ public ProjectListControl() public void Initialize() { + ConfigurationService.ConfigurationUpdated += configurationService_ConfigurationUpdated; } public void UpdateProjectList(Server server) { this.server = server; + RefreshList(); + } + + private void RefreshList() + { #if SYNCRHONOUS List dataSource = new List(); @@ -56,6 +62,8 @@ public void UpdateProjectList(Server server) var status = string.Format(JenkinsTrayResources.LoadingProjects_FormatString, server.Url); Controller.SetStatus(status, true); + folderNameGridColumn.Visible = ConfigurationService.GeneralSettings.ShowFolders; + // run the process in background var process = new Process("Loading project " + server.Url); IList projects = null; @@ -94,6 +102,16 @@ private void SetProjectsDataSource(List dataSource) projectsGridControl.DataSource = projectsDataSource; } + private void configurationService_ConfigurationUpdated() + { + SetFoldersVisibility(); + } + + private void SetFoldersVisibility() + { + folderNameGridColumn.Visible = ConfigurationService.GeneralSettings.ShowFolders; + } + private void projectsGridView_CustomUnboundColumnData(object sender, CustomColumnDataEventArgs e) { if (e.IsGetData) diff --git a/JenkinsTray/UI/MainForm.cs b/JenkinsTray/UI/MainForm.cs index 02da0dd..78e765e 100644 --- a/JenkinsTray/UI/MainForm.cs +++ b/JenkinsTray/UI/MainForm.cs @@ -69,6 +69,7 @@ protected override void OnLoad(EventArgs e) base.OnLoad(e); Initialize(); UpdateClaimPluginIntegration(); + SetFoldersVisibility(); LoadIcons(); LoadProjects(); } @@ -76,6 +77,7 @@ protected override void OnLoad(EventArgs e) private void configurationService_ConfigurationUpdated() { UpdateClaimPluginIntegration(); + SetFoldersVisibility(); LoadProjects(); if (ConfigurationService.GeneralSettings.UpdateMainWindowIcon == false) ResetIcon(); @@ -610,6 +612,11 @@ private void UpdateClaimPluginIntegration() } } + private void SetFoldersVisibility() + { + folderGridColumn.Visible = ConfigurationService.GeneralSettings.ShowFolders; + } + private void acknowledgeProjectMenuItem_Click(object sender, EventArgs e) { var menuItem = sender as ToolStripMenuItem; diff --git a/JenkinsTray/UI/SettingsForm.cs b/JenkinsTray/UI/SettingsForm.cs index e7182ad..4f7699c 100644 --- a/JenkinsTray/UI/SettingsForm.cs +++ b/JenkinsTray/UI/SettingsForm.cs @@ -46,32 +46,45 @@ private void SettingsForm_Load(object sender, EventArgs e) refreshSpinEdit.Value = ConfigurationService.GeneralSettings.RefreshIntervalInSeconds; updateMainWindowIconCheckEdit.Checked = ConfigurationService.GeneralSettings.UpdateMainWindowIcon; integrateWithClaimPluginCheckEdit.Checked = ConfigurationService.GeneralSettings.IntegrateWithClaimPlugin; - showProjectDisplayNameCheckEdit.Checked = ConfigurationService.GeneralSettings.ShowProjectDisplayNameInMainUI; - checkForUpdatesCheckEdit.Checked = ConfigurationService.GeneralSettings.CheckForUpdates; + + //TODO: Add a showFoldersCheckEdit control on the General tab of the Settings Form and swap the lines below + checkForUpdatesCheckEdit.Checked = ConfigurationService.GeneralSettings.ShowFolders; + //checkForUpdatesCheckEdit.Checked = ConfigurationService.GeneralSettings.CheckForUpdates; + //showFoldersCheckEdit.Checked = ConfigurationService.GeneralSettings.ShowFolders; + notificationsSettingsControl.InitializeValues(); } private void SettingsForm_FormClosing(object sender, FormClosingEventArgs e) { - var refreshInterval = (int) refreshSpinEdit.Value; + var refreshInterval = (int)refreshSpinEdit.Value; ConfigurationService.SetRefreshIntervalInSeconds(refreshInterval); ConfigurationService.SetUpdateMainWindowIcon(updateMainWindowIconCheckEdit.Checked); ConfigurationService.SetIntegrateWithClaimPlugin(integrateWithClaimPluginCheckEdit.Checked); - ConfigurationService.SetShowProjectDisplayName(showProjectDisplayNameCheckEdit.Checked); - ConfigurationService.SetCheckForUpdates(checkForUpdatesCheckEdit.Checked); ConfigurationService.SetTreadUnstableAsFailed(notificationsSettingsControl.TreadUnstableAsFailed()); ConfigurationService.SetSoundNotifications(notificationsSettingsControl.SoundNotificationsEnabled()); + + //TODO: Add a showFoldersCheckEdit control on the General tab of the Settings Form and swap the lines below + ConfigurationService.SetShowFolders(checkForUpdatesCheckEdit.Checked); + //ConfigurationService.SetShowFolders(showFoldersCheckEdit.Checked); + //ConfigurationService.SetCheckForUpdates(checkForUpdatesCheckEdit.Checked); + notificationsSettingsControl.InvalidateData(); } private void checkForUpdatesCheckEdit_CheckedChanged(object sender, EventArgs e) { - if (applicationUpdateService == null) - { - applicationUpdateService = - (ApplicationUpdateService) ContextRegistry.GetContext().GetObject("ApplicationUpdateService"); - } - applicationUpdateService.EnableTimer(checkForUpdatesCheckEdit.Checked); + //TODO: Uncomment this after the showFoldersCheckEdit is added + //if (applicationUpdateService == null) + //{ + // applicationUpdateService = + // (ApplicationUpdateService) ContextRegistry.GetContext().GetObject("ApplicationUpdateService"); + //} + //applicationUpdateService.EnableTimer(checkForUpdatesCheckEdit.Checked); + + //TODO: Move this into its own event handler for showFoldersCheckEdit_CheckedChanged + ConfigurationService.SetShowFolders(checkForUpdatesCheckEdit.Checked); + ConfigurationService.SaveConfiguration(); } } } \ No newline at end of file From 9275b40199f1a913eb0b3672d3b8b3d912d24018 Mon Sep 17 00:00:00 2001 From: Khang Yeen Lee Date: Sat, 22 Apr 2017 14:16:44 +0200 Subject: [PATCH 3/7] Added showFoldersCheckEdit in Settings > General tab. --- JenkinsTray/UI/SettingsForm.Designer.cs | 115 ++++++++---------------- 1 file changed, 36 insertions(+), 79 deletions(-) diff --git a/JenkinsTray/UI/SettingsForm.Designer.cs b/JenkinsTray/UI/SettingsForm.Designer.cs index 24e913a..edbd029 100644 --- a/JenkinsTray/UI/SettingsForm.Designer.cs +++ b/JenkinsTray/UI/SettingsForm.Designer.cs @@ -37,14 +37,12 @@ private void InitializeComponent() this.generalTabPage = new DevExpress.XtraTab.XtraTabPage(); this.groupControl1 = new DevExpress.XtraEditors.GroupControl(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); - this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel(); - this.checkForUpdatesCheckEdit = new DevExpress.XtraEditors.CheckEdit(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.refreshLabel = new DevExpress.XtraEditors.LabelControl(); this.refreshSpinEdit = new DevExpress.XtraEditors.SpinEdit(); - this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); + this.showFoldersCheckEdit = new DevExpress.XtraEditors.CheckEdit(); + this.checkForUpdatesCheckEdit = new DevExpress.XtraEditors.CheckEdit(); this.updateMainWindowIconCheckEdit = new DevExpress.XtraEditors.CheckEdit(); - this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); this.integrateWithClaimPluginCheckEdit = new DevExpress.XtraEditors.CheckEdit(); this.showProjectDisplayNameCheckEdit = new DevExpress.XtraEditors.CheckEdit(); ((System.ComponentModel.ISupportInitialize)(this.tabControl)).BeginInit(); @@ -55,13 +53,11 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.groupControl1)).BeginInit(); this.groupControl1.SuspendLayout(); this.tableLayoutPanel2.SuspendLayout(); - this.tableLayoutPanel5.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.checkForUpdatesCheckEdit.Properties)).BeginInit(); this.tableLayoutPanel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.refreshSpinEdit.Properties)).BeginInit(); - this.tableLayoutPanel3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.showFoldersCheckEdit.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.checkForUpdatesCheckEdit.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.updateMainWindowIconCheckEdit.Properties)).BeginInit(); - this.tableLayoutPanel4.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.integrateWithClaimPluginCheckEdit.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.showProjectDisplayNameCheckEdit.Properties)).BeginInit(); this.SuspendLayout(); @@ -139,15 +135,17 @@ private void InitializeComponent() // this.tableLayoutPanel2.ColumnCount = 1; this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel5, 0, 3); this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel1, 0, 0); - this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel3, 0, 1); - this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel4, 0, 2); - this.tableLayoutPanel2.Controls.Add(this.checkForUpdatesCheckEdit, 0, 4); + this.tableLayoutPanel2.Controls.Add(this.showFoldersCheckEdit, 0, 4); + this.tableLayoutPanel2.Controls.Add(this.checkForUpdatesCheckEdit, 0, 5); + this.tableLayoutPanel2.Controls.Add(this.updateMainWindowIconCheckEdit, 0, 1); + this.tableLayoutPanel2.Controls.Add(this.integrateWithClaimPluginCheckEdit, 0, 2); + this.tableLayoutPanel2.Controls.Add(this.showProjectDisplayNameCheckEdit, 0, 3); this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel2.Location = new System.Drawing.Point(2, 22); this.tableLayoutPanel2.Name = "tableLayoutPanel2"; - this.tableLayoutPanel2.RowCount = 6; + this.tableLayoutPanel2.RowCount = 7; + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); @@ -157,31 +155,6 @@ private void InitializeComponent() this.tableLayoutPanel2.Size = new System.Drawing.Size(713, 380); this.tableLayoutPanel2.TabIndex = 4; // - // tableLayoutPanel5 - // - this.tableLayoutPanel5.AutoSize = true; - this.tableLayoutPanel5.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.tableLayoutPanel5.ColumnCount = 1; - this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel5.Controls.Add(this.showProjectDisplayNameCheckEdit, 0, 0); - this.tableLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel5.Location = new System.Drawing.Point(3, 97); - this.tableLayoutPanel5.Name = "tableLayoutPanel5"; - this.tableLayoutPanel5.RowCount = 1; - this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel5.Size = new System.Drawing.Size(707, 25); - this.tableLayoutPanel5.TabIndex = 6; - // - // checkForUpdatesCheckEdit - // - this.checkForUpdatesCheckEdit.Location = new System.Drawing.Point(3, 128); - this.checkForUpdatesCheckEdit.Name = "checkForUpdatesCheckEdit"; - this.checkForUpdatesCheckEdit.Properties.AutoWidth = true; - this.checkForUpdatesCheckEdit.Properties.Caption = "&Check for updates periodically"; - this.checkForUpdatesCheckEdit.Size = new System.Drawing.Size(167, 19); - this.checkForUpdatesCheckEdit.TabIndex = 0; - this.checkForUpdatesCheckEdit.CheckedChanged += new System.EventHandler(this.checkForUpdatesCheckEdit_CheckedChanged); - // // tableLayoutPanel1 // this.tableLayoutPanel1.AutoSize = true; @@ -228,49 +201,38 @@ private void InitializeComponent() this.refreshSpinEdit.Size = new System.Drawing.Size(100, 20); this.refreshSpinEdit.TabIndex = 1; // - // tableLayoutPanel3 - // - this.tableLayoutPanel3.AutoSize = true; - this.tableLayoutPanel3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.tableLayoutPanel3.ColumnCount = 1; - this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.tableLayoutPanel3.Controls.Add(this.updateMainWindowIconCheckEdit, 0, 0); - this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel3.Location = new System.Drawing.Point(3, 35); - this.tableLayoutPanel3.Name = "tableLayoutPanel3"; - this.tableLayoutPanel3.RowCount = 1; - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel3.Size = new System.Drawing.Size(707, 25); - this.tableLayoutPanel3.TabIndex = 4; + // showFoldersCheckEdit + // + this.showFoldersCheckEdit.Location = new System.Drawing.Point(3, 110); + this.showFoldersCheckEdit.Name = "showFoldersCheckEdit"; + this.showFoldersCheckEdit.Properties.AutoWidth = true; + this.showFoldersCheckEdit.Properties.Caption = "Show &folders"; + this.showFoldersCheckEdit.Size = new System.Drawing.Size(85, 19); + this.showFoldersCheckEdit.TabIndex = 0; + this.showFoldersCheckEdit.CheckedChanged += new System.EventHandler(this.checkForUpdatesCheckEdit_CheckedChanged); + // + // checkForUpdatesCheckEdit + // + this.checkForUpdatesCheckEdit.Location = new System.Drawing.Point(3, 135); + this.checkForUpdatesCheckEdit.Name = "checkForUpdatesCheckEdit"; + this.checkForUpdatesCheckEdit.Properties.AutoWidth = true; + this.checkForUpdatesCheckEdit.Properties.Caption = "&Check for updates periodically"; + this.checkForUpdatesCheckEdit.Size = new System.Drawing.Size(167, 19); + this.checkForUpdatesCheckEdit.TabIndex = 0; + this.checkForUpdatesCheckEdit.CheckedChanged += new System.EventHandler(this.checkForUpdatesCheckEdit_CheckedChanged); // // updateMainWindowIconCheckEdit // - this.updateMainWindowIconCheckEdit.Location = new System.Drawing.Point(3, 3); + this.updateMainWindowIconCheckEdit.Location = new System.Drawing.Point(3, 35); this.updateMainWindowIconCheckEdit.Name = "updateMainWindowIconCheckEdit"; this.updateMainWindowIconCheckEdit.Properties.AutoWidth = true; this.updateMainWindowIconCheckEdit.Properties.Caption = "&Update the main window\'s icon"; this.updateMainWindowIconCheckEdit.Size = new System.Drawing.Size(170, 19); this.updateMainWindowIconCheckEdit.TabIndex = 5; // - // tableLayoutPanel4 - // - this.tableLayoutPanel4.AutoSize = true; - this.tableLayoutPanel4.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.tableLayoutPanel4.ColumnCount = 1; - this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel4.Controls.Add(this.integrateWithClaimPluginCheckEdit, 0, 0); - this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel4.Location = new System.Drawing.Point(3, 66); - this.tableLayoutPanel4.Name = "tableLayoutPanel4"; - this.tableLayoutPanel4.RowCount = 1; - this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel4.Size = new System.Drawing.Size(707, 25); - this.tableLayoutPanel4.TabIndex = 5; - // // integrateWithClaimPluginCheckEdit // - this.integrateWithClaimPluginCheckEdit.Location = new System.Drawing.Point(3, 3); + this.integrateWithClaimPluginCheckEdit.Location = new System.Drawing.Point(3, 60); this.integrateWithClaimPluginCheckEdit.Name = "integrateWithClaimPluginCheckEdit"; this.integrateWithClaimPluginCheckEdit.Properties.AutoWidth = true; this.integrateWithClaimPluginCheckEdit.Properties.Caption = "Integrate with Clai&m plugin (experimental)"; @@ -279,7 +241,7 @@ private void InitializeComponent() // // showProjectDisplayNameCheckEdit // - this.showProjectDisplayNameCheckEdit.Location = new System.Drawing.Point(3, 3); + this.showProjectDisplayNameCheckEdit.Location = new System.Drawing.Point(3, 85); this.showProjectDisplayNameCheckEdit.Name = "showProjectDisplayNameCheckEdit"; this.showProjectDisplayNameCheckEdit.Properties.AutoWidth = true; this.showProjectDisplayNameCheckEdit.Properties.Caption = "&Show display name over project name in Main UI"; @@ -308,15 +270,12 @@ private void InitializeComponent() this.groupControl1.ResumeLayout(false); this.tableLayoutPanel2.ResumeLayout(false); this.tableLayoutPanel2.PerformLayout(); - this.tableLayoutPanel5.ResumeLayout(false); - this.tableLayoutPanel5.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.checkForUpdatesCheckEdit.Properties)).EndInit(); this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.refreshSpinEdit.Properties)).EndInit(); - this.tableLayoutPanel3.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.showFoldersCheckEdit.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.checkForUpdatesCheckEdit.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.updateMainWindowIconCheckEdit.Properties)).EndInit(); - this.tableLayoutPanel4.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.integrateWithClaimPluginCheckEdit.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.showProjectDisplayNameCheckEdit.Properties)).EndInit(); this.ResumeLayout(false); @@ -336,12 +295,10 @@ private void InitializeComponent() private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; private DevExpress.XtraEditors.LabelControl refreshLabel; private DevExpress.XtraEditors.GroupControl groupControl1; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; private DevExpress.XtraEditors.CheckEdit updateMainWindowIconCheckEdit; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4; private DevExpress.XtraEditors.CheckEdit integrateWithClaimPluginCheckEdit; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5; private DevExpress.XtraEditors.CheckEdit checkForUpdatesCheckEdit; private DevExpress.XtraEditors.CheckEdit showProjectDisplayNameCheckEdit; + private DevExpress.XtraEditors.CheckEdit showFoldersCheckEdit; } } \ No newline at end of file From 036cdef99d3d81fe960dabbecc913b81094b8cc8 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Mon, 24 Apr 2017 12:41:53 -0400 Subject: [PATCH 4/7] Wiring up the showFoldersCheckEdit --- JenkinsTray/UI/Controls/ProjectListControl.cs | 17 +++++---- JenkinsTray/UI/SettingsForm.Designer.cs | 2 +- JenkinsTray/UI/SettingsForm.cs | 35 ++++++++----------- 3 files changed, 25 insertions(+), 29 deletions(-) diff --git a/JenkinsTray/UI/Controls/ProjectListControl.cs b/JenkinsTray/UI/Controls/ProjectListControl.cs index 3e2162b..6b71f2d 100644 --- a/JenkinsTray/UI/Controls/ProjectListControl.cs +++ b/JenkinsTray/UI/Controls/ProjectListControl.cs @@ -15,7 +15,7 @@ public partial class ProjectListControl : XtraUserControl { private List projectsDataSource; private Server server; - + public ProjectListControl() { InitializeComponent(); @@ -27,6 +27,7 @@ public ProjectListControl() public void Initialize() { + SetFoldersVisibility(ConfigurationService.GeneralSettings.ShowFolders); ConfigurationService.ConfigurationUpdated += configurationService_ConfigurationUpdated; } @@ -61,9 +62,7 @@ private void RefreshList() Enabled = false; var status = string.Format(JenkinsTrayResources.LoadingProjects_FormatString, server.Url); Controller.SetStatus(status, true); - - folderNameGridColumn.Visible = ConfigurationService.GeneralSettings.ShowFolders; - + // run the process in background var process = new Process("Loading project " + server.Url); IList projects = null; @@ -104,12 +103,16 @@ private void SetProjectsDataSource(List dataSource) private void configurationService_ConfigurationUpdated() { - SetFoldersVisibility(); + if (folderNameGridColumn.Visible != ConfigurationService.GeneralSettings.ShowFolders) + { + SetFoldersVisibility(ConfigurationService.GeneralSettings.ShowFolders); + RefreshList(); + } } - private void SetFoldersVisibility() + private void SetFoldersVisibility(bool showFolders) { - folderNameGridColumn.Visible = ConfigurationService.GeneralSettings.ShowFolders; + folderNameGridColumn.Visible = showFolders; } private void projectsGridView_CustomUnboundColumnData(object sender, CustomColumnDataEventArgs e) diff --git a/JenkinsTray/UI/SettingsForm.Designer.cs b/JenkinsTray/UI/SettingsForm.Designer.cs index edbd029..d3ac986 100644 --- a/JenkinsTray/UI/SettingsForm.Designer.cs +++ b/JenkinsTray/UI/SettingsForm.Designer.cs @@ -209,7 +209,7 @@ private void InitializeComponent() this.showFoldersCheckEdit.Properties.Caption = "Show &folders"; this.showFoldersCheckEdit.Size = new System.Drawing.Size(85, 19); this.showFoldersCheckEdit.TabIndex = 0; - this.showFoldersCheckEdit.CheckedChanged += new System.EventHandler(this.checkForUpdatesCheckEdit_CheckedChanged); + this.showFoldersCheckEdit.CheckedChanged += new System.EventHandler(this.showFoldersCheckEdit_CheckedChanged); // // checkForUpdatesCheckEdit // diff --git a/JenkinsTray/UI/SettingsForm.cs b/JenkinsTray/UI/SettingsForm.cs index 4f7699c..acaeb86 100644 --- a/JenkinsTray/UI/SettingsForm.cs +++ b/JenkinsTray/UI/SettingsForm.cs @@ -46,12 +46,8 @@ private void SettingsForm_Load(object sender, EventArgs e) refreshSpinEdit.Value = ConfigurationService.GeneralSettings.RefreshIntervalInSeconds; updateMainWindowIconCheckEdit.Checked = ConfigurationService.GeneralSettings.UpdateMainWindowIcon; integrateWithClaimPluginCheckEdit.Checked = ConfigurationService.GeneralSettings.IntegrateWithClaimPlugin; - - //TODO: Add a showFoldersCheckEdit control on the General tab of the Settings Form and swap the lines below - checkForUpdatesCheckEdit.Checked = ConfigurationService.GeneralSettings.ShowFolders; - //checkForUpdatesCheckEdit.Checked = ConfigurationService.GeneralSettings.CheckForUpdates; - //showFoldersCheckEdit.Checked = ConfigurationService.GeneralSettings.ShowFolders; - + showFoldersCheckEdit.Checked = ConfigurationService.GeneralSettings.ShowFolders; + checkForUpdatesCheckEdit.Checked = ConfigurationService.GeneralSettings.CheckForUpdates; notificationsSettingsControl.InitializeValues(); } @@ -63,27 +59,24 @@ private void SettingsForm_FormClosing(object sender, FormClosingEventArgs e) ConfigurationService.SetIntegrateWithClaimPlugin(integrateWithClaimPluginCheckEdit.Checked); ConfigurationService.SetTreadUnstableAsFailed(notificationsSettingsControl.TreadUnstableAsFailed()); ConfigurationService.SetSoundNotifications(notificationsSettingsControl.SoundNotificationsEnabled()); - - //TODO: Add a showFoldersCheckEdit control on the General tab of the Settings Form and swap the lines below - ConfigurationService.SetShowFolders(checkForUpdatesCheckEdit.Checked); - //ConfigurationService.SetShowFolders(showFoldersCheckEdit.Checked); - //ConfigurationService.SetCheckForUpdates(checkForUpdatesCheckEdit.Checked); - + ConfigurationService.SetShowFolders(showFoldersCheckEdit.Checked); + ConfigurationService.SetCheckForUpdates(checkForUpdatesCheckEdit.Checked); notificationsSettingsControl.InvalidateData(); } private void checkForUpdatesCheckEdit_CheckedChanged(object sender, EventArgs e) { - //TODO: Uncomment this after the showFoldersCheckEdit is added - //if (applicationUpdateService == null) - //{ - // applicationUpdateService = - // (ApplicationUpdateService) ContextRegistry.GetContext().GetObject("ApplicationUpdateService"); - //} - //applicationUpdateService.EnableTimer(checkForUpdatesCheckEdit.Checked); + if (applicationUpdateService == null) + { + applicationUpdateService = + (ApplicationUpdateService)ContextRegistry.GetContext().GetObject("ApplicationUpdateService"); + } + applicationUpdateService.EnableTimer(checkForUpdatesCheckEdit.Checked); + } - //TODO: Move this into its own event handler for showFoldersCheckEdit_CheckedChanged - ConfigurationService.SetShowFolders(checkForUpdatesCheckEdit.Checked); + private void showFoldersCheckEdit_CheckedChanged(object sender, EventArgs e) + { + ConfigurationService.SetShowFolders(showFoldersCheckEdit.Checked); ConfigurationService.SaveConfiguration(); } } From 641ac6599d70bca0dd1df160b8d8b07589efee82 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Sat, 29 Apr 2017 11:03:59 -0400 Subject: [PATCH 5/7] Added code in the LegacyConfigurationService to initialize the ShowFolders setting for older configuration files --- .../Legacy/BusinessComponents/LegacyConfigurationService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/JenkinsTray/Legacy/BusinessComponents/LegacyConfigurationService.cs b/JenkinsTray/Legacy/BusinessComponents/LegacyConfigurationService.cs index c5c0500..6adac43 100644 --- a/JenkinsTray/Legacy/BusinessComponents/LegacyConfigurationService.cs +++ b/JenkinsTray/Legacy/BusinessComponents/LegacyConfigurationService.cs @@ -95,6 +95,7 @@ public Configuration LoadConfiguration() generalSettings.UpdateMainWindowIcon = propertiesFile.GetBoolValue("general.UpdateMainWindowIcon", true); generalSettings.IntegrateWithClaimPlugin = propertiesFile.GetBoolValue("general.IntegrateWithClaimPlugin", true); + generalSettings.ShowFolders = propertiesFile.GetBoolValue("general.ShowFolders", false); var res = new Configuration { From 7d35440f2af21eae739a7a1048be61becea54448 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Sat, 29 Apr 2017 12:11:15 -0400 Subject: [PATCH 6/7] Changed code to always show all projects regardless of whether Show Folders is enabled. --- .../BusinessComponents/JenkinsService.cs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/JenkinsTray/BusinessComponents/JenkinsService.cs b/JenkinsTray/BusinessComponents/JenkinsService.cs index 4b13f93..412fa08 100644 --- a/JenkinsTray/BusinessComponents/JenkinsService.cs +++ b/JenkinsTray/BusinessComponents/JenkinsService.cs @@ -64,9 +64,7 @@ public IList LoadProjects(Server server) public List GetProjects(XmlNodeList jobElements, Server server, string folder = "") { var projects = new List(); - - var showFolders = ConfigurationService.GeneralSettings.ShowFolders; - + foreach (XmlNode jobElement in jobElements) { var projectName = jobElement.SelectSingleNode("name").InnerText; @@ -75,15 +73,12 @@ public List GetProjects(XmlNodeList jobElements, Server server, string // If the job is a folder we need to recursively get the jobs within. if (projectColor == null) //folders do not have a color node { - if (showFolders) - { - var url = NetUtils.ConcatUrls(projectUrl, "/api/xml?tree=jobs[name,url,color]"); - var xmlStr = DownloadString(server.Credentials, url, false, server.IgnoreUntrustedCertificate); - var xml = new XmlDocument(); - xml.LoadXml(xmlStr); - var nodes = xml.SelectNodes("/folder/job"); - projects.AddRange(GetProjects(nodes, server, projectName)); - } + var url = NetUtils.ConcatUrls(projectUrl, "/api/xml?tree=jobs[name,url,color]"); + var xmlStr = DownloadString(server.Credentials, url, false, server.IgnoreUntrustedCertificate); + var xml = new XmlDocument(); + xml.LoadXml(xmlStr); + var nodes = xml.SelectNodes("/folder/job"); + projects.AddRange(GetProjects(nodes, server, projectName)); } else { From c178a2d28b5d698332a04dd33ae69389718d8ec6 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Sat, 29 Apr 2017 12:33:30 -0400 Subject: [PATCH 7/7] Added back code for ShowProjectDisplayNameInMainUI --- JenkinsTray/UI/SettingsForm.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/JenkinsTray/UI/SettingsForm.cs b/JenkinsTray/UI/SettingsForm.cs index acaeb86..752668f 100644 --- a/JenkinsTray/UI/SettingsForm.cs +++ b/JenkinsTray/UI/SettingsForm.cs @@ -46,6 +46,7 @@ private void SettingsForm_Load(object sender, EventArgs e) refreshSpinEdit.Value = ConfigurationService.GeneralSettings.RefreshIntervalInSeconds; updateMainWindowIconCheckEdit.Checked = ConfigurationService.GeneralSettings.UpdateMainWindowIcon; integrateWithClaimPluginCheckEdit.Checked = ConfigurationService.GeneralSettings.IntegrateWithClaimPlugin; + showProjectDisplayNameCheckEdit.Checked = ConfigurationService.GeneralSettings.ShowProjectDisplayNameInMainUI; showFoldersCheckEdit.Checked = ConfigurationService.GeneralSettings.ShowFolders; checkForUpdatesCheckEdit.Checked = ConfigurationService.GeneralSettings.CheckForUpdates; notificationsSettingsControl.InitializeValues(); @@ -57,10 +58,11 @@ private void SettingsForm_FormClosing(object sender, FormClosingEventArgs e) ConfigurationService.SetRefreshIntervalInSeconds(refreshInterval); ConfigurationService.SetUpdateMainWindowIcon(updateMainWindowIconCheckEdit.Checked); ConfigurationService.SetIntegrateWithClaimPlugin(integrateWithClaimPluginCheckEdit.Checked); + ConfigurationService.SetShowProjectDisplayName(showProjectDisplayNameCheckEdit.Checked); + ConfigurationService.SetCheckForUpdates(checkForUpdatesCheckEdit.Checked); ConfigurationService.SetTreadUnstableAsFailed(notificationsSettingsControl.TreadUnstableAsFailed()); ConfigurationService.SetSoundNotifications(notificationsSettingsControl.SoundNotificationsEnabled()); ConfigurationService.SetShowFolders(showFoldersCheckEdit.Checked); - ConfigurationService.SetCheckForUpdates(checkForUpdatesCheckEdit.Checked); notificationsSettingsControl.InvalidateData(); }