-
Notifications
You must be signed in to change notification settings - Fork 0
/
SettingsForm.cs
45 lines (36 loc) · 1.21 KB
/
SettingsForm.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
using System;
using System.Linq;
using System.Windows.Forms;
namespace Quickchan
{
public partial class SettingsForm : Form
{
public SettingsForm()
{
InitializeComponent();
viewedSmallerCB.Checked = Settings.GetValue<bool>("viewedSmaller");
safeModeCB.Checked = Settings.GetValue<bool>("safeMode");
if (Settings.GetValue<bool>("dynamic"))
chooseDynamicallyRB.Checked = true;
else
folderRB.Checked = true;
folderTB.Text = Settings.GetValue<string>("defaultFolder");
}
void FolderRBCheckedChanged(object sender, EventArgs e)
{ folderTB.Enabled = searchB.Enabled = folderRB.Checked; }
void SearchBClick(object sender, EventArgs e)
{
if (fbd.ShowDialog() == DialogResult.OK)
folderTB.Text = fbd.SelectedPath;
}
void AcceptBClick(object sender, EventArgs e)
{
Settings.SetValue<bool>("viewedSmaller", viewedSmallerCB.Checked);
Settings.SetValue<bool>("safeMode", safeModeCB.Checked);
Settings.SetValue<bool>("dynamic", chooseDynamicallyRB.Checked);
Settings.SetValue<string>("defaultFolder", folderTB.Text);
((MainForm)Application.OpenForms["MainForm"]).CheckSettings();
Close();
}
}
}