Feature autodownload #44
6 changed files with 32 additions and 7 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
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>
|
||||
/// Looks up a localized string similar to Driver installer successfully downloaded..
|
||||
/// </summary>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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;
|
||||
|
|
Reference in a new issue