From ba07aec7f374e195104902676c22824af6cc709b Mon Sep 17 00:00:00 2001 From: lightlike Date: Fri, 11 Oct 2019 14:29:41 +0200 Subject: [PATCH] Fix some small stuff (Updating) --- Drachenhorn.Core/Lang/LanguageManager.cs | 6 +- Drachenhorn.Core/Settings/ISettings.cs | 3 +- .../Converter/NullVisibilityConverter.cs | 17 ++++- .../Drachenhorn.Desktop.csproj | 3 - .../UI/Lang/TranslateExtension.cs | 2 +- .../Common/SettingsViewControl.xaml | 74 +++++++++---------- .../Common/SettingsViewControl.xaml.cs | 2 +- Drachenhorn.Desktop/UserSettings/Settings.cs | 32 +------- .../UserSettings/SquirrelManager.cs | 8 +- Drachenhorn.Desktop/commit | 1 - 10 files changed, 61 insertions(+), 87 deletions(-) delete mode 100644 Drachenhorn.Desktop/commit diff --git a/Drachenhorn.Core/Lang/LanguageManager.cs b/Drachenhorn.Core/Lang/LanguageManager.cs index 9277f86..174ac5e 100644 --- a/Drachenhorn.Core/Lang/LanguageManager.cs +++ b/Drachenhorn.Core/Lang/LanguageManager.cs @@ -5,6 +5,7 @@ using System.Resources; using Drachenhorn.Xml; using Easy.Logger.Interfaces; +using GalaSoft.MvvmLight; using GalaSoft.MvvmLight.Ioc; namespace Drachenhorn.Core.Lang @@ -13,7 +14,7 @@ public class LanguageManager : BindableBase, INotifyLanguageChanged { #region Properties - private readonly ResourceManager _resourceManager = + private readonly ResourceManager _resourceManager = new ResourceManager("Drachenhorn.Core.Lang.lang", typeof(LanguageManager).Assembly); private CultureInfo _currentCulture = CultureInfo.CurrentUICulture; @@ -47,6 +48,9 @@ public CultureInfo CurrentCulture /// Translated Text. public string GetLanguageText(string identifier) { + if (ViewModelBase.IsInDesignModeStatic) + return identifier; + try { return _resourceManager.GetString(identifier, CurrentCulture)?.Replace("\\n", "\n"); diff --git a/Drachenhorn.Core/Settings/ISettings.cs b/Drachenhorn.Core/Settings/ISettings.cs index 6830c2b..61b9cc5 100644 --- a/Drachenhorn.Core/Settings/ISettings.cs +++ b/Drachenhorn.Core/Settings/ISettings.cs @@ -12,8 +12,7 @@ public interface ISettings : INotifyPropertyChanged CultureInfo CurrentCulture { get; set; } string Version { get; } - string GitCommit { get; } - string GitCommitLink { get; } + string NewVersion { get; } VisualThemeType VisualTheme { get; set; } string AccentColor { get; set; } diff --git a/Drachenhorn.Desktop/Converter/NullVisibilityConverter.cs b/Drachenhorn.Desktop/Converter/NullVisibilityConverter.cs index ce8e8ff..189dad1 100644 --- a/Drachenhorn.Desktop/Converter/NullVisibilityConverter.cs +++ b/Drachenhorn.Desktop/Converter/NullVisibilityConverter.cs @@ -14,10 +14,19 @@ public class NullVisibilityConverter : IValueConverter /// public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - if (value == null) - return Visibility.Collapsed; - else - return Visibility.Visible; + var onNull = Visibility.Collapsed; + var notNull = Visibility.Visible; + + if (parameter != null && parameter.ToString() == "Invert") + { + onNull = Visibility.Visible; + notNull = Visibility.Collapsed; + } + + if (value == null || string.IsNullOrEmpty(value.ToString())) + return onNull; + + return notNull; } /// diff --git a/Drachenhorn.Desktop/Drachenhorn.Desktop.csproj b/Drachenhorn.Desktop/Drachenhorn.Desktop.csproj index d7f353c..9ad2f37 100644 --- a/Drachenhorn.Desktop/Drachenhorn.Desktop.csproj +++ b/Drachenhorn.Desktop/Drachenhorn.Desktop.csproj @@ -469,9 +469,6 @@ Images\White\Common\Yes.png - - Always - Always diff --git a/Drachenhorn.Desktop/UI/Lang/TranslateExtension.cs b/Drachenhorn.Desktop/UI/Lang/TranslateExtension.cs index 3adbe64..3388897 100644 --- a/Drachenhorn.Desktop/UI/Lang/TranslateExtension.cs +++ b/Drachenhorn.Desktop/UI/Lang/TranslateExtension.cs @@ -20,7 +20,7 @@ public TranslateExtension(string name) : base("[%" + name + "]") try { if (ViewModelBase.IsInDesignModeStatic) - Source = new LanguageManager {CurrentCulture = CultureInfo.CurrentCulture}; + Source = new LanguageManager(); else Source = SimpleIoc.Default.GetInstance(); } diff --git a/Drachenhorn.Desktop/UserControls/Common/SettingsViewControl.xaml b/Drachenhorn.Desktop/UserControls/Common/SettingsViewControl.xaml index 22de217..9ca3400 100644 --- a/Drachenhorn.Desktop/UserControls/Common/SettingsViewControl.xaml +++ b/Drachenhorn.Desktop/UserControls/Common/SettingsViewControl.xaml @@ -92,51 +92,45 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - -