1 | using System; |
---|
2 | using System.Collections.Generic; |
---|
3 | using System.ComponentModel; |
---|
4 | using System.Data; |
---|
5 | using System.Drawing; |
---|
6 | using System.Linq; |
---|
7 | using System.Text; |
---|
8 | using System.Windows.Forms; |
---|
9 | using System.Globalization; |
---|
10 | using System.Threading; |
---|
11 | |
---|
12 | namespace Picasa2Piwigo |
---|
13 | { |
---|
14 | using Picasa2PiwigoCommonFunctions; |
---|
15 | public partial class OptionsForm : Form |
---|
16 | { |
---|
17 | public OptionsForm() |
---|
18 | { |
---|
19 | CultureInfo ci; |
---|
20 | ci = new CultureInfo(Thread.CurrentThread.CurrentCulture.Name); |
---|
21 | Thread.CurrentThread.CurrentUICulture = ci; |
---|
22 | Thread.CurrentThread.CurrentCulture = ci; |
---|
23 | if (Picasa2PiwigoConstants.constants.DEBUG_LOCALE) |
---|
24 | { |
---|
25 | #pragma warning disable 0162 |
---|
26 | Thread.CurrentThread.CurrentUICulture = new CultureInfo(Picasa2PiwigoConstants.constants.SET_LOCALE); |
---|
27 | #pragma warning restore 0162 |
---|
28 | } |
---|
29 | InitializeComponent(); |
---|
30 | } |
---|
31 | |
---|
32 | private void OptionsForm_Load(object sender, EventArgs e) |
---|
33 | { |
---|
34 | this.ACancelButton.Text = WinFormStrings.OFCancelButtonStrRes; |
---|
35 | this.Text = WinFormStrings.OFCaption; |
---|
36 | this.label1.Text = WinFormStrings.OFlabel1StrRes; |
---|
37 | this.label2.Text = WinFormStrings.OFlabel2StrRes; |
---|
38 | this.label3.Text = WinFormStrings.OFlabel3StrRes; |
---|
39 | this.label8.Text = WinFormStrings.OFlabel8StrRes; |
---|
40 | this.OKButton.Text = WinFormStrings.OFOKButtonStrRes; |
---|
41 | this.SetContactPathBtn.Text = WinFormStrings.OFSetContactPathBtn; |
---|
42 | |
---|
43 | PiwigoURLTextbox.Text = FormSettings.Default.PiwigoUrlSetting; |
---|
44 | PiwigoUserNameTextBox.Text = FormSettings.Default.PiwigoUserName; |
---|
45 | PiwigoPasswordTextBox.Text = FormSettings.Default.PiwigoPassword; |
---|
46 | PicasaContactsFileTextBox.Text = FormSettings.Default.PicasaContactsLocation; |
---|
47 | |
---|
48 | LabelAdjust AdjustLabelClass = new LabelAdjust(); |
---|
49 | AdjustLabelClass.AdjustLabelSize(label1); |
---|
50 | AdjustLabelClass.AdjustLabelSize(label2); |
---|
51 | AdjustLabelClass.AdjustLabelSize(label3); |
---|
52 | AdjustLabelClass.AdjustLabelSize(label8); |
---|
53 | AdjustLabelClass.AdjustButtonSize(OKButton); |
---|
54 | AdjustLabelClass.AdjustButtonSize(ACancelButton); |
---|
55 | AdjustLabelClass.AdjustButtonSize(SetContactPathBtn); |
---|
56 | } |
---|
57 | |
---|
58 | private void OKButton_Click(object sender, EventArgs e) |
---|
59 | { |
---|
60 | FormSettings.Default.PiwigoUrlSetting = PiwigoURLTextbox.Text; |
---|
61 | FormSettings.Default.PiwigoUserName = PiwigoUserNameTextBox.Text; |
---|
62 | FormSettings.Default.PiwigoPassword = PiwigoPasswordTextBox.Text; |
---|
63 | FormSettings.Default.PicasaContactsLocation = PicasaContactsFileTextBox.Text; |
---|
64 | FormSettings.Default.Save(); |
---|
65 | this.DialogResult = DialogResult.OK; |
---|
66 | this.Close(); |
---|
67 | } |
---|
68 | |
---|
69 | private void ACancelButton_Click(object sender, EventArgs e) |
---|
70 | { |
---|
71 | this.DialogResult = DialogResult.No; |
---|
72 | this.Close(); |
---|
73 | } |
---|
74 | |
---|
75 | private void SetContactPathBtn_Click(object sender, EventArgs e) |
---|
76 | { |
---|
77 | OpenFileDialog openFile1 = new OpenFileDialog(); |
---|
78 | openFile1.Filter = "XML Files|*.xml"; |
---|
79 | if (openFile1.ShowDialog() == System.Windows.Forms.DialogResult.OK) |
---|
80 | { |
---|
81 | PicasaContactsFileTextBox.Text = openFile1.FileName; |
---|
82 | } |
---|
83 | } |
---|
84 | } |
---|
85 | } |
---|