Disable control service button while a routine is active

This commit is contained in:
Travis Nickles 2019-07-26 03:41:38 -05:00
parent 0630719ffc
commit af9557e53b

View File

@ -1163,6 +1163,7 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
{ {
var uiContext = SynchronizationContext.Current; var uiContext = SynchronizationContext.Current;
changingService = true; changingService = true;
btnStartStop.Enabled = false;
TaskRunner.Run(() => TaskRunner.Run(() =>
{ {
//Thread.CurrentThread.Priority = ThreadPriority.AboveNormal; //Thread.CurrentThread.Priority = ThreadPriority.AboveNormal;
@ -1187,11 +1188,13 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
} }
startToolStripMenuItem.Text = btnStartStop.Text = Properties.Resources.StopText; startToolStripMenuItem.Text = btnStartStop.Text = Properties.Resources.StopText;
btnStartStop.Enabled = true;
} }
private void ServiceShutdown(bool log) private void ServiceShutdown(bool log)
{ {
changingService = true; changingService = true;
btnStartStop.Enabled = false;
TaskRunner.Run(() => TaskRunner.Run(() =>
{ {
Program.rootHub.Stop(log); Program.rootHub.Stop(log);
@ -1207,6 +1210,7 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
//hotkeysTimer.Stop(); //hotkeysTimer.Stop();
//autoProfilesTimer.Stop(); //autoProfilesTimer.Stop();
startToolStripMenuItem.Text = btnStartStop.Text = Properties.Resources.StartText; startToolStripMenuItem.Text = btnStartStop.Text = Properties.Resources.StartText;
btnStartStop.Enabled = true;
blankControllerTab(); blankControllerTab();
populateFullNotifyText(); populateFullNotifyText();
} }