-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOptions.cs
101 lines (82 loc) · 3.4 KB
/
Options.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
/*
Copyright (C) 2012 Ian Bradley
This file is part of SubBuddy.
SubBuddy is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
SubBuddy is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with SubBuddy. If not, see http://www.gnu.org/licenses/.
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace SubBuddy
{
public partial class Options : Form
{
public Options()
{
InitializeComponent();
textBox1.Text = Settings.Default.Path;
comboBox2.SelectedIndex = Settings.Default.SubscriptionType;
comboBox1.SelectedIndex = Settings.Default.Thumbnails;
textBox2.Text = Settings.Default.Naming;
numericUpDown1.Value = Settings.Default.Delay;
textBox2.Enabled = false;
//comboBox1.Enabled = true;
//comboBox1.SelectedIndex = 3;
numericUpDown2.Value = Settings.Default.DownloadQueue;
numericUpDown3.Value = Settings.Default.MaxDownloads;
checkBox1.Checked = Settings.Default.Async;
}
private void Form2_Load(object sender, EventArgs e)
{
button2.Click += new EventHandler(button2_Click);
textBox2.MouseHover += new EventHandler(textBox2_MouseHover);
}
void textBox2_MouseHover(object sender, EventArgs e)
{
toolTip1.SetToolTip(textBox2, "Options: %user %id %date %title %quality");
}
void button2_Click(object sender, EventArgs e)
{
FolderBrowserDialog folder = new FolderBrowserDialog();
folder.ShowDialog();
textBox1.Text = folder.SelectedPath;
}
private void toolTip1_Popup(object sender, PopupEventArgs e)
{
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void numericUpDown1_ValueChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
Settings.Default.Delay = numericUpDown1.Value;
Settings.Default.DownloadQueue = numericUpDown2.Value;
Settings.Default.SubscriptionType = comboBox2.SelectedIndex;
Settings.Default.Thumbnails = comboBox1.SelectedIndex;
Settings.Default.Naming = textBox2.Text;
Settings.Default.Async = checkBox1.Checked;
Settings.Default.MaxDownloads = numericUpDown3.Value;
if (!Settings.Default.Path.EndsWith("/SubBuddy/"))
{
Settings.Default.Path = textBox1.Text + "/SubBuddy/";
}
else
{
Settings.Default.Path = textBox1.Text;
}
Settings.Default.Save();
}
private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
}