File size: 1,614 Bytes
e26fba6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using MovieTube.Viewer.Data;
using MovieTube.Client.Scraper;
using System.IO;

namespace MovieTube.Viewer
{
    public partial class Options : Form
    {
        public Options()
        {
            InitializeComponent();
            var s =ClientDataService.Single.Settings ;
            this.comboBox1.DataSource = Language.Languages;
            this.comboBox1.SelectedItem = Language.Languages.Find(x => x.Id == s.DefaultLanguage);
            this.checkBox1.Checked = s.PlayFirstLink;
            this.textBoxDFolder.Text = AppSettings.MovieDownloadFolder;
           
        }

        private void buttonOk_Click(object sender, EventArgs e)
        {
            var s = ClientDataService.Single.Settings;
            s.DefaultLanguage = ((Language)this.comboBox1.SelectedItem).Id;
            s.PlayFirstLink = this.checkBox1.Checked;
            ClientDataService.Single.SaveGlobalSettings(s);
            AppSettings.MovieDownloadFolder = this.textBoxDFolder.Text;
            DialogResult = System.Windows.Forms.DialogResult.OK;
        }

        private void buttonFolder_Click(object sender, EventArgs e)
        {

            using (var di = new FolderBrowserDialog() { Description = "Select download folder" })
            {
                if (di.ShowDialog() == DialogResult.OK)
                    this.textBoxDFolder.Text = di.SelectedPath;
            }

        }
    }
}