Merge pull request #2638 from jlewin/design_tools

Remove deprecated LocalizedString.Get method
This commit is contained in:
johnlewin 2017-11-08 08:38:40 -08:00 committed by GitHub
commit f44ca2ed2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 20 deletions

View file

@ -69,8 +69,7 @@ namespace MatterHackers.MatterControl
headerRow.Padding = new BorderDouble(0, 3, 0, 3);
{
string titleString = LocalizedString.Get("Title Stuff".Localize());
stepDescriptionWidget = new TextWidget(titleString, pointSize: 14 * extraTextScaling);
stepDescriptionWidget = new TextWidget("", pointSize: 14 * extraTextScaling);
stepDescriptionWidget.AutoExpandBoundsToText = true;
stepDescriptionWidget.TextColor = ActiveTheme.Instance.PrimaryTextColor;
stepDescriptionWidget.HAnchor = HAnchor.Stretch;

View file

@ -1,5 +1,5 @@
/*
Copyright (c) 2014, Lars Brubaker
Copyright (c) 2017, Lars Brubaker, John Lewin
All rights reserved.
Redistribution and use in source and binary forms, with or without
@ -27,7 +27,6 @@ of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
*/
using MatterHackers.Agg.Platform;
using MatterHackers.MatterControl;
namespace MatterHackers.Localizations
@ -62,11 +61,6 @@ namespace MatterHackers.Localizations
}
}
public static string Get(string englishText)
{
return MatterControlTranslationMap.Translate(englishText);
}
public static void ResetTranslationMap()
{
MatterControlTranslationMap = new TranslationMap("Translations", UserSettings.Instance.Language);
@ -74,7 +68,7 @@ namespace MatterHackers.Localizations
public static string Localize(this string englishString)
{
return Get(englishString);
return MatterControlTranslationMap.Translate(englishString);
}
}
}

View file

@ -52,7 +52,7 @@ namespace MatterHackers.MatterControl.PrinterControls
private Button homeYButton;
private Button homeZButton;
internal JogControls jogControls;
// Provides a list of DisableableWidgets controls that can be toggled on/off at runtime
internal List<DisableableWidget> DisableableWidgets = new List<DisableableWidget>();

View file

@ -51,7 +51,7 @@ namespace MatterHackers.MatterControl
var textImageButtonFactory = ApplicationController.Instance.Theme.ButtonFactory;
AlwaysOnTopOfMain = true;
Title = LocalizedString.Get("Leveling Settings".Localize());
Title = "Leveling Settings".Localize();
FlowLayoutWidget topToBottom = new FlowLayoutWidget(FlowDirection.TopToBottom);
topToBottom.AnchorAll();
@ -63,8 +63,7 @@ namespace MatterHackers.MatterControl
headerRow.Padding = new BorderDouble(0, 3, 0, 3);
{
string movementSpeedsLabel = LocalizedString.Get("Sampled Positions".Localize());
TextWidget elementHeader = new TextWidget(string.Format("{0}:", movementSpeedsLabel), pointSize: 14);
var elementHeader = new TextWidget("Sampled Positions".Localize() + ":", pointSize: 14);
elementHeader.TextColor = ActiveTheme.Instance.PrimaryTextColor;
elementHeader.HAnchor = HAnchor.Stretch;
elementHeader.VAnchor = Agg.UI.VAnchor.Bottom;

View file

@ -51,7 +51,7 @@ namespace MatterHackers.MatterControl
var buttonFactory = ApplicationController.Instance.Theme.ButtonFactory;
AlwaysOnTopOfMain = true;
Title = LocalizedString.Get(windowTitle);
Title = windowTitle;
FlowLayoutWidget topToBottom = new FlowLayoutWidget(FlowDirection.TopToBottom);
topToBottom.AnchorAll();
@ -63,8 +63,7 @@ namespace MatterHackers.MatterControl
headerRow.Padding = new BorderDouble(0, 3, 0, 3);
{
string movementSpeedsLabel = LocalizedString.Get("Movement Speeds Presets".Localize());
TextWidget elementHeader = new TextWidget(string.Format("{0}:", movementSpeedsLabel), pointSize: 14);
var elementHeader = new TextWidget("Movement Speeds Presets".Localize() + ":", pointSize: 14);
elementHeader.TextColor = ActiveTheme.Instance.PrimaryTextColor;
elementHeader.HAnchor = HAnchor.Stretch;
elementHeader.VAnchor = Agg.UI.VAnchor.Bottom;

View file

@ -73,7 +73,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
public bool ResetAtEndOfPrint { get; set; } = false;
public bool RebuildGCodeOnChange { get; set; } = true;
public bool ReloadUiWhenChanged { get; set; } = false;
public SliceSettingData(string slicerConfigName, string presentationName, DataEditTypes dataEditType, string extraSettings = "", string helpText = "")
@ -85,7 +85,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
this.SlicerConfigName = slicerConfigName;
this.PresentationName = presentationName;
this.DataEditType = dataEditType;
this.HelpText = LocalizedString.Get(helpText);
this.HelpText = helpText.Localize();
}
}
@ -106,7 +106,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
public string Name { get; }
public List<OrganizerSubGroup> SubGroupsList { get; set; } = new List<OrganizerSubGroup>();
public OrganizerGroup(string displayName)
{
this.Name = displayName;