From fd54d0891c181ab7c02c2d999909f43aede3b3ec Mon Sep 17 00:00:00 2001 From: LarsBrubaker Date: Sat, 7 Dec 2019 10:25:30 -0800 Subject: [PATCH] removing and mini touch screen ui for now plan is to get all the functionality working in standard ui then build out the touch screen ui after that, working to make a better separation between ui and functionality --- .../ApplicationView/ApplicationController.cs | 17 +++++++ .../PartPreviewWindow/MainViewWidget.cs | 44 ++----------------- Program.cs | 2 + 3 files changed, 23 insertions(+), 40 deletions(-) diff --git a/MatterControlLib/ApplicationView/ApplicationController.cs b/MatterControlLib/ApplicationView/ApplicationController.cs index a04aedf3a..4a2773c14 100644 --- a/MatterControlLib/ApplicationView/ApplicationController.cs +++ b/MatterControlLib/ApplicationView/ApplicationController.cs @@ -3530,6 +3530,21 @@ Support and tutorials: public enum ReportSeverity2 { Warning, Error } + public class MiniTouchScreen + { + public bool Enabled + { + get + { + return !string.IsNullOrEmpty(Make); + } + } + + public string Make { get; set; } + + public string Model { get; set; } + } + public static class Application { private static ProgressBar progressBar; @@ -3542,6 +3557,8 @@ Support and tutorials: public static bool EnableNetworkTraffic { get; set; } = true; + public static MiniTouchScreen MiniTouchScreen { get; set; } = new MiniTouchScreen(); + public static SystemWindow LoadRootWindow(int width, int height) { timer = Stopwatch.StartNew(); diff --git a/MatterControlLib/PartPreviewWindow/MainViewWidget.cs b/MatterControlLib/PartPreviewWindow/MainViewWidget.cs index cfae5efd4..647cb52ff 100644 --- a/MatterControlLib/PartPreviewWindow/MainViewWidget.cs +++ b/MatterControlLib/PartPreviewWindow/MainViewWidget.cs @@ -69,18 +69,10 @@ namespace MatterHackers.MatterControl.PartPreviewWindow // Push TouchScreenMode into GuiWidget GuiWidget.TouchScreenMode = UserSettings.Instance.IsTouchScreen; - var normalUi = true; - if (normalUi) - { - AddStandardUi(theme); - ApplicationController.Instance.WorkspacesChanged += Workspaces_Changed; - ApplicationController.Instance.Tasks.TasksChanged += Tasks_TasksChanged; - tabControl.ActiveTabChanged += TabControl_ActiveTabChanged; - } - else - { - AddConnectUi(theme); - } + AddStandardUi(theme); + ApplicationController.Instance.WorkspacesChanged += Workspaces_Changed; + ApplicationController.Instance.Tasks.TasksChanged += Tasks_TasksChanged; + tabControl.ActiveTabChanged += TabControl_ActiveTabChanged; // Register listeners PrinterSettings.AnyPrinterSettingChanged += Printer_SettingChanged; @@ -90,34 +82,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow ApplicationController.Instance.MainView = this; } - private async void AddConnectUi(ThemeConfig theme) - { - await ProfileManager.CreatePrinterAsync("Pulse", "S-500", "Pulse S-500"); - - if (ApplicationController.Instance.ActivePrinters.Any()) - { - var activePrinter = ApplicationController.Instance.ActivePrinters.First(); - var printerName = new TextWidget(activePrinter.Settings.GetValue(SettingsKey.printer_name), pointSize: theme.DefaultFontSize, textColor: theme.TextColor) - { - //VAnchor = VAnchor.Center, - HAnchor = HAnchor.Center - }; - this.AddChild(printerName); - } - - this.AddChild(new TextWidget("Ready to Print".Localize(), pointSize: 18, textColor: theme.TextColor) - { - //VAnchor = VAnchor.Center, - HAnchor = HAnchor.Center - }); - - var buttonText = new TextWidget("Select file to print".Localize() + "...", pointSize: theme.DefaultFontSize, textColor: theme.TextColor) - { - //VAnchor = VAnchor.Center, - HAnchor = HAnchor.Center - }; - this.AddChild(buttonText); - } private void AddStandardUi(ThemeConfig theme) { diff --git a/Program.cs b/Program.cs index 5471496d0..313c8f978 100644 --- a/Program.cs +++ b/Program.cs @@ -148,6 +148,8 @@ namespace MatterHackers.MatterControl Slicer.RunInProcess = config.GetValue("MatterControl:Slicer:Debug"); Application.EnableF5Collect = config.GetValue("MatterControl:Application:EnableF5Collect"); Application.EnableNetworkTraffic = config.GetValue("MatterControl:Application:EnableNetworkTraffic", true); + Application.MiniTouchScreen.Make = config.GetValue("MatterControl:MiniTouchScreen.Make", ""); + Application.MiniTouchScreen.Model = config.GetValue("MatterControl:MiniTouchScreen.Model", ""); // Make sure we have the right working directory as we assume everything relative to the executable. Directory.SetCurrentDirectory(Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location));