-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathDialogConfigure.cs
63 lines (51 loc) · 2.46 KB
/
DialogConfigure.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
using System;
using System.Windows.Forms;
namespace SDRSharp.Tetra
{
public partial class DialogConfigure : Form
{
private TetraSettings _tetraSettings;
private TetraPanel _tetra;
public DialogConfigure(TetraSettings tetraSettings, TetraPanel tetra)
{
_tetraSettings = tetraSettings;
_tetra = tetra;
InitializeComponent();
ignoreEncodedSpeechCheckBox.Checked = _tetraSettings.IgnoreEncodedSpeech;
enableUdpOutputCheckBox.Checked = _tetraSettings.UdpEnabled;
udpPortNumericUpDown.Value = _tetraSettings.UdpPort;
afcCheckBox.Checked = _tetraSettings.AfcDisabled;
logFolderBrowserDialog.SelectedPath = _tetraSettings.LogWriteFolder;
logFileRulesTextBox.Text = _tetraSettings.LogFileNameRules;
LogFileRulesTextBox_TextChanged(null, null);
logEntriesRulesTextBox.Text = _tetraSettings.LogEntryRules;
LogEntriesRulesTextBox_TextChanged(null, null);
logSeparatorTextBox.Text = _tetraSettings.LogSeparator;
logEnableCheckBox.Checked = _tetraSettings.LogEnabled;
}
private void BtnOk_Click(object sender, EventArgs e)
{
_tetraSettings.LogFileNameRules = logFileRulesTextBox.Text;
_tetraSettings.LogEntryRules = logEntriesRulesTextBox.Text;
_tetraSettings.LogSeparator = logSeparatorTextBox.Text;
_tetraSettings.LogEnabled = logEnableCheckBox.Checked;
_tetraSettings.IgnoreEncodedSpeech = ignoreEncodedSpeechCheckBox.Checked;
_tetraSettings.UdpEnabled = enableUdpOutputCheckBox.Checked;
_tetraSettings.UdpPort = (int)udpPortNumericUpDown.Value;
_tetraSettings.AfcDisabled = afcCheckBox.Checked;
DialogResult = DialogResult.OK;
}
private void LogFolderButton_Click(object sender, EventArgs e)
{
if (logFolderBrowserDialog.ShowDialog() == DialogResult.OK) _tetraSettings.LogWriteFolder = logFolderBrowserDialog.SelectedPath;
}
private void LogFileRulesTextBox_TextChanged(object sender, EventArgs e)
{
LogFileLabel.Text = _tetra.ParseStringToPath(logFileRulesTextBox.Text, ".csv");
}
private void LogEntriesRulesTextBox_TextChanged(object sender, EventArgs e)
{
LogEntryLabel.Text = _tetra.ParseStringToEntries(logEntriesRulesTextBox.Text, null);
}
}
}