Skip to content

Commit

Permalink
disable livery tab controls during livery import
Browse files Browse the repository at this point in the history
  • Loading branch information
RiddleTime committed Apr 13, 2022
1 parent cc62c5a commit 3cf3803
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions ACC_Manager/Controls/Liveries/LiveryImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Threading;

namespace ACCSetupApp.Controls
{
Expand All @@ -19,6 +20,15 @@ public static void ImportLiveryZips()
{
try
{
LiveryBrowser.Instance.Dispatcher.BeginInvoke(new Action(() =>
{
LiveryBrowser.Instance.liveriesTreeViewTeams.IsEnabled = false;
LiveryBrowser.Instance.liveriesTreeViewCars.IsEnabled = false;
LiveryBrowser.Instance.buttonImportLiveries.IsEnabled = false;
LiveryBrowser.Instance.buttonGenerateAllDDS.IsEnabled = false;
LiveryDisplayer.Instance.IsEnabled = false;
}));

Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();

// Set filter for file extension and default file extension
Expand Down Expand Up @@ -50,6 +60,15 @@ public static void ImportLiveryZips()
LogWriter.WriteToLog(ex);
}

LiveryBrowser.Instance.Dispatcher.BeginInvoke(new Action(() =>
{
LiveryBrowser.Instance.liveriesTreeViewTeams.IsEnabled = true;
LiveryBrowser.Instance.liveriesTreeViewCars.IsEnabled = true;
LiveryBrowser.Instance.buttonImportLiveries.IsEnabled = true;
LiveryBrowser.Instance.buttonGenerateAllDDS.IsEnabled = true;
LiveryDisplayer.Instance.IsEnabled = true;
}));

MainWindow.Instance.EnqueueSnackbarMessage($"Finished importing liveries");
LiveryBrowser.Instance.FetchAllCars();
}
Expand Down

0 comments on commit 3cf3803

Please sign in to comment.