using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Sownloader
{
    public partial class Settings : Form
    {


        FileHandler.INIClass inifile;

        public Settings()
        {
            InitializeComponent();
            inifile = new FileHandler.INIClass();
        }

        private void Settings_Load(object sender, EventArgs e)
        {
            tbSavePath.Text = inifile.SAVEPATH;
            tbDefaultPage.Text = inifile.DEFAULTPAGE;

            cbForeground.Checked = inifile.KEEPFOCUSED;
            cbID3Tags.Checked = inifile.SHOWID3WINDOW;

            cbBitrate.Text = inifile.BITRATE;
            cbVideoSize.Text = "600x600px";

            if (inifile.KEEPFOCUSED)
                this.TopMost = true;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            inifile.SaveValues(cbForeground.Checked, tbDefaultPage.Text, tbSavePath.Text, cbBitrate.Text, cbID3Tags.Checked);
        }
    }
}
