From 6464e46df0f97d883f2976f40363b232068a2eb2 Mon Sep 17 00:00:00 2001 From: Thomas Nind Date: Fri, 20 May 2022 12:58:40 +0100 Subject: [PATCH] Adds user setting ExpandAllInCohortBuilder Fixes #1183 --- CHANGELOG.md | 1 + .../SimpleDialogs/UserSettingsUI.Designer.cs | 17 +++++++++++++++-- Rdmp.UI/SimpleDialogs/UserSettingsUI.cs | 5 +++-- .../CohortIdentificationConfigurationUI.cs | 5 ++++- .../Settings/UserSettings.cs | 10 ++++++++++ 5 files changed, 33 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a25cf06a98..ae5051658f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added `CrashAtEnd` system for DLE that allows Attachers to flag a load as a failure without halting execution [#1157](https://github.com/HicServices/RDMP/issues/1157) - Added UserSettings editing UI to Console Gui +- Added ability to suppress tree expansion when opening Cohort Builder configurations ## [7.0.12] - 2022-05-16 diff --git a/Rdmp.UI/SimpleDialogs/UserSettingsUI.Designer.cs b/Rdmp.UI/SimpleDialogs/UserSettingsUI.Designer.cs index adea4c6e1a..eaf83073ab 100644 --- a/Rdmp.UI/SimpleDialogs/UserSettingsUI.Designer.cs +++ b/Rdmp.UI/SimpleDialogs/UserSettingsUI.Designer.cs @@ -85,6 +85,7 @@ private void InitializeComponent() this.userSettingsToolTips = new System.Windows.Forms.ToolTip(this.components); this.tbFind = new System.Windows.Forms.TextBox(); this.label14 = new System.Windows.Forms.Label(); + this.cbExpandAllInCohortBuilder = new System.Windows.Forms.CheckBox(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.olvErrorCodes)).BeginInit(); this.groupBox2.SuspendLayout(); @@ -428,12 +429,12 @@ private void InitializeComponent() this.groupBox3.TabStop = false; this.groupBox3.Text = "Tabbed UI Options"; // - // cbAutoRunQueries + // cbAutoRunSqlQueries // this.cbAutoRunSqlQueries.AutoSize = true; this.cbAutoRunSqlQueries.Location = new System.Drawing.Point(4, 102); this.cbAutoRunSqlQueries.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.cbAutoRunSqlQueries.Name = "cbAutoRunQueries"; + this.cbAutoRunSqlQueries.Name = "cbAutoRunSqlQueries"; this.cbAutoRunSqlQueries.Size = new System.Drawing.Size(138, 19); this.cbAutoRunSqlQueries.TabIndex = 20; this.cbAutoRunSqlQueries.Text = "Auto Run Sql Queries"; @@ -497,6 +498,7 @@ private void InitializeComponent() // // groupBox8 // + this.groupBox8.Controls.Add(this.cbExpandAllInCohortBuilder); this.groupBox8.Controls.Add(this.cbStrictValidationForCohortBuilderContainers); this.groupBox8.Controls.Add(this.cbShowCohortWizard); this.groupBox8.Location = new System.Drawing.Point(3, 174); @@ -686,6 +688,16 @@ private void InitializeComponent() this.label14.TabIndex = 26; this.label14.Text = "Find Setting:"; // + // cbAutoExpandInCohortBuilder + // + this.cbExpandAllInCohortBuilder.AutoSize = true; + this.cbExpandAllInCohortBuilder.Location = new System.Drawing.Point(6, 64); + this.cbExpandAllInCohortBuilder.Name = "cbAutoExpandInCohortBuilder"; + this.cbExpandAllInCohortBuilder.Size = new System.Drawing.Size(175, 19); + this.cbExpandAllInCohortBuilder.TabIndex = 3; + this.cbExpandAllInCohortBuilder.Text = "Expand All in Cohort Builder"; + this.cbExpandAllInCohortBuilder.UseVisualStyleBackColor = true; + // // UserSettingsFileUI // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); @@ -782,5 +794,6 @@ private void InitializeComponent() private System.Windows.Forms.TextBox tbFind; private System.Windows.Forms.Label label14; private System.Windows.Forms.CheckBox cbAutoRunSqlQueries; + private System.Windows.Forms.CheckBox cbExpandAllInCohortBuilder; } } \ No newline at end of file diff --git a/Rdmp.UI/SimpleDialogs/UserSettingsUI.cs b/Rdmp.UI/SimpleDialogs/UserSettingsUI.cs index 631427118b..d36e697910 100644 --- a/Rdmp.UI/SimpleDialogs/UserSettingsUI.cs +++ b/Rdmp.UI/SimpleDialogs/UserSettingsUI.cs @@ -100,6 +100,7 @@ public UserSettingsFileUI(IActivateItems activator) RegisterCheckbox(cbSelectiveRefresh, nameof(UserSettings.SelectiveRefresh)); RegisterCheckbox(cbAlwaysJoinEverything,nameof(UserSettings.AlwaysJoinEverything)); RegisterCheckbox(cbAutoRunSqlQueries, nameof(UserSettings.AutoRunSqlQueries)); + RegisterCheckbox(cbExpandAllInCohortBuilder, nameof(UserSettings.ExpandAllInCohortBuilder)); AddTooltip(label7, nameof(UserSettings.CreateDatabaseTimeout)); AddTooltip(tbCreateDatabaseTimeout, nameof(UserSettings.CreateDatabaseTimeout)); @@ -190,9 +191,9 @@ private void CheckboxCheckedChanged(object sender, EventArgs e) { if (!_bLoaded) return; - + var cb = (CheckBox)sender; - checkboxDictionary[cb].SetValue(null,cb.Checked); + checkboxDictionary[cb].SetValue(null, cb.Checked); } private void ddTheme_SelectedIndexChanged(object sender, EventArgs e) diff --git a/Rdmp.UI/SubComponents/CohortIdentificationConfigurationUI.cs b/Rdmp.UI/SubComponents/CohortIdentificationConfigurationUI.cs index cf372dff22..0ef491820e 100644 --- a/Rdmp.UI/SubComponents/CohortIdentificationConfigurationUI.cs +++ b/Rdmp.UI/SubComponents/CohortIdentificationConfigurationUI.cs @@ -34,6 +34,7 @@ using Rdmp.UI.TestsAndSetup.ServicePropogation; using ReusableLibraryCode; using ReusableLibraryCode.Icons.IconProvision; +using ReusableLibraryCode.Settings; using Timer = System.Windows.Forms.Timer; @@ -247,7 +248,9 @@ public override void SetDatabaseObject(IActivateItems activator, CohortIdentific }); _commonFunctionality.MenuBuilt += MenuBuilt; tlvCic.AddObject(_configuration); - tlvCic.ExpandAll(); + + if(UserSettings.ExpandAllInCohortBuilder) + tlvCic.ExpandAll(); } CommonFunctionality.AddToMenu(cbIncludeCumulative); diff --git a/Reusable/ReusableLibraryCode/Settings/UserSettings.cs b/Reusable/ReusableLibraryCode/Settings/UserSettings.cs index 7616bbe9dc..13143669b2 100644 --- a/Reusable/ReusableLibraryCode/Settings/UserSettings.cs +++ b/Reusable/ReusableLibraryCode/Settings/UserSettings.cs @@ -378,6 +378,16 @@ public static bool AutoRunSqlQueries set { AppSettings.AddOrUpdateValue("AutoRunSqlQueries", value); } } + /// + /// Enable to automatically expand the tree when opening or creating cohorts in + /// Cohort Builder + /// + public static bool ExpandAllInCohortBuilder + { + get { return AppSettings.GetValueOrDefault("ExpandAllInCohortBuilder", true); } + set { AppSettings.AddOrUpdateValue("ExpandAllInCohortBuilder", value); } + } + #endregion