Consolidate file extension definitions
- Issue MatterHackers/MCCentral#2527 Too many authorities on valid files types
This commit is contained in:
parent
bf1ae223ac
commit
1da9d0dfb5
9 changed files with 8 additions and 22 deletions
|
|
@ -37,10 +37,7 @@ namespace MatterHackers.MatterControl
|
|||
{
|
||||
using Agg.Image;
|
||||
using MatterHackers.Agg.Platform;
|
||||
using MatterHackers.DataConverters3D;
|
||||
using MatterHackers.MatterControl.DataStorage;
|
||||
using MatterHackers.MatterControl.PluginSystem;
|
||||
using MatterHackers.MatterControl.PrintQueue;
|
||||
using MatterHackers.RenderOpenGl.OpenGl;
|
||||
|
||||
public class WindowsPlatformsFeatures : INativePlatformFeatures
|
||||
|
|
@ -139,18 +136,6 @@ namespace MatterHackers.MatterControl
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Do we still want to support command line arguments for adding to the queue?
|
||||
foreach (string arg in commandLineArgs)
|
||||
{
|
||||
string argExtension = Path.GetExtension(arg).ToUpper();
|
||||
if (argExtension.Length > 1
|
||||
&& MeshFileIo.ValidFileExtensions().Contains(argExtension))
|
||||
{
|
||||
QueueData.Instance.AddItem(new PrintItemWrapper(new PrintItem(Path.GetFileName(arg), Path.GetFullPath(arg))));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void ReportException(Exception e, string key = "", string value = "", ReportSeverity2 warningLevel = ReportSeverity2.Warning)
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ namespace MatterHackers.MatterControl.Library.Export
|
|||
string fileToProcess = "";
|
||||
|
||||
string sourceExtension = Path.GetExtension(libraryContent.FileName).ToUpper();
|
||||
if (MeshFileIo.ValidFileExtensions().Contains(sourceExtension)
|
||||
if (ApplicationSettings.ValidFileExtensions.Contains(sourceExtension)
|
||||
|| sourceExtension == ".MCX")
|
||||
{
|
||||
// Conceptually we need to:
|
||||
|
|
|
|||
|
|
@ -273,7 +273,7 @@ namespace MatterHackers.MatterControl.Library
|
|||
|
||||
// Special load processing for mesh data, simple copy below for non-mesh
|
||||
if (forceAMF
|
||||
&& (extension != "" && MeshFileIo.ValidFileExtensions().Contains(extension.ToUpper())))
|
||||
&& (extension != "" && ApplicationSettings.ValidFileExtensions.Contains(extension.ToUpper())))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
|
|||
|
|
@ -513,7 +513,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
foreach (string loadedFileName in filesToLoadIncludingZips)
|
||||
{
|
||||
string extension = Path.GetExtension(loadedFileName).ToUpper();
|
||||
if ((extension != "" && MeshFileIo.ValidFileExtensions().Contains(extension)))
|
||||
if ((extension != "" && ApplicationSettings.ValidFileExtensions.Contains(extension)))
|
||||
{
|
||||
filesToLoad.Add(loadedFileName);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ namespace MatterHackers.MatterControl.PrintQueue
|
|||
{
|
||||
var printItemWrapper = new PrintItemWrapper(part);
|
||||
string extension = Path.GetExtension(printItemWrapper.FileLocation).ToUpper();
|
||||
if (extension != "" && MeshFileIo.ValidFileExtensions().Contains(extension))
|
||||
if (extension != "" && ApplicationSettings.ValidFileExtensions.Contains(extension))
|
||||
{
|
||||
await ApplicationController.Instance.Tasks.Execute((reporter, cancellationToken) =>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -353,7 +353,7 @@ namespace MatterHackers.MatterControl
|
|||
foreach (string file in mouseEvent.DragFiles)
|
||||
{
|
||||
string extension = Path.GetExtension(file).ToUpper();
|
||||
if ((extension != "" && MeshFileIo.ValidFileExtensions().Contains(extension))
|
||||
if ((extension != "" && ApplicationSettings.ValidFileExtensions.Contains(extension))
|
||||
|| extension == ".GCODE"
|
||||
|| extension == ".ZIP")
|
||||
{
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
public class ApplicationSettings
|
||||
{
|
||||
public static string ValidFileExtensions { get; } = ".STL;.AMF;.OBJ";
|
||||
public static string LibraryMeshFileExtensions { get; } = ".stl,.obj,.amf,.mcx";
|
||||
public static string LibraryFilterFileExtensions { get; } = LibraryMeshFileExtensions + ",.gcode";
|
||||
public static string OpenPrintableFileParams { get; } = "STL, AMF, OBJ, GCODE, MCX|*.stl;*.amf;*.obj;*.gcode;*.mcx";
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 7c227e8487d6432dd0b0db7b380f93d946e5faa4
|
||||
Subproject commit 006fcf790727fbfffb6de131764f3481b8e65a88
|
||||
|
|
@ -251,7 +251,7 @@ namespace MatterHackers.MatterControl
|
|||
// - are named manifest.json
|
||||
if (!string.IsNullOrWhiteSpace(zipEntry.Name) &&
|
||||
(zipEntry.Name == "manifest.json"
|
||||
|| MeshFileIo.ValidFileExtensions().Contains(sourceExtension)
|
||||
|| ApplicationSettings.ValidFileExtensions.Contains(sourceExtension)
|
||||
|| sourceExtension == ".GCODE"))
|
||||
{
|
||||
string extractedFileName = Path.Combine(stagingFolder, zipEntry.Name);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue