Version number is written into Profiles.xml

About Window shows version number
This commit is contained in:
jays2kings 2014-05-17 15:53:46 -04:00
parent dacaada0ea
commit 00587cdc31
4 changed files with 21 additions and 7 deletions

View File

@ -184,6 +184,16 @@ namespace DS4Control
return m_Config.useExclusiveMode;
}
public static void setVersion(double data)
{
m_Config.version = data;
}
public static double getVersion()
{
return m_Config.version;
}
// New settings
public static void saveLowColor(int device, byte red, byte green, byte blue)
{
@ -410,7 +420,7 @@ namespace DS4Control
public Int32 formWidth = 782;
public Int32 formHeight = 550;
public Boolean startMinimized = false;
public double version;
public Dictionary<DS4Controls, DS4KeyType>[] customMapKeyTypes = {null, null, null, null};
public Dictionary<DS4Controls, UInt16>[] customMapKeys = { null, null, null, null };
public Dictionary<DS4Controls, X360Controls>[] customMapButtons = { null, null, null, null };
@ -921,6 +931,8 @@ namespace DS4Control
catch { missingSetting = true; }
try { Item = m_Xdoc.SelectSingleNode("/Profile/Controller4"); profilePath[3] = Item.InnerText; }
catch { missingSetting = true; }
try { Item = m_Xdoc.SelectSingleNode("/Profile/DS4Version"); Double.TryParse(Item.InnerText, out version); }
catch { missingSetting = true; }
}
}
catch { }
@ -960,6 +972,7 @@ namespace DS4Control
XmlNode xmlController3 = m_Xdoc.CreateNode(XmlNodeType.Element, "Controller3", null); xmlController3.InnerText = profilePath[2]; Node.AppendChild(xmlController3);
XmlNode xmlController4 = m_Xdoc.CreateNode(XmlNodeType.Element, "Controller4", null); xmlController4.InnerText = profilePath[3]; Node.AppendChild(xmlController4);
XmlNode xmlVersion = m_Xdoc.CreateNode(XmlNodeType.Element, "DS4Version", null); xmlVersion.InnerText = version.ToString(); Node.AppendChild(xmlVersion);
m_Xdoc.AppendChild(Node);
m_Xdoc.Save(m_Profile);

View File

@ -206,9 +206,9 @@
this.lbAbout.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lbAbout.Location = new System.Drawing.Point(26, 9);
this.lbAbout.Name = "lbAbout";
this.lbAbout.Size = new System.Drawing.Size(229, 13);
this.lbAbout.Size = new System.Drawing.Size(201, 13);
this.lbAbout.TabIndex = 0;
this.lbAbout.Text = "DS4Windows is Open Source software!";
this.lbAbout.Text = "DS4Windows - J2K Build (Version ";
//
// Hotkeys
//

View File

@ -15,6 +15,7 @@ namespace ScpServer
public Hotkeys()
{
InitializeComponent();
lbAbout.Text += Global.getVersion().ToString() + ")";
}
private void button1_Click(object sender, EventArgs e)

View File

@ -13,7 +13,7 @@ namespace ScpServer
{
private DS4Control.Control rootHub;
delegate void LogDebugDelegate(DateTime Time, String Data);
double version = 6.8;
double version = 6.9;
protected void LogDebug(DateTime Time, String Data)
{
@ -88,7 +88,7 @@ namespace ScpServer
ebns = new Button[4] { bnEditC1, bnEditC2, bnEditC3, bnEditC4 };
dbns = new Button[4] { bnDeleteC1, bnDeleteC2, bnDeleteC3, bnDeleteC4 };
protexts = new Label[4] { lbSelPro1, lbSelPro2, lbSelPro3, lbSelPro4 };
shortcuts = new ToolStripMenuItem[4] { (ToolStripMenuItem)notifyIcon1.ContextMenuStrip.Items[0],
(ToolStripMenuItem)notifyIcon1.ContextMenuStrip.Items[1],
(ToolStripMenuItem)notifyIcon1.ContextMenuStrip.Items[2],
@ -99,8 +99,6 @@ namespace ScpServer
Directory.CreateDirectory(Global.appdatapath);
wc.DownloadFileAsync(url, Global.appdatapath + "\\version.txt");
wc.DownloadFileCompleted += Check_Version;
// if (Directory.Exists(Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName + @"\Profiles\"))
//File.C
}
private void Check_Version(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
@ -140,6 +138,8 @@ namespace ScpServer
Log.TrayIconLog += ShowNotification;
// tmrUpdate.Enabled = true; TODO remove tmrUpdate and leave tick()
Global.Load();
Global.setVersion(version);
Global.Save();
hideDS4CheckBox.CheckedChanged -= hideDS4CheckBox_CheckedChanged;
hideDS4CheckBox.Checked = Global.getUseExclusiveMode();
hideDS4CheckBox.CheckedChanged += hideDS4CheckBox_CheckedChanged;