From b522a47dbecd8a00df641f0932cb537ee0e2c3f3 Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Wed, 28 Sep 2016 15:31:40 -0700 Subject: [PATCH] Making android not connect to unspecified printer --- ActionBar/ActionBarPlus.cs | 2 +- ActionBar/ActionRowBase.cs | 66 ---------- ActionBar/PrintActionRow.cs | 123 +++++++++++------- ...w.cs => PrinterConnectAndSelectControl.cs} | 42 +++--- MatterControl.csproj | 3 +- StaticData/Translations/Master.txt | 6 + .../MatterControl/Slicing/SliceLayersTests.cs | 2 + 7 files changed, 112 insertions(+), 132 deletions(-) delete mode 100644 ActionBar/ActionRowBase.cs rename ActionBar/{PrinterActionRow.cs => PrinterConnectAndSelectControl.cs} (98%) diff --git a/ActionBar/ActionBarPlus.cs b/ActionBar/ActionBarPlus.cs index 2fa9426aa..4bc8e7216 100644 --- a/ActionBar/ActionBarPlus.cs +++ b/ActionBar/ActionBarPlus.cs @@ -57,7 +57,7 @@ namespace MatterHackers.MatterControl // Add Child Elements if (UserSettings.Instance.DisplayMode == ApplicationDisplayType.Responsive) { - this.AddChild(new ActionBar.PrinterActionRow()); + this.AddChild(new PrinterConnectAndSelectControl()); } this.AddChild(PrintStatusRow.Create(queueDataView)); this.Padding = new BorderDouble(bottom: 6); diff --git a/ActionBar/ActionRowBase.cs b/ActionBar/ActionRowBase.cs deleted file mode 100644 index 3c7096d05..000000000 --- a/ActionBar/ActionRowBase.cs +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright (c) 2016, Lars Brubaker -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The views and conclusions contained in the software and documentation are those -of the authors and should not be interpreted as representing official policies, -either expressed or implied, of the FreeBSD Project. -*/ - -using MatterHackers.Agg; -using MatterHackers.Agg.UI; -using MatterHackers.Agg.VertexSource; -using System; - -namespace MatterHackers.MatterControl.ActionBar -{ - //Base widget for ActionBarRows - public abstract class ActionRowBase : FlowLayoutWidget - { - public ActionRowBase() - : base(FlowDirection.LeftToRight) - { - Initialize(); - SetDisplayAttributes(); - AddChildElements(); - AddHandlers(); - } - - protected virtual void Initialize() - { - //Placeholder for row-specific initialization - } - - protected void SetDisplayAttributes() - { - this.HAnchor = HAnchor.ParentLeftRight; - } - - protected abstract void AddChildElements(); - - protected virtual void AddHandlers() - { - //Placeholder for row-specific handlers - } - } -} \ No newline at end of file diff --git a/ActionBar/PrintActionRow.cs b/ActionBar/PrintActionRow.cs index 0904dbdf1..958aeacfd 100644 --- a/ActionBar/PrintActionRow.cs +++ b/ActionBar/PrintActionRow.cs @@ -46,10 +46,11 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; +using System.Linq; namespace MatterHackers.MatterControl.ActionBar { - internal class PrintActionRow : ActionRowBase + internal class PrintActionRow : FlowLayoutWidget { private List