[21241] | 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; |
---|
[30536] | 47 | DebugtextBox.Text = FormSettings.Default.DebugFileLocation; |
---|
| 48 | LogEnabled.Checked = FormSettings.Default.DebugEnabled; |
---|
[21241] | 49 | |
---|
[30536] | 50 | |
---|
[21241] | 51 | LabelAdjust AdjustLabelClass = new LabelAdjust(); |
---|
| 52 | AdjustLabelClass.AdjustLabelSize(label1); |
---|
| 53 | AdjustLabelClass.AdjustLabelSize(label2); |
---|
| 54 | AdjustLabelClass.AdjustLabelSize(label3); |
---|
| 55 | AdjustLabelClass.AdjustLabelSize(label8); |
---|
| 56 | AdjustLabelClass.AdjustButtonSize(OKButton); |
---|
| 57 | AdjustLabelClass.AdjustButtonSize(ACancelButton); |
---|
| 58 | AdjustLabelClass.AdjustButtonSize(SetContactPathBtn); |
---|
| 59 | } |
---|
| 60 | |
---|
| 61 | private void OKButton_Click(object sender, EventArgs e) |
---|
| 62 | { |
---|
| 63 | FormSettings.Default.PiwigoUrlSetting = PiwigoURLTextbox.Text; |
---|
| 64 | FormSettings.Default.PiwigoUserName = PiwigoUserNameTextBox.Text; |
---|
| 65 | FormSettings.Default.PiwigoPassword = PiwigoPasswordTextBox.Text; |
---|
| 66 | FormSettings.Default.PicasaContactsLocation = PicasaContactsFileTextBox.Text; |
---|
[30536] | 67 | FormSettings.Default.DebugFileLocation = DebugtextBox.Text; |
---|
| 68 | FormSettings.Default.DebugEnabled = LogEnabled.Checked; |
---|
[21241] | 69 | FormSettings.Default.Save(); |
---|
| 70 | this.DialogResult = DialogResult.OK; |
---|
| 71 | this.Close(); |
---|
| 72 | } |
---|
| 73 | |
---|
| 74 | private void ACancelButton_Click(object sender, EventArgs e) |
---|
| 75 | { |
---|
| 76 | this.DialogResult = DialogResult.No; |
---|
| 77 | this.Close(); |
---|
| 78 | } |
---|
| 79 | |
---|
| 80 | private void SetContactPathBtn_Click(object sender, EventArgs e) |
---|
| 81 | { |
---|
| 82 | OpenFileDialog openFile1 = new OpenFileDialog(); |
---|
| 83 | openFile1.Filter = "XML Files|*.xml"; |
---|
| 84 | if (openFile1.ShowDialog() == System.Windows.Forms.DialogResult.OK) |
---|
| 85 | { |
---|
| 86 | PicasaContactsFileTextBox.Text = openFile1.FileName; |
---|
| 87 | } |
---|
| 88 | } |
---|
[30536] | 89 | |
---|
| 90 | private void SetDebugPathBtn_Click(object sender, EventArgs e) |
---|
| 91 | { |
---|
| 92 | SaveFileDialog openFile1 = new SaveFileDialog(); |
---|
| 93 | openFile1.Filter = "Text Files|*.txt"; |
---|
| 94 | if (openFile1.ShowDialog() == System.Windows.Forms.DialogResult.OK) |
---|
| 95 | { |
---|
| 96 | DebugtextBox.Text = openFile1.FileName; |
---|
| 97 | } |
---|
| 98 | |
---|
| 99 | } |
---|
[21241] | 100 | } |
---|
| 101 | } |
---|