-
Notifications
You must be signed in to change notification settings - Fork 13
/
Settings.cs
95 lines (79 loc) · 2.71 KB
/
Settings.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Omnibus
{
public partial class Settings : Form
{
public Settings()
{
InitializeComponent();
}
private void Settings_Load(object sender, EventArgs e)
{
tbDLocation.Text = Properties.Settings.Default.DownloadLocation;
tbLLocation.Text = Properties.Settings.Default.LogLocation;
if (Properties.Settings.Default.LogEnabled == true)
{
cbLogs.Checked = true;
}
else
{
cbLogs.Checked = false;
}
//tbUserAgent.Text = Properties.Settings.Default.UserAgent;
//tbCfduid.Text = Properties.Settings.Default.cfduid;
//tbCfClearance.Text = Properties.Settings.Default.cf_clearance;
}
private void btnSave_Click(object sender, EventArgs e)
{
Properties.Settings.Default.DownloadLocation = tbDLocation.Text;
Properties.Settings.Default.Save();
Properties.Settings.Default.LogLocation = tbLLocation.Text;
Properties.Settings.Default.Save();
//Properties.Settings.Default.UserAgent = tbUserAgent.Text;
//Properties.Settings.Default.Save();
//Properties.Settings.Default.cfduid = tbCfduid.Text;
//Properties.Settings.Default.Save();
//Properties.Settings.Default.cf_clearance = tbCfClearance.Text;
//Properties.Settings.Default.Save();
Properties.Settings.Default.Save();
this.Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.Close();
}
private void btnBrowse_Click(object sender, EventArgs e)
{
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
tbDLocation.Text = folderBrowserDialog1.SelectedPath;
}
}
private void btnBrowseLog_Click(object sender, EventArgs e)
{
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
tbLLocation.Text = folderBrowserDialog1.SelectedPath;
}
}
private void cbLogs_CheckedChanged(object sender, EventArgs e)
{
if (cbLogs.Checked == true)
{
Properties.Settings.Default.LogEnabled = true;
}
else
{
Properties.Settings.Default.LogEnabled = false;
}
}
}
}