Files
Tiago Conceição 379c5140f6 v0.5.1.2
* (Add) Able to install only the desired profiles and not the whole lot (Suggested  by: Ingo Strohmenger)
* (Add) Update manager for PrusaSlicer profiles
* (Add) If PrusaSlicer not installed on system it prompt for installation (By open the official website)
* (Fix) Prevent profiles instalation when PrusaSlicer is not installed on system
* (Fix) The "Issues" computation sometimes fails triggering an error due the use of non concurrent dictionary
* (Fix) Print profiles won't install into PrusaSlicer
2020-06-17 19:54:00 +01:00

58 lines
1.9 KiB
C#

using System;
using System.IO;
using System.Text;
using System.Windows.Forms;
namespace UVtools.GUI.Forms
{
public class PEProfileFolder
{
public enum FolderType
{
Print,
Printer
}
public FolderType Type { get; }
public ListView ListView { get; }
public ToolStripLabel LabelCount { get; }
public string SourcePath { get; }
public string TargetPath { get; }
public string SelectedFiles
{
get
{
StringBuilder sb = new StringBuilder();
foreach (ListViewItem item in ListView.Items)
{
if (!item.Checked) continue;
sb.AppendLine(item.Text);
}
return sb.ToString();
}
}
public PEProfileFolder(FolderType type, ListView listView, ToolStripLabel labelCount)
{
Type = type;
ListView = listView;
LabelCount = labelCount;
switch (type)
{
case FolderType.Print:
SourcePath = $"{Application.StartupPath}{Path.DirectorySeparatorChar}PrusaSlicer{Path.DirectorySeparatorChar}sla_print";
TargetPath = $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}{Path.DirectorySeparatorChar}PrusaSlicer{Path.DirectorySeparatorChar}sla_print";
break;
case FolderType.Printer:
SourcePath = $"{Application.StartupPath}{Path.DirectorySeparatorChar}PrusaSlicer{Path.DirectorySeparatorChar}printer";
TargetPath = $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}{Path.DirectorySeparatorChar}PrusaSlicer{Path.DirectorySeparatorChar}printer";
break;
}
}
}
}