From f6e5929e5b15dabd2c48241611ec2a21567ad2d3 Mon Sep 17 00:00:00 2001 From: gregory-diaz Date: Fri, 10 Oct 2014 14:52:50 -0700 Subject: [PATCH 1/3] Added Export button to PartPreviewWindow with functionality. --- CustomWidgets/ExportPrintItemWindow.cs | 6 ++-- PartPreviewWindow/View3DTransfromPart.cs | 43 +++++++++++++++++++++++- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/CustomWidgets/ExportPrintItemWindow.cs b/CustomWidgets/ExportPrintItemWindow.cs index a854bf1f7..d4e8e8977 100644 --- a/CustomWidgets/ExportPrintItemWindow.cs +++ b/CustomWidgets/ExportPrintItemWindow.cs @@ -28,12 +28,12 @@ namespace MatterHackers.MatterControl bool partIsGCode = false; string documentsPath; - public ExportPrintItemWindow(PrintItemWrapper printItemWraper) + public ExportPrintItemWindow(PrintItemWrapper printItemWrapper) : base(400, 250) { - this.printItemWrapper = printItemWraper; + this.printItemWrapper = printItemWrapper; documentsPath = System.Environment.GetFolderPath (System.Environment.SpecialFolder.Personal); - if (Path.GetExtension(printItemWraper.FileLocation).ToUpper() == ".GCODE") + if (Path.GetExtension(printItemWrapper.FileLocation).ToUpper() == ".GCODE") { partIsGCode = true; } diff --git a/PartPreviewWindow/View3DTransfromPart.cs b/PartPreviewWindow/View3DTransfromPart.cs index a1fc4d408..11617838e 100644 --- a/PartPreviewWindow/View3DTransfromPart.cs +++ b/PartPreviewWindow/View3DTransfromPart.cs @@ -60,6 +60,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow public class View3DTransformPart : PartPreview3DWidget { public WindowType windowType { get; set; } + public PrintItemWrapper PrintItemWrapper { + get { return this.printItemWrapper; } + } FlowLayoutWidget viewOptionContainer; FlowLayoutWidget rotateOptionContainer; @@ -88,9 +91,11 @@ namespace MatterHackers.MatterControl.PartPreviewWindow FlowLayoutWidget saveButtons; Button applyScaleButton; - PrintItemWrapper printItemWrapper; + PrintItemWrapper printItemWrapper; bool saveAsWindowIsOpen = false; SaveAsWindow saveAsWindow; + ExportPrintItemWindow exportingWindow; + bool exportingWindowIsOpen = false; List asynchMeshGroupsList = new List(); List asynchMeshGroupTransforms = new List(); @@ -337,7 +342,20 @@ namespace MatterHackers.MatterControl.PartPreviewWindow EnterEditAndSplitIntoMeshes(); }; + Button exportButton = textImageButtonFactory.Generate(LocalizedString.Get("Export")); + exportButton.Margin = new BorderDouble(right: 10); + exportButton.Click += (sender, e) => + { + UiThread.RunOnIdle((state) => + { + OpenExportWindow(); + + }); + + }; + enterEditButtonsContainer.AddChild(enterEdittingButton); + enterEditButtonsContainer.AddChild(exportButton); } editToolBar.AddChild(enterEditButtonsContainer); @@ -489,6 +507,29 @@ namespace MatterHackers.MatterControl.PartPreviewWindow } + private void OpenExportWindow() + { + if (exportingWindowIsOpen == false) + { + exportingWindow = new ExportPrintItemWindow(this.PrintItemWrapper);// + this.exportingWindowIsOpen = true; + exportingWindow.Closed += new EventHandler(ExportQueueItemWindow_Closed); + exportingWindow.ShowAsSystemWindow(); + } + else + { + if (exportingWindow != null) + { + exportingWindow.BringToFront(); + } + } + } + + void ExportQueueItemWindow_Closed(object sender, EventArgs e) + { + this.exportingWindowIsOpen = false; + } + public void ThemeChanged(object sender, EventArgs e) { processingProgressControl.fillColor = ActiveTheme.Instance.PrimaryAccentColor; From 5ab69b0b732aa036dc19287ff9522cbe5d11210f Mon Sep 17 00:00:00 2001 From: gregory-diaz Date: Fri, 10 Oct 2014 15:52:33 -0700 Subject: [PATCH 2/3] Localization of untranslated strings --- .../ApplicationSettings/ApplicationSettingsView.cs | 9 ++++++--- ConfigurationPage/CloudSettings/CloudSettingsView.cs | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs b/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs index 3daaaa55b..49b91c0e7 100644 --- a/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs +++ b/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs @@ -63,7 +63,10 @@ namespace MatterHackers.MatterControl.ConfigurationPage buttonRow.HAnchor = HAnchor.ParentLeftRight; buttonRow.Margin = new BorderDouble(0, 6); - TextWidget settingLabel = new TextWidget(LocalizedString.Get("Theme/Display Options")); + string settingLabelBeggining = LocalizedString.Get("Theme"); + string settingLabelEnd = LocalizedString.Get("Display Options"); + string settingLabelFull = String.Format("{0}/{1}", settingLabelBeggining, settingLabelEnd); + TextWidget settingLabel = new TextWidget(settingLabelFull);//"Theme/Display Options" settingLabel.AutoExpandBoundsToText = true; settingLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor; settingLabel.HAnchor = Agg.UI.HAnchor.ParentLeft; @@ -123,8 +126,8 @@ namespace MatterHackers.MatterControl.ConfigurationPage optionsContainer.AddChild(releaseOptionsDropList); optionsContainer.Width = 200; - MenuItem releaseOptionsDropDownItem = releaseOptionsDropList.AddItem("Normal", "responsive"); - MenuItem preReleaseDropDownItem = releaseOptionsDropList.AddItem("Touchscreen", "touchscreen"); + MenuItem releaseOptionsDropDownItem = releaseOptionsDropList.AddItem(LocalizedString.Get("Normal"), "responsive"); + MenuItem preReleaseDropDownItem = releaseOptionsDropList.AddItem(LocalizedString.Get("Touchscreen"), "touchscreen"); List acceptableUpdateFeedTypeValues = new List() { "responsive", "touchscreen" }; string currentUpdateFeedType = UserSettings.Instance.get("ApplicationDisplayMode"); diff --git a/ConfigurationPage/CloudSettings/CloudSettingsView.cs b/ConfigurationPage/CloudSettings/CloudSettingsView.cs index 0f37a748e..b88c43967 100644 --- a/ConfigurationPage/CloudSettings/CloudSettingsView.cs +++ b/ConfigurationPage/CloudSettings/CloudSettingsView.cs @@ -209,7 +209,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage configureNotificationSettingsButton.VAnchor = VAnchor.ParentCenter; configureNotificationSettingsButton.Click += new ButtonBase.ButtonEventHandler(configureNotificationSettingsButton_Click); - notificationSettingsLabel = new TextWidget("Notification Settings"); + notificationSettingsLabel = new TextWidget(LocalizedString.Get("Notification Settings")); notificationSettingsLabel.AutoExpandBoundsToText = true; notificationSettingsLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor; notificationSettingsLabel.VAnchor = VAnchor.ParentCenter; From 35ed4899d001a78b89170a0ef9cacdf74f97e891 Mon Sep 17 00:00:00 2001 From: gregory-diaz Date: Fri, 10 Oct 2014 15:55:57 -0700 Subject: [PATCH 3/3] More Localizations --- PrintQueue/OptionsMenu/QueueOptionsMenu.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PrintQueue/OptionsMenu/QueueOptionsMenu.cs b/PrintQueue/OptionsMenu/QueueOptionsMenu.cs index 908224346..b5aec1955 100644 --- a/PrintQueue/OptionsMenu/QueueOptionsMenu.cs +++ b/PrintQueue/OptionsMenu/QueueOptionsMenu.cs @@ -87,7 +87,7 @@ namespace MatterHackers.MatterControl.PrintQueue void SetMenuItems() { menuItems = new TupleList>(); - menuItems.Add(new Tuple>("Design", null)); + menuItems.Add(new Tuple>(LocalizedString.Get("Design"), null)); menuItems.Add(new Tuple>(LocalizedString.Get(" Import from Zip"), importQueueFromZipMenu_Click)); menuItems.Add(new Tuple>(LocalizedString.Get(" Export to Zip"), exportQueueToZipMenu_Click)); menuItems.Add(new Tuple>("GCode", null));