From 00587cdc31af0806d0ee64747a148b062f44da57 Mon Sep 17 00:00:00 2001 From: jays2kings Date: Sat, 17 May 2014 15:53:46 -0400 Subject: [PATCH] Version number is written into Profiles.xml About Window shows version number --- DS4Control/ScpUtil.cs | 15 ++++++++++++++- DS4Tool/Hotkeys.Designer.cs | 4 ++-- DS4Tool/Hotkeys.cs | 1 + DS4Tool/ScpForm.cs | 8 ++++---- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/DS4Control/ScpUtil.cs b/DS4Control/ScpUtil.cs index 32b8fd1..1027458 100644 --- a/DS4Control/ScpUtil.cs +++ b/DS4Control/ScpUtil.cs @@ -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[] customMapKeyTypes = {null, null, null, null}; public Dictionary[] customMapKeys = { null, null, null, null }; public Dictionary[] 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); diff --git a/DS4Tool/Hotkeys.Designer.cs b/DS4Tool/Hotkeys.Designer.cs index bda1747..5fb4b03 100644 --- a/DS4Tool/Hotkeys.Designer.cs +++ b/DS4Tool/Hotkeys.Designer.cs @@ -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 // diff --git a/DS4Tool/Hotkeys.cs b/DS4Tool/Hotkeys.cs index bc69dd8..60d818e 100644 --- a/DS4Tool/Hotkeys.cs +++ b/DS4Tool/Hotkeys.cs @@ -15,6 +15,7 @@ namespace ScpServer public Hotkeys() { InitializeComponent(); + lbAbout.Text += Global.getVersion().ToString() + ")"; } private void button1_Click(object sender, EventArgs e) diff --git a/DS4Tool/ScpForm.cs b/DS4Tool/ScpForm.cs index bfa8ea6..d0b4de7 100644 --- a/DS4Tool/ScpForm.cs +++ b/DS4Tool/ScpForm.cs @@ -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;