source: extensions/Picasa2Piwigo/Picasa2Piwigo/OptionForm.cs @ 26935

Last change on this file since 26935 was 21241, checked in by kenl, 11 years ago
File size: 3.5 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Data;
5using System.Drawing;
6using System.Linq;
7using System.Text;
8using System.Windows.Forms;
9using System.Globalization;
10using System.Threading;
11
12namespace 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}
Note: See TracBrowser for help on using the repository browser.