Feature autodownload #44
4 changed files with 42 additions and 16 deletions
|
@ -22,6 +22,7 @@ namespace EnvyUpdate
|
|||
private string gpuURL = null;
|
||||
private string skippedVer = null;
|
||||
private DateTime lastFileChanged = DateTime.MinValue;
|
||||
private bool isDownloading = false;
|
||||
|
||||
public DashboardPage()
|
||||
{
|
||||
|
@ -345,9 +346,17 @@ namespace EnvyUpdate
|
|||
}
|
||||
|
||||
private void buttonDownload_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (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);
|
||||
}
|
||||
else
|
||||
{
|
||||
progressbarDownload.Visibility = Visibility.Visible;
|
||||
buttonDownload.IsEnabled = false;
|
||||
isDownloading = true;
|
||||
|
||||
if (File.Exists(Path.Combine(GlobalVars.saveDirectory, onlineDriv + "-nvidia-installer.exe.downloading")))
|
||||
{
|
||||
|
@ -366,6 +375,7 @@ namespace EnvyUpdate
|
|||
thread.Start();
|
||||
Debug.LogToFile("INFO Started installer download.");
|
||||
}
|
||||
}
|
||||
|
||||
void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
|
||||
{
|
||||
|
@ -382,6 +392,7 @@ namespace EnvyUpdate
|
|||
Application.Current.Dispatcher.Invoke(new Action(() => {
|
||||
buttonDownload.IsEnabled = true;
|
||||
progressbarDownload.Visibility = Visibility.Collapsed;
|
||||
isDownloading = false;
|
||||
}));
|
||||
if (e.Error == null)
|
||||
{
|
||||
|
|
9
EnvyUpdate/Properties/Resources.Designer.cs
generated
9
EnvyUpdate/Properties/Resources.Designer.cs
generated
|
@ -105,6 +105,15 @@ namespace EnvyUpdate.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to A download process is already running!.
|
||||
/// </summary>
|
||||
public static string info_download_running {
|
||||
get {
|
||||
return ResourceManager.GetString("info_download_running", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Driver installer successfully downloaded..
|
||||
/// </summary>
|
||||
|
|
|
@ -132,6 +132,9 @@
|
|||
<data name="info_download_error_title" xml:space="preserve">
|
||||
<value>Fehler beim Herunterladen</value>
|
||||
</data>
|
||||
<data name="info_download_running" xml:space="preserve">
|
||||
<value>Ein Downloadvorgang läuft bereits!</value>
|
||||
</data>
|
||||
<data name="info_download_success" xml:space="preserve">
|
||||
<value>Treiber-Installationsdatei erfolgreich heruntergeladen.</value>
|
||||
</data>
|
||||
|
|
|
@ -132,6 +132,9 @@
|
|||
<data name="info_download_error_title" xml:space="preserve">
|
||||
<value>Error while downloading</value>
|
||||
</data>
|
||||
<data name="info_download_running" xml:space="preserve">
|
||||
<value>A download process is already running!</value>
|
||||
</data>
|
||||
<data name="info_download_success" xml:space="preserve">
|
||||
<value>Driver installer successfully downloaded.</value>
|
||||
</data>
|
||||
|
|
Reference in a new issue