finalize download check
This commit is contained in:
parent
76425a3c50
commit
a4a97f7b99
6 changed files with 32 additions and 7 deletions
|
@ -22,7 +22,6 @@ namespace EnvyUpdate
|
||||||
private string gpuURL = null;
|
private string gpuURL = null;
|
||||||
private string skippedVer = null;
|
private string skippedVer = null;
|
||||||
private DateTime lastFileChanged = DateTime.MinValue;
|
private DateTime lastFileChanged = DateTime.MinValue;
|
||||||
private bool isDownloading = false;
|
|
||||||
|
|
||||||
public DashboardPage()
|
public DashboardPage()
|
||||||
{
|
{
|
||||||
|
@ -212,10 +211,13 @@ namespace EnvyUpdate
|
||||||
if (skippedVer != onlineDriv)
|
if (skippedVer != onlineDriv)
|
||||||
{
|
{
|
||||||
if (GlobalVars.autoDownload)
|
if (GlobalVars.autoDownload)
|
||||||
|
{
|
||||||
|
if (buttonDownload.IsVisible)
|
||||||
{
|
{
|
||||||
Debug.LogToFile("INFO Auto-Downloading driver.");
|
Debug.LogToFile("INFO Auto-Downloading driver.");
|
||||||
buttonDownload_Click(null, null);
|
buttonDownload_Click(null, null);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Debug.LogToFile("INFO Showing update popup notification.");
|
Debug.LogToFile("INFO Showing update popup notification.");
|
||||||
Notify.ShowDrivUpdatePopup();
|
Notify.ShowDrivUpdatePopup();
|
||||||
|
@ -347,16 +349,16 @@ namespace EnvyUpdate
|
||||||
|
|
||||||
private void buttonDownload_Click(object sender, RoutedEventArgs e)
|
private void buttonDownload_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (isDownloading)
|
if (GlobalVars.isDownloading)
|
||||||
{
|
{
|
||||||
Debug.LogToFile("WARN A download is already running.");
|
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
|
else
|
||||||
{
|
{
|
||||||
progressbarDownload.Visibility = Visibility.Visible;
|
progressbarDownload.Visibility = Visibility.Visible;
|
||||||
buttonDownload.IsEnabled = false;
|
buttonDownload.IsEnabled = false;
|
||||||
isDownloading = true;
|
GlobalVars.isDownloading = true;
|
||||||
|
|
||||||
if (File.Exists(Path.Combine(GlobalVars.saveDirectory, onlineDriv + "-nvidia-installer.exe.downloading")))
|
if (File.Exists(Path.Combine(GlobalVars.saveDirectory, onlineDriv + "-nvidia-installer.exe.downloading")))
|
||||||
{
|
{
|
||||||
|
@ -392,7 +394,7 @@ namespace EnvyUpdate
|
||||||
Application.Current.Dispatcher.Invoke(new Action(() => {
|
Application.Current.Dispatcher.Invoke(new Action(() => {
|
||||||
buttonDownload.IsEnabled = true;
|
buttonDownload.IsEnabled = true;
|
||||||
progressbarDownload.Visibility = Visibility.Collapsed;
|
progressbarDownload.Visibility = Visibility.Collapsed;
|
||||||
isDownloading = false;
|
GlobalVars.isDownloading = false;
|
||||||
}));
|
}));
|
||||||
if (e.Error == null)
|
if (e.Error == null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,5 +20,6 @@ namespace EnvyUpdate
|
||||||
public static bool useAppdata = false;
|
public static bool useAppdata = false;
|
||||||
public static bool hasWrite = true;
|
public static bool hasWrite = true;
|
||||||
public static bool autoDownload = false;
|
public static bool autoDownload = false;
|
||||||
|
public static bool isDownloading = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
9
EnvyUpdate/Properties/Resources.Designer.cs
generated
9
EnvyUpdate/Properties/Resources.Designer.cs
generated
|
@ -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>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Driver installer successfully downloaded..
|
/// Looks up a localized string similar to Driver installer successfully downloaded..
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -135,6 +135,9 @@
|
||||||
<data name="info_download_running" xml:space="preserve">
|
<data name="info_download_running" xml:space="preserve">
|
||||||
<value>Ein Downloadvorgang läuft bereits!</value>
|
<value>Ein Downloadvorgang läuft bereits!</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="info_download_running_title" xml:space="preserve">
|
||||||
|
<value>Download läuft</value>
|
||||||
|
</data>
|
||||||
<data name="info_download_success" xml:space="preserve">
|
<data name="info_download_success" xml:space="preserve">
|
||||||
<value>Treiber-Installationsdatei erfolgreich heruntergeladen.</value>
|
<value>Treiber-Installationsdatei erfolgreich heruntergeladen.</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
@ -135,6 +135,9 @@
|
||||||
<data name="info_download_running" xml:space="preserve">
|
<data name="info_download_running" xml:space="preserve">
|
||||||
<value>A download process is already running!</value>
|
<value>A download process is already running!</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="info_download_running_title" xml:space="preserve">
|
||||||
|
<value>Download running</value>
|
||||||
|
</data>
|
||||||
<data name="info_download_success" xml:space="preserve">
|
<data name="info_download_success" xml:space="preserve">
|
||||||
<value>Driver installer successfully downloaded.</value>
|
<value>Driver installer successfully downloaded.</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
@ -33,6 +33,13 @@ namespace EnvyUpdate
|
||||||
if (GlobalVars.autoDownload)
|
if (GlobalVars.autoDownload)
|
||||||
chkAutodl.IsChecked = true;
|
chkAutodl.IsChecked = true;
|
||||||
|
|
||||||
|
if (GlobalVars.isDownloading)
|
||||||
|
{
|
||||||
|
chkAppdata.IsEnabled = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
chkAppdata.IsEnabled = true;
|
||||||
|
|
||||||
textBoxLicEnvyupdate.Text = Properties.Licenses.EnvyUpdate;
|
textBoxLicEnvyupdate.Text = Properties.Licenses.EnvyUpdate;
|
||||||
textBoxLicFody.Text = Properties.Licenses.Fody;
|
textBoxLicFody.Text = Properties.Licenses.Fody;
|
||||||
textBoxLicCostura.Text = Properties.Licenses.CosturaFody;
|
textBoxLicCostura.Text = Properties.Licenses.CosturaFody;
|
||||||
|
|
Reference in a new issue