mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-03-27 10:56:41 +01:00
Auto Profiles are live(beta) - Automatically load profiles when starting up certain programs or games.
DS4Tool.exe merged with it's dll's, now named DS4Windows.exe Settings tab - Hide DS4, Run at start up, Change update rate or disable it all together, turn off notifications and more there there When battery is low and starts flashing, it will not continue to flash when charging Possible fix for memory leak Small UI changes such as not being able to edit the text in combo boxes Spelling fixes Updater: Now doesn't need admin rights to run, DS4Windows will try to start the updater with admin permissions if DS4Windows is located in an admin folder like program files, also renamed DS4Updater.exe. The old updater will automatically be deleted
This commit is contained in:
parent
fe9fec0e78
commit
107d71ef04
@ -515,23 +515,24 @@ namespace DS4Control
|
||||
{
|
||||
DS4State cState = CurrentState[ind];
|
||||
string slidedir = "none";
|
||||
if (cState.Touch2)
|
||||
if (DS4Controllers[ind] != null)
|
||||
if (touchPad[ind].slideright && !touchslid[ind])
|
||||
{
|
||||
slidedir = "right";
|
||||
touchslid[ind] = true;
|
||||
}
|
||||
else if (touchPad[ind].slideleft && !touchslid[ind])
|
||||
{
|
||||
slidedir = "left";
|
||||
touchslid[ind] = true;
|
||||
}
|
||||
else if (!touchPad[ind].slideleft && !touchPad[ind].slideright)
|
||||
{
|
||||
slidedir = "";
|
||||
touchslid[ind] = false;
|
||||
}
|
||||
if (DS4Controllers[ind] != null)
|
||||
if (cState.Touch2)
|
||||
if (DS4Controllers[ind] != null)
|
||||
if (touchPad[ind].slideright && !touchslid[ind])
|
||||
{
|
||||
slidedir = "right";
|
||||
touchslid[ind] = true;
|
||||
}
|
||||
else if (touchPad[ind].slideleft && !touchslid[ind])
|
||||
{
|
||||
slidedir = "left";
|
||||
touchslid[ind] = true;
|
||||
}
|
||||
else if (!touchPad[ind].slideleft && !touchPad[ind].slideright)
|
||||
{
|
||||
slidedir = "";
|
||||
touchslid[ind] = false;
|
||||
}
|
||||
return slidedir;
|
||||
}
|
||||
public virtual void LogDebug(String Data)
|
||||
|
@ -121,7 +121,7 @@ namespace DS4Control
|
||||
};
|
||||
if (haptics.IsLightBarSet())
|
||||
{
|
||||
if (device.Battery <= Global.getFlashAt(deviceNum) && !defualtLight)
|
||||
if (device.Battery <= Global.getFlashAt(deviceNum) && !defualtLight && !device.Charging)
|
||||
{
|
||||
int level = device.Battery / 10;
|
||||
if (level >= 10)
|
||||
|
@ -43,7 +43,8 @@ namespace DS4Control
|
||||
slideleft = true;
|
||||
dev.getCurrentState(s);
|
||||
synthesizeMouseButtons();
|
||||
//Console.WriteLine(arg.timeStamp.ToString("O") + " " + "moved to " + arg.touches[0].hwX + "," + arg.touches[0].hwY);
|
||||
//if (arg.touches.Length == 2)
|
||||
// Console.WriteLine("Left " + slideleft + " Right " + slideright);
|
||||
}
|
||||
public virtual void touchesBegan(object sender, TouchpadEventArgs arg)
|
||||
{
|
||||
|
@ -226,6 +226,26 @@ namespace DS4Control
|
||||
{
|
||||
return m_Config.lastChecked;
|
||||
}
|
||||
|
||||
public static void setCheckWhen(int data)
|
||||
{
|
||||
m_Config.CheckWhen = data;
|
||||
}
|
||||
|
||||
public static int getCheckWhen()
|
||||
{
|
||||
return m_Config.CheckWhen;
|
||||
}
|
||||
|
||||
public static void setNotifications(bool data)
|
||||
{
|
||||
m_Config.notifications = data;
|
||||
}
|
||||
|
||||
public static bool getNotifications()
|
||||
{
|
||||
return m_Config.notifications;
|
||||
}
|
||||
// New settings
|
||||
public static void saveLowColor(int device, byte red, byte green, byte blue)
|
||||
{
|
||||
@ -361,7 +381,7 @@ namespace DS4Control
|
||||
}
|
||||
public static void setAProfile(int device, string filepath)
|
||||
{
|
||||
m_Config.profilePath[device] = Global.appdatapath + @"\Profiles\" + filepath + ".xml";
|
||||
m_Config.profilePath[device] = appdatapath + @"\Profiles\" + filepath + ".xml";
|
||||
}
|
||||
public static string getAProfile(int device)
|
||||
{
|
||||
@ -416,6 +436,10 @@ namespace DS4Control
|
||||
{
|
||||
m_Config.LoadProfile(device);
|
||||
}
|
||||
public static void LoadTempProfile(int device, string name)
|
||||
{
|
||||
m_Config.LoadProfile(device, appdatapath + @"\Profiles\" + name + ".xml");
|
||||
}
|
||||
public static void Save()
|
||||
{
|
||||
m_Config.Save();
|
||||
@ -562,7 +586,9 @@ namespace DS4Control
|
||||
public Boolean startMinimized = false;
|
||||
public double version;
|
||||
public DateTime lastChecked;
|
||||
public Dictionary<DS4Controls, DS4KeyType>[] customMapKeyTypes = {null, null, null, null, null};
|
||||
public int CheckWhen = 1;
|
||||
public bool notifications = true;
|
||||
public Dictionary<DS4Controls, DS4KeyType>[] customMapKeyTypes = { null, null, null, null, null };
|
||||
public Dictionary<DS4Controls, UInt16>[] customMapKeys = { null, null, null, null, null };
|
||||
public Dictionary<DS4Controls, String>[] customMapMacros = { null, null, null, null, null };
|
||||
public Dictionary<DS4Controls, X360Controls>[] customMapButtons = { null, null, null, null, null };
|
||||
@ -994,7 +1020,7 @@ namespace DS4Control
|
||||
|
||||
return Loaded;
|
||||
}
|
||||
public Boolean LoadProfile(int device)
|
||||
public Boolean LoadProfile(int device, string propath = "")
|
||||
{
|
||||
Boolean Loaded = true;
|
||||
Dictionary<DS4Controls, DS4KeyType> customMapKeyTypes = new Dictionary<DS4Controls, DS4KeyType>();
|
||||
@ -1002,14 +1028,18 @@ namespace DS4Control
|
||||
Dictionary<DS4Controls, X360Controls> customMapButtons = new Dictionary<DS4Controls, X360Controls>();
|
||||
Dictionary<DS4Controls, String> customMapMacros = new Dictionary<DS4Controls, String>();
|
||||
Boolean missingSetting = false;
|
||||
|
||||
string profilepath;
|
||||
if (propath == "")
|
||||
profilepath = profilePath[device];
|
||||
else
|
||||
profilepath = propath;
|
||||
try
|
||||
{
|
||||
if (File.Exists(profilePath[device]))
|
||||
if (File.Exists(profilepath))
|
||||
{
|
||||
XmlNode Item;
|
||||
|
||||
m_Xdoc.Load(profilePath[device]);
|
||||
m_Xdoc.Load(profilepath);
|
||||
|
||||
try { Item = m_Xdoc.SelectSingleNode("/ScpControl/flushHIDQueue"); Boolean.TryParse(Item.InnerText, out flushHIDQueue[device]); }
|
||||
catch { missingSetting = true; }
|
||||
@ -1123,7 +1153,7 @@ namespace DS4Control
|
||||
}
|
||||
// Only add missing settings if the actual load was graceful
|
||||
if (missingSetting && Loaded)
|
||||
SaveProfile(device, profilePath[device], null);
|
||||
SaveProfile(device, profilepath, null);
|
||||
|
||||
return Loaded;
|
||||
}
|
||||
@ -1162,6 +1192,10 @@ namespace DS4Control
|
||||
catch { missingSetting = true; }
|
||||
try { Item = m_Xdoc.SelectSingleNode("/Profile/LastChecked"); DateTime.TryParse(Item.InnerText, out lastChecked); }
|
||||
catch { missingSetting = true; }
|
||||
try { Item = m_Xdoc.SelectSingleNode("/Profile/CheckWhen"); Int32.TryParse(Item.InnerText, out CheckWhen); }
|
||||
catch { missingSetting = true; }
|
||||
try { Item = m_Xdoc.SelectSingleNode("/Profile/Notifications"); Boolean.TryParse(Item.InnerText, out notifications); }
|
||||
catch { missingSetting = true; }
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
@ -1203,6 +1237,8 @@ namespace DS4Control
|
||||
|
||||
XmlNode xmlVersion = m_Xdoc.CreateNode(XmlNodeType.Element, "DS4Version", null); xmlVersion.InnerText = version.ToString(); Node.AppendChild(xmlVersion);
|
||||
XmlNode xmlLastChecked = m_Xdoc.CreateNode(XmlNodeType.Element, "LastChecked", null); xmlLastChecked.InnerText = lastChecked.ToString(); Node.AppendChild(xmlLastChecked);
|
||||
XmlNode xmlCheckWhen = m_Xdoc.CreateNode(XmlNodeType.Element, "CheckWhen", null); xmlCheckWhen.InnerText = CheckWhen.ToString(); Node.AppendChild(xmlCheckWhen);
|
||||
XmlNode xmlNotifications = m_Xdoc.CreateNode(XmlNodeType.Element, "Notifications", null); xmlNotifications.InnerText = notifications.ToString(); Node.AppendChild(xmlNotifications);
|
||||
m_Xdoc.AppendChild(Node);
|
||||
|
||||
m_Xdoc.Save(m_Profile);
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Express 2013 for Windows Desktop
|
||||
VisualStudioVersion = 12.0.21005.1
|
||||
VisualStudioVersion = 12.0.30501.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DS4Library", "DS4Library\DS4Library.csproj", "{43E14DAD-E6E8-4B66-AC50-20F5CF9B9712}"
|
||||
EndProject
|
||||
|
@ -8,7 +8,7 @@
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ScpServer</RootNamespace>
|
||||
<AssemblyName>DS4Tool</AssemblyName>
|
||||
<AssemblyName>DS4Windows</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<IsWebBootstrapper>true</IsWebBootstrapper>
|
||||
|
50
DS4Tool/Hotkeys.Designer.cs
generated
50
DS4Tool/Hotkeys.Designer.cs
generated
@ -29,16 +29,13 @@
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.linkProfiles = new System.Windows.Forms.LinkLabel();
|
||||
this.linkElectro = new System.Windows.Forms.LinkLabel();
|
||||
this.linkJays2Kings = new System.Windows.Forms.LinkLabel();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.lbAbout = new System.Windows.Forms.Label();
|
||||
this.linkInhexSTER = new System.Windows.Forms.LinkLabel();
|
||||
this.linkJhebbel = new System.Windows.Forms.LinkLabel();
|
||||
this.linkUninstall = new System.Windows.Forms.LinkLabel();
|
||||
this.label23 = new System.Windows.Forms.Label();
|
||||
this.lLBUpdate = new System.Windows.Forms.LinkLabel();
|
||||
this.label26 = new System.Windows.Forms.Label();
|
||||
this.label27 = new System.Windows.Forms.Label();
|
||||
this.label25 = new System.Windows.Forms.Label();
|
||||
@ -84,18 +81,6 @@
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// linkProfiles
|
||||
//
|
||||
this.linkProfiles.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.linkProfiles.AutoSize = true;
|
||||
this.linkProfiles.Location = new System.Drawing.Point(378, 391);
|
||||
this.linkProfiles.Name = "linkProfiles";
|
||||
this.linkProfiles.Size = new System.Drawing.Size(94, 13);
|
||||
this.linkProfiles.TabIndex = 17;
|
||||
this.linkProfiles.TabStop = true;
|
||||
this.linkProfiles.Text = "Open Profile folder";
|
||||
this.linkProfiles.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkProfiles_LinkClicked);
|
||||
//
|
||||
// linkElectro
|
||||
//
|
||||
this.linkElectro.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
@ -164,18 +149,6 @@
|
||||
this.linkJhebbel.Text = "jhebbel (DSDCS)";
|
||||
this.linkJhebbel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkJhebbel_LinkClicked);
|
||||
//
|
||||
// linkUninstall
|
||||
//
|
||||
this.linkUninstall.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.linkUninstall.AutoSize = true;
|
||||
this.linkUninstall.Location = new System.Drawing.Point(35, 391);
|
||||
this.linkUninstall.Name = "linkUninstall";
|
||||
this.linkUninstall.Size = new System.Drawing.Size(106, 13);
|
||||
this.linkUninstall.TabIndex = 17;
|
||||
this.linkUninstall.TabStop = true;
|
||||
this.linkUninstall.Text = "Uninstall VBus Driver";
|
||||
this.linkUninstall.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkUninstall_LinkClicked);
|
||||
//
|
||||
// label23
|
||||
//
|
||||
this.label23.AutoSize = true;
|
||||
@ -185,17 +158,6 @@
|
||||
this.label23.TabIndex = 3;
|
||||
this.label23.Text = "*If enabled";
|
||||
//
|
||||
// lLBUpdate
|
||||
//
|
||||
this.lLBUpdate.AutoSize = true;
|
||||
this.lLBUpdate.Location = new System.Drawing.Point(6, 9);
|
||||
this.lLBUpdate.Name = "lLBUpdate";
|
||||
this.lLBUpdate.Size = new System.Drawing.Size(96, 13);
|
||||
this.lLBUpdate.TabIndex = 48;
|
||||
this.lLBUpdate.TabStop = true;
|
||||
this.lLBUpdate.Text = "Check for Updates";
|
||||
this.lLBUpdate.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lLBUpdate_LinkClicked);
|
||||
//
|
||||
// label26
|
||||
//
|
||||
this.label26.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
@ -518,10 +480,10 @@
|
||||
this.label31.AutoSize = true;
|
||||
this.label31.Location = new System.Drawing.Point(193, 3);
|
||||
this.label31.Name = "label31";
|
||||
this.label31.Size = new System.Drawing.Size(292, 26);
|
||||
this.label31.Size = new System.Drawing.Size(324, 26);
|
||||
this.label31.TabIndex = 14;
|
||||
this.label31.Text = "Hides the DS4\'s regular input (Dinput) from other progrmas\r\nIf you are getting do" +
|
||||
"uble input in Steam or games, check this";
|
||||
this.label31.Text = "Hides the DS4\'s regular input (Dinput) from other progrmas\r\ncheck if you are gett" +
|
||||
"ing double input in games or R2 pauses games";
|
||||
//
|
||||
// Hotkeys
|
||||
//
|
||||
@ -530,14 +492,11 @@
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.button1;
|
||||
this.ClientSize = new System.Drawing.Size(520, 413);
|
||||
this.Controls.Add(this.lLBUpdate);
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.Controls.Add(this.linkJhebbel);
|
||||
this.Controls.Add(this.linkInhexSTER);
|
||||
this.Controls.Add(this.linkJays2Kings);
|
||||
this.Controls.Add(this.linkElectro);
|
||||
this.Controls.Add(this.linkUninstall);
|
||||
this.Controls.Add(this.linkProfiles);
|
||||
this.Controls.Add(this.label23);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.button1);
|
||||
@ -557,16 +516,13 @@
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.LinkLabel linkProfiles;
|
||||
private System.Windows.Forms.LinkLabel linkElectro;
|
||||
private System.Windows.Forms.LinkLabel linkJays2Kings;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label lbAbout;
|
||||
private System.Windows.Forms.LinkLabel linkInhexSTER;
|
||||
private System.Windows.Forms.LinkLabel linkJhebbel;
|
||||
private System.Windows.Forms.LinkLabel linkUninstall;
|
||||
private System.Windows.Forms.Label label23;
|
||||
private System.Windows.Forms.LinkLabel lLBUpdate;
|
||||
private System.Windows.Forms.Label label26;
|
||||
private System.Windows.Forms.Label label27;
|
||||
private System.Windows.Forms.Label label25;
|
||||
|
@ -19,11 +19,7 @@ namespace ScpServer
|
||||
{
|
||||
form = main;
|
||||
InitializeComponent();
|
||||
lbAbout.Text += Global.getVersion().ToString() + ")";
|
||||
ToolTip tt = new ToolTip();
|
||||
tt.SetToolTip(linkUninstall, "To fully remove DS4Windows, You can delete the profiles by the link to the other side");
|
||||
if (!System.IO.Directory.Exists(Global.appdatapath + "\\Virtual Bus Driver"))
|
||||
linkUninstall.Visible = false;
|
||||
lbAbout.Text += Global.getVersion().ToString() + ")";
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
@ -31,11 +27,6 @@ namespace ScpServer
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void linkProfiles_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start(Global.appdatapath + "\\Profiles");
|
||||
}
|
||||
|
||||
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start("https://code.google.com/r/jays2kings-ds4tool/source/list?name=jay");
|
||||
@ -56,51 +47,5 @@ namespace ScpServer
|
||||
System.Diagnostics.Process.Start("https://code.google.com/r/jhebbel-ds4tool/source/browse/");
|
||||
}
|
||||
|
||||
private void linkUninstall_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
if (System.IO.File.Exists(Global.appdatapath + "\\Virtual Bus Driver\\ScpDriver.exe"))
|
||||
try { System.Diagnostics.Process.Start(Global.appdatapath + "\\Virtual Bus Driver\\ScpDriver.exe"); }
|
||||
catch { System.Diagnostics.Process.Start(Global.appdatapath + "\\Virtual Bus Driver"); }
|
||||
}
|
||||
|
||||
private void lLBUpdate_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
Uri url = new Uri("https://dl.dropboxusercontent.com/u/16364552/DS4Tool/newest%20version.txt"); //Sorry other devs, gonna have to find your own server
|
||||
WebClient wc = new WebClient();
|
||||
wc.DownloadFileAsync(url, Global.appdatapath + "\\version.txt");
|
||||
wc.DownloadFileCompleted += wc_DownloadFileCompleted;
|
||||
}
|
||||
|
||||
void wc_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
|
||||
{
|
||||
Global.setLastChecked(DateTime.Now);
|
||||
double newversion;
|
||||
try
|
||||
{
|
||||
if (double.TryParse(File.ReadAllText(Global.appdatapath + "\\version.txt"), out newversion))
|
||||
if (newversion > Global.getVersion())
|
||||
if (MessageBox.Show("Download now?", "DS4Windows Update Available!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
|
||||
{
|
||||
if (!File.Exists("Updater.exe"))
|
||||
{
|
||||
Uri url2 = new Uri("https://dl.dropboxusercontent.com/u/16364552/DS4Tool/Updater.exe");
|
||||
WebClient wc2 = new WebClient();
|
||||
wc2.DownloadFile(url2, "Updater.exe");
|
||||
}
|
||||
System.Diagnostics.Process.Start("Updater.exe");
|
||||
form.Close();
|
||||
}
|
||||
else
|
||||
File.Delete(Global.appdatapath + "\\version.txt");
|
||||
else
|
||||
{
|
||||
File.Delete(Global.appdatapath + "\\version.txt");
|
||||
MessageBox.Show("You are up to date", "DS4 Updater");
|
||||
}
|
||||
else
|
||||
File.Delete(Global.appdatapath + "\\version.txt");
|
||||
}
|
||||
catch { };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
398
DS4Tool/ScpForm.Designer.cs
generated
398
DS4Tool/ScpForm.Designer.cs
generated
@ -35,12 +35,12 @@
|
||||
this.chData = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.tmrUpdate = new System.Windows.Forms.Timer(this.components);
|
||||
this.pnlButton = new System.Windows.Forms.Panel();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.lBTest = new System.Windows.Forms.Label();
|
||||
this.llbHelp = new System.Windows.Forms.LinkLabel();
|
||||
this.btnStartStop = new System.Windows.Forms.Button();
|
||||
this.lnkControllers = new System.Windows.Forms.LinkLabel();
|
||||
this.StartWindowsCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.lbLastMessage = new System.Windows.Forms.Label();
|
||||
this.StartWindowsCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.startMinimizedCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.hideDS4CheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.btnClear = new System.Windows.Forms.Button();
|
||||
@ -71,10 +71,10 @@
|
||||
this.cBController3 = new System.Windows.Forms.ComboBox();
|
||||
this.bnEditC1 = new System.Windows.Forms.Button();
|
||||
this.cBController4 = new System.Windows.Forms.ComboBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.lBSelectedProfile = new System.Windows.Forms.Label();
|
||||
this.lBID = new System.Windows.Forms.Label();
|
||||
this.lBStatus = new System.Windows.Forms.Label();
|
||||
this.lBBattery = new System.Windows.Forms.Label();
|
||||
this.lBBatt1 = new System.Windows.Forms.Label();
|
||||
this.lBBatt2 = new System.Windows.Forms.Label();
|
||||
this.lBBatt3 = new System.Windows.Forms.Label();
|
||||
@ -109,7 +109,18 @@
|
||||
this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.tabLog = new System.Windows.Forms.TabPage();
|
||||
this.tabAutoProfiles = new System.Windows.Forms.TabPage();
|
||||
this.tabSettings = new System.Windows.Forms.TabPage();
|
||||
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.cBUpdate = new System.Windows.Forms.CheckBox();
|
||||
this.saveProfiles = new System.Windows.Forms.SaveFileDialog();
|
||||
this.nUDUpdateTime = new System.Windows.Forms.NumericUpDown();
|
||||
this.pNUpdate = new System.Windows.Forms.Panel();
|
||||
this.lBCheckEvery = new System.Windows.Forms.Label();
|
||||
this.cBUpdateTime = new System.Windows.Forms.ComboBox();
|
||||
this.lLBUpdate = new System.Windows.Forms.LinkLabel();
|
||||
this.linkUninstall = new System.Windows.Forms.LinkLabel();
|
||||
this.linkProfiles = new System.Windows.Forms.LinkLabel();
|
||||
this.cBNotifications = new System.Windows.Forms.CheckBox();
|
||||
this.pnlButton.SuspendLayout();
|
||||
this.cMTaskbar.SuspendLayout();
|
||||
this.tabMain.SuspendLayout();
|
||||
@ -124,6 +135,10 @@
|
||||
this.toolStrip1.SuspendLayout();
|
||||
this.cMProfile.SuspendLayout();
|
||||
this.tabLog.SuspendLayout();
|
||||
this.tabSettings.SuspendLayout();
|
||||
this.flowLayoutPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nUDUpdateTime)).BeginInit();
|
||||
this.pNUpdate.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// lvDebug
|
||||
@ -160,36 +175,31 @@
|
||||
// pnlButton
|
||||
//
|
||||
this.pnlButton.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.pnlButton.Controls.Add(this.label1);
|
||||
this.pnlButton.Controls.Add(this.llbHelp);
|
||||
this.pnlButton.Controls.Add(this.lBTest);
|
||||
this.pnlButton.Controls.Add(this.btnStartStop);
|
||||
this.pnlButton.Controls.Add(this.lnkControllers);
|
||||
this.pnlButton.Controls.Add(this.StartWindowsCheckBox);
|
||||
this.pnlButton.Controls.Add(this.lbLastMessage);
|
||||
this.pnlButton.Controls.Add(this.startMinimizedCheckBox);
|
||||
this.pnlButton.Controls.Add(this.hideDS4CheckBox);
|
||||
this.pnlButton.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.pnlButton.Location = new System.Drawing.Point(0, 339);
|
||||
this.pnlButton.Name = "pnlButton";
|
||||
this.pnlButton.Size = new System.Drawing.Size(794, 54);
|
||||
this.pnlButton.Size = new System.Drawing.Size(794, 30);
|
||||
this.pnlButton.TabIndex = 10;
|
||||
//
|
||||
// label1
|
||||
// lBTest
|
||||
//
|
||||
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(526, 5);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(98, 13);
|
||||
this.label1.TabIndex = 46;
|
||||
this.label1.Text = "Used to test values";
|
||||
this.label1.Visible = false;
|
||||
this.lBTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.lBTest.AutoSize = true;
|
||||
this.lBTest.Location = new System.Drawing.Point(625, 9);
|
||||
this.lBTest.Name = "lBTest";
|
||||
this.lBTest.Size = new System.Drawing.Size(98, 13);
|
||||
this.lBTest.TabIndex = 46;
|
||||
this.lBTest.Text = "Used to test values";
|
||||
this.lBTest.Visible = false;
|
||||
//
|
||||
// llbHelp
|
||||
//
|
||||
this.llbHelp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.llbHelp.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.llbHelp.AutoSize = true;
|
||||
this.llbHelp.Location = new System.Drawing.Point(649, 5);
|
||||
this.llbHelp.Location = new System.Drawing.Point(198, 30);
|
||||
this.llbHelp.Name = "llbHelp";
|
||||
this.llbHelp.Size = new System.Drawing.Size(79, 13);
|
||||
this.llbHelp.TabIndex = 13;
|
||||
@ -199,8 +209,8 @@
|
||||
//
|
||||
// btnStartStop
|
||||
//
|
||||
this.btnStartStop.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
|
||||
this.btnStartStop.Location = new System.Drawing.Point(535, 26);
|
||||
this.btnStartStop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnStartStop.Location = new System.Drawing.Point(729, 4);
|
||||
this.btnStartStop.Name = "btnStartStop";
|
||||
this.btnStartStop.Size = new System.Drawing.Size(58, 23);
|
||||
this.btnStartStop.TabIndex = 1;
|
||||
@ -210,21 +220,31 @@
|
||||
//
|
||||
// lnkControllers
|
||||
//
|
||||
this.lnkControllers.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.lnkControllers.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.lnkControllers.AutoSize = true;
|
||||
this.lnkControllers.Location = new System.Drawing.Point(734, 5);
|
||||
this.lnkControllers.Location = new System.Drawing.Point(383, 30);
|
||||
this.lnkControllers.Name = "lnkControllers";
|
||||
this.lnkControllers.Size = new System.Drawing.Size(56, 13);
|
||||
this.lnkControllers.Size = new System.Drawing.Size(122, 13);
|
||||
this.lnkControllers.TabIndex = 11;
|
||||
this.lnkControllers.TabStop = true;
|
||||
this.lnkControllers.Text = "Controllers";
|
||||
this.lnkControllers.Text = "Control Panel Controllers";
|
||||
this.lnkControllers.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lnkControllers_LinkClicked);
|
||||
//
|
||||
// lbLastMessage
|
||||
//
|
||||
this.lbLastMessage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.lbLastMessage.ForeColor = System.Drawing.SystemColors.GrayText;
|
||||
this.lbLastMessage.Location = new System.Drawing.Point(4, 9);
|
||||
this.lbLastMessage.Name = "lbLastMessage";
|
||||
this.lbLastMessage.Size = new System.Drawing.Size(724, 18);
|
||||
this.lbLastMessage.TabIndex = 41;
|
||||
//
|
||||
// StartWindowsCheckBox
|
||||
//
|
||||
this.StartWindowsCheckBox.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
|
||||
this.StartWindowsCheckBox.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.StartWindowsCheckBox.AutoSize = true;
|
||||
this.StartWindowsCheckBox.Location = new System.Drawing.Point(206, 30);
|
||||
this.StartWindowsCheckBox.Location = new System.Drawing.Point(3, 3);
|
||||
this.StartWindowsCheckBox.Name = "StartWindowsCheckBox";
|
||||
this.StartWindowsCheckBox.Size = new System.Drawing.Size(95, 17);
|
||||
this.StartWindowsCheckBox.TabIndex = 40;
|
||||
@ -232,21 +252,11 @@
|
||||
this.StartWindowsCheckBox.UseVisualStyleBackColor = true;
|
||||
this.StartWindowsCheckBox.CheckedChanged += new System.EventHandler(this.StartWindowsCheckBox_CheckedChanged);
|
||||
//
|
||||
// lbLastMessage
|
||||
//
|
||||
this.lbLastMessage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.lbLastMessage.ForeColor = System.Drawing.SystemColors.GrayText;
|
||||
this.lbLastMessage.Location = new System.Drawing.Point(8, 5);
|
||||
this.lbLastMessage.Name = "lbLastMessage";
|
||||
this.lbLastMessage.Size = new System.Drawing.Size(635, 18);
|
||||
this.lbLastMessage.TabIndex = 41;
|
||||
//
|
||||
// startMinimizedCheckBox
|
||||
//
|
||||
this.startMinimizedCheckBox.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
|
||||
this.startMinimizedCheckBox.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.startMinimizedCheckBox.AutoSize = true;
|
||||
this.startMinimizedCheckBox.Location = new System.Drawing.Point(307, 30);
|
||||
this.startMinimizedCheckBox.Location = new System.Drawing.Point(104, 3);
|
||||
this.startMinimizedCheckBox.Name = "startMinimizedCheckBox";
|
||||
this.startMinimizedCheckBox.Size = new System.Drawing.Size(97, 17);
|
||||
this.startMinimizedCheckBox.TabIndex = 40;
|
||||
@ -256,9 +266,9 @@
|
||||
//
|
||||
// hideDS4CheckBox
|
||||
//
|
||||
this.hideDS4CheckBox.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
|
||||
this.hideDS4CheckBox.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.hideDS4CheckBox.AutoSize = true;
|
||||
this.hideDS4CheckBox.Location = new System.Drawing.Point(410, 30);
|
||||
this.hideDS4CheckBox.Location = new System.Drawing.Point(207, 3);
|
||||
this.hideDS4CheckBox.Name = "hideDS4CheckBox";
|
||||
this.hideDS4CheckBox.Size = new System.Drawing.Size(119, 17);
|
||||
this.hideDS4CheckBox.TabIndex = 13;
|
||||
@ -371,6 +381,7 @@
|
||||
this.tabMain.Controls.Add(this.tabProfiles);
|
||||
this.tabMain.Controls.Add(this.tabLog);
|
||||
this.tabMain.Controls.Add(this.tabAutoProfiles);
|
||||
this.tabMain.Controls.Add(this.tabSettings);
|
||||
this.tabMain.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tabMain.Location = new System.Drawing.Point(0, 0);
|
||||
this.tabMain.Name = "tabMain";
|
||||
@ -396,7 +407,7 @@
|
||||
this.tLPControllers.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 23.34039F));
|
||||
this.tLPControllers.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25.31077F));
|
||||
this.tLPControllers.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 117F));
|
||||
this.tLPControllers.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 48F));
|
||||
this.tLPControllers.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 50F));
|
||||
this.tLPControllers.Controls.Add(this.pBStatus1, 1, 1);
|
||||
this.tLPControllers.Controls.Add(this.lbPad1, 0, 1);
|
||||
this.tLPControllers.Controls.Add(this.lbPad2, 0, 2);
|
||||
@ -410,10 +421,10 @@
|
||||
this.tLPControllers.Controls.Add(this.cBController3, 3, 3);
|
||||
this.tLPControllers.Controls.Add(this.bnEditC1, 4, 1);
|
||||
this.tLPControllers.Controls.Add(this.cBController4, 3, 4);
|
||||
this.tLPControllers.Controls.Add(this.label2, 3, 0);
|
||||
this.tLPControllers.Controls.Add(this.label3, 0, 0);
|
||||
this.tLPControllers.Controls.Add(this.label4, 1, 0);
|
||||
this.tLPControllers.Controls.Add(this.label5, 2, 0);
|
||||
this.tLPControllers.Controls.Add(this.lBSelectedProfile, 3, 0);
|
||||
this.tLPControllers.Controls.Add(this.lBID, 0, 0);
|
||||
this.tLPControllers.Controls.Add(this.lBStatus, 1, 0);
|
||||
this.tLPControllers.Controls.Add(this.lBBattery, 2, 0);
|
||||
this.tLPControllers.Controls.Add(this.lBBatt1, 2, 1);
|
||||
this.tLPControllers.Controls.Add(this.lBBatt2, 2, 2);
|
||||
this.tLPControllers.Controls.Add(this.lBBatt3, 2, 3);
|
||||
@ -438,7 +449,7 @@
|
||||
this.pBStatus1.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.pBStatus1.Image = ((System.Drawing.Image)(resources.GetObject("pBStatus1.Image")));
|
||||
this.pBStatus1.InitialImage = global::ScpServer.Properties.Resources.BT;
|
||||
this.pBStatus1.Location = new System.Drawing.Point(370, 19);
|
||||
this.pBStatus1.Location = new System.Drawing.Point(369, 19);
|
||||
this.pBStatus1.Name = "pBStatus1";
|
||||
this.pBStatus1.Size = new System.Drawing.Size(39, 20);
|
||||
this.pBStatus1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
|
||||
@ -470,7 +481,7 @@
|
||||
// bnEditC3
|
||||
//
|
||||
this.bnEditC3.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.bnEditC3.Location = new System.Drawing.Point(739, 76);
|
||||
this.bnEditC3.Location = new System.Drawing.Point(737, 76);
|
||||
this.bnEditC3.Name = "bnEditC3";
|
||||
this.bnEditC3.Size = new System.Drawing.Size(40, 23);
|
||||
this.bnEditC3.TabIndex = 43;
|
||||
@ -482,7 +493,7 @@
|
||||
// bnEditC4
|
||||
//
|
||||
this.bnEditC4.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.bnEditC4.Location = new System.Drawing.Point(739, 105);
|
||||
this.bnEditC4.Location = new System.Drawing.Point(737, 105);
|
||||
this.bnEditC4.Name = "bnEditC4";
|
||||
this.bnEditC4.Size = new System.Drawing.Size(40, 23);
|
||||
this.bnEditC4.TabIndex = 43;
|
||||
@ -516,8 +527,9 @@
|
||||
// cBController1
|
||||
//
|
||||
this.cBController1.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.cBController1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cBController1.FormattingEnabled = true;
|
||||
this.cBController1.Location = new System.Drawing.Point(622, 19);
|
||||
this.cBController1.Location = new System.Drawing.Point(620, 19);
|
||||
this.cBController1.Name = "cBController1";
|
||||
this.cBController1.Size = new System.Drawing.Size(111, 21);
|
||||
this.cBController1.TabIndex = 42;
|
||||
@ -527,7 +539,7 @@
|
||||
// bnEditC2
|
||||
//
|
||||
this.bnEditC2.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.bnEditC2.Location = new System.Drawing.Point(739, 47);
|
||||
this.bnEditC2.Location = new System.Drawing.Point(737, 47);
|
||||
this.bnEditC2.Name = "bnEditC2";
|
||||
this.bnEditC2.Size = new System.Drawing.Size(40, 23);
|
||||
this.bnEditC2.TabIndex = 43;
|
||||
@ -539,8 +551,9 @@
|
||||
// cBController2
|
||||
//
|
||||
this.cBController2.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.cBController2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cBController2.FormattingEnabled = true;
|
||||
this.cBController2.Location = new System.Drawing.Point(622, 48);
|
||||
this.cBController2.Location = new System.Drawing.Point(620, 48);
|
||||
this.cBController2.Name = "cBController2";
|
||||
this.cBController2.Size = new System.Drawing.Size(111, 21);
|
||||
this.cBController2.TabIndex = 42;
|
||||
@ -550,8 +563,9 @@
|
||||
// cBController3
|
||||
//
|
||||
this.cBController3.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.cBController3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cBController3.FormattingEnabled = true;
|
||||
this.cBController3.Location = new System.Drawing.Point(622, 77);
|
||||
this.cBController3.Location = new System.Drawing.Point(620, 77);
|
||||
this.cBController3.Name = "cBController3";
|
||||
this.cBController3.Size = new System.Drawing.Size(111, 21);
|
||||
this.cBController3.TabIndex = 42;
|
||||
@ -561,7 +575,7 @@
|
||||
// bnEditC1
|
||||
//
|
||||
this.bnEditC1.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.bnEditC1.Location = new System.Drawing.Point(739, 18);
|
||||
this.bnEditC1.Location = new System.Drawing.Point(737, 18);
|
||||
this.bnEditC1.Name = "bnEditC1";
|
||||
this.bnEditC1.Size = new System.Drawing.Size(40, 23);
|
||||
this.bnEditC1.TabIndex = 43;
|
||||
@ -573,64 +587,65 @@
|
||||
// cBController4
|
||||
//
|
||||
this.cBController4.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.cBController4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cBController4.FormattingEnabled = true;
|
||||
this.cBController4.Location = new System.Drawing.Point(622, 106);
|
||||
this.cBController4.Location = new System.Drawing.Point(620, 106);
|
||||
this.cBController4.Name = "cBController4";
|
||||
this.cBController4.Size = new System.Drawing.Size(111, 21);
|
||||
this.cBController4.TabIndex = 42;
|
||||
this.cBController4.Tag = "3";
|
||||
this.cBController4.SelectedValueChanged += new System.EventHandler(this.Profile_Changed);
|
||||
//
|
||||
// label2
|
||||
// lBSelectedProfile
|
||||
//
|
||||
this.label2.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label2.Location = new System.Drawing.Point(623, 0);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(109, 15);
|
||||
this.label2.TabIndex = 45;
|
||||
this.label2.Text = "Selected Profile";
|
||||
this.lBSelectedProfile.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.lBSelectedProfile.AutoSize = true;
|
||||
this.lBSelectedProfile.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lBSelectedProfile.Location = new System.Drawing.Point(621, 0);
|
||||
this.lBSelectedProfile.Name = "lBSelectedProfile";
|
||||
this.lBSelectedProfile.Size = new System.Drawing.Size(109, 15);
|
||||
this.lBSelectedProfile.TabIndex = 45;
|
||||
this.lBSelectedProfile.Text = "Selected Profile";
|
||||
//
|
||||
// label3
|
||||
// lBID
|
||||
//
|
||||
this.label3.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label3.Location = new System.Drawing.Point(3, 0);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(21, 15);
|
||||
this.label3.TabIndex = 45;
|
||||
this.label3.Text = "ID";
|
||||
this.lBID.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.lBID.AutoSize = true;
|
||||
this.lBID.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lBID.Location = new System.Drawing.Point(3, 0);
|
||||
this.lBID.Name = "lBID";
|
||||
this.lBID.Size = new System.Drawing.Size(21, 15);
|
||||
this.lBID.TabIndex = 45;
|
||||
this.lBID.Text = "ID";
|
||||
//
|
||||
// label4
|
||||
// lBStatus
|
||||
//
|
||||
this.label4.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label4.Location = new System.Drawing.Point(366, 0);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(47, 15);
|
||||
this.label4.TabIndex = 45;
|
||||
this.label4.Text = "Status";
|
||||
this.lBStatus.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.lBStatus.AutoSize = true;
|
||||
this.lBStatus.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lBStatus.Location = new System.Drawing.Point(365, 0);
|
||||
this.lBStatus.Name = "lBStatus";
|
||||
this.lBStatus.Size = new System.Drawing.Size(47, 15);
|
||||
this.lBStatus.TabIndex = 45;
|
||||
this.lBStatus.Text = "Status";
|
||||
//
|
||||
// label5
|
||||
// lBBattery
|
||||
//
|
||||
this.label5.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label5.Location = new System.Drawing.Point(515, 0);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(51, 15);
|
||||
this.label5.TabIndex = 45;
|
||||
this.label5.Text = "Battery";
|
||||
this.lBBattery.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.lBBattery.AutoSize = true;
|
||||
this.lBBattery.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lBBattery.Location = new System.Drawing.Point(513, 0);
|
||||
this.lBBattery.Name = "lBBattery";
|
||||
this.lBBattery.Size = new System.Drawing.Size(51, 15);
|
||||
this.lBBattery.TabIndex = 45;
|
||||
this.lBBattery.Text = "Battery";
|
||||
//
|
||||
// lBBatt1
|
||||
//
|
||||
this.lBBatt1.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.lBBatt1.AutoSize = true;
|
||||
this.lBBatt1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lBBatt1.Location = new System.Drawing.Point(521, 22);
|
||||
this.lBBatt1.Location = new System.Drawing.Point(519, 22);
|
||||
this.lBBatt1.Name = "lBBatt1";
|
||||
this.lBBatt1.Size = new System.Drawing.Size(39, 15);
|
||||
this.lBBatt1.TabIndex = 44;
|
||||
@ -641,7 +656,7 @@
|
||||
this.lBBatt2.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.lBBatt2.AutoSize = true;
|
||||
this.lBBatt2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lBBatt2.Location = new System.Drawing.Point(521, 51);
|
||||
this.lBBatt2.Location = new System.Drawing.Point(519, 51);
|
||||
this.lBBatt2.Name = "lBBatt2";
|
||||
this.lBBatt2.Size = new System.Drawing.Size(39, 15);
|
||||
this.lBBatt2.TabIndex = 44;
|
||||
@ -652,7 +667,7 @@
|
||||
this.lBBatt3.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.lBBatt3.AutoSize = true;
|
||||
this.lBBatt3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lBBatt3.Location = new System.Drawing.Point(521, 80);
|
||||
this.lBBatt3.Location = new System.Drawing.Point(519, 80);
|
||||
this.lBBatt3.Name = "lBBatt3";
|
||||
this.lBBatt3.Size = new System.Drawing.Size(39, 15);
|
||||
this.lBBatt3.TabIndex = 44;
|
||||
@ -663,7 +678,7 @@
|
||||
this.lBBatt4.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.lBBatt4.AutoSize = true;
|
||||
this.lBBatt4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lBBatt4.Location = new System.Drawing.Point(521, 109);
|
||||
this.lBBatt4.Location = new System.Drawing.Point(519, 109);
|
||||
this.lBBatt4.Name = "lBBatt4";
|
||||
this.lBBatt4.Size = new System.Drawing.Size(39, 15);
|
||||
this.lBBatt4.TabIndex = 44;
|
||||
@ -674,7 +689,7 @@
|
||||
this.pBStatus2.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.pBStatus2.Image = ((System.Drawing.Image)(resources.GetObject("pBStatus2.Image")));
|
||||
this.pBStatus2.InitialImage = global::ScpServer.Properties.Resources.BT;
|
||||
this.pBStatus2.Location = new System.Drawing.Point(370, 48);
|
||||
this.pBStatus2.Location = new System.Drawing.Point(369, 48);
|
||||
this.pBStatus2.Name = "pBStatus2";
|
||||
this.pBStatus2.Size = new System.Drawing.Size(39, 20);
|
||||
this.pBStatus2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
|
||||
@ -686,7 +701,7 @@
|
||||
this.pBStatus3.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.pBStatus3.Image = ((System.Drawing.Image)(resources.GetObject("pBStatus3.Image")));
|
||||
this.pBStatus3.InitialImage = global::ScpServer.Properties.Resources.BT;
|
||||
this.pBStatus3.Location = new System.Drawing.Point(370, 77);
|
||||
this.pBStatus3.Location = new System.Drawing.Point(369, 77);
|
||||
this.pBStatus3.Name = "pBStatus3";
|
||||
this.pBStatus3.Size = new System.Drawing.Size(39, 20);
|
||||
this.pBStatus3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
|
||||
@ -698,7 +713,7 @@
|
||||
this.pBStatus4.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.pBStatus4.Image = ((System.Drawing.Image)(resources.GetObject("pBStatus4.Image")));
|
||||
this.pBStatus4.InitialImage = global::ScpServer.Properties.Resources.BT;
|
||||
this.pBStatus4.Location = new System.Drawing.Point(370, 106);
|
||||
this.pBStatus4.Location = new System.Drawing.Point(369, 106);
|
||||
this.pBStatus4.Name = "pBStatus4";
|
||||
this.pBStatus4.Size = new System.Drawing.Size(39, 20);
|
||||
this.pBStatus4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
|
||||
@ -822,8 +837,8 @@
|
||||
this.tSBDupProfile.Image = ((System.Drawing.Image)(resources.GetObject("tSBDupProfile.Image")));
|
||||
this.tSBDupProfile.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.tSBDupProfile.Name = "tSBDupProfile";
|
||||
this.tSBDupProfile.Size = new System.Drawing.Size(83, 22);
|
||||
this.tSBDupProfile.Text = "Dupliacate";
|
||||
this.tSBDupProfile.Size = new System.Drawing.Size(77, 22);
|
||||
this.tSBDupProfile.Text = "Duplicate";
|
||||
this.tSBDupProfile.TextAlign = System.Drawing.ContentAlignment.TopLeft;
|
||||
this.tSBDupProfile.ToolTipText = "Dupliacate Selected Profile (Ctrl+C)";
|
||||
this.tSBDupProfile.Click += new System.EventHandler(this.tSBDupProfile_Click);
|
||||
@ -972,25 +987,163 @@
|
||||
this.tabAutoProfiles.Name = "tabAutoProfiles";
|
||||
this.tabAutoProfiles.Size = new System.Drawing.Size(786, 313);
|
||||
this.tabAutoProfiles.TabIndex = 2;
|
||||
this.tabAutoProfiles.Text = "Auto Profiles (Alpha)";
|
||||
this.tabAutoProfiles.Text = "Auto Profiles (Beta)";
|
||||
this.tabAutoProfiles.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// tabSettings
|
||||
//
|
||||
this.tabSettings.Controls.Add(this.flowLayoutPanel1);
|
||||
this.tabSettings.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabSettings.Name = "tabSettings";
|
||||
this.tabSettings.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabSettings.Size = new System.Drawing.Size(786, 313);
|
||||
this.tabSettings.TabIndex = 4;
|
||||
this.tabSettings.Text = "Settings";
|
||||
this.tabSettings.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
this.flowLayoutPanel1.AutoScroll = true;
|
||||
this.flowLayoutPanel1.Controls.Add(this.StartWindowsCheckBox);
|
||||
this.flowLayoutPanel1.Controls.Add(this.startMinimizedCheckBox);
|
||||
this.flowLayoutPanel1.Controls.Add(this.hideDS4CheckBox);
|
||||
this.flowLayoutPanel1.Controls.Add(this.cBNotifications);
|
||||
this.flowLayoutPanel1.Controls.Add(this.cBUpdate);
|
||||
this.flowLayoutPanel1.Controls.Add(this.pNUpdate);
|
||||
this.flowLayoutPanel1.Controls.Add(this.llbHelp);
|
||||
this.flowLayoutPanel1.Controls.Add(this.linkProfiles);
|
||||
this.flowLayoutPanel1.Controls.Add(this.lnkControllers);
|
||||
this.flowLayoutPanel1.Controls.Add(this.lLBUpdate);
|
||||
this.flowLayoutPanel1.Controls.Add(this.linkUninstall);
|
||||
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 3);
|
||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(780, 307);
|
||||
this.flowLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// cBUpdate
|
||||
//
|
||||
this.cBUpdate.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.cBUpdate.AutoSize = true;
|
||||
this.cBUpdate.Location = new System.Drawing.Point(452, 3);
|
||||
this.cBUpdate.Name = "cBUpdate";
|
||||
this.cBUpdate.Size = new System.Drawing.Size(164, 17);
|
||||
this.cBUpdate.TabIndex = 41;
|
||||
this.cBUpdate.Text = "Check for Updates at Startup";
|
||||
this.cBUpdate.UseVisualStyleBackColor = true;
|
||||
this.cBUpdate.CheckedChanged += new System.EventHandler(this.cBUpdate_CheckedChanged);
|
||||
//
|
||||
// saveProfiles
|
||||
//
|
||||
this.saveProfiles.Filter = "XML Files (*.xml)|*.xml";
|
||||
//
|
||||
// nUDUpdateTime
|
||||
//
|
||||
this.nUDUpdateTime.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.nUDUpdateTime.Location = new System.Drawing.Point(76, 1);
|
||||
this.nUDUpdateTime.Maximum = new decimal(new int[] {
|
||||
24,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.nUDUpdateTime.Name = "nUDUpdateTime";
|
||||
this.nUDUpdateTime.Size = new System.Drawing.Size(44, 20);
|
||||
this.nUDUpdateTime.TabIndex = 42;
|
||||
this.nUDUpdateTime.ValueChanged += new System.EventHandler(this.nUDUpdateTime_ValueChanged);
|
||||
//
|
||||
// pNUpdate
|
||||
//
|
||||
this.pNUpdate.Controls.Add(this.cBUpdateTime);
|
||||
this.pNUpdate.Controls.Add(this.lBCheckEvery);
|
||||
this.pNUpdate.Controls.Add(this.nUDUpdateTime);
|
||||
this.pNUpdate.Enabled = false;
|
||||
this.pNUpdate.Location = new System.Drawing.Point(3, 26);
|
||||
this.pNUpdate.Name = "pNUpdate";
|
||||
this.pNUpdate.Size = new System.Drawing.Size(189, 22);
|
||||
this.pNUpdate.TabIndex = 43;
|
||||
//
|
||||
// lBCheckEvery
|
||||
//
|
||||
this.lBCheckEvery.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.lBCheckEvery.AutoSize = true;
|
||||
this.lBCheckEvery.Location = new System.Drawing.Point(3, 3);
|
||||
this.lBCheckEvery.Name = "lBCheckEvery";
|
||||
this.lBCheckEvery.Size = new System.Drawing.Size(67, 13);
|
||||
this.lBCheckEvery.TabIndex = 0;
|
||||
this.lBCheckEvery.Text = "Check every";
|
||||
//
|
||||
// cBUpdateTime
|
||||
//
|
||||
this.cBUpdateTime.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cBUpdateTime.FormattingEnabled = true;
|
||||
this.cBUpdateTime.Items.AddRange(new object[] {
|
||||
"hours",
|
||||
"days"});
|
||||
this.cBUpdateTime.Location = new System.Drawing.Point(126, 0);
|
||||
this.cBUpdateTime.Name = "cBUpdateTime";
|
||||
this.cBUpdateTime.Size = new System.Drawing.Size(60, 21);
|
||||
this.cBUpdateTime.TabIndex = 43;
|
||||
this.cBUpdateTime.SelectedIndexChanged += new System.EventHandler(this.cBUpdateTime_SelectedIndexChanged);
|
||||
//
|
||||
// lLBUpdate
|
||||
//
|
||||
this.lLBUpdate.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.lLBUpdate.Location = new System.Drawing.Point(511, 25);
|
||||
this.lLBUpdate.Name = "lLBUpdate";
|
||||
this.lLBUpdate.Size = new System.Drawing.Size(116, 23);
|
||||
this.lLBUpdate.TabIndex = 49;
|
||||
this.lLBUpdate.TabStop = true;
|
||||
this.lLBUpdate.Text = "Check for Update Now";
|
||||
this.lLBUpdate.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.lLBUpdate.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lLBUpdate_LinkClicked);
|
||||
//
|
||||
// linkUninstall
|
||||
//
|
||||
this.linkUninstall.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.linkUninstall.Location = new System.Drawing.Point(633, 25);
|
||||
this.linkUninstall.Name = "linkUninstall";
|
||||
this.linkUninstall.Size = new System.Drawing.Size(106, 23);
|
||||
this.linkUninstall.TabIndex = 44;
|
||||
this.linkUninstall.TabStop = true;
|
||||
this.linkUninstall.Text = "Uninstall VBus Driver";
|
||||
this.linkUninstall.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.linkUninstall.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkUninstall_LinkClicked);
|
||||
//
|
||||
// linkProfiles
|
||||
//
|
||||
this.linkProfiles.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.linkProfiles.AutoSize = true;
|
||||
this.linkProfiles.Location = new System.Drawing.Point(283, 30);
|
||||
this.linkProfiles.Name = "linkProfiles";
|
||||
this.linkProfiles.Size = new System.Drawing.Size(94, 13);
|
||||
this.linkProfiles.TabIndex = 50;
|
||||
this.linkProfiles.TabStop = true;
|
||||
this.linkProfiles.Text = "Open Profile folder";
|
||||
this.linkProfiles.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkProfiles_LinkClicked);
|
||||
//
|
||||
// cBNotifications
|
||||
//
|
||||
this.cBNotifications.AutoSize = true;
|
||||
this.cBNotifications.Location = new System.Drawing.Point(332, 3);
|
||||
this.cBNotifications.Name = "cBNotifications";
|
||||
this.cBNotifications.Size = new System.Drawing.Size(114, 17);
|
||||
this.cBNotifications.TabIndex = 51;
|
||||
this.cBNotifications.Text = "Show Notifications";
|
||||
this.cBNotifications.UseVisualStyleBackColor = true;
|
||||
this.cBNotifications.CheckedChanged += new System.EventHandler(this.cBNotifications_CheckedChanged);
|
||||
//
|
||||
// ScpForm
|
||||
//
|
||||
this.AllowDrop = true;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
|
||||
this.BackColor = System.Drawing.Color.White;
|
||||
this.ClientSize = new System.Drawing.Size(794, 393);
|
||||
this.ClientSize = new System.Drawing.Size(794, 369);
|
||||
this.Controls.Add(this.tabMain);
|
||||
this.Controls.Add(this.pnlButton);
|
||||
this.MinimumSize = new System.Drawing.Size(420, 161);
|
||||
this.MinimumSize = new System.Drawing.Size(420, 137);
|
||||
this.Name = "ScpForm";
|
||||
this.Text = "DS4Windows 1.0 Beta J2K Build";
|
||||
this.Text = "DS4Windows";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form_Close);
|
||||
this.Load += new System.EventHandler(this.Form_Load);
|
||||
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.ScpForm_DragDrop);
|
||||
@ -1015,6 +1168,12 @@
|
||||
this.toolStrip1.PerformLayout();
|
||||
this.cMProfile.ResumeLayout(false);
|
||||
this.tabLog.ResumeLayout(false);
|
||||
this.tabSettings.ResumeLayout(false);
|
||||
this.flowLayoutPanel1.ResumeLayout(false);
|
||||
this.flowLayoutPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nUDUpdateTime)).EndInit();
|
||||
this.pNUpdate.ResumeLayout(false);
|
||||
this.pNUpdate.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
@ -1045,7 +1204,7 @@
|
||||
private System.Windows.Forms.OpenFileDialog openProfiles;
|
||||
private System.Windows.Forms.LinkLabel llbHelp;
|
||||
private System.Windows.Forms.CheckBox StartWindowsCheckBox;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label lBTest;
|
||||
private System.Windows.Forms.TabControl tabMain;
|
||||
private System.Windows.Forms.TabPage tabProfiles;
|
||||
private System.Windows.Forms.TabPage tabLog;
|
||||
@ -1071,10 +1230,10 @@
|
||||
private System.Windows.Forms.ComboBox cBController3;
|
||||
private System.Windows.Forms.Button bnEditC1;
|
||||
private System.Windows.Forms.ComboBox cBController4;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.Label lBSelectedProfile;
|
||||
private System.Windows.Forms.Label lBID;
|
||||
private System.Windows.Forms.Label lBStatus;
|
||||
private System.Windows.Forms.Label lBBattery;
|
||||
private System.Windows.Forms.Label lBBatt1;
|
||||
private System.Windows.Forms.Label lBBatt2;
|
||||
private System.Windows.Forms.Label lBBatt3;
|
||||
@ -1101,6 +1260,17 @@
|
||||
private System.Windows.Forms.ToolStripTextBox tSTBProfile;
|
||||
private System.Windows.Forms.ToolStripButton toolStripButton1;
|
||||
private System.Windows.Forms.ToolStripButton tSBCancel;
|
||||
private System.Windows.Forms.TabPage tabSettings;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
|
||||
private System.Windows.Forms.CheckBox cBUpdate;
|
||||
private System.Windows.Forms.NumericUpDown nUDUpdateTime;
|
||||
private System.Windows.Forms.Panel pNUpdate;
|
||||
private System.Windows.Forms.Label lBCheckEvery;
|
||||
private System.Windows.Forms.ComboBox cBUpdateTime;
|
||||
private System.Windows.Forms.LinkLabel lLBUpdate;
|
||||
private System.Windows.Forms.LinkLabel linkUninstall;
|
||||
private System.Windows.Forms.LinkLabel linkProfiles;
|
||||
private System.Windows.Forms.CheckBox cBNotifications;
|
||||
//private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2;
|
||||
}
|
||||
}
|
||||
|
@ -11,11 +11,12 @@ using System.Management;
|
||||
using System.Drawing;
|
||||
using Microsoft.Win32;
|
||||
using System.Diagnostics;
|
||||
using System.Xml;
|
||||
namespace ScpServer
|
||||
{
|
||||
public partial class ScpForm : Form
|
||||
{
|
||||
double version = 9.33;
|
||||
double version = 9.9;
|
||||
private DS4Control.Control rootHub;
|
||||
delegate void LogDebugDelegate(DateTime Time, String Data);
|
||||
|
||||
@ -26,62 +27,20 @@ namespace ScpServer
|
||||
protected ToolStripMenuItem[] shortcuts;
|
||||
WebClient wc = new WebClient();
|
||||
Timer test = new Timer(), hotkeystimer = new Timer();
|
||||
#region Aero
|
||||
/*[StructLayout(LayoutKind.Sequential)]
|
||||
public struct MARGINS
|
||||
{
|
||||
public int Left;
|
||||
public int Right;
|
||||
public int Top;
|
||||
public int Bottom;
|
||||
}
|
||||
|
||||
[DllImport("dwmapi.dll")]
|
||||
public static extern int DwmExtendFrameIntoClientArea(IntPtr hWnd, ref MARGINS pMargins);
|
||||
/// <summary>
|
||||
/// Determins whether the Desktop Windows Manager is enabled
|
||||
/// and can therefore display Aero
|
||||
/// </summary>
|
||||
[DllImport("dwmapi.dll", PreserveSig = false)]
|
||||
public static extern bool DwmIsCompositionEnabled();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Override the OnPaintBackground method, to draw the desired
|
||||
/// Glass regions black and display as Glass
|
||||
/// </summary>
|
||||
protected override void OnPaintBackground(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
if (DwmIsCompositionEnabled())
|
||||
{
|
||||
e.Graphics.Clear(Color.Black);
|
||||
// put back the original form background for non-glass area
|
||||
Rectangle clientArea = new Rectangle(
|
||||
marg.Left,
|
||||
marg.Top,
|
||||
this.ClientRectangle.Width - marg.Left - marg.Right,
|
||||
this.ClientRectangle.Height - marg.Top - marg.Bottom);
|
||||
Brush b = new SolidBrush(this.BackColor);
|
||||
e.Graphics.FillRectangle(b, clientArea);
|
||||
}
|
||||
}
|
||||
|
||||
MARGINS marg = new MARGINS() { Left = 0, Right = 0, Top = 0, Bottom = 0 };
|
||||
/// <summary>
|
||||
/// Use the form padding values to define a Glass margin
|
||||
/// </summary>
|
||||
private void trackBar1_Scroll(object sender, EventArgs e)
|
||||
{
|
||||
this.Padding = new Padding(this.trackBar1.Value);
|
||||
int value = (int)trackBar1.Value;
|
||||
marg = new MARGINS() { Left = value, Right = value, Top = value, Bottom = value };
|
||||
DwmExtendFrameIntoClientArea(this.Handle, ref marg);
|
||||
//SetGlassRegion();
|
||||
//Invalidate();
|
||||
}*/
|
||||
#endregion
|
||||
|
||||
string exepath = Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName;
|
||||
float dpix, dpiy;
|
||||
string filename;
|
||||
DateTime oldnow = DateTime.UtcNow;
|
||||
string tempprofile = "null";
|
||||
List<string> profilenames = new List<string>();
|
||||
List<string> programpaths = new List<string>();
|
||||
List<string>[] proprofiles;
|
||||
private static int WM_QUERYENDSESSION = 0x11;
|
||||
private static bool systemShutdown = false;
|
||||
delegate void ControllerStatusChangedDelegate(object sender, EventArgs e);
|
||||
delegate void HotKeysDelegate(object sender, EventArgs e);
|
||||
Options opt;
|
||||
private System.Drawing.Size oldsize;
|
||||
protected void SetupArrays()
|
||||
{
|
||||
Pads = new Label[4] { lbPad1, lbPad2, lbPad3, lbPad4 };
|
||||
@ -102,10 +61,30 @@ namespace ScpServer
|
||||
ThemeUtil.SetTheme(lvDebug);
|
||||
SetupArrays();
|
||||
CheckDrivers();
|
||||
SystemEvents.PowerModeChanged += OnPowerChange;
|
||||
tSOptions.Visible = false;
|
||||
LoadP();
|
||||
ToolTip tt = new ToolTip();
|
||||
tt.SetToolTip(linkUninstall, "To fully remove DS4Windows, You can delete the profiles by the link to the other side");
|
||||
if (!System.IO.Directory.Exists(Global.appdatapath + "\\Virtual Bus Driver"))
|
||||
linkUninstall.Visible = false;
|
||||
}
|
||||
float dpix, dpiy;
|
||||
|
||||
|
||||
private void OnPowerChange(object s, PowerModeChangedEventArgs e)
|
||||
{
|
||||
switch (e.Mode)
|
||||
{
|
||||
case PowerModes.Resume:
|
||||
if (btnStartStop.Text == "Start")
|
||||
btnStartStop_Clicked();
|
||||
break;
|
||||
case PowerModes.Suspend:
|
||||
if (btnStartStop.Text == "Stop")
|
||||
btnStartStop_Clicked();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
protected void Form_Load(object sender, EventArgs e)
|
||||
{
|
||||
SetupArrays();
|
||||
@ -159,33 +138,44 @@ namespace ScpServer
|
||||
ControllerStatusChanged();
|
||||
if (btnStartStop.Enabled)
|
||||
btnStartStop_Clicked();
|
||||
cBNotifications.Checked = Global.getNotifications();
|
||||
int checkwhen = Global.getCheckWhen();
|
||||
cBUpdate.Checked = checkwhen > 0;
|
||||
if (checkwhen > 23)
|
||||
{
|
||||
cBUpdateTime.SelectedIndex = 1;
|
||||
nUDUpdateTime.Value = checkwhen / 24;
|
||||
}
|
||||
else
|
||||
{
|
||||
cBUpdateTime.SelectedIndex = 0;
|
||||
nUDUpdateTime.Value = checkwhen;
|
||||
}
|
||||
Uri url = new Uri("https://dl.dropboxusercontent.com/u/16364552/DS4Tool/newest%20version.txt"); //Sorry other devs, gonna have to find your own server
|
||||
Directory.CreateDirectory(Global.appdatapath);
|
||||
if (DateTime.Now >= Global.getLastChecked() + TimeSpan.FromHours(1))
|
||||
if (checkwhen > 0 && DateTime.Now >= Global.getLastChecked() + TimeSpan.FromHours(checkwhen))
|
||||
{
|
||||
wc.DownloadFileAsync(url, Global.appdatapath + "\\version.txt");
|
||||
wc.DownloadFileCompleted += Check_Version;
|
||||
Global.setLastChecked(DateTime.Now);
|
||||
}
|
||||
WinProgs WP = new WinProgs(profilenames.ToArray());
|
||||
WP.TopLevel = false;
|
||||
WP.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
WP.Visible = true;
|
||||
WP.Dock = DockStyle.Fill;
|
||||
WP.Enabled = false;
|
||||
tabAutoProfiles.Controls.Add(WP);
|
||||
|
||||
if (File.Exists("Updater.exe"))
|
||||
{
|
||||
System.Threading.Thread.Sleep(2000);
|
||||
File.Delete("Updater.exe");
|
||||
}
|
||||
//test.Start();
|
||||
hotkeystimer.Start();
|
||||
hotkeystimer.Tick += Hotkeys;
|
||||
test.Tick += test_Tick;
|
||||
test.Tick += test_Tick;
|
||||
}
|
||||
|
||||
|
||||
private void test_Tick(object sender, EventArgs e)
|
||||
{
|
||||
label1.Visible = true;
|
||||
label1.Text = dpix + " " + dpiy;
|
||||
lBTest.Visible = true;
|
||||
lBTest.Text = filename;
|
||||
}
|
||||
|
||||
void Hotkeys(object sender, EventArgs e)
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
@ -204,6 +194,62 @@ namespace ScpServer
|
||||
if (slide.Contains("t"))
|
||||
ShowNotification(this, "Controller " + (i + 1) + " is now using Profile \"" + cbs[i].Text + "\"");
|
||||
}
|
||||
|
||||
//Check for process for auto profiles
|
||||
DateTime now = DateTime.UtcNow;
|
||||
if (now >= oldnow + TimeSpan.FromSeconds(2))
|
||||
{
|
||||
oldnow = now;
|
||||
if (tempprofile == "null")
|
||||
{
|
||||
for (int i = 0; i < programpaths.Count; i++)
|
||||
{
|
||||
string name = Path.GetFileNameWithoutExtension(programpaths[i]);
|
||||
if (Process.GetProcessesByName(name).Length > 0)
|
||||
{
|
||||
if (programpaths[i].ToLower() == Process.GetProcessesByName(name)[0].Modules[0].FileName.ToLower())
|
||||
{
|
||||
for (int j = 0; j < 4; j++)
|
||||
if (proprofiles[j][i] != "(none)")
|
||||
Global.LoadTempProfile(j, proprofiles[j][i]); //j is filename, i is controller index
|
||||
tempprofile = name;
|
||||
filename = Process.GetProcessesByName(name)[0].Modules[0].FileName;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (Process.GetProcessesByName(tempprofile).Length <= 0)
|
||||
{
|
||||
for (int j = 0; j < 4; j++)
|
||||
Global.LoadProfile(j);
|
||||
tempprofile = "null";
|
||||
}
|
||||
PerformanceCounter.CloseSharedResources();
|
||||
}
|
||||
else
|
||||
PerformanceCounter.CloseSharedResources();
|
||||
GC.Collect();
|
||||
}
|
||||
|
||||
public void LoadP()
|
||||
{
|
||||
XmlDocument doc = new XmlDocument();
|
||||
proprofiles = new List<string>[4] { new List<string>(), new List<string>(),
|
||||
new List<string>(), new List<string>() };
|
||||
programpaths.Clear();
|
||||
if (!File.Exists(Global.appdatapath + "\\Auto Profiles.xml"))
|
||||
return;
|
||||
doc.Load(Global.appdatapath + "\\Auto Profiles.xml");
|
||||
XmlNodeList programslist = doc.SelectNodes("Programs/Program");
|
||||
foreach (XmlNode x in programslist)
|
||||
programpaths.Add(x.Attributes["path"].Value);
|
||||
foreach (string s in programpaths)
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
proprofiles[i].Add(doc.SelectSingleNode("/Programs/Program[@path=\"" + s + "\"]"
|
||||
+ "/Controller" + (i + 1)).InnerText);
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckDrivers()
|
||||
@ -229,40 +275,6 @@ namespace ScpServer
|
||||
}
|
||||
}
|
||||
|
||||
private void linkLabel1_LinkClicked_1(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
Uri url = new Uri("https://dl.dropboxusercontent.com/u/16364552/DS4Tool/newest%20version.txt"); //Sorry other devs, gonna have to find your own server
|
||||
wc.DownloadFile(url, Global.appdatapath + "\\version.txt");
|
||||
Global.setLastChecked(DateTime.Now);
|
||||
double newversion;
|
||||
try
|
||||
{
|
||||
if (double.TryParse(File.ReadAllText(Global.appdatapath + "\\version.txt"), out newversion))
|
||||
if (newversion > version)
|
||||
if (MessageBox.Show("Download now?", "DS4Windows Update Available!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
|
||||
{
|
||||
if (!File.Exists("Updater.exe"))
|
||||
{
|
||||
Uri url2 = new Uri("https://dl.dropboxusercontent.com/u/16364552/DS4Tool/Updater.exe");
|
||||
WebClient wc2 = new WebClient();
|
||||
wc2.DownloadFile(url2, "Updater.exe");
|
||||
}
|
||||
System.Diagnostics.Process.Start("Updater.exe");
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
File.Delete(Global.appdatapath + "\\version.txt");
|
||||
else
|
||||
{
|
||||
File.Delete(Global.appdatapath + "\\version.txt");
|
||||
MessageBox.Show("No new version", "You're up to date");
|
||||
}
|
||||
else
|
||||
File.Delete(Global.appdatapath + "\\version.txt");
|
||||
}
|
||||
catch { };
|
||||
}
|
||||
|
||||
private void Check_Version(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
|
||||
{
|
||||
double newversion;
|
||||
@ -270,15 +282,19 @@ namespace ScpServer
|
||||
{
|
||||
if (double.TryParse(File.ReadAllText(Global.appdatapath + "\\version.txt"), out newversion))
|
||||
if (newversion > version)
|
||||
if (MessageBox.Show("Download now?", "DS4Windows Update Available!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
|
||||
if (MessageBox.Show("Download Version " + newversion + " now?", "DS4Windows Update Available!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
|
||||
{
|
||||
if (!File.Exists("Updater.exe"))
|
||||
if (!File.Exists("DS4Updater.exe"))
|
||||
{
|
||||
Uri url2 = new Uri("https://dl.dropboxusercontent.com/u/16364552/DS4Tool/Updater.exe");
|
||||
Uri url2 = new Uri("https://dl.dropboxusercontent.com/u/16364552/DS4Tool/DS4Updater.exe");
|
||||
WebClient wc2 = new WebClient();
|
||||
wc2.DownloadFile(url2, "Updater.exe");
|
||||
wc2.DownloadFile(url2, "DS4Updater.exe");
|
||||
}
|
||||
System.Diagnostics.Process.Start("Updater.exe");
|
||||
Process p = new Process();
|
||||
p.StartInfo.FileName = "DS4Updater.exe";
|
||||
if (!exepath.StartsWith("C:\\Program Files") && !exepath.StartsWith("C:\\Windows"))
|
||||
p.StartInfo.Verb = "runas";
|
||||
p.Start();
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
@ -291,7 +307,6 @@ namespace ScpServer
|
||||
catch { };
|
||||
}
|
||||
|
||||
List<string> profilenames = new List<string>();
|
||||
public void RefreshProfiles()
|
||||
{
|
||||
try
|
||||
@ -349,8 +364,25 @@ namespace ScpServer
|
||||
shortcuts[i].DropDownItems.Add("+New Profile");
|
||||
}
|
||||
}
|
||||
tabAutoProfiles.Controls.Clear();
|
||||
WinProgs WP = new WinProgs(profilenames.ToArray(), this);
|
||||
WP.TopLevel = false;
|
||||
WP.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
WP.Visible = true;
|
||||
WP.Dock = DockStyle.Fill;
|
||||
tabAutoProfiles.Controls.Add(WP);
|
||||
}
|
||||
|
||||
public void RefreshAutoProfilesPage()
|
||||
{
|
||||
tabAutoProfiles.Controls.Clear();
|
||||
WinProgs WP = new WinProgs(profilenames.ToArray(), this);
|
||||
WP.TopLevel = false;
|
||||
WP.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
WP.Visible = true;
|
||||
WP.Dock = DockStyle.Fill;
|
||||
tabAutoProfiles.Controls.Add(WP);
|
||||
}
|
||||
protected void LogDebug(DateTime Time, String Data)
|
||||
{
|
||||
if (lvDebug.InvokeRequired)
|
||||
@ -375,7 +407,7 @@ namespace ScpServer
|
||||
|
||||
protected void ShowNotification(object sender, DebugEventArgs args)
|
||||
{
|
||||
if (Form.ActiveForm != this)
|
||||
if (Form.ActiveForm != this && cBNotifications.Checked)
|
||||
{
|
||||
this.notifyIcon1.BalloonTipText = args.Data;
|
||||
notifyIcon1.BalloonTipTitle = "DS4Windows";
|
||||
@ -385,7 +417,7 @@ namespace ScpServer
|
||||
|
||||
protected void ShowNotification(object sender, string text)
|
||||
{
|
||||
if (Form.ActiveForm != this)
|
||||
if (Form.ActiveForm != this && cBNotifications.Checked)
|
||||
{
|
||||
this.notifyIcon1.BalloonTipText = text;
|
||||
notifyIcon1.BalloonTipTitle = "DS4Windows";
|
||||
@ -423,16 +455,17 @@ namespace ScpServer
|
||||
if (btnStartStop.Text == "Start")
|
||||
{
|
||||
rootHub.Start();
|
||||
hotkeystimer.Start();
|
||||
btnStartStop.Text = "Stop";
|
||||
}
|
||||
|
||||
else if (btnStartStop.Text == "Stop")
|
||||
{
|
||||
rootHub.Stop();
|
||||
hotkeystimer.Stop();
|
||||
btnStartStop.Text = "Start";
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnClear_Click(object sender, EventArgs e)
|
||||
{
|
||||
lvDebug.Items.Clear();
|
||||
@ -440,8 +473,8 @@ namespace ScpServer
|
||||
lbLastMessage.Text = string.Empty;
|
||||
}
|
||||
|
||||
private static int WM_QUERYENDSESSION = 0x11;
|
||||
private static bool systemShutdown = false;
|
||||
|
||||
|
||||
protected override void WndProc(ref Message m)
|
||||
{
|
||||
try
|
||||
@ -463,8 +496,7 @@ namespace ScpServer
|
||||
// raised in the base WndProc.
|
||||
base.WndProc(ref m);
|
||||
}
|
||||
|
||||
delegate void ControllerStatusChangedDelegate(object sender, EventArgs e);
|
||||
|
||||
protected void ControllerStatusChange(object sender, EventArgs e)
|
||||
{
|
||||
if (InvokeRequired)
|
||||
@ -491,7 +523,7 @@ namespace ScpServer
|
||||
if (Pads[Index].Text != "Connecting...")
|
||||
{
|
||||
Enable_Controls(Index, true);
|
||||
MinimumSize = new Size(MinimumSize.Width, 161 + 29 * Index);
|
||||
MinimumSize = new Size(MinimumSize.Width, 137 + 29 * Index);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -516,7 +548,7 @@ namespace ScpServer
|
||||
shortcuts[device].Enabled = on;
|
||||
Batteries[device].Enabled = on;
|
||||
}
|
||||
delegate void HotKeysDelegate(object sender, EventArgs e);
|
||||
|
||||
void ScpForm_Report(object sender, EventArgs e)
|
||||
{
|
||||
if (InvokeRequired)
|
||||
@ -596,7 +628,6 @@ namespace ScpServer
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void tSBDupProfile_Click(object sender, EventArgs e)
|
||||
{
|
||||
@ -647,9 +678,7 @@ namespace ScpServer
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Options opt;
|
||||
private System.Drawing.Size oldsize;
|
||||
|
||||
private void ShowOptions(int devID, string profile)
|
||||
{
|
||||
if (opt == null)
|
||||
@ -689,21 +718,22 @@ namespace ScpServer
|
||||
oldsize = this.Size;
|
||||
if (dpix == 120)
|
||||
{
|
||||
if (this.Size.Height < 560)
|
||||
this.Size = new System.Drawing.Size(this.Size.Width, 560);
|
||||
if (this.Size.Height < 518)
|
||||
this.Size = new System.Drawing.Size(this.Size.Width, 518);
|
||||
if (this.Size.Width < 1125)
|
||||
this.Size = new System.Drawing.Size(1125, this.Size.Height);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.Size.Height < 442)
|
||||
this.Size = new System.Drawing.Size(this.Size.Width, 442);
|
||||
if (this.Size.Height < 418)
|
||||
this.Size = new System.Drawing.Size(this.Size.Width, 418);
|
||||
if (this.Size.Width < 910)
|
||||
this.Size = new System.Drawing.Size(910, this.Size.Height);
|
||||
}
|
||||
tabMain.SelectedIndex = 1;
|
||||
}
|
||||
}
|
||||
|
||||
private void editButtons_Click(object sender, EventArgs e)
|
||||
{
|
||||
Button bn = (Button)sender;
|
||||
@ -713,6 +743,7 @@ namespace ScpServer
|
||||
else
|
||||
ShowOptions(i, cbs[i].Text);
|
||||
}
|
||||
|
||||
private void editMenu_Click(object sender, EventArgs e)
|
||||
{
|
||||
ToolStripMenuItem em = (ToolStripMenuItem)sender;
|
||||
@ -744,6 +775,7 @@ namespace ScpServer
|
||||
btnStartStop_Clicked();
|
||||
Global.Save();
|
||||
}
|
||||
|
||||
private void startMinimizedCheckBox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Global.setStartMinimized(startMinimizedCheckBox.Checked);
|
||||
@ -844,19 +876,19 @@ namespace ScpServer
|
||||
{
|
||||
if (dpix == 120)
|
||||
{
|
||||
if (this.Size.Width < 930 || this.Size.Height < 415)
|
||||
if (this.Size.Width < 930 || this.Size.Height < 392)
|
||||
oldsize = Size;
|
||||
if (this.Size.Height < 415)
|
||||
this.Size = new System.Drawing.Size(this.Size.Width, 415);
|
||||
this.Size = new System.Drawing.Size(this.Size.Width, 392);
|
||||
if (this.Size.Width < 930)
|
||||
this.Size = new System.Drawing.Size(930, this.Size.Height);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.Size.Width < 755 || this.Size.Height < 340)
|
||||
if (this.Size.Width < 755 || this.Size.Height < 316)
|
||||
oldsize = Size;
|
||||
if (this.Size.Height < 340)
|
||||
this.Size = new System.Drawing.Size(this.Size.Width, 340);
|
||||
if (this.Size.Height < 316)
|
||||
this.Size = new System.Drawing.Size(this.Size.Width, 316);
|
||||
if (this.Size.Width < 755)
|
||||
this.Size = new System.Drawing.Size(755, this.Size.Height);
|
||||
}
|
||||
@ -1002,6 +1034,100 @@ namespace ScpServer
|
||||
MessageBox.Show("Please enter a valid name", "Not valid", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
}
|
||||
}
|
||||
|
||||
private void cBUpdate_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!cBUpdate.Checked)
|
||||
{
|
||||
nUDUpdateTime.Value = 0;
|
||||
pNUpdate.Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
nUDUpdateTime.Value = 1;
|
||||
cBUpdateTime.SelectedIndex = 0;
|
||||
pNUpdate.Enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void nUDUpdateTime_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (cBUpdateTime.SelectedIndex == 0)
|
||||
Global.setCheckWhen((int)nUDUpdateTime.Value);
|
||||
else if (cBUpdateTime.SelectedIndex == 1)
|
||||
Global.setCheckWhen((int)nUDUpdateTime.Value * 24);
|
||||
if (nUDUpdateTime.Value < 1)
|
||||
cBUpdate.Checked = false;
|
||||
}
|
||||
|
||||
private void cBUpdateTime_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (cBUpdateTime.SelectedIndex == 0)
|
||||
Global.setCheckWhen((int)nUDUpdateTime.Value);
|
||||
else if (cBUpdateTime.SelectedIndex == 1)
|
||||
Global.setCheckWhen((int)nUDUpdateTime.Value * 24);
|
||||
}
|
||||
|
||||
private void lLBUpdate_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
Uri url = new Uri("https://dl.dropboxusercontent.com/u/16364552/DS4Tool/newest%20version.txt"); //Sorry other devs, gonna have to find your own server
|
||||
WebClient wct = new WebClient();
|
||||
wct.DownloadFileAsync(url, Global.appdatapath + "\\version.txt");
|
||||
wct.DownloadFileCompleted += wct_DownloadFileCompleted;
|
||||
}
|
||||
|
||||
void wct_DownloadFileCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
|
||||
{
|
||||
Global.setLastChecked(DateTime.Now);
|
||||
double newversion;
|
||||
try
|
||||
{
|
||||
if (double.TryParse(File.ReadAllText(Global.appdatapath + "\\version.txt"), out newversion))
|
||||
if (newversion > Global.getVersion())
|
||||
if (MessageBox.Show("Download Version " + newversion + " now?", "DS4Windows Update Available!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
|
||||
{
|
||||
if (!File.Exists("DS4Updater.exe"))
|
||||
{
|
||||
Uri url2 = new Uri("https://dl.dropboxusercontent.com/u/16364552/DS4Tool/DS4Updater.exe");
|
||||
WebClient wc2 = new WebClient();
|
||||
wc2.DownloadFile(url2, "DS4Updater.exe");
|
||||
}
|
||||
Process p = new Process();
|
||||
p.StartInfo.FileName = "DS4Updater.exe";
|
||||
if (!exepath.StartsWith("C:\\Program Files") && !exepath.StartsWith("C:\\Windows"))
|
||||
p.StartInfo.Verb = "runas";
|
||||
p.Start();
|
||||
Close();
|
||||
}
|
||||
else
|
||||
File.Delete(Global.appdatapath + "\\version.txt");
|
||||
else
|
||||
{
|
||||
File.Delete(Global.appdatapath + "\\version.txt");
|
||||
MessageBox.Show("You are up to date", "DS4 Updater");
|
||||
}
|
||||
else
|
||||
File.Delete(Global.appdatapath + "\\version.txt");
|
||||
}
|
||||
catch { };
|
||||
}
|
||||
|
||||
private void linkProfiles_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start(Global.appdatapath + "\\Profiles");
|
||||
}
|
||||
|
||||
private void linkUninstall_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
if (System.IO.File.Exists(Global.appdatapath + "\\Virtual Bus Driver\\ScpDriver.exe"))
|
||||
try { System.Diagnostics.Process.Start(Global.appdatapath + "\\Virtual Bus Driver\\ScpDriver.exe"); }
|
||||
catch { System.Diagnostics.Process.Start(Global.appdatapath + "\\Virtual Bus Driver"); }
|
||||
}
|
||||
|
||||
private void cBNotifications_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Global.setNotifications(cBNotifications.Checked);
|
||||
}
|
||||
}
|
||||
|
||||
public class ThemeUtil
|
||||
|
@ -6302,6 +6302,12 @@
|
||||
<metadata name="openProfiles.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>449, 17</value>
|
||||
</metadata>
|
||||
<metadata name="tSOptions.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>891, 17</value>
|
||||
</metadata>
|
||||
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>568, 17</value>
|
||||
</metadata>
|
||||
<data name="pBStatus1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAACcAAAAUCAYAAAAOTSQ2AAAABGdBTUEAALGOfPtRkwAAACBjSFJNAACH
|
||||
|
24
DS4Tool/WelcomeDialog.Designer.cs
generated
24
DS4Tool/WelcomeDialog.Designer.cs
generated
@ -28,7 +28,6 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.bnFinish = new System.Windows.Forms.Button();
|
||||
this.bnStep1 = new System.Windows.Forms.Button();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
@ -38,19 +37,10 @@
|
||||
this.linkBluetoothSettings = new System.Windows.Forms.LinkLabel();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.bnFinish = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// bnFinish
|
||||
//
|
||||
this.bnFinish.Location = new System.Drawing.Point(123, 388);
|
||||
this.bnFinish.Name = "bnFinish";
|
||||
this.bnFinish.Size = new System.Drawing.Size(75, 23);
|
||||
this.bnFinish.TabIndex = 0;
|
||||
this.bnFinish.Text = "Finish";
|
||||
this.bnFinish.UseVisualStyleBackColor = true;
|
||||
this.bnFinish.Click += new System.EventHandler(this.bnFinish_Click);
|
||||
//
|
||||
// bnStep1
|
||||
//
|
||||
this.bnStep1.Location = new System.Drawing.Point(82, 8);
|
||||
@ -141,6 +131,16 @@
|
||||
this.label2.Text = "If you\'ve used a 360 Controller on this PC, you can skip this";
|
||||
this.label2.TextAlign = System.Drawing.ContentAlignment.TopCenter;
|
||||
//
|
||||
// bnFinish
|
||||
//
|
||||
this.bnFinish.Location = new System.Drawing.Point(123, 388);
|
||||
this.bnFinish.Name = "bnFinish";
|
||||
this.bnFinish.Size = new System.Drawing.Size(75, 23);
|
||||
this.bnFinish.TabIndex = 0;
|
||||
this.bnFinish.Text = "Finish";
|
||||
this.bnFinish.UseVisualStyleBackColor = true;
|
||||
this.bnFinish.Click += new System.EventHandler(this.bnFinish_Click);
|
||||
//
|
||||
// WelcomeDialog
|
||||
//
|
||||
this.AcceptButton = this.bnFinish;
|
||||
@ -167,7 +167,6 @@
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button bnFinish;
|
||||
private System.Windows.Forms.Button bnStep1;
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
@ -177,5 +176,6 @@
|
||||
private System.Windows.Forms.LinkLabel linkBluetoothSettings;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Button bnFinish;
|
||||
}
|
||||
}
|
399
DS4Tool/WinProgs.Designer.cs
generated
399
DS4Tool/WinProgs.Designer.cs
generated
@ -28,95 +28,101 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.listBox1 = new System.Windows.Forms.ListBox();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.listBox2 = new System.Windows.Forms.ListBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.comboBox1 = new System.Windows.Forms.ComboBox();
|
||||
this.comboBox2 = new System.Windows.Forms.ComboBox();
|
||||
this.comboBox3 = new System.Windows.Forms.ComboBox();
|
||||
this.comboBox4 = new System.Windows.Forms.ComboBox();
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.bnAddPrograms = new System.Windows.Forms.Button();
|
||||
this.lBProgramPath = new System.Windows.Forms.Label();
|
||||
this.cBProfile1 = new System.Windows.Forms.ComboBox();
|
||||
this.cBProfile2 = new System.Windows.Forms.ComboBox();
|
||||
this.cBProfile3 = new System.Windows.Forms.ComboBox();
|
||||
this.cBProfile4 = new System.Windows.Forms.ComboBox();
|
||||
this.bnSave = new System.Windows.Forms.Button();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.lBController1 = new System.Windows.Forms.Label();
|
||||
this.lBController2 = new System.Windows.Forms.Label();
|
||||
this.lBController3 = new System.Windows.Forms.Label();
|
||||
this.lBController4 = new System.Windows.Forms.Label();
|
||||
this.lBBeta = new System.Windows.Forms.Label();
|
||||
this.openProgram = new System.Windows.Forms.OpenFileDialog();
|
||||
this.bnDelete = new System.Windows.Forms.Button();
|
||||
this.iLIcons = new System.Windows.Forms.ImageList(this.components);
|
||||
this.bnLoadSteam = new System.Windows.Forms.Button();
|
||||
this.lVPrograms = new System.Windows.Forms.ListView();
|
||||
this.nameHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.PathHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.lBTip = new System.Windows.Forms.Label();
|
||||
this.pBProfilesTip = new System.Windows.Forms.Label();
|
||||
this.bnHideUnchecked = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// listBox1
|
||||
// bnAddPrograms
|
||||
//
|
||||
this.listBox1.FormattingEnabled = true;
|
||||
this.listBox1.Location = new System.Drawing.Point(5, 4);
|
||||
this.listBox1.Name = "listBox1";
|
||||
this.listBox1.Size = new System.Drawing.Size(279, 199);
|
||||
this.listBox1.TabIndex = 0;
|
||||
this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
|
||||
this.bnAddPrograms.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.bnAddPrograms.Location = new System.Drawing.Point(516, 195);
|
||||
this.bnAddPrograms.Name = "bnAddPrograms";
|
||||
this.bnAddPrograms.Size = new System.Drawing.Size(114, 23);
|
||||
this.bnAddPrograms.TabIndex = 2;
|
||||
this.bnAddPrograms.Text = "Add more programs";
|
||||
this.bnAddPrograms.UseVisualStyleBackColor = true;
|
||||
this.bnAddPrograms.Click += new System.EventHandler(this.bnAddPrograms_Click);
|
||||
//
|
||||
// button2
|
||||
// lBProgramPath
|
||||
//
|
||||
this.button2.Location = new System.Drawing.Point(516, 180);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(114, 23);
|
||||
this.button2.TabIndex = 2;
|
||||
this.button2.Text = "Browse More";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
this.lBProgramPath.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.lBProgramPath.Location = new System.Drawing.Point(602, 131);
|
||||
this.lBProgramPath.Name = "lBProgramPath";
|
||||
this.lBProgramPath.Size = new System.Drawing.Size(47, 18);
|
||||
this.lBProgramPath.TabIndex = 3;
|
||||
this.lBProgramPath.Visible = false;
|
||||
this.lBProgramPath.TextChanged += new System.EventHandler(this.lBProgramPath_TextChanged);
|
||||
//
|
||||
// listBox2
|
||||
// cBProfile1
|
||||
//
|
||||
this.listBox2.FormattingEnabled = true;
|
||||
this.listBox2.Location = new System.Drawing.Point(290, 4);
|
||||
this.listBox2.Name = "listBox2";
|
||||
this.listBox2.Size = new System.Drawing.Size(220, 199);
|
||||
this.listBox2.TabIndex = 0;
|
||||
this.listBox2.SelectedIndexChanged += new System.EventHandler(this.listBox2_SelectedIndexChanged);
|
||||
this.cBProfile1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cBProfile1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cBProfile1.FormattingEnabled = true;
|
||||
this.cBProfile1.Location = new System.Drawing.Point(609, 18);
|
||||
this.cBProfile1.Name = "cBProfile1";
|
||||
this.cBProfile1.Size = new System.Drawing.Size(121, 21);
|
||||
this.cBProfile1.TabIndex = 6;
|
||||
this.cBProfile1.SelectedIndexChanged += new System.EventHandler(this.CBProfile_IndexChanged);
|
||||
//
|
||||
// label1
|
||||
// cBProfile2
|
||||
//
|
||||
this.label1.Location = new System.Drawing.Point(5, 206);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(717, 19);
|
||||
this.label1.TabIndex = 3;
|
||||
this.cBProfile2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cBProfile2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cBProfile2.FormattingEnabled = true;
|
||||
this.cBProfile2.Location = new System.Drawing.Point(609, 45);
|
||||
this.cBProfile2.Name = "cBProfile2";
|
||||
this.cBProfile2.Size = new System.Drawing.Size(121, 21);
|
||||
this.cBProfile2.TabIndex = 6;
|
||||
this.cBProfile2.SelectedIndexChanged += new System.EventHandler(this.CBProfile_IndexChanged);
|
||||
//
|
||||
// comboBox1
|
||||
// cBProfile3
|
||||
//
|
||||
this.comboBox1.FormattingEnabled = true;
|
||||
this.comboBox1.Location = new System.Drawing.Point(601, 6);
|
||||
this.comboBox1.Name = "comboBox1";
|
||||
this.comboBox1.Size = new System.Drawing.Size(121, 21);
|
||||
this.comboBox1.TabIndex = 6;
|
||||
this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.CBProfile_IndexChanged);
|
||||
this.cBProfile3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cBProfile3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cBProfile3.FormattingEnabled = true;
|
||||
this.cBProfile3.Location = new System.Drawing.Point(609, 72);
|
||||
this.cBProfile3.Name = "cBProfile3";
|
||||
this.cBProfile3.Size = new System.Drawing.Size(121, 21);
|
||||
this.cBProfile3.TabIndex = 6;
|
||||
this.cBProfile3.SelectedIndexChanged += new System.EventHandler(this.CBProfile_IndexChanged);
|
||||
//
|
||||
// comboBox2
|
||||
// cBProfile4
|
||||
//
|
||||
this.comboBox2.FormattingEnabled = true;
|
||||
this.comboBox2.Location = new System.Drawing.Point(601, 33);
|
||||
this.comboBox2.Name = "comboBox2";
|
||||
this.comboBox2.Size = new System.Drawing.Size(121, 21);
|
||||
this.comboBox2.TabIndex = 6;
|
||||
this.comboBox2.SelectedIndexChanged += new System.EventHandler(this.CBProfile_IndexChanged);
|
||||
//
|
||||
// comboBox3
|
||||
//
|
||||
this.comboBox3.FormattingEnabled = true;
|
||||
this.comboBox3.Location = new System.Drawing.Point(601, 60);
|
||||
this.comboBox3.Name = "comboBox3";
|
||||
this.comboBox3.Size = new System.Drawing.Size(121, 21);
|
||||
this.comboBox3.TabIndex = 6;
|
||||
this.comboBox3.SelectedIndexChanged += new System.EventHandler(this.CBProfile_IndexChanged);
|
||||
//
|
||||
// comboBox4
|
||||
//
|
||||
this.comboBox4.FormattingEnabled = true;
|
||||
this.comboBox4.Location = new System.Drawing.Point(601, 87);
|
||||
this.comboBox4.Name = "comboBox4";
|
||||
this.comboBox4.Size = new System.Drawing.Size(121, 21);
|
||||
this.comboBox4.TabIndex = 6;
|
||||
this.comboBox4.SelectedIndexChanged += new System.EventHandler(this.CBProfile_IndexChanged);
|
||||
this.cBProfile4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cBProfile4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cBProfile4.FormattingEnabled = true;
|
||||
this.cBProfile4.Location = new System.Drawing.Point(609, 99);
|
||||
this.cBProfile4.Name = "cBProfile4";
|
||||
this.cBProfile4.Size = new System.Drawing.Size(121, 21);
|
||||
this.cBProfile4.TabIndex = 6;
|
||||
this.cBProfile4.SelectedIndexChanged += new System.EventHandler(this.CBProfile_IndexChanged);
|
||||
//
|
||||
// bnSave
|
||||
//
|
||||
this.bnSave.Location = new System.Drawing.Point(655, 180);
|
||||
this.bnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.bnSave.Enabled = false;
|
||||
this.bnSave.Location = new System.Drawing.Point(663, 126);
|
||||
this.bnSave.Name = "bnSave";
|
||||
this.bnSave.Size = new System.Drawing.Size(67, 23);
|
||||
this.bnSave.TabIndex = 2;
|
||||
@ -124,73 +130,186 @@
|
||||
this.bnSave.UseVisualStyleBackColor = true;
|
||||
this.bnSave.Click += new System.EventHandler(this.bnSave_Click);
|
||||
//
|
||||
// label2
|
||||
// lBController1
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(516, 9);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(60, 13);
|
||||
this.label2.TabIndex = 7;
|
||||
this.label2.Text = "Controller 1";
|
||||
this.lBController1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.lBController1.AutoSize = true;
|
||||
this.lBController1.Location = new System.Drawing.Point(516, 21);
|
||||
this.lBController1.Name = "lBController1";
|
||||
this.lBController1.Size = new System.Drawing.Size(60, 13);
|
||||
this.lBController1.TabIndex = 7;
|
||||
this.lBController1.Text = "Controller 1";
|
||||
//
|
||||
// label3
|
||||
// lBController2
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(516, 36);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(60, 13);
|
||||
this.label3.TabIndex = 7;
|
||||
this.label3.Text = "Controller 2";
|
||||
this.lBController2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.lBController2.AutoSize = true;
|
||||
this.lBController2.Location = new System.Drawing.Point(516, 48);
|
||||
this.lBController2.Name = "lBController2";
|
||||
this.lBController2.Size = new System.Drawing.Size(60, 13);
|
||||
this.lBController2.TabIndex = 7;
|
||||
this.lBController2.Text = "Controller 2";
|
||||
//
|
||||
// label4
|
||||
// lBController3
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(516, 63);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(60, 13);
|
||||
this.label4.TabIndex = 7;
|
||||
this.label4.Text = "Controller 3";
|
||||
this.lBController3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.lBController3.AutoSize = true;
|
||||
this.lBController3.Location = new System.Drawing.Point(516, 75);
|
||||
this.lBController3.Name = "lBController3";
|
||||
this.lBController3.Size = new System.Drawing.Size(60, 13);
|
||||
this.lBController3.TabIndex = 7;
|
||||
this.lBController3.Text = "Controller 3";
|
||||
//
|
||||
// label5
|
||||
// lBController4
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(516, 90);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(60, 13);
|
||||
this.label5.TabIndex = 7;
|
||||
this.label5.Text = "Controller 4";
|
||||
this.lBController4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.lBController4.AutoSize = true;
|
||||
this.lBController4.Location = new System.Drawing.Point(516, 102);
|
||||
this.lBController4.Name = "lBController4";
|
||||
this.lBController4.Size = new System.Drawing.Size(60, 13);
|
||||
this.lBController4.TabIndex = 7;
|
||||
this.lBController4.Text = "Controller 4";
|
||||
//
|
||||
// label6
|
||||
// lBBeta
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.BackColor = System.Drawing.Color.Transparent;
|
||||
this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label6.Location = new System.Drawing.Point(530, 129);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(182, 24);
|
||||
this.label6.TabIndex = 8;
|
||||
this.label6.Text = "Not yet ready for use";
|
||||
this.lBBeta.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.lBBeta.AutoSize = true;
|
||||
this.lBBeta.BackColor = System.Drawing.Color.Transparent;
|
||||
this.lBBeta.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lBBeta.ForeColor = System.Drawing.SystemColors.GrayText;
|
||||
this.lBBeta.Location = new System.Drawing.Point(606, 175);
|
||||
this.lBBeta.Name = "lBBeta";
|
||||
this.lBBeta.Size = new System.Drawing.Size(38, 18);
|
||||
this.lBBeta.TabIndex = 8;
|
||||
this.lBBeta.Text = "Beta";
|
||||
this.lBBeta.Visible = false;
|
||||
//
|
||||
// openProgram
|
||||
//
|
||||
this.openProgram.FileName = "openFileDialog1";
|
||||
this.openProgram.Filter = "Programs|*.exe|Shortcuts|*.lnk";
|
||||
//
|
||||
// bnDelete
|
||||
//
|
||||
this.bnDelete.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.bnDelete.Location = new System.Drawing.Point(519, 126);
|
||||
this.bnDelete.Name = "bnDelete";
|
||||
this.bnDelete.Size = new System.Drawing.Size(67, 23);
|
||||
this.bnDelete.TabIndex = 2;
|
||||
this.bnDelete.Text = "Remove";
|
||||
this.bnDelete.UseVisualStyleBackColor = true;
|
||||
this.bnDelete.Click += new System.EventHandler(this.bnDelete_Click);
|
||||
//
|
||||
// iLIcons
|
||||
//
|
||||
this.iLIcons.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
|
||||
this.iLIcons.ImageSize = new System.Drawing.Size(16, 16);
|
||||
this.iLIcons.TransparentColor = System.Drawing.Color.Transparent;
|
||||
//
|
||||
// bnLoadSteam
|
||||
//
|
||||
this.bnLoadSteam.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.bnLoadSteam.Location = new System.Drawing.Point(5, 195);
|
||||
this.bnLoadSteam.Name = "bnLoadSteam";
|
||||
this.bnLoadSteam.Size = new System.Drawing.Size(505, 23);
|
||||
this.bnLoadSteam.TabIndex = 11;
|
||||
this.bnLoadSteam.Text = "Load Steam Games";
|
||||
this.bnLoadSteam.UseVisualStyleBackColor = true;
|
||||
this.bnLoadSteam.Click += new System.EventHandler(this.bnLoadSteam_Click);
|
||||
//
|
||||
// lVPrograms
|
||||
//
|
||||
this.lVPrograms.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.lVPrograms.CheckBoxes = true;
|
||||
this.lVPrograms.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
|
||||
this.nameHeader,
|
||||
this.PathHeader});
|
||||
this.lVPrograms.FullRowSelect = true;
|
||||
this.lVPrograms.LargeImageList = this.iLIcons;
|
||||
this.lVPrograms.Location = new System.Drawing.Point(5, 6);
|
||||
this.lVPrograms.MultiSelect = false;
|
||||
this.lVPrograms.Name = "lVPrograms";
|
||||
this.lVPrograms.Size = new System.Drawing.Size(505, 187);
|
||||
this.lVPrograms.SmallImageList = this.iLIcons;
|
||||
this.lVPrograms.TabIndex = 12;
|
||||
this.lVPrograms.UseCompatibleStateImageBehavior = false;
|
||||
this.lVPrograms.View = System.Windows.Forms.View.Details;
|
||||
this.lVPrograms.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.listView1_ItemCheck);
|
||||
this.lVPrograms.SelectedIndexChanged += new System.EventHandler(this.lBProgramPath_SelectedIndexChanged);
|
||||
//
|
||||
// nameHeader
|
||||
//
|
||||
this.nameHeader.Text = "Name";
|
||||
this.nameHeader.Width = 140;
|
||||
//
|
||||
// PathHeader
|
||||
//
|
||||
this.PathHeader.Text = "Path";
|
||||
this.PathHeader.Width = 358;
|
||||
//
|
||||
// lBTip
|
||||
//
|
||||
this.lBTip.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.lBTip.AutoSize = true;
|
||||
this.lBTip.BackColor = System.Drawing.Color.Transparent;
|
||||
this.lBTip.ForeColor = System.Drawing.SystemColors.GrayText;
|
||||
this.lBTip.Location = new System.Drawing.Point(529, 152);
|
||||
this.lBTip.Name = "lBTip";
|
||||
this.lBTip.Size = new System.Drawing.Size(191, 13);
|
||||
this.lBTip.TabIndex = 8;
|
||||
this.lBTip.Text = "Pick a program, then profiles, and save";
|
||||
this.lBTip.Visible = false;
|
||||
//
|
||||
// pBProfilesTip
|
||||
//
|
||||
this.pBProfilesTip.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.pBProfilesTip.AutoSize = true;
|
||||
this.pBProfilesTip.BackColor = System.Drawing.Color.Transparent;
|
||||
this.pBProfilesTip.ForeColor = System.Drawing.SystemColors.GrayText;
|
||||
this.pBProfilesTip.Location = new System.Drawing.Point(620, 2);
|
||||
this.pBProfilesTip.Name = "pBProfilesTip";
|
||||
this.pBProfilesTip.Size = new System.Drawing.Size(89, 13);
|
||||
this.pBProfilesTip.TabIndex = 8;
|
||||
this.pBProfilesTip.Text = "Pick Profiles here";
|
||||
//
|
||||
// bnHideUnchecked
|
||||
//
|
||||
this.bnHideUnchecked.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.bnHideUnchecked.Location = new System.Drawing.Point(636, 195);
|
||||
this.bnHideUnchecked.Name = "bnHideUnchecked";
|
||||
this.bnHideUnchecked.Size = new System.Drawing.Size(94, 23);
|
||||
this.bnHideUnchecked.TabIndex = 2;
|
||||
this.bnHideUnchecked.Text = "Hide unchecked";
|
||||
this.bnHideUnchecked.UseVisualStyleBackColor = true;
|
||||
this.bnHideUnchecked.Click += new System.EventHandler(this.bnHideUnchecked_Click);
|
||||
//
|
||||
// WinProgs
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
|
||||
this.BackColor = System.Drawing.Color.White;
|
||||
this.ClientSize = new System.Drawing.Size(736, 230);
|
||||
this.Controls.Add(this.label6);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.comboBox4);
|
||||
this.Controls.Add(this.comboBox3);
|
||||
this.Controls.Add(this.comboBox2);
|
||||
this.Controls.Add(this.comboBox1);
|
||||
this.Controls.Add(this.label1);
|
||||
this.ClientSize = new System.Drawing.Size(736, 222);
|
||||
this.Controls.Add(this.lVPrograms);
|
||||
this.Controls.Add(this.bnLoadSteam);
|
||||
this.Controls.Add(this.lBController4);
|
||||
this.Controls.Add(this.lBController3);
|
||||
this.Controls.Add(this.lBController2);
|
||||
this.Controls.Add(this.lBController1);
|
||||
this.Controls.Add(this.cBProfile4);
|
||||
this.Controls.Add(this.cBProfile3);
|
||||
this.Controls.Add(this.cBProfile2);
|
||||
this.Controls.Add(this.cBProfile1);
|
||||
this.Controls.Add(this.lBProgramPath);
|
||||
this.Controls.Add(this.bnDelete);
|
||||
this.Controls.Add(this.bnSave);
|
||||
this.Controls.Add(this.button2);
|
||||
this.Controls.Add(this.listBox2);
|
||||
this.Controls.Add(this.listBox1);
|
||||
this.Controls.Add(this.bnHideUnchecked);
|
||||
this.Controls.Add(this.bnAddPrograms);
|
||||
this.Controls.Add(this.pBProfilesTip);
|
||||
this.Controls.Add(this.lBTip);
|
||||
this.Controls.Add(this.lBBeta);
|
||||
this.Name = "WinProgs";
|
||||
this.Text = "Auto-Profiles";
|
||||
this.ResumeLayout(false);
|
||||
@ -200,19 +319,27 @@
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.ListBox listBox1;
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.ListBox listBox2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.ComboBox comboBox1;
|
||||
private System.Windows.Forms.ComboBox comboBox2;
|
||||
private System.Windows.Forms.ComboBox comboBox3;
|
||||
private System.Windows.Forms.ComboBox comboBox4;
|
||||
private System.Windows.Forms.Button bnAddPrograms;
|
||||
private System.Windows.Forms.Label lBProgramPath;
|
||||
private System.Windows.Forms.ComboBox cBProfile1;
|
||||
private System.Windows.Forms.ComboBox cBProfile2;
|
||||
private System.Windows.Forms.ComboBox cBProfile3;
|
||||
private System.Windows.Forms.ComboBox cBProfile4;
|
||||
private System.Windows.Forms.Button bnSave;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.Label lBController1;
|
||||
private System.Windows.Forms.Label lBController2;
|
||||
private System.Windows.Forms.Label lBController3;
|
||||
private System.Windows.Forms.Label lBController4;
|
||||
private System.Windows.Forms.Label lBBeta;
|
||||
private System.Windows.Forms.OpenFileDialog openProgram;
|
||||
private System.Windows.Forms.Button bnDelete;
|
||||
private System.Windows.Forms.ImageList iLIcons;
|
||||
private System.Windows.Forms.Button bnLoadSteam;
|
||||
private System.Windows.Forms.ListView lVPrograms;
|
||||
private System.Windows.Forms.ColumnHeader nameHeader;
|
||||
private System.Windows.Forms.ColumnHeader PathHeader;
|
||||
private System.Windows.Forms.Label lBTip;
|
||||
private System.Windows.Forms.Label pBProfilesTip;
|
||||
private System.Windows.Forms.Button bnHideUnchecked;
|
||||
}
|
||||
}
|
@ -20,66 +20,39 @@ namespace ScpServer
|
||||
{
|
||||
ToolTip tp = new ToolTip();
|
||||
ComboBox[] cbs;
|
||||
public WinProgs(string[] oc)
|
||||
{
|
||||
InitializeComponent();
|
||||
cbs = new ComboBox[4] { comboBox1, comboBox2, comboBox3, comboBox4 };
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
cbs[i].Text = "(none)";
|
||||
cbs[i].Items.AddRange(oc);
|
||||
}
|
||||
try
|
||||
{
|
||||
string[] lods = Directory.GetDirectories(@"C:\Program Files (x86)\Steam\steamapps\common");
|
||||
foreach (string s in lods)
|
||||
listBox1.Items.Add(Path.GetFileName(s));
|
||||
}
|
||||
catch { }
|
||||
if (!File.Exists(Global.appdatapath + @"\Auto Profiles.xml"))
|
||||
Create();
|
||||
//foreach (ListBox.ObjectCollection s in listBox1.Items)
|
||||
// tp.SetToolTip((Control)s, @"C:\Program Files (x86)\Steam\SteamApps\common" + s.ToString());
|
||||
}
|
||||
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
List<string> lods = new List<string>();
|
||||
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
string s = listBox1.SelectedItem.ToString();
|
||||
lods.Clear();
|
||||
lods.AddRange(Directory.GetFiles(@"C:\Program Files (x86)\Steam\SteamApps\common\" + s, "*.exe", SearchOption.AllDirectories));
|
||||
for (int i = lods.Count-1; i >= 0; i--)
|
||||
if (lods[i].Contains("etup") || lods[i].Contains("dotnet") || lods[i].Contains("SETUP")
|
||||
|| lods[i].Contains("edist") || lods[i].Contains("nstall"))
|
||||
lods.RemoveAt(i);
|
||||
|
||||
listBox2.Items.Clear();
|
||||
foreach (string st in lods)
|
||||
//if (!st.Contains("etup") && !st.Contains("dotnet") && !st.Contains("SETUP") && !st.Contains("edist") && !st.Contains("nstall"))
|
||||
listBox2.Items.Add(Path.GetFileNameWithoutExtension(st));
|
||||
if (listBox2.Items.Count == 1 && listBox2.SelectedIndex != 0)
|
||||
listBox2.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
private void listBox2_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (listBox2.SelectedIndex >= 0)
|
||||
{
|
||||
label1.Text = lods[listBox2.SelectedIndex];
|
||||
LoadP();
|
||||
}
|
||||
else
|
||||
label1.Text = "";
|
||||
}
|
||||
|
||||
ScpForm form;
|
||||
string steamgamesdir;
|
||||
protected String m_Profile = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\DS4Tool\\Auto Profiles.xml";
|
||||
protected XmlDocument m_Xdoc = new XmlDocument();
|
||||
List<string> programpaths = new List<string>();
|
||||
List<string> lodsf = new List<string>();
|
||||
bool appsloaded = false;
|
||||
|
||||
public WinProgs(string[] oc, ScpForm main)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
form = main;
|
||||
cbs = new ComboBox[4] { cBProfile1, cBProfile2, cBProfile3, cBProfile4 };
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
cbs[i].Items.AddRange(oc);
|
||||
cbs[i].Items.Add("(none)");
|
||||
cbs[i].SelectedIndex = cbs[i].Items.Count - 1;
|
||||
}
|
||||
if (!File.Exists(Global.appdatapath + @"\Auto Profiles.xml"))
|
||||
Create();
|
||||
LoadP();
|
||||
RegistryKey regKey = Registry.CurrentUser;
|
||||
regKey = regKey.OpenSubKey(@"Software\Valve\Steam");
|
||||
if (regKey != null)
|
||||
steamgamesdir = Path.GetDirectoryName(regKey.GetValue("SourceModInstallPath").ToString()) + @"\common";
|
||||
if (!Directory.Exists(steamgamesdir))
|
||||
{
|
||||
bnLoadSteam.Visible = false;
|
||||
lVPrograms.Size = new Size(lVPrograms.Size.Width, lVPrograms.Size.Height + 25);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Create()
|
||||
{
|
||||
@ -98,7 +71,7 @@ namespace ScpServer
|
||||
Node = m_Xdoc.CreateWhitespace("\r\n");
|
||||
m_Xdoc.AppendChild(Node);
|
||||
|
||||
Node = m_Xdoc.CreateNode(XmlNodeType.Element, "Programs", null);
|
||||
Node = m_Xdoc.CreateNode(XmlNodeType.Element, "Programs", "");
|
||||
m_Xdoc.AppendChild(Node);
|
||||
m_Xdoc.Save(m_Profile);
|
||||
}
|
||||
@ -106,92 +79,229 @@ namespace ScpServer
|
||||
|
||||
return Saved;
|
||||
}
|
||||
public bool Save()
|
||||
{
|
||||
Boolean Saved = true;
|
||||
m_Xdoc.Load(m_Profile);
|
||||
//try
|
||||
{
|
||||
XmlNode Node;
|
||||
Node = m_Xdoc.SelectSingleNode("Programs");
|
||||
|
||||
string programname = listBox2.SelectedItem.ToString();
|
||||
//if (programname.Contains(" "))
|
||||
programname = programname.Replace(' ', '_');
|
||||
XmlNode xmlprogram = m_Xdoc.CreateNode(XmlNodeType.Element, programname, null);
|
||||
|
||||
XmlNode xmlController1 = m_Xdoc.CreateNode(XmlNodeType.Element, "Controller1", null);
|
||||
xmlController1.InnerText = comboBox1.Text;
|
||||
xmlprogram.AppendChild(xmlController1);
|
||||
XmlNode xmlController2 = m_Xdoc.CreateNode(XmlNodeType.Element, "Controller2", null);
|
||||
xmlController2.InnerText = comboBox2.Text;
|
||||
xmlprogram.AppendChild(xmlController2);
|
||||
XmlNode xmlController3 = m_Xdoc.CreateNode(XmlNodeType.Element, "Controller3", null);
|
||||
xmlController3.InnerText = comboBox3.Text;
|
||||
xmlprogram.AppendChild(xmlController3);
|
||||
XmlNode xmlController4 = m_Xdoc.CreateNode(XmlNodeType.Element, "Controller4", null);
|
||||
xmlController4.InnerText = comboBox4.Text;
|
||||
xmlprogram.AppendChild(xmlController4);
|
||||
|
||||
try
|
||||
{
|
||||
XmlNode oldxmlprocess = m_Xdoc.SelectSingleNode("/Programs/" + listBox2.SelectedItem.ToString());
|
||||
Node.ReplaceChild(xmlprogram, oldxmlprocess);
|
||||
}
|
||||
catch { Node.AppendChild(xmlprogram); }
|
||||
//Node.AppendChild(oldxmlprocess);
|
||||
m_Xdoc.AppendChild(Node);
|
||||
m_Xdoc.Save(m_Profile);
|
||||
}
|
||||
//catch { Saved = false; }
|
||||
|
||||
return Saved;
|
||||
}
|
||||
|
||||
public void LoadP()
|
||||
{
|
||||
//try
|
||||
XmlDocument doc = new XmlDocument();
|
||||
programpaths.Clear();
|
||||
if (!File.Exists(Global.appdatapath + "\\Auto Profiles.xml"))
|
||||
return;
|
||||
doc.Load(Global.appdatapath + "\\Auto Profiles.xml");
|
||||
XmlNodeList programslist = doc.SelectNodes("Programs/Program");
|
||||
foreach (XmlNode x in programslist)
|
||||
programpaths.Add(x.Attributes["path"].Value);
|
||||
foreach (string st in programpaths)
|
||||
{
|
||||
if (File.Exists(m_Profile))
|
||||
int index = programpaths.IndexOf(st);
|
||||
if (string.Empty != st)
|
||||
{
|
||||
XmlNode Item;
|
||||
m_Xdoc.Load(m_Profile);
|
||||
string programname = listBox2.SelectedItem.ToString();
|
||||
programname = programname.Replace(' ', '_');
|
||||
string[] profiles = new string[4];
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
Item = m_Xdoc.SelectSingleNode("/Programs/" + programname + "/Controller" + (i + 1));
|
||||
profiles[i] = Item.InnerText;
|
||||
for (int j = 0; j < cbs[i].Items.Count; j++)
|
||||
if (cbs[i].Items[j].ToString() == profiles[i])
|
||||
{
|
||||
cbs[i].SelectedIndex = j;
|
||||
break;
|
||||
}
|
||||
//else
|
||||
//cbs[i].Text = "(none)";
|
||||
}
|
||||
catch { cbs[i].Text = "(none)"; }
|
||||
}
|
||||
iLIcons.Images.Add(Icon.ExtractAssociatedIcon(st));
|
||||
ListViewItem lvi = new ListViewItem(Path.GetFileNameWithoutExtension(st), index);
|
||||
lvi.SubItems.Add(st);
|
||||
lvi.Checked = true;
|
||||
lVPrograms.Items.Add(lvi);
|
||||
}
|
||||
}
|
||||
//catch { missingSetting = true; }
|
||||
//return missingSetting;
|
||||
//if (missingSetting)
|
||||
//label1.Content = "Current version not found, please re-run DS4Tool";
|
||||
}
|
||||
|
||||
|
||||
private void bnLoadSteam_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var AppCollectionThread = new System.Threading.Thread(() => GetApps());
|
||||
AppCollectionThread.IsBackground = true;
|
||||
AppCollectionThread.Start();
|
||||
}
|
||||
catch { }
|
||||
bnLoadSteam.Text = "Loading...";
|
||||
bnLoadSteam.Enabled = false;
|
||||
Timer appstimer = new Timer();
|
||||
appstimer.Start();
|
||||
appstimer.Tick += appstimer_Tick;
|
||||
}
|
||||
|
||||
|
||||
private void GetApps()
|
||||
{
|
||||
lodsf.AddRange(Directory.GetFiles(steamgamesdir, "*.exe", SearchOption.AllDirectories));
|
||||
appsloaded = true;
|
||||
}
|
||||
|
||||
void appstimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
if (appsloaded)
|
||||
{
|
||||
bnLoadSteam.Text = "Adding to list...";
|
||||
for (int i = lodsf.Count - 1; i >= 0; i--)
|
||||
if (lodsf[i].Contains("etup") || lodsf[i].Contains("dotnet") || lodsf[i].Contains("SETUP")
|
||||
|| lodsf[i].Contains("edist") || lodsf[i].Contains("nstall"))
|
||||
lodsf.RemoveAt(i);
|
||||
for (int i = lodsf.Count - 1; i >= 0; i--)
|
||||
for (int j = programpaths.Count - 1; j >= 0; j--)
|
||||
if (lodsf[i] == programpaths[j])
|
||||
lodsf.RemoveAt(i);
|
||||
foreach (string st in lodsf)
|
||||
{
|
||||
int index = programpaths.IndexOf(st);
|
||||
iLIcons.Images.Add(Icon.ExtractAssociatedIcon(st));
|
||||
ListViewItem lvi = new ListViewItem(Path.GetFileNameWithoutExtension(st), iLIcons.Images.Count + index);
|
||||
lvi.SubItems.Add(st);
|
||||
lVPrograms.Items.Add(lvi);
|
||||
}
|
||||
bnLoadSteam.Visible = false;
|
||||
lVPrograms.Size = new Size(lVPrograms.Size.Width, lVPrograms.Size.Height + 25);
|
||||
appsloaded = false;
|
||||
((Timer)sender).Stop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void Save(string name)
|
||||
{
|
||||
m_Xdoc.Load(m_Profile);
|
||||
XmlNode Node;
|
||||
|
||||
Node = m_Xdoc.CreateComment(String.Format(" Auto-Profile Configuration Data. {0} ", DateTime.Now));
|
||||
foreach (XmlNode node in m_Xdoc.SelectNodes("//comment()"))
|
||||
node.ParentNode.ReplaceChild(Node, node);
|
||||
|
||||
Node = m_Xdoc.SelectSingleNode("Programs");
|
||||
string programname;
|
||||
programname = Path.GetFileNameWithoutExtension(name);
|
||||
XmlElement el = m_Xdoc.CreateElement("Program");
|
||||
el.SetAttribute("path", name);
|
||||
el.AppendChild(m_Xdoc.CreateElement("Controller1")).InnerText = cBProfile1.Text;
|
||||
el.AppendChild(m_Xdoc.CreateElement("Controller2")).InnerText = cBProfile2.Text;
|
||||
el.AppendChild(m_Xdoc.CreateElement("Controller3")).InnerText = cBProfile3.Text;
|
||||
el.AppendChild(m_Xdoc.CreateElement("Controller4")).InnerText = cBProfile4.Text;
|
||||
try
|
||||
{
|
||||
XmlNode oldxmlprocess = m_Xdoc.SelectSingleNode("/Programs/Program[@path=\"" + lBProgramPath.Text + "\"]");
|
||||
Node.ReplaceChild(el, oldxmlprocess);
|
||||
}
|
||||
catch { Node.AppendChild(el); }
|
||||
m_Xdoc.AppendChild(Node);
|
||||
m_Xdoc.Save(m_Profile);
|
||||
if (lVPrograms.SelectedItems.Count > 0)
|
||||
lVPrograms.SelectedItems[0].Checked = true;
|
||||
form.LoadP();
|
||||
}
|
||||
|
||||
public void LoadP(string name)
|
||||
{
|
||||
XmlDocument doc = new XmlDocument();
|
||||
doc.Load(m_Profile);
|
||||
XmlNodeList programs = doc.SelectNodes("Programs/Program");
|
||||
XmlNode Item = doc.SelectSingleNode("/Programs/Program[@path=\"" + name + "\"]");
|
||||
if (Item != null)
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
Item = doc.SelectSingleNode("/Programs/Program[@path=\"" + name + "\"]" + "/Controller" + (i + 1));
|
||||
for (int j = 0; j < cbs[i].Items.Count; j++)
|
||||
if (cbs[i].Items[j].ToString() == Item.InnerText)
|
||||
{
|
||||
cbs[i].SelectedIndex = j;
|
||||
bnSave.Enabled = false;
|
||||
break;
|
||||
}
|
||||
else
|
||||
cbs[i].SelectedIndex = cbs[i].Items.Count - 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
cbs[i].SelectedIndex = cbs[i].Items.Count - 1;
|
||||
bnSave.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveP(string name, bool uncheck)
|
||||
{
|
||||
|
||||
XmlDocument doc = new XmlDocument();
|
||||
doc.Load(m_Profile);
|
||||
XmlNode Node = doc.SelectSingleNode("Programs");
|
||||
XmlNode Item = doc.SelectSingleNode("/Programs/Program[@path=\"" + name + "\"]");
|
||||
if (Item != null)
|
||||
Node.RemoveChild(Item);
|
||||
doc.AppendChild(Node);
|
||||
doc.Save(m_Profile);
|
||||
if (lVPrograms.SelectedItems.Count > 0 && uncheck)
|
||||
lVPrograms.SelectedItems[0].Checked = false;
|
||||
for (int i = 0; i < 4; i++)
|
||||
cbs[i].SelectedIndex = cbs[i].Items.Count - 1;
|
||||
bnSave.Enabled = false;
|
||||
form.LoadP();
|
||||
}
|
||||
|
||||
private void CBProfile_IndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
int last = cbs[0].Items.Count - 1;
|
||||
if (lBProgramPath.Text != string.Empty)
|
||||
bnSave.Enabled = true;
|
||||
if (cbs[0].SelectedIndex == last && cbs[1].SelectedIndex == last &&
|
||||
cbs[2].SelectedIndex == last && cbs[3].SelectedIndex == last)
|
||||
bnSave.Enabled = false;
|
||||
}
|
||||
|
||||
private void bnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
Save();
|
||||
if (lBProgramPath.Text != "")
|
||||
Save(lBProgramPath.Text);
|
||||
bnSave.Enabled = false;
|
||||
}
|
||||
|
||||
private void bnAddPrograms_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (openProgram.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
||||
{
|
||||
string file = openProgram.FileName;
|
||||
lBProgramPath.Text = file;
|
||||
iLIcons.Images.Add(Icon.ExtractAssociatedIcon(file));
|
||||
ListViewItem lvi = new ListViewItem(Path.GetFileNameWithoutExtension(file), lVPrograms.Items.Count);
|
||||
lvi.SubItems.Add(file);
|
||||
lVPrograms.Items.Insert(0, lvi);
|
||||
}
|
||||
}
|
||||
|
||||
private void lBProgramPath_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (lBProgramPath.Text != "")
|
||||
LoadP(lBProgramPath.Text);
|
||||
else
|
||||
for (int i = 0; i < 4; i++)
|
||||
cbs[i].SelectedIndex = cbs[i].Items.Count - 1;
|
||||
}
|
||||
|
||||
private void bnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
RemoveP(lBProgramPath.Text, true);
|
||||
}
|
||||
|
||||
private void lBProgramPath_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (lVPrograms.SelectedItems.Count > 0)
|
||||
{
|
||||
if (lVPrograms.SelectedIndices[0] > -1)
|
||||
lBProgramPath.Text = lVPrograms.SelectedItems[0].SubItems[1].Text;
|
||||
}
|
||||
else
|
||||
lBProgramPath.Text = "";
|
||||
}
|
||||
|
||||
private void listView1_ItemCheck(object sender, ItemCheckEventArgs e)
|
||||
{
|
||||
if (lVPrograms.Items[e.Index].Checked)
|
||||
RemoveP(lVPrograms.Items[e.Index].SubItems[1].Text, false);
|
||||
}
|
||||
|
||||
private void bnHideUnchecked_Click(object sender, EventArgs e)
|
||||
{
|
||||
form.RefreshAutoProfilesPage();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -117,4 +117,10 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="openProgram.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="iLIcons.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>143, 17</value>
|
||||
</metadata>
|
||||
</root>
|
Loading…
x
Reference in New Issue
Block a user