Skip to content

Commit

Permalink
rtk/gps: fix quick double click on "connect"
Browse files Browse the repository at this point in the history
When the user quickly clicked the "connect" button twice, the task to
connect to the receiver would be executed twice, causing problems.
Disable the button until the connection process is finished.
  • Loading branch information
flyingthingsintothings committed Apr 11, 2024
1 parent f360b58 commit 4f31d6c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion GCSViews/ConfigurationView/ConfigSerialInjectGPS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,14 @@ public async Task DoConnect()
}
else if (chk_autoconfig.Checked && comboBoxConfigType.Text == "Septentrio")
{
await ConfigureSeptentrioReceiver();
BUT_connect.Enabled = false;
try
{
await ConfigureSeptentrioReceiver();
} catch (Exception ex)
{
throw ex;
} finally { BUT_connect.Enabled = true; }
}
t12 = new System.Threading.Thread(new System.Threading.ThreadStart(mainloop))
{
Expand Down

0 comments on commit 4f31d6c

Please sign in to comment.