finalize download check

This commit is contained in:
Jakob 2024-02-26 20:02:16 +01:00
parent 76425a3c50
commit a4a97f7b99
6 changed files with 32 additions and 7 deletions

View file

@ -22,7 +22,6 @@ namespace EnvyUpdate
private string gpuURL = null;
private string skippedVer = null;
private DateTime lastFileChanged = DateTime.MinValue;
private bool isDownloading = false;
public DashboardPage()
{
@ -213,8 +212,11 @@ namespace EnvyUpdate
{
if (GlobalVars.autoDownload)
{
Debug.LogToFile("INFO Auto-Downloading driver.");
buttonDownload_Click(null, null);
if (buttonDownload.IsVisible)
{
Debug.LogToFile("INFO Auto-Downloading driver.");
buttonDownload_Click(null, null);
}
}
Debug.LogToFile("INFO Showing update popup notification.");
@ -347,16 +349,16 @@ namespace EnvyUpdate
private void buttonDownload_Click(object sender, RoutedEventArgs e)
{
if (isDownloading)
if (GlobalVars.isDownloading)
{
Debug.LogToFile("WARN A download is already running.");
ShowSnackbar(Wpf.Ui.Common.ControlAppearance.Danger, Wpf.Ui.Common.SymbolRegular.ErrorCircle24, Properties.Resources.info_install_complete, Properties.Resources.info_install_complete_title);
ShowSnackbar(Wpf.Ui.Common.ControlAppearance.Danger, Wpf.Ui.Common.SymbolRegular.ErrorCircle24, Properties.Resources.info_download_running, Properties.Resources.info_download_running_title);
}
else
{
progressbarDownload.Visibility = Visibility.Visible;
buttonDownload.IsEnabled = false;
isDownloading = true;
GlobalVars.isDownloading = true;
if (File.Exists(Path.Combine(GlobalVars.saveDirectory, onlineDriv + "-nvidia-installer.exe.downloading")))
{
@ -392,7 +394,7 @@ namespace EnvyUpdate
Application.Current.Dispatcher.Invoke(new Action(() => {
buttonDownload.IsEnabled = true;
progressbarDownload.Visibility = Visibility.Collapsed;
isDownloading = false;
GlobalVars.isDownloading = false;
}));
if (e.Error == null)
{

View file

@ -20,5 +20,6 @@ namespace EnvyUpdate
public static bool useAppdata = false;
public static bool hasWrite = true;
public static bool autoDownload = false;
public static bool isDownloading = false;
}
}

View file

@ -114,6 +114,15 @@ namespace EnvyUpdate.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Download running.
/// </summary>
public static string info_download_running_title {
get {
return ResourceManager.GetString("info_download_running_title", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Driver installer successfully downloaded..
/// </summary>

View file

@ -135,6 +135,9 @@
<data name="info_download_running" xml:space="preserve">
<value>Ein Downloadvorgang läuft bereits!</value>
</data>
<data name="info_download_running_title" xml:space="preserve">
<value>Download läuft</value>
</data>
<data name="info_download_success" xml:space="preserve">
<value>Treiber-Installationsdatei erfolgreich heruntergeladen.</value>
</data>

View file

@ -135,6 +135,9 @@
<data name="info_download_running" xml:space="preserve">
<value>A download process is already running!</value>
</data>
<data name="info_download_running_title" xml:space="preserve">
<value>Download running</value>
</data>
<data name="info_download_success" xml:space="preserve">
<value>Driver installer successfully downloaded.</value>
</data>

View file

@ -33,6 +33,13 @@ namespace EnvyUpdate
if (GlobalVars.autoDownload)
chkAutodl.IsChecked = true;
if (GlobalVars.isDownloading)
{
chkAppdata.IsEnabled = false;
}
else
chkAppdata.IsEnabled = true;
textBoxLicEnvyupdate.Text = Properties.Licenses.EnvyUpdate;
textBoxLicFody.Text = Properties.Licenses.Fody;
textBoxLicCostura.Text = Properties.Licenses.CosturaFody;