Skip to content

Commit afa1244

Browse files
committed
Settings dialog: add configuration of default tree settings
1 parent 8044267 commit afa1244

File tree

1 file changed

+49
-3
lines changed

1 file changed

+49
-3
lines changed

src/GuiRunner/TestCentric.Gui/SettingsPages/TreeSettingsPage.cs

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ public class TreeSettingsPage : SettingsPage
1515
{
1616
private System.Windows.Forms.GroupBox groupBox1;
1717
private System.Windows.Forms.Label label1;
18+
private System.Windows.Forms.Label label2;
19+
private System.Windows.Forms.Label label3;
1820
private System.Windows.Forms.CheckBox showCheckBoxesCheckBox;
21+
private System.Windows.Forms.ComboBox displayFormatComboBox;
1922
private System.Windows.Forms.HelpProvider helpProvider1;
2023
private Label label6;
2124
private PictureBox successImage;
@@ -63,7 +66,10 @@ private void InitializeComponent()
6366
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TreeSettingsPage));
6467
this.groupBox1 = new System.Windows.Forms.GroupBox();
6568
this.label1 = new System.Windows.Forms.Label();
69+
this.label2 = new System.Windows.Forms.Label();
70+
this.label3 = new System.Windows.Forms.Label();
6671
this.showCheckBoxesCheckBox = new System.Windows.Forms.CheckBox();
72+
this.displayFormatComboBox = new System.Windows.Forms.ComboBox();
6773
this.helpProvider1 = new System.Windows.Forms.HelpProvider();
6874
this.label6 = new System.Windows.Forms.Label();
6975
this.successImage = new System.Windows.Forms.PictureBox();
@@ -101,16 +107,48 @@ private void InitializeComponent()
101107
this.label1.TabIndex = 9;
102108
this.label1.Text = "Tree View";
103109
//
110+
// label2
111+
//
112+
this.label2.AutoSize = true;
113+
this.label2.Location = new System.Drawing.Point(8, 115);
114+
this.label2.Name = "label2";
115+
this.label2.Size = new System.Drawing.Size(55, 13);
116+
this.label2.TabIndex = 9;
117+
this.label2.Text = "Default settings for new projects:";
118+
//
119+
// label3
120+
//
121+
this.label3.AutoSize = true;
122+
this.label3.Location = new System.Drawing.Point(32, 168);
123+
this.label3.Name = "label3";
124+
this.label3.Size = new System.Drawing.Size(55, 13);
125+
this.label3.TabIndex = 9;
126+
this.label3.Text = "Default tree display format:";
127+
//
104128
// showCheckBoxesCheckBox
105129
//
106130
this.showCheckBoxesCheckBox.AutoSize = true;
107-
this.helpProvider1.SetHelpString(this.showCheckBoxesCheckBox, "If checked, a checkbox is displayed next to each item in the tree.");
108-
this.showCheckBoxesCheckBox.Location = new System.Drawing.Point(32, 120);
131+
this.helpProvider1.SetHelpString(this.showCheckBoxesCheckBox, "Selects the default display of the checkbox when a new project is created.");
132+
this.showCheckBoxesCheckBox.Location = new System.Drawing.Point(32, 140);
109133
this.showCheckBoxesCheckBox.Name = "showCheckBoxesCheckBox";
110134
this.helpProvider1.SetShowHelp(this.showCheckBoxesCheckBox, true);
111135
this.showCheckBoxesCheckBox.Size = new System.Drawing.Size(227, 17);
112136
this.showCheckBoxesCheckBox.TabIndex = 36;
113-
this.showCheckBoxesCheckBox.Text = "Display a checkbox next to each tree item.";
137+
this.showCheckBoxesCheckBox.Text = "Default display of a checkbox next to each tree item.";
138+
//
139+
// displayFormatComboBox
140+
//
141+
this.displayFormatComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
142+
this.helpProvider1.SetHelpString(this.displayFormatComboBox, "Selects the default tree display format when a new project is created");
143+
this.displayFormatComboBox.ItemHeight = 13;
144+
this.displayFormatComboBox.Items.AddRange(new object[] {
145+
"NUnit Tree",
146+
"Test List"});
147+
this.displayFormatComboBox.Location = new System.Drawing.Point(270, 165);
148+
this.displayFormatComboBox.Name = "initialDisplayComboBox";
149+
this.helpProvider1.SetShowHelp(this.displayFormatComboBox, true);
150+
this.displayFormatComboBox.Size = new System.Drawing.Size(168, 21);
151+
this.displayFormatComboBox.TabIndex = 33;
114152
//
115153
// label6
116154
//
@@ -212,8 +250,11 @@ private void InitializeComponent()
212250
this.Controls.Add(this.successImage);
213251
this.Controls.Add(this.label6);
214252
this.Controls.Add(this.showCheckBoxesCheckBox);
253+
this.Controls.Add(this.displayFormatComboBox);
215254
this.Controls.Add(this.groupBox1);
216255
this.Controls.Add(this.label1);
256+
this.Controls.Add(this.label2);
257+
this.Controls.Add(this.label3);
217258
this.Name = "TreeSettingsPage";
218259
((System.ComponentModel.ISupportInitialize)(this.successImage)).EndInit();
219260
((System.ComponentModel.ISupportInitialize)(this.failureImage)).EndInit();
@@ -231,6 +272,9 @@ public override void LoadSettings()
231272
{
232273
showCheckBoxesCheckBox.Checked = Settings.Gui.TestTree.ShowCheckBoxes;
233274

275+
int selectedDisplayFormatIndex = Settings.Gui.TestTree.DisplayFormat == "TEST_LIST" ? 1 : 0;
276+
displayFormatComboBox.SelectedIndex = selectedDisplayFormatIndex;
277+
234278
foreach (string imageSetName in _imageSetManager.ImageSets.Keys)
235279
imageSetListBox.Items.Add(imageSetName);
236280

@@ -240,6 +284,8 @@ public override void LoadSettings()
240284
public override void ApplySettings()
241285
{
242286
Settings.Gui.TestTree.ShowCheckBoxes = showCheckBoxesCheckBox.Checked;
287+
string displayFormat = displayFormatComboBox.SelectedIndex == 0 ? "NUNIT_TREE" : "TEST_LIST";
288+
Settings.Gui.TestTree.DisplayFormat = displayFormat;
243289

244290
if (imageSetListBox.SelectedIndex >= 0)
245291
Settings.Gui.TestTree.AlternateImageSet = (string)imageSetListBox.SelectedItem;

0 commit comments

Comments
 (0)