Updated fix to XP file extension problem

This commit is contained in:
gregory-diaz 2014-02-19 18:42:52 -08:00
parent fc32be16f0
commit 02f5179ab6
2 changed files with 14 additions and 19 deletions

View file

@ -70,10 +70,10 @@ namespace MatterHackers.MatterControl
string exportStlTxt = new LocalizedString("Export as").Translated;
string exportStlTxtFull = string.Format("{0} STL", exportStlTxt);
Button exportSTL = textImageButtonFactory.Generate(exportStlTxtFull);
exportSTL.Click += new ButtonBase.ButtonEventHandler(exportSTL_Click);
Button exportAsStlButton = textImageButtonFactory.Generate(exportStlTxtFull);
exportAsStlButton.Click += new ButtonBase.ButtonEventHandler(exportSTL_Click);
//exportSTL.HAnchor = Agg.UI.HAnchor.ParentCenter;
topToBottom.AddChild(exportSTL);
topToBottom.AddChild(exportAsStlButton);
}
bool showExportGCodeButton = ActivePrinterProfile.Instance.ActivePrinter != null || partIsGCode;
@ -142,19 +142,17 @@ namespace MatterHackers.MatterControl
if (streamToSaveTo != null)
{
streamToSaveTo.Close ();
string filePathToSave = saveParams.FileName;
string extension = GetExtension(filePathToSave);
if(extension == "")
{
File.Delete (filePathToSave);
filePathToSave += ".gcode";
}
if (System.IO.Path.GetExtension(printQueueItem.PrintItemWrapper.FileLocation).ToUpper() == ".STL")
{
pathAndFilenameToSave = saveParams.FileName;
Close();
SlicingQueue.Instance.QueuePartForSlicing(printQueueItem.PrintItemWrapper);
printQueueItem.PrintItemWrapper.Done += new EventHandler(sliceItem_Done);
@ -162,7 +160,7 @@ namespace MatterHackers.MatterControl
else if (partIsGCode)
{
Close();
SaveGCodeToNewLocation(printQueueItem.PrintItemWrapper.FileLocation, saveParams.FileName);
SaveGCodeToNewLocation(printQueueItem.PrintItemWrapper.FileLocation, filePathToSave);
}
}
}
@ -250,9 +248,9 @@ namespace MatterHackers.MatterControl
string extension = CheckExtension(filePathToSave);
if (extension == "")
{
File.Delete (filePathToSave);
filePathToSave += ".stl";
}
File.Copy (printQueueItem.PrintItemWrapper.FileLocation, filePathToSave, true);
ShowFileIfRequested (filePathToSave);
}

View file

@ -1,22 +1,19 @@
<Properties>
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
<MonoDevelop.Ide.Workbench ActiveDocument="..\MatterControlPlugins\PrintNotifications\NotificationForm.cs">
<MonoDevelop.Ide.Workbench ActiveDocument="Localizations\LocalizedString.cs">
<Files>
<File FileName="Localizations\LocalizedString.cs" Line="18" Column="14" />
<File FileName="Localizations\LocalizedString.cs" Line="14" Column="10" />
<File FileName="PrintLibrary\PrintLibraryListItem.cs" Line="1" Column="1" />
<File FileName="ActionBar\ActionBarBaseControls.cs" Line="218" Column="49" />
<File FileName="ActionBar\HelpTextWidget.cs" Line="145" Column="8" />
<File FileName="ActionBar\ActionBarBaseControls.cs" Line="1" Column="1" />
<File FileName="ActionBar\HelpTextWidget.cs" Line="1" Column="1" />
<File FileName="PrintQueue\PrintQueueMenu.cs" Line="1" Column="1" />
<File FileName="CustomWidgets\ExportQueueItemWindow.cs" Line="255" Column="5" />
<File FileName="ActionBar\ActionBarPlus.cs" Line="69" Column="23" />
<File FileName="ActionBar\PrintActionRow.cs" Line="15" Column="46" />
<File FileName="..\MatterControlPlugins\PrintNotifications\NotificationForm.cs" Line="210" Column="65" />
<File FileName="..\MatterControlPlugins\PrintNotifications\NotificationForm.cs" Line="1" Column="1" />
<File FileName="PrinterCommunication.cs" Line="1" Column="1" />
<File FileName="PrintLevelWizard.cs" Line="1" Column="1" />
</Files>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.DebuggingService.Breakpoints>
<BreakpointStore>
<Breakpoint file="C:\Users\Matter Hackers 1\Development\mattercontrol\PrintQueue\PrintQueueMenu.cs" line="148" column="1" />
</BreakpointStore>
<BreakpointStore />
</MonoDevelop.Ide.DebuggingService.Breakpoints>
<MonoDevelop.Ide.DebuggingService.PinnedWatches />
</Properties>