Feature autodownload #44
7 changed files with 45 additions and 3 deletions
|
@ -210,6 +210,12 @@ namespace EnvyUpdate
|
||||||
|
|
||||||
if (skippedVer != onlineDriv)
|
if (skippedVer != onlineDriv)
|
||||||
{
|
{
|
||||||
|
if (GlobalVars.autoDownload)
|
||||||
|
{
|
||||||
|
Debug.LogToFile("INFO Auto-Downloading driver.");
|
||||||
|
buttonDownload_Click(null, null);
|
||||||
|
}
|
||||||
|
|
||||||
Debug.LogToFile("INFO Showing update popup notification.");
|
Debug.LogToFile("INFO Showing update popup notification.");
|
||||||
Notify.ShowDrivUpdatePopup();
|
Notify.ShowDrivUpdatePopup();
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,5 +19,6 @@ namespace EnvyUpdate
|
||||||
public static readonly string useragent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:115.0) Gecko/20100101 Firefox/115.0";
|
public static readonly string useragent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:115.0) Gecko/20100101 Firefox/115.0";
|
||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
9
EnvyUpdate/Properties/Resources.Designer.cs
generated
9
EnvyUpdate/Properties/Resources.Designer.cs
generated
|
@ -267,6 +267,15 @@ namespace EnvyUpdate.Properties {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Download updates automatically.
|
||||||
|
/// </summary>
|
||||||
|
public static string ui_enable_autodownload {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("ui_enable_autodownload", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Enable logging to file.
|
/// Looks up a localized string similar to Enable logging to file.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -186,6 +186,9 @@
|
||||||
<data name="ui_enable_appdata" xml:space="preserve">
|
<data name="ui_enable_appdata" xml:space="preserve">
|
||||||
<value>Programmdaten in AppData speichern</value>
|
<value>Programmdaten in AppData speichern</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ui_enable_autodownload" xml:space="preserve">
|
||||||
|
<value>Updates automatisch herunterladen</value>
|
||||||
|
</data>
|
||||||
<data name="ui_enable_logging" xml:space="preserve">
|
<data name="ui_enable_logging" xml:space="preserve">
|
||||||
<value>Programm-Log in Datei schreiben</value>
|
<value>Programm-Log in Datei schreiben</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
@ -186,6 +186,9 @@
|
||||||
<data name="ui_enable_appdata" xml:space="preserve">
|
<data name="ui_enable_appdata" xml:space="preserve">
|
||||||
<value>Save files to AppData</value>
|
<value>Save files to AppData</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ui_enable_autodownload" xml:space="preserve">
|
||||||
|
<value>Download updates automatically</value>
|
||||||
|
</data>
|
||||||
<data name="ui_enable_logging" xml:space="preserve">
|
<data name="ui_enable_logging" xml:space="preserve">
|
||||||
<value>Enable logging to file</value>
|
<value>Enable logging to file</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
@ -35,9 +35,19 @@
|
||||||
<ui:ToggleSwitch x:Name="chkLog" Checked="chkLog_Checked" Unchecked="chkLog_Unchecked"/>
|
<ui:ToggleSwitch x:Name="chkLog" Checked="chkLog_Checked" Unchecked="chkLog_Unchecked"/>
|
||||||
</ui:CardControl>
|
</ui:CardControl>
|
||||||
|
|
||||||
<ui:CardControl Grid.Row="3" Margin="0,12,0,0" Icon="Folder24" Header="{x:Static p:Resources.ui_enable_appdata}" >
|
<Grid Grid.Row="3">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="5"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<ui:CardControl Grid.Column="0" Margin="0,12,0,0" Icon="Folder24" Header="{x:Static p:Resources.ui_enable_appdata}" VerticalAlignment="Top" >
|
||||||
<ui:ToggleSwitch x:Name="chkAppdata" Checked="chkAppdata_Checked" Unchecked="chkAppdata_Unchecked"/>
|
<ui:ToggleSwitch x:Name="chkAppdata" Checked="chkAppdata_Checked" Unchecked="chkAppdata_Unchecked"/>
|
||||||
</ui:CardControl>
|
</ui:CardControl>
|
||||||
|
<ui:CardControl Grid.Column="2" Margin="0,12,0,0" Icon="ArrowDownload24" Header="{x:Static p:Resources.ui_enable_autodownload}" VerticalAlignment="Top">
|
||||||
|
<ui:ToggleSwitch x:Name="chkAutodl" Checked="chkAutodl_Checked" Unchecked="chkAutodl_Unchecked"/>
|
||||||
|
</ui:CardControl>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<Label Grid.Row="4" Content="{x:Static p:Resources.ui_licenses}" HorizontalAlignment="Left" VerticalAlignment="Top" FontWeight="Bold"/>
|
<Label Grid.Row="4" Content="{x:Static p:Resources.ui_licenses}" HorizontalAlignment="Left" VerticalAlignment="Top" FontWeight="Bold"/>
|
||||||
<ScrollViewer Grid.Row="5" MaxHeight="700" HorizontalAlignment="Stretch">
|
<ScrollViewer Grid.Row="5" MaxHeight="700" HorizontalAlignment="Stretch">
|
||||||
|
|
|
@ -91,5 +91,15 @@ namespace EnvyUpdate
|
||||||
|
|
||||||
Debug.LogToFile("INFO Switched to EXE directory.");
|
Debug.LogToFile("INFO Switched to EXE directory.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void chkAutodl_Checked(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
GlobalVars.autoDownload = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void chkAutodl_Unchecked(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
GlobalVars.autoDownload = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue