Merge remote-tracking branch 'Greg's_Fork/master' into development
This commit is contained in:
commit
a8690d8cc8
21 changed files with 378 additions and 84 deletions
|
|
@ -146,7 +146,10 @@ namespace MatterHackers.MatterControl.ActionBar
|
|||
printerNameText.HAnchor = HAnchor.ParentCenter;
|
||||
printerNameText.TextColor = textColor;
|
||||
|
||||
printerStatusText = new TextWidget("Status: Connected", pointSize:statusTextHeight);
|
||||
string printerStatusTxtBeg = new LocalizedString("Status").Translated;
|
||||
string printerStatusTxtEnd = new LocalizedString("Connected").Translated;
|
||||
string printerStatusTxtFull = string.Format("{0}: {1}", printerStatusTxtBeg, printerStatusTxtEnd);
|
||||
printerStatusText = new TextWidget(printerStatusTxtFull, pointSize:statusTextHeight);
|
||||
printerStatusText.AutoExpandBoundsToText = true;
|
||||
printerStatusText.HAnchor = HAnchor.ParentCenter;
|
||||
printerStatusText.TextColor = textColor;
|
||||
|
|
@ -191,8 +194,9 @@ namespace MatterHackers.MatterControl.ActionBar
|
|||
}
|
||||
else
|
||||
{
|
||||
string statusString = new LocalizedString("Status: {0}").Translated;
|
||||
printerStatusText.Text = string.Format(statusString, PrinterCommunication.Instance.PrinterConnectionStatusVerbose);
|
||||
string statusStringBeg = new LocalizedString ("Status").Translated;
|
||||
string statusString = string.Format("{1}: {0}", PrinterCommunication.Instance.PrinterConnectionStatusVerbose, statusStringBeg);
|
||||
printerStatusText.Text = string.Format(statusString,PrinterCommunication.Instance.PrinterConnectionStatusVerbose);
|
||||
}
|
||||
if (ActivePrinterProfile.Instance.ActivePrinter != null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ namespace MatterHackers.MatterControl
|
|||
case PrinterCommunication.CommunicationStates.Disconnected:
|
||||
return new LocalizedString("Not connected. Press 'Connect' to enable printing.").Translated;
|
||||
case PrinterCommunication.CommunicationStates.AttemptingToConnect:
|
||||
return "Attempting to connect...";
|
||||
return new LocalizedString("Attempting to connect...").Translated;
|
||||
case PrinterCommunication.CommunicationStates.ConnectionLost:
|
||||
case PrinterCommunication.CommunicationStates.FailedToConnect:
|
||||
return new LocalizedString("Unable to communicate with printer.").Translated;
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
if(showExportGCodeButton)
|
||||
{
|
||||
Button exportGCode = textImageButtonFactory.Generate("Export as GCode");
|
||||
Button exportGCode = textImageButtonFactory.Generate(new LocalizedString("Export as GCode").Translated);
|
||||
//exportGCode.HAnchor = Agg.UI.HAnchor.ParentCenter;
|
||||
exportGCode.Click += new ButtonBase.ButtonEventHandler(exportGCode_Click);
|
||||
topToBottom.AddChild(exportGCode);
|
||||
|
|
@ -115,6 +115,22 @@ namespace MatterHackers.MatterControl
|
|||
UiThread.RunOnIdle(DoExportGCode_Click);
|
||||
}
|
||||
|
||||
string GetExtension (string filename)
|
||||
{
|
||||
string extension;
|
||||
int indexOfDot = filename.LastIndexOf(".");
|
||||
if (indexOfDot == -1) {
|
||||
extension = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
extension = filename.Substring (indexOfDot);
|
||||
}
|
||||
|
||||
return extension;
|
||||
}
|
||||
|
||||
|
||||
void DoExportGCode_Click(object state)
|
||||
{
|
||||
SaveFileDialogParams saveParams = new SaveFileDialogParams("Export GCode|*.gcode", title: "Export GCode");
|
||||
|
|
@ -122,9 +138,21 @@ namespace MatterHackers.MatterControl
|
|||
saveParams.ActionButtonLabel = "Export";
|
||||
|
||||
System.IO.Stream streamToSaveTo = FileDialog.SaveFileDialog(ref saveParams);
|
||||
if (streamToSaveTo != null)
|
||||
{
|
||||
streamToSaveTo.Close();
|
||||
if (streamToSaveTo != null)
|
||||
{
|
||||
streamToSaveTo.Close ();
|
||||
|
||||
|
||||
string filePathToSave = saveParams.FileName;
|
||||
string extension = GetExtension(filePathToSave);
|
||||
|
||||
if(extension == "")
|
||||
{
|
||||
filePathToSave += ".gcode";
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (System.IO.Path.GetExtension(printQueueItem.PrintItemWrapper.FileLocation).ToUpper() == ".STL")
|
||||
{
|
||||
pathAndFilenameToSave = saveParams.FileName;
|
||||
|
|
@ -187,22 +215,52 @@ namespace MatterHackers.MatterControl
|
|||
UiThread.RunOnIdle(DoExportSTL_Click);
|
||||
}
|
||||
|
||||
|
||||
string CheckExtension(string fileName)
|
||||
{
|
||||
string extension;
|
||||
int indexOfDot = fileName.LastIndexOf(".");
|
||||
if (indexOfDot == -1)
|
||||
{
|
||||
extension = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
extension = fileName.Substring(indexOfDot);
|
||||
}
|
||||
return extension;
|
||||
}
|
||||
|
||||
void DoExportSTL_Click(object state)
|
||||
{
|
||||
SaveFileDialogParams saveParams = new SaveFileDialogParams("Save as STL|*.stl");
|
||||
SaveFileDialogParams saveParams = new SaveFileDialogParams("Save as STL|*.stl");
|
||||
saveParams.Title = "MatterControl: Export File";
|
||||
saveParams.ActionButtonLabel = "Export";
|
||||
|
||||
System.IO.Stream streamToSaveTo = FileDialog.SaveFileDialog(ref saveParams);
|
||||
if (streamToSaveTo != null)
|
||||
{
|
||||
streamToSaveTo.Close();
|
||||
Close();
|
||||
File.Copy(printQueueItem.PrintItemWrapper.FileLocation, saveParams.FileName, true);
|
||||
ShowFileIfRequested(saveParams.FileName);
|
||||
}
|
||||
|
||||
if (streamToSaveTo != null)
|
||||
{
|
||||
streamToSaveTo.Close ();
|
||||
Close ();
|
||||
}
|
||||
// windows vista +: filePathToSave 'test.stl'
|
||||
// windows xp: filePathToSave 'test'
|
||||
|
||||
string filePathToSave = saveParams.FileName;
|
||||
string extension = CheckExtension(filePathToSave);
|
||||
|
||||
if (extension == "")
|
||||
{
|
||||
|
||||
filePathToSave += ".stl";
|
||||
}
|
||||
|
||||
File.Copy (printQueueItem.PrintItemWrapper.FileLocation, filePathToSave, true);
|
||||
ShowFileIfRequested (filePathToSave);
|
||||
}
|
||||
|
||||
|
||||
void sliceItem_Done(object sender, EventArgs e)
|
||||
{
|
||||
PrintItemWrapper sliceItem = (PrintItemWrapper)sender;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ using System.Text;
|
|||
|
||||
using MatterHackers.Agg;
|
||||
using MatterHackers.Agg.UI;
|
||||
using MatterHackers.Localizations;
|
||||
|
||||
namespace MatterHackers.MatterControl
|
||||
{
|
||||
|
|
@ -19,7 +20,9 @@ namespace MatterHackers.MatterControl
|
|||
: base(300, 500)
|
||||
{
|
||||
BackgroundColor = backgroundColor;
|
||||
Title = "MatterControl - Exporting to Folder";
|
||||
string exportingToFolderTitle = new LocalizedString("MatterControl").Translated;
|
||||
string exportingToFolderTitleFull = new LocalizedString("Exporting to Folder").Translated;
|
||||
Title = string.Format("{0} - {1}", exportingToFolderTitle, exportingToFolderTitleFull);
|
||||
this.totalParts = totalParts;
|
||||
|
||||
feedback.Padding = new BorderDouble(5, 5);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ using System.Text;
|
|||
|
||||
using MatterHackers.Agg;
|
||||
using MatterHackers.Agg.UI;
|
||||
using MatterHackers.Localizations;
|
||||
|
||||
namespace MatterHackers.MatterControl
|
||||
{
|
||||
|
|
@ -18,7 +19,9 @@ namespace MatterHackers.MatterControl
|
|||
: base(300, 500)
|
||||
{
|
||||
BackgroundColor = backgroundColor;
|
||||
Title = "MatterControl - Saving to Parts Sheet";
|
||||
string savePartSheetTitle = new LocalizedString("MatterControl").Translated;
|
||||
string savePartSheetTitleFull = new LocalizedString("Saving to Parts Sheet").Translated;
|
||||
Title = string.Format("{0} - {1}",savePartSheetTitle, savePartSheetTitleFull) ;
|
||||
this.totalParts = totalParts;
|
||||
|
||||
feedback.Padding = new BorderDouble(5, 5);
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ namespace MatterHackers.MatterControl
|
|||
public WizardControl()
|
||||
{
|
||||
Padding = new BorderDouble(10);
|
||||
|
||||
textImageButtonFactory.normalTextColor = RGBA_Bytes.White;
|
||||
textImageButtonFactory.hoverTextColor = RGBA_Bytes.White;
|
||||
textImageButtonFactory.disabledTextColor = new RGBA_Bytes(200, 200, 200);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
//#define DEBUG_SHOW_TRANSLATED_STRINGS
|
||||
#define DEBUG_SHOW_TRANSLATED_STRINGS
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
/*
|
||||
Copyright (c) 2014, Lars Brubaker
|
||||
All rights reserved.
|
||||
|
|
@ -27,6 +28,7 @@ of the authors and should not be interpreted as representing official policies,
|
|||
either expressed or implied, of the FreeBSD Project.
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
|
@ -336,9 +338,9 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
void NumQueueItemsChanged(object sender, EventArgs widgetEvent)
|
||||
{
|
||||
|
||||
string queueString = new LocalizedString("Queue ({0})").Translated;
|
||||
QueueTabPage.Text = string.Format(queueString, PrintQueue.PrintQueueControl.Instance.Count);
|
||||
string queueStringBeg = new LocalizedString("Queue").Translated;
|
||||
string queueString = string.Format("{1} ({0})",PrintQueue.PrintQueueControl.Instance.Count, queueStringBeg);
|
||||
QueueTabPage.Text = string.Format(queueString, PrintQueue.PrintQueueControl.Instance.Count);
|
||||
}
|
||||
|
||||
private void onThemeChanged(object sender, EventArgs e)
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@
|
|||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
<ReleaseVersion>0.8.2</ReleaseVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
|
|
@ -106,7 +105,9 @@
|
|||
<Compile Include="WidescreenPanel.cs" />
|
||||
<Compile Include="PrintLevelWizard.cs" />
|
||||
<Compile Include="ContactForm.cs" />
|
||||
<Compile Include="CustomWidgets\ClickWidget.cs" />
|
||||
<Compile Include="CustomWidgets\ClickWidget.cs">
|
||||
<DependentUpon>ExportQueueItemWindow.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="CustomWidgets\SavePartsSheetFeedbackWindow.cs" />
|
||||
<Compile Include="CustomWidgets\DropDownMenuWidget.cs" />
|
||||
<Compile Include="ControlElements\ImageButtonFactory.cs" />
|
||||
|
|
@ -314,10 +315,6 @@
|
|||
<Project>{670BDDFF-927B-425D-9DD1-22ACB14356EB}</Project>
|
||||
<Name>PlatformWin32</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\agg-sharp\agg\Agg.csproj">
|
||||
<Project>{657DBC6D-C3EA-4398-A3FA-DDB73C14F71B}</Project>
|
||||
<Name>Agg</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="Localizations\Localizations.csproj">
|
||||
<Project>{CA96058C-1A37-465D-A357-D6D695B13D25}</Project>
|
||||
<Name>Localizations</Name>
|
||||
|
|
@ -326,5 +323,9 @@
|
|||
<Project>{865172A0-A1A9-49C2-9386-F2FDB4E141B7}</Project>
|
||||
<Name>MatterControlPluginSystem</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\agg-sharp\Agg\Agg.csproj">
|
||||
<Project>{657DBC6D-C3EA-4398-A3FA-DDB73C14F71B}</Project>
|
||||
<Name>Agg</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -1,15 +1,26 @@
|
|||
<Properties>
|
||||
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
|
||||
<MonoDevelop.Ide.Workbench ActiveDocument="PrintLevelWizard.cs">
|
||||
<MonoDevelop.Ide.Workbench ActiveDocument="MainSlidePanel.cs">
|
||||
<Files>
|
||||
<File FileName="MatterControlApplication.cs" Line="1" Column="1" />
|
||||
<File FileName="PrinterCommunication.cs" Line="1" Column="1" />
|
||||
<File FileName="PrinterControls\PrinterConnections\ConnectionWindow.cs" Line="1" Column="1" />
|
||||
<File FileName="WidescreenPanel.cs" Line="1" Column="1" />
|
||||
<File FileName="PrintQueue\QueueControlsWidget.cs" Line="1" Column="1" />
|
||||
<File FileName="PrintLibrary\ExportLibraryItemWindow.cs" Line="1" Column="1" />
|
||||
<File FileName="MainSlidePanel.cs" Line="328" Column="14" />
|
||||
<File FileName="CustomWidgets\WizardControl.cs" Line="1" Column="1" />
|
||||
<File FileName="PartPreviewWindow\PartPreviewMainWindow.cs" Line="1" Column="1" />
|
||||
<File FileName="CustomWidgets\SavePartsSheetFeedbackWindow.cs" Line="1" Column="1" />
|
||||
<File FileName="Localizations\LocalizedString.cs" Line="1" Column="1" />
|
||||
<File FileName="c:\Users\Matter Hackers 1\Development\agg-sharp\Gui\GUIWidget.cs" Line="2116" Column="1" />
|
||||
<File FileName="PrintLevelWizard.cs" Line="392" Column="40" />
|
||||
<File FileName="PrintQueue\PrintQueueItem.cs" Line="1" Column="1" />
|
||||
<File FileName="c:\Users\Matter Hackers 1\Development\agg-sharp\Gui\SystemWindow.cs" Line="1" Column="1" />
|
||||
<File FileName="PrintLibrary\PrintLibraryListItem.cs" Line="1" Column="1" />
|
||||
</Files>
|
||||
</MonoDevelop.Ide.Workbench>
|
||||
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||
<BreakpointStore />
|
||||
<BreakpointStore>
|
||||
<Breakpoint file="C:\Users\Matter Hackers 1\Development\mattercontrol\PrintQueue\PrintQueueMenu.cs" line="148" column="1" />
|
||||
</BreakpointStore>
|
||||
</MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||
<MonoDevelop.Ide.DebuggingService.PinnedWatches />
|
||||
</Properties>
|
||||
|
|
@ -38,6 +38,7 @@ using MatterHackers.MatterControl.DataStorage;
|
|||
using MatterHackers.MatterControl.PrintQueue;
|
||||
using MatterHackers.MatterControl.SlicerConfiguration;
|
||||
using MatterHackers.VectorMath;
|
||||
using MatterHackers.Localizations;
|
||||
|
||||
namespace MatterHackers.MatterControl.PartPreviewWindow
|
||||
{
|
||||
|
|
@ -50,7 +51,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
public PartPreviewMainWindow(PrintItemWrapper printItem)
|
||||
: base(690, 340)
|
||||
{
|
||||
Title = "MatterControl: " + Path.GetFileName(printItem.Name);
|
||||
string partPreviewTitle = new LocalizedString ("MatterControl").Translated;
|
||||
Title = string.Format("{0}: ", partPreviewTitle) + Path.GetFileName(printItem.Name);
|
||||
|
||||
BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
|
||||
|
||||
|
|
|
|||
|
|
@ -9,8 +9,12 @@ using MatterHackers.Agg.UI;
|
|||
using MatterHackers.MatterControl.DataStorage;
|
||||
using MatterHackers.MatterControl.PrintQueue;
|
||||
using MatterHackers.GCodeVisualizer;
|
||||
|
||||
using MatterHackers.Localizations;
|
||||
|
||||
using MatterHackers.MatterControl.SlicerConfiguration;
|
||||
|
||||
|
||||
namespace MatterHackers.MatterControl.PrintLibrary
|
||||
{
|
||||
public class ExportLibraryItemWindow : SystemWindow
|
||||
|
|
@ -28,7 +32,9 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
partIsGCode = true;
|
||||
}
|
||||
|
||||
this.Title = "MatterControl: Export File";
|
||||
string exportLibraryFileTitle = new LocalizedString("MatterControl").Translated;
|
||||
string exportLibraryFileTitleFull = new LocalizedString("Export File").Translated;
|
||||
this.Title = string.Format("{0}: {1}", exportLibraryFileTitle, exportLibraryFileTitleFull);
|
||||
this.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
|
||||
|
||||
// TODO: Complete member initialization
|
||||
|
|
@ -47,7 +53,8 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
topToBottom.Padding = new BorderDouble(10);
|
||||
topToBottom.AnchorAll();
|
||||
|
||||
TextWidget exportLabel = new TextWidget("File export options:");
|
||||
string fileExportLabelTxt = new LocalizedString("File export options").Translated;
|
||||
TextWidget exportLabel = new TextWidget(string.Format("{0}:", fileExportLabelTxt));
|
||||
exportLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
topToBottom.AddChild(exportLabel);
|
||||
|
||||
|
|
@ -60,7 +67,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
|
||||
if (!partIsGCode)
|
||||
{
|
||||
Button exportSTL = textImageButtonFactory.Generate("Export as STL");
|
||||
Button exportSTL = textImageButtonFactory.Generate(new LocalizedString("Export as STL").Translated);
|
||||
exportSTL.Click += new ButtonBase.ButtonEventHandler(exportSTL_Click);
|
||||
//exportSTL.HAnchor = Agg.UI.HAnchor.ParentCenter;
|
||||
topToBottom.AddChild(exportSTL);
|
||||
|
|
@ -70,7 +77,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
|
||||
if (showExportGCodeButton)
|
||||
{
|
||||
Button exportGCode = textImageButtonFactory.Generate("Export as GCode");
|
||||
Button exportGCode = textImageButtonFactory.Generate(new LocalizedString("Export as GCode").Translated);
|
||||
//exportGCode.HAnchor = Agg.UI.HAnchor.ParentCenter;
|
||||
exportGCode.Click += new ButtonBase.ButtonEventHandler(exportGCode_Click);
|
||||
topToBottom.AddChild(exportGCode);
|
||||
|
|
@ -82,14 +89,16 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
|
||||
if (!showExportGCodeButton)
|
||||
{
|
||||
TextWidget noGCodeMessage = new TextWidget("Note: To enable GCode export, select a printer profile.", textColor: RGBA_Bytes.White, pointSize: 10);
|
||||
string noGCodeMessageText = new LocalizedString("Note").Translated;
|
||||
string noGCodeMessageTextFull = new LocalizedString("To enable GCode export, select a printer profile").Translated;
|
||||
TextWidget noGCodeMessage = new TextWidget(string.Format("{0}: {1}.", noGCodeMessageText, noGCodeMessageTextFull), textColor: RGBA_Bytes.White, pointSize: 10);
|
||||
topToBottom.AddChild(noGCodeMessage);
|
||||
}
|
||||
|
||||
// TODO: make this work on the mac and then delete this if
|
||||
if (MatterHackers.Agg.UI.WindowsFormsAbstract.GetOSType() == WindowsFormsAbstract.OSType.Windows)
|
||||
{
|
||||
showInFolderAfterSave = new CheckBox("Show file in folder after save", RGBA_Bytes.White, 10);
|
||||
showInFolderAfterSave = new CheckBox(new LocalizedString("Show file in folder after save").Translated, RGBA_Bytes.White, 10);
|
||||
showInFolderAfterSave.Margin = new BorderDouble(top: 10);
|
||||
topToBottom.AddChild(showInFolderAfterSave);
|
||||
}
|
||||
|
|
@ -102,6 +111,21 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
UiThread.RunOnIdle(DoExportGCode_Click);
|
||||
}
|
||||
|
||||
string GetExtension (string filename)
|
||||
{
|
||||
string extension;
|
||||
int indexOfDot = filename.LastIndexOf(".");
|
||||
if (indexOfDot == -1)
|
||||
{
|
||||
extension = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
extension = filename.Substring(indexOfDot);
|
||||
}
|
||||
return extension;
|
||||
}
|
||||
|
||||
void DoExportGCode_Click(object state)
|
||||
{
|
||||
SaveFileDialogParams saveParams = new SaveFileDialogParams("Export GCode|*.gcode", title: "Export GCode");
|
||||
|
|
@ -112,6 +136,16 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
if (streamToSaveTo != null)
|
||||
{
|
||||
streamToSaveTo.Close();
|
||||
|
||||
|
||||
string filePathToSave = saveParams.FileName;
|
||||
string extension = GetExtension(filePathToSave);
|
||||
|
||||
if(extension == "")
|
||||
{
|
||||
filePathToSave += ".gcode";
|
||||
}
|
||||
|
||||
if (System.IO.Path.GetExtension(printQueueItem.printItem.FileLocation).ToUpper() == ".STL")
|
||||
{
|
||||
pathAndFilenameToSave = saveParams.FileName;
|
||||
|
|
@ -174,6 +208,22 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
UiThread.RunOnIdle(DoExportSTL_Click);
|
||||
}
|
||||
|
||||
|
||||
string CheckExtension(string fileName)
|
||||
{
|
||||
string extension;
|
||||
int indexOfDot = fileName.LastIndexOf(".");
|
||||
if (indexOfDot == -1)
|
||||
{
|
||||
extension = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
extension = fileName.Substring(indexOfDot);
|
||||
}
|
||||
return extension;
|
||||
}
|
||||
|
||||
void DoExportSTL_Click(object state)
|
||||
{
|
||||
SaveFileDialogParams saveParams = new SaveFileDialogParams("Save as STL|*.stl");
|
||||
|
|
@ -181,13 +231,24 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
saveParams.ActionButtonLabel = "Export";
|
||||
|
||||
System.IO.Stream streamToSaveTo = FileDialog.SaveFileDialog(ref saveParams);
|
||||
if (streamToSaveTo != null)
|
||||
{
|
||||
streamToSaveTo.Close();
|
||||
Close();
|
||||
File.Copy(printQueueItem.printItem.FileLocation, saveParams.FileName, true);
|
||||
ShowFileIfRequested(saveParams.FileName);
|
||||
}
|
||||
if (streamToSaveTo != null)
|
||||
{
|
||||
streamToSaveTo.Close ();
|
||||
Close ();
|
||||
}
|
||||
|
||||
|
||||
string filePathToSave = saveParams.FileName;
|
||||
string extension = CheckExtension(filePathToSave);
|
||||
|
||||
if(extension == "")
|
||||
{
|
||||
filePathToSave += ".stl";
|
||||
}
|
||||
|
||||
File.Copy(printQueueItem.printItem.FileLocation, filePathToSave, true);
|
||||
ShowFileIfRequested(filePathToSave);
|
||||
|
||||
}
|
||||
|
||||
void sliceItem_Done(object sender, EventArgs e)
|
||||
|
|
|
|||
13
PrintLibrary/ExportLibraryItemWindow.cs.rej
Normal file
13
PrintLibrary/ExportLibraryItemWindow.cs.rej
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
diff a/PrintLibrary/ExportLibraryItemWindow.cs b/PrintLibrary/ExportLibraryItemWindow.cs (rejected hunks)
|
||||
@@ -9,7 +9,11 @@
|
||||
using MatterHackers.MatterControl.DataStorage;
|
||||
using MatterHackers.MatterControl.PrintQueue;
|
||||
using MatterHackers.GCodeVisualizer;
|
||||
+<<<<<<< HEAD
|
||||
using MatterHackers.Localizations;
|
||||
+=======
|
||||
+using MatterHackers.MatterControl.SlicerConfiguration;
|
||||
+>>>>>>> upstream/development
|
||||
|
||||
namespace MatterHackers.MatterControl.PrintLibrary
|
||||
{
|
||||
|
|
@ -25,7 +25,6 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
public class LibraryThumbnailWidget : ClickWidget
|
||||
{
|
||||
static Thread thumbNailThread = null;
|
||||
|
||||
private PrintItemWrapper printItem;
|
||||
public PrintItemWrapper PrintItem
|
||||
{
|
||||
|
|
@ -202,7 +201,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
//this.thumbNailHasBeenRequested = false;
|
||||
this.Invalidate();
|
||||
}
|
||||
|
||||
|
||||
private void onMouseClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (printItem != null)
|
||||
|
|
@ -210,7 +209,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
string pathAndFile = printItem.FileLocation;
|
||||
if (File.Exists(pathAndFile))
|
||||
{
|
||||
new PartPreviewMainWindow(printItem);
|
||||
new PartPreviewMainWindow(printItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -281,6 +280,34 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
public CheckBox selectionCheckBox;
|
||||
FlowLayoutWidget buttonContainer;
|
||||
LinkButtonFactory linkButtonFactory = new LinkButtonFactory();
|
||||
bool exportWindowIsOpen = false;
|
||||
bool viewWindowIsOpen = false;
|
||||
PartPreviewMainWindow viewingWindow;
|
||||
ExportLibraryItemWindow exportingWindow;
|
||||
|
||||
private void OpenExportWindow()
|
||||
{
|
||||
if (exportWindowIsOpen == false)
|
||||
{
|
||||
exportingWindow = new ExportLibraryItemWindow(this);
|
||||
this.exportWindowIsOpen = true;
|
||||
exportingWindow.Closed += new EventHandler(ExportLibraryItemWindow_Closed);
|
||||
exportingWindow.ShowAsSystemWindow ();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (exportingWindow != null)
|
||||
{
|
||||
exportingWindow.BringToFront ();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void ExportLibraryItemWindow_Closed(object sender, EventArgs e)
|
||||
{
|
||||
this.exportWindowIsOpen = false;
|
||||
}
|
||||
|
||||
public PrintLibraryListItem(PrintItemWrapper printItem)
|
||||
{
|
||||
|
|
@ -352,8 +379,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
|
||||
exportLink.Click += (sender, e) =>
|
||||
{
|
||||
ExportLibraryItemWindow exportingWindow = new ExportLibraryItemWindow(this);
|
||||
exportingWindow.ShowAsSystemWindow();
|
||||
OpenExportWindow();
|
||||
};
|
||||
|
||||
removeLink = linkButtonFactory.Generate(new LocalizedString("Remove").Translated);
|
||||
|
|
@ -458,13 +484,38 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
UiThread.RunOnIdle(onViewLinkClick);
|
||||
}
|
||||
|
||||
|
||||
private void OpenPartViewWindow()
|
||||
{
|
||||
if (viewWindowIsOpen == false)
|
||||
{
|
||||
viewingWindow = new PartPreviewMainWindow(this.printItem);
|
||||
this.viewWindowIsOpen = true;
|
||||
viewingWindow.Closed += new EventHandler(PartPreviewMainWindow_Closed);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(viewingWindow != null)
|
||||
{
|
||||
viewingWindow.BringToFront();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void PartPreviewMainWindow_Closed(object sender, EventArgs e)
|
||||
{
|
||||
viewWindowIsOpen = false;
|
||||
}
|
||||
|
||||
|
||||
private void onViewLinkClick(object state)
|
||||
{
|
||||
string pathAndFile = this.printItem.FileLocation;
|
||||
Console.WriteLine(pathAndFile);
|
||||
if (File.Exists(pathAndFile))
|
||||
{
|
||||
new PartPreviewMainWindow(this.printItem);
|
||||
OpenPartViewWindow ();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -32,6 +32,11 @@ namespace MatterHackers.MatterControl.PrintQueue
|
|||
TextWidget partStatus;
|
||||
FlowLayoutWidget editControls;
|
||||
LinkButtonFactory linkButtonFactory = new LinkButtonFactory();
|
||||
ExportQueueItemWindow exportingWindow;
|
||||
PartPreviewMainWindow viewingWindow;
|
||||
bool exportingWindowIsOpen = false;
|
||||
bool viewWindowIsOpen = false;
|
||||
|
||||
|
||||
public PrintQueueItem(PrintItemWrapper printItem)
|
||||
{
|
||||
|
|
@ -81,7 +86,6 @@ namespace MatterHackers.MatterControl.PrintQueue
|
|||
{
|
||||
string labelName = textInfo.ToTitleCase(PrintItemWrapper.Name);
|
||||
labelName = labelName.Replace('_', ' ');
|
||||
labelName = new LocalizedString (labelName).Translated;
|
||||
partLabel = new TextWidget(labelName, pointSize: 14);
|
||||
partLabel.TextColor = WidgetTextColor;
|
||||
partLabel.MinimumSize = new Vector2(1, 16);
|
||||
|
|
@ -114,6 +118,51 @@ namespace MatterHackers.MatterControl.PrintQueue
|
|||
AddHandlers();
|
||||
}
|
||||
|
||||
private void OpenExportWindow()
|
||||
{
|
||||
if(exportingWindowIsOpen == false)
|
||||
{
|
||||
exportingWindow = new ExportQueueItemWindow (this);
|
||||
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;
|
||||
}
|
||||
|
||||
private void OpenViewWindow()
|
||||
{
|
||||
if (viewWindowIsOpen == false)
|
||||
{
|
||||
viewingWindow = new PartPreviewMainWindow(PrintItemWrapper);
|
||||
this.viewWindowIsOpen = true;
|
||||
viewingWindow.Closed += new EventHandler(PartPreviewWindow_Closed);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(viewingWindow != null)
|
||||
{
|
||||
viewingWindow.BringToFront();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PartPreviewWindow_Closed(object sender, EventArgs e)
|
||||
{
|
||||
this.viewWindowIsOpen = false;
|
||||
}
|
||||
|
||||
private void CreateEditControls()
|
||||
{
|
||||
editControls = new FlowLayoutWidget();
|
||||
|
|
@ -129,10 +178,11 @@ namespace MatterHackers.MatterControl.PrintQueue
|
|||
Button viewLink = linkButtonFactory.Generate(new LocalizedString("View").Translated);
|
||||
viewLink.Click += (sender, e) =>
|
||||
{
|
||||
|
||||
string pathAndFile = PrintItemWrapper.FileLocation;
|
||||
if (File.Exists(pathAndFile))
|
||||
{
|
||||
new PartPreviewMainWindow(PrintItemWrapper);
|
||||
OpenViewWindow();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -165,8 +215,8 @@ namespace MatterHackers.MatterControl.PrintQueue
|
|||
Button exportLink = linkButtonFactory.Generate(new LocalizedString("Export").Translated);
|
||||
exportLink.Click += (sender, e) =>
|
||||
{
|
||||
ExportQueueItemWindow exportingWindow = new ExportQueueItemWindow(this);
|
||||
exportingWindow.ShowAsSystemWindow();
|
||||
OpenExportWindow();
|
||||
|
||||
};
|
||||
layoutLeftToRight.AddChild(exportLink);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,10 @@ namespace MatterHackers.MatterControl.PrintQueue
|
|||
public DropDownMenu MenuDropList;
|
||||
private TupleList<string, Func<bool>> menuItems;
|
||||
|
||||
|
||||
ExportToFolderFeedbackWindow exportingWindow;
|
||||
bool exportingWindowIsOpen = false;
|
||||
|
||||
public PrintQueueMenu()
|
||||
{
|
||||
MenuDropList = new DropDownMenu(new LocalizedString("Queue Options").Translated, Direction.Up);
|
||||
|
|
@ -98,8 +102,10 @@ namespace MatterHackers.MatterControl.PrintQueue
|
|||
if (parts.Count > 0)
|
||||
{
|
||||
SaveFileDialogParams saveParams = new SaveFileDialogParams("Save Parts Sheet|*.pdf");
|
||||
saveParams.ActionButtonLabel = "Save Parts Sheet";
|
||||
saveParams.Title = "MatterControl: Save";
|
||||
saveParams.ActionButtonLabel = new LocalizedString("Save Parts Sheet").Translated;
|
||||
string saveParamsTitleLbl = new LocalizedString("MatterContol").Translated;
|
||||
string saveParamsTitleLblFull = new LocalizedString ("Save").Translated;
|
||||
saveParams.Title = string.Format("{0}: {1}",saveParamsTitleLbl,saveParamsTitleLblFull);
|
||||
|
||||
System.IO.Stream streamToSaveTo = FileDialog.SaveFileDialog(ref saveParams);
|
||||
if (streamToSaveTo != null)
|
||||
|
|
@ -136,10 +142,35 @@ namespace MatterHackers.MatterControl.PrintQueue
|
|||
return true;
|
||||
}
|
||||
|
||||
private static void SelectLocationToExportGCode(object state)
|
||||
|
||||
private void OpenExportWindow(List<PrintItem> parts)
|
||||
{
|
||||
if (this.exportingWindowIsOpen == false)
|
||||
{
|
||||
exportingWindow = new ExportToFolderFeedbackWindow(parts.Count, parts [0].Name, ActiveTheme.Instance.PrimaryBackgroundColor);
|
||||
this.exportingWindowIsOpen = true;
|
||||
exportingWindow.Closed += new EventHandler(ExportToFolderFeedbackWindow_Closed);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (exportingWindow != null)
|
||||
{
|
||||
exportingWindow.BringToFront();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ExportToFolderFeedbackWindow_Closed(object sender, EventArgs e)
|
||||
{
|
||||
this.exportingWindowIsOpen = false;
|
||||
}
|
||||
|
||||
|
||||
private void SelectLocationToExportGCode(object state)
|
||||
{
|
||||
SelectFolderDialogParams selectParams = new SelectFolderDialogParams("Select Location To Save Files");
|
||||
selectParams.ActionButtonLabel = "Export";
|
||||
selectParams.ActionButtonLabel = new LocalizedString("Export").Translated;
|
||||
selectParams.Title = "MatterControl: Select A Folder";
|
||||
|
||||
string path = FileDialog.SelectFolderDialog(ref selectParams);
|
||||
|
|
@ -148,10 +179,8 @@ namespace MatterHackers.MatterControl.PrintQueue
|
|||
List<PrintItem> parts = PrintQueueControl.Instance.CreateReadOnlyPartList();
|
||||
if (parts.Count > 0)
|
||||
{
|
||||
ExportToFolderFeedbackWindow exportingWindow = new ExportToFolderFeedbackWindow(parts.Count, parts[0].Name, ActiveTheme.Instance.PrimaryBackgroundColor);
|
||||
exportingWindow.ShowAsSystemWindow();
|
||||
|
||||
ExportToFolderProcess exportToFolderProcess = new ExportToFolderProcess(parts, path);
|
||||
OpenExportWindow (parts);
|
||||
ExportToFolderProcess exportToFolderProcess = new ExportToFolderProcess(parts, path);
|
||||
exportToFolderProcess.StartingNextPart += exportingWindow.StartingNextPart;
|
||||
exportToFolderProcess.UpdatePartStatus += exportingWindow.UpdatePartStatus;
|
||||
exportToFolderProcess.DoneSaving += exportingWindow.DoneSaving;
|
||||
|
|
|
|||
|
|
@ -482,25 +482,25 @@ namespace MatterHackers.MatterControl
|
|||
switch (CommunicationState)
|
||||
{
|
||||
case CommunicationStates.Disconnected:
|
||||
return "Not Connected";
|
||||
return new LocalizedString("Not Connected").Translated;
|
||||
case CommunicationStates.Disconnecting:
|
||||
return "Disconnecting";
|
||||
return new LocalizedString("Disconnecting").Translated;
|
||||
case CommunicationStates.AttemptingToConnect:
|
||||
return "Connecting...";
|
||||
case CommunicationStates.ConnectionLost:
|
||||
return "Connection Lost";
|
||||
return new LocalizedString("Connection Lost").Translated;
|
||||
case CommunicationStates.FailedToConnect:
|
||||
return string.Format("Unable to Connect");
|
||||
case CommunicationStates.Connected:
|
||||
return "Connected";
|
||||
return new LocalizedString("Connected").Translated;
|
||||
case CommunicationStates.PreparingToPrint:
|
||||
return "Preparing To Print";
|
||||
return new LocalizedString("Preparing To Print").Translated;
|
||||
case CommunicationStates.Printing:
|
||||
return "Printing";
|
||||
return new LocalizedString("Printing").Translated;
|
||||
case CommunicationStates.Paused:
|
||||
return "Paused";
|
||||
return new LocalizedString("Paused").Translated;
|
||||
case CommunicationStates.FinishedPrint:
|
||||
return "Finished Print";
|
||||
return new LocalizedString("Finished Print").Translated;
|
||||
default:
|
||||
throw new NotImplementedException("Make sure very satus returns the correct connected state.");
|
||||
}
|
||||
|
|
@ -1071,7 +1071,7 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
//Create and start connection thread
|
||||
connectThread = new Thread(Connect_Thread);
|
||||
connectThread.Name = "Connect To Printer";
|
||||
connectThread.Name = "Connect To Printer";
|
||||
connectThread.IsBackground = true;
|
||||
connectThread.Start();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ using MatterHackers.Agg.UI;
|
|||
using MatterHackers.VectorMath;
|
||||
using MatterHackers.Agg.Image;
|
||||
using MatterHackers.MatterControl.DataStorage;
|
||||
using MatterHackers.Localizations;
|
||||
|
||||
namespace MatterHackers.MatterControl
|
||||
{
|
||||
|
|
@ -50,7 +51,7 @@ namespace MatterHackers.MatterControl
|
|||
public EditManualMovementSpeedsWindow(string windowTitle, string movementSpeedsString, EventHandler functionToCallOnSave)
|
||||
: base(260, 300)
|
||||
{
|
||||
Title = windowTitle;
|
||||
Title = new LocalizedString(windowTitle).Translated;
|
||||
|
||||
FlowLayoutWidget topToBottom = new FlowLayoutWidget(FlowDirection.TopToBottom);
|
||||
topToBottom.AnchorAll();
|
||||
|
|
@ -62,7 +63,8 @@ namespace MatterHackers.MatterControl
|
|||
headerRow.Padding = new BorderDouble(0, 3, 0, 3);
|
||||
|
||||
{
|
||||
TextWidget elementHeader = new TextWidget(string.Format("Movement Speeds Presets:"), pointSize: 14);
|
||||
string movementSpeedsLbl = new LocalizedString("Movement Speeds Presets").Translated;
|
||||
TextWidget elementHeader = new TextWidget(string.Format("{0}:",movementSpeedsLbl), pointSize: 14);
|
||||
elementHeader.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
elementHeader.HAnchor = HAnchor.ParentLeftRight;
|
||||
elementHeader.VAnchor = Agg.UI.VAnchor.ParentBottom;
|
||||
|
|
@ -131,11 +133,13 @@ namespace MatterHackers.MatterControl
|
|||
if (settingsArray[i].StartsWith("e"))
|
||||
{
|
||||
int extruderIndex = (int)double.Parse(settingsArray[i].Substring(1)) + 1;
|
||||
axisLabel = new TextWidget(string.Format("Extruder {0}", extruderIndex), textColor: ActiveTheme.Instance.PrimaryTextColor);
|
||||
string extruderLblTxt = new LocalizedString ("Extruder").Translated;
|
||||
axisLabel = new TextWidget(string.Format("{0} {1}",extruderLblTxt ,extruderIndex), textColor: ActiveTheme.Instance.PrimaryTextColor);
|
||||
}
|
||||
else
|
||||
{
|
||||
axisLabel = new TextWidget(string.Format("Axis {0}", settingsArray[i]), textColor: ActiveTheme.Instance.PrimaryTextColor);
|
||||
string axisLblText = new LocalizedString("Axis").Translated;
|
||||
axisLabel = new TextWidget(string.Format("{0} {1}",axisLblText, settingsArray[i]), textColor: ActiveTheme.Instance.PrimaryTextColor);
|
||||
}
|
||||
axisLabel.VAnchor = VAnchor.ParentCenter;
|
||||
leftRightEdit.AddChild(axisLabel);
|
||||
|
|
@ -165,10 +169,10 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
ShowAsSystemWindow();
|
||||
|
||||
Button savePresetsButton = textImageButtonFactory.Generate("Save");
|
||||
Button savePresetsButton = textImageButtonFactory.Generate(new LocalizedString("Save").Translated);
|
||||
savePresetsButton.Click += new ButtonBase.ButtonEventHandler(save_Click);
|
||||
|
||||
Button cancelPresetsButton = textImageButtonFactory.Generate("Cancel");
|
||||
Button cancelPresetsButton = textImageButtonFactory.Generate(new LocalizedString("Cancel").Translated);
|
||||
cancelPresetsButton.Click += (sender, e) => { Close(); };
|
||||
|
||||
FlowLayoutWidget buttonRow = new FlowLayoutWidget();
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ namespace MatterHackers.MatterControl
|
|||
public EditTemperaturePresetsWindow(string windowTitle, string temperatureSettings, EventHandler functionToCallOnSave)
|
||||
: base(360, 300)
|
||||
{
|
||||
Title = windowTitle;
|
||||
Title = new LocalizedString(windowTitle).Translated;
|
||||
|
||||
FlowLayoutWidget topToBottom = new FlowLayoutWidget(FlowDirection.TopToBottom);
|
||||
topToBottom.AnchorAll();
|
||||
|
|
|
|||
|
|
@ -24,7 +24,10 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
public ConnectionWindow()
|
||||
: base(350, 500)
|
||||
{
|
||||
Title = new LocalizedString("MatterControl - Connect to Printer").Translated;
|
||||
string connectToPrinterTitle = new LocalizedString("MatterControl").Translated;
|
||||
string connectToPrinterTitleEnd = new LocalizedString ("Connect to Printer").Translated;
|
||||
Title = string.Format("{0} - {1}",connectToPrinterTitle,connectToPrinterTitleEnd);
|
||||
|
||||
if (GetPrinterRecordCount() > 0)
|
||||
{
|
||||
ChangeToChoosePrinter();
|
||||
|
|
|
|||
|
|
@ -322,7 +322,7 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
void NumQueueItemsChanged(object sender, EventArgs widgetEvent)
|
||||
{
|
||||
string queueString = new LocalizedString("Queue ({0})").Translated;
|
||||
string queueString = "Queue ({0})";
|
||||
QueueTabPage.Text = string.Format(queueString, PrintQueue.PrintQueueControl.Instance.Count);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue