Skip to content

Commit 8503ad5

Browse files
committed
1 parent d65a188 commit 8503ad5

File tree

6 files changed

+195
-18
lines changed

6 files changed

+195
-18
lines changed

RetailCoder.VBE/Rubberduck.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@
286286
<DependentUpon>ExtractMethodDialog.cs</DependentUpon>
287287
</Compile>
288288
<Compile Include="UI\Refactorings\ExtractMethod\IExtractMethodDialog.cs" />
289-
<Compile Include="UI\Refactorings\IDialogView.cs" />
289+
<Compile Include="UI\IDialogView.cs" />
290290
<Compile Include="UI\Refactorings\ExtractMethod\ValueChangedEventArgs.cs" />
291291
<Compile Include="UI\Refactorings\Rename\IRenameView.cs" />
292292
<Compile Include="UI\Refactorings\Rename\RenameDialog.cs">

RetailCoder.VBE/UI/Refactorings/IDialogView.cs renamed to RetailCoder.VBE/UI/IDialogView.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using System.Windows.Forms;
33

4-
namespace Rubberduck.UI.Refactorings
4+
namespace Rubberduck.UI
55
{
66
public interface IDialogView
77
{

RetailCoder.VBE/UI/RubberduckUI.Designer.cs

Lines changed: 54 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

RetailCoder.VBE/UI/RubberduckUI.resx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,4 +195,22 @@
195195
<value>Method '{0}' implements '{1}.{2}'. Rename the interface member?</value>
196196
<comment>0: Selected target; 1: Interface name; 2: Interface member name</comment>
197197
</data>
198+
<data name="SettingsCaption_GeneralSettings" xml:space="preserve">
199+
<value>General Settings</value>
200+
</data>
201+
<data name="SettingsCaption_CodeInspections" xml:space="preserve">
202+
<value>Code Inspection Settings</value>
203+
</data>
204+
<data name="SettingsCaption_ToDoSettings" xml:space="preserve">
205+
<value>ToDo Settings</value>
206+
</data>
207+
<data name="SettingsInstructions_CodeInspections" xml:space="preserve">
208+
<value>Configure inspection severity. Use "do no show" to disable an inspection.</value>
209+
</data>
210+
<data name="SettingsInstructions_GeneralSettings" xml:space="preserve">
211+
<value>Changes will be applied after Rubberduck is reloaded.</value>
212+
</data>
213+
<data name="SettingsInstructions_ToDoSettings" xml:space="preserve">
214+
<value>Configure markers to be recognized in comments.</value>
215+
</data>
198216
</root>

RetailCoder.VBE/UI/Settings/SettingsDialog.Designer.cs

Lines changed: 97 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

RetailCoder.VBE/UI/Settings/SettingsDialog.cs

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@ public partial class _SettingsDialog : Form
2222
public _SettingsDialog()
2323
{
2424
InitializeComponent();
25+
26+
OkButton.Click += OkButton_Click;
27+
CancelButton.Click += CancelButton_Click;
28+
}
29+
30+
private void CancelButton_Click(object sender, System.EventArgs e)
31+
{
32+
Close();
33+
}
34+
35+
private void OkButton_Click(object sender, System.EventArgs e)
36+
{
37+
SaveConfig();
38+
Close();
2539
}
2640

2741
public _SettingsDialog(IConfigurationService configService)
@@ -31,7 +45,7 @@ public _SettingsDialog(IConfigurationService configService)
3145
_config = _configService.LoadConfiguration();
3246
_treeview = new ConfigurationTreeViewControl(_config);
3347

34-
this.splitContainer1.Panel1.Controls.Add(_treeview);
48+
splitContainer1.Panel1.Controls.Add(_treeview);
3549
_treeview.Dock = DockStyle.Fill;
3650

3751
var markers = _config.UserSettings.ToDoListSettings.ToDoMarkers.ToList();
@@ -54,16 +68,22 @@ private void _treeview_NodeSelected(object sender, TreeViewEventArgs e)
5468

5569
if (e.Node.Text == "Rubberduck")
5670
{
71+
TitleLabel.Text = RubberduckUI.SettingsCaption_GeneralSettings;
72+
InstructionsLabel.Text = RubberduckUI.SettingsInstructions_GeneralSettings;
5773
return; //do nothing
5874
}
5975

6076
if (e.Node.Text == "Todo List")
6177
{
78+
TitleLabel.Text = RubberduckUI.SettingsCaption_ToDoSettings;
79+
InstructionsLabel.Text = RubberduckUI.SettingsInstructions_ToDoSettings;
6280
controlToActivate = _todoView;
6381
}
6482

6583
if (e.Node.Text == "Code Inpsections")
6684
{
85+
TitleLabel.Text = RubberduckUI.SettingsCaption_CodeInspections;
86+
InstructionsLabel.Text = RubberduckUI.SettingsInstructions_CodeInspections;
6787
controlToActivate = new CodeInspectionControl(_config.UserSettings.CodeInspectionSettings.CodeInspections.ToList());
6888
}
6989

@@ -73,22 +93,16 @@ private void _treeview_NodeSelected(object sender, TreeViewEventArgs e)
7393
private void ActivateControl(Control control)
7494
{
7595
control.Dock = DockStyle.Fill;
76-
this.splitContainer1.Panel2.Controls.Clear();
77-
this.splitContainer1.Panel2.Controls.Add(control);
96+
splitContainer1.Panel2.Controls.Clear();
97+
splitContainer1.Panel2.Controls.Add(control);
7898
_activeControl = control;
7999
}
80100

81-
private void SettingsDialog_FormClosed(object sender, FormClosedEventArgs e)
82-
{
83-
SaveConfig();
84-
MessageBox.Show("Changes to settings will take affect next time the application is started.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
85-
}
86-
87101
private void SaveConfig()
88102
{
89103
_config.UserSettings.ToDoListSettings.ToDoMarkers = _todoView.TodoMarkers.ToArray();
90104
// The datagrid view of the CodeInspectionControl seems to keep the config magically in sync, so I don't manually do it here.
91-
_configService.SaveConfiguration<Configuration>(_config);
105+
_configService.SaveConfiguration(_config);
92106
}
93107
}
94108
}

0 commit comments

Comments
 (0)