mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-09 01:52:32 +02:00
379c5140f6
* (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
58 lines
1.9 KiB
C#
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;
|
|
}
|
|
}
|
|
}
|
|
}
|