remove unnecessary debug and fix locale issues

This commit is contained in:
Jakob 2021-09-06 22:49:56 +02:00
parent e41b348acb
commit 051c4df2b6
4 changed files with 25 additions and 14 deletions

View file

@ -2,8 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:EnvyUpdate"
StartupUri="MainWindow.xaml"
DispatcherUnhandledException="Application_DispatcherUnhandledException">
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>

View file

@ -14,10 +14,5 @@ namespace EnvyUpdate
/// </summary>
public partial class App : Application
{
public bool DoHandle { get; set; }
private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
MessageBox.Show(e.Exception.ToString());
}
}
}

View file

@ -152,6 +152,8 @@ namespace EnvyUpdate
textblockOnline.Text = onlineDriv;
c.Dispose();
try
{
if (float.Parse(localDriv) < float.Parse(onlineDriv))
{
textblockOnline.Foreground = Brushes.Red;
@ -160,6 +162,21 @@ namespace EnvyUpdate
}
else
textblockOnline.Foreground = Brushes.Green;
}
catch (FormatException)
{
//Thank you locales. Some languages need , instead of .
string cLocalDriv = localDriv.Replace('.', ',');
string cOnlineDriv = onlineDriv.Replace('.', ',');
if (float.Parse(cLocalDriv) < float.Parse(cOnlineDriv))
{
textblockOnline.Foreground = Brushes.Red;
buttonDL.IsEnabled = true;
Notify.ShowDrivUpdatePopup();
}
else
textblockOnline.Foreground = Brushes.Green;
}
if (GlobalVars.exepath == GlobalVars.appdata)
{

View file

@ -295,7 +295,7 @@ namespace EnvyUpdate
{
GPUName = obj["VideoProcessor"].ToString().ToLower();
// Remove any 3GB, 6GB or similar from name. We don't need to know the VRAM to get results.
GPUName = Regex.Replace(GPUName, "\\d+GB", "");
GPUName = Regex.Replace(GPUName, " \\d+gb", "");
GPUName = Regex.Replace(GPUName, "nvidia ", "");
}
else