-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrm_Settings.cs
101 lines (85 loc) · 2.94 KB
/
frm_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
96
97
98
99
100
101
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;
using System.IO;
using Paster.Classes;
using IWshRuntimeLibrary;
namespace Paster
{
public partial class frm_Settings : Form
{
Configuration configClone;
public frm_Settings()
{
InitializeComponent();
configClone = Global.Configuration.Clone();
UpdateControls();
}
private void UpdateControls()
{
chk_StartWithWindows.Checked = configClone.AutoStart;
chk_StartMinimized.Checked = configClone.StartMinimized;
}
private void btn_OpenConfigFile_Click(object sender, EventArgs e)
{
Global.OpenActionsFile();
}
private void btn_ResetDefault_Click(object sender, EventArgs e)
{
DialogResult result = MessageBox.Show("Are you sure you want to reset the settings?", "Reset settings", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if(result == DialogResult.Yes)
{
Global.ResetActions();
}
}
private void chk_StartWithWindows_CheckedChanged(object sender, EventArgs e)
{
configClone.AutoStart = chk_StartWithWindows.Checked;
}
private void chk_StartMinimized_CheckedChanged(object sender, EventArgs e)
{
configClone.StartMinimized = chk_StartMinimized.Checked;
}
private void btn_OpenConfigurationFile_Click(object sender, EventArgs e)
{
Global.OpenConfigurationFile();
}
private void btn_OpenActionsFile_Click(object sender, EventArgs e)
{
Global.OpenActionsFile();
}
private void btn_ResetDefaultConfiguration_Click(object sender, EventArgs e)
{
DialogResult result = MessageBox.Show("Are you sure you want to reset the settings?", "Are your sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if(result == DialogResult.Yes)
{
Global.ResetActions();
}
}
private void btn_ResetActionsDefault_Click(object sender, EventArgs e)
{
DialogResult result = MessageBox.Show("Are you sure you want to reset the actions?", "Are your sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
Global.ResetActions();
}
}
private void btn_Close_Click(object sender, EventArgs e)
{
this.Close();
}
private void btn_Save_Click(object sender, EventArgs e)
{
Global.Configuration = configClone;
Global.SaveConfiguration();
Global.EnforceConfiguration();
this.Close();
}
}
}