This repository was archived by the owner on Feb 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathSetupWindow.cs
More file actions
66 lines (53 loc) · 1.76 KB
/
SetupWindow.cs
File metadata and controls
66 lines (53 loc) · 1.76 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using ComponentFactory.Krypton.Toolkit;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DualSenseAT
{
public partial class SetupWindow : KryptonForm
{
public SetupWindow()
{
InitializeComponent();
this.Text = "DualSense AT v" + Application.ProductVersion + " Setup";
}
FileInfo[] langList = { };
private void LoadLangsList()
{
DirectoryInfo d = new DirectoryInfo(Constants.LANG_PATH);
langList = d.GetFiles("*.json"); //Getting Json files
foreach (FileInfo file in langList)
{
langCBox.Items.Add(file.Name.Replace(".json", ""));
}
}
private void SetupWindow_Load(object sender, EventArgs e)
{
LoadLangsList();
}
private void atButton1_Click(object sender, EventArgs e)
{
Functions.UIFunctions.setDefaultLang(langCBox.Text);
if (langCBox.SelectedIndex == -1)
{
if (MessageBox.Show(this, "You have not selected any language, if you continue the default language will be set to English (en_US)", Constants.AppName, MessageBoxButtons.OKCancel) == DialogResult.Cancel)
{
return;
}
else
{
Functions.UIFunctions.setDefaultLang("en_US");
}
}
MessageBox.Show("DualSenseAT will restart", "Setup Success!",0, MessageBoxIcon.Information) ;
Application.Restart();
}
}
}