Making the OEMSettings a single JSon file.
This commit is contained in:
parent
bc011a33a6
commit
978d7ddcfa
11 changed files with 101 additions and 52 deletions
|
|
@ -131,29 +131,28 @@ namespace MatterHackers.MatterControl
|
|||
}
|
||||
if (elementState.Classes.Contains("versionNumber"))
|
||||
{
|
||||
decodedHtml = "*release*" + VersionInfo.Instance.ReleaseVersion;
|
||||
decodedHtml = VersionInfo.Instance.ReleaseVersion;
|
||||
}
|
||||
if (elementState.Classes.Contains("buildNumber"))
|
||||
{
|
||||
decodedHtml = "*build*" + VersionInfo.Instance.BuildVersion;
|
||||
decodedHtml = VersionInfo.Instance.BuildVersion;
|
||||
}
|
||||
|
||||
Button createdButton = null;
|
||||
if (elementState.Classes.Contains("centeredButton"))
|
||||
{
|
||||
Button feedbackLink = textImageButtonFactory.Generate(decodedHtml);
|
||||
feedbackLink.Click += (sender, mouseEvent) => { ContactFormWindow.Open(); };
|
||||
widgetToAdd = feedbackLink;
|
||||
createdButton = textImageButtonFactory.Generate(decodedHtml);
|
||||
widgetToAdd = createdButton;
|
||||
}
|
||||
else if (elementState.Classes.Contains("linkButton"))
|
||||
{
|
||||
double oldFontSize = linkButtonFactory.fontSize;
|
||||
linkButtonFactory.fontSize = elementState.PointSize;
|
||||
Button deleteCacheLink = linkButtonFactory.Generate(decodedHtml);
|
||||
createdButton = linkButtonFactory.Generate(decodedHtml);
|
||||
StyledTypeFace styled = new StyledTypeFace(LiberationSansFont.Instance, elementState.PointSize);
|
||||
double descentInPixels = styled.DescentInPixels;
|
||||
deleteCacheLink.OriginRelativeParent = new VectorMath.Vector2(deleteCacheLink.OriginRelativeParent.x, deleteCacheLink.OriginRelativeParent.y + descentInPixels);
|
||||
deleteCacheLink.Click += (sender, mouseEvent) => { DeleteCacheData(); };
|
||||
widgetToAdd = deleteCacheLink;
|
||||
createdButton.OriginRelativeParent = new VectorMath.Vector2(createdButton.OriginRelativeParent.x, createdButton.OriginRelativeParent.y + descentInPixels);
|
||||
widgetToAdd = createdButton;
|
||||
linkButtonFactory.fontSize = oldFontSize;
|
||||
}
|
||||
else
|
||||
|
|
@ -162,6 +161,18 @@ namespace MatterHackers.MatterControl
|
|||
widgetToAdd = content;
|
||||
}
|
||||
|
||||
if (createdButton != null)
|
||||
{
|
||||
if (elementState.Id == "sendFeedback")
|
||||
{
|
||||
createdButton.Click += (sender, mouseEvent) => { ContactFormWindow.Open(); };
|
||||
}
|
||||
else if (elementState.Id == "clearCache")
|
||||
{
|
||||
createdButton.Click += (sender, mouseEvent) => { DeleteCacheData(); };
|
||||
}
|
||||
}
|
||||
|
||||
if (elementState.VerticalAlignment == ElementState.VerticalAlignType.top)
|
||||
{
|
||||
widgetToAdd.VAnchor = VAnchor.ParentTop;
|
||||
|
|
@ -183,7 +194,7 @@ namespace MatterHackers.MatterControl
|
|||
break;
|
||||
|
||||
default:
|
||||
throw new NotImplementedException();
|
||||
throw new NotImplementedException("Don't know what to do with {0}".FormatWith(elementState.TypeName));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ namespace MatterHackers.MatterControl.HtmlParsing
|
|||
string[] classes = splitOnEquals[1].Split(' ');
|
||||
foreach (string className in classes)
|
||||
{
|
||||
style.classes.Add(className);
|
||||
style.classes.Add(new Regex("[^']*").Match(className).Value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
@ -165,7 +165,7 @@ namespace MatterHackers.MatterControl.HtmlParsing
|
|||
break;
|
||||
|
||||
case "id":
|
||||
style.id = splitOnEquals[1].Substring(0, splitOnEquals[1].Length - 1);
|
||||
style.id = splitOnEquals[1];
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue