From af9557e53b93f3f1e710ceb09b9b9f9178568f56 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Fri, 26 Jul 2019 03:41:38 -0500 Subject: [PATCH] Disable control service button while a routine is active --- DS4Windows/DS4Forms/DS4Form.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/DS4Windows/DS4Forms/DS4Form.cs b/DS4Windows/DS4Forms/DS4Form.cs index 0b57bb0..d76df50 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs +++ b/DS4Windows/DS4Forms/DS4Form.cs @@ -1163,6 +1163,7 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question { var uiContext = SynchronizationContext.Current; changingService = true; + btnStartStop.Enabled = false; TaskRunner.Run(() => { //Thread.CurrentThread.Priority = ThreadPriority.AboveNormal; @@ -1187,11 +1188,13 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question } startToolStripMenuItem.Text = btnStartStop.Text = Properties.Resources.StopText; + btnStartStop.Enabled = true; } private void ServiceShutdown(bool log) { changingService = true; + btnStartStop.Enabled = false; TaskRunner.Run(() => { Program.rootHub.Stop(log); @@ -1207,6 +1210,7 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question //hotkeysTimer.Stop(); //autoProfilesTimer.Stop(); startToolStripMenuItem.Text = btnStartStop.Text = Properties.Resources.StartText; + btnStartStop.Enabled = true; blankControllerTab(); populateFullNotifyText(); }