Moving show folders to the menu
refactoring
This commit is contained in:
parent
3431651654
commit
32b8776276
11 changed files with 20 additions and 9 deletions
|
|
@ -51,6 +51,8 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
public string Name => _libraryContainer.Name;
|
||||
|
||||
public string CollectionKeyName { get; set; }
|
||||
|
||||
public string StatusMessage => _libraryContainer.StatusMessage;
|
||||
|
||||
public bool IsProtected => _libraryContainer.IsProtected;
|
||||
|
|
|
|||
|
|
@ -60,6 +60,8 @@ namespace MatterHackers.MatterControl.Library
|
|||
|
||||
event EventHandler ContentChanged;
|
||||
|
||||
string CollectionKeyName { get; }
|
||||
|
||||
List<ILibraryContainerLink> ChildContainers { get; }
|
||||
|
||||
List<ILibraryItem> Items { get; }
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ namespace MatterHackers.MatterControl.Library
|
|||
public interface ILibraryContainerLink : ILibraryItem
|
||||
{
|
||||
Task<ILibraryContainer> GetContainer(Action<double, string> reportProgress);
|
||||
|
||||
bool IsReadOnly { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,9 @@ namespace MatterHackers.MatterControl.Library
|
|||
public class DynamicContainerLink : ILibraryContainerLink, IThumbnail
|
||||
{
|
||||
public string ID { get; set; }
|
||||
|
||||
public string Category { get; set; }
|
||||
|
||||
public bool IsProtected { get; set; } = true;
|
||||
|
||||
public bool IsReadOnly { get; set; } = false;
|
||||
|
|
@ -52,7 +54,7 @@ namespace MatterHackers.MatterControl.Library
|
|||
private ImageBuffer microIcon;
|
||||
|
||||
public DynamicContainerLink(Func<string> nameResolver, ImageBuffer microIcon, ImageBuffer thumbnail, Func<ILibraryContainer> creator = null, Func<bool> visibilityResolver = null)
|
||||
: this (nameResolver, thumbnail, creator, visibilityResolver)
|
||||
: this(nameResolver, thumbnail, creator, visibilityResolver)
|
||||
{
|
||||
this.microIcon = microIcon;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@ namespace MatterHackers.MatterControl.Library
|
|||
|
||||
public string Name { get; set; }
|
||||
|
||||
public string CollectionKeyName { get; set; }
|
||||
|
||||
public Type DefaultView { get; protected set; }
|
||||
|
||||
public List<ILibraryContainerLink> ChildContainers { get; set; } = new List<ILibraryContainerLink>();
|
||||
|
|
|
|||
|
|
@ -51,6 +51,8 @@ namespace MatterHackers.MatterControl.Library
|
|||
|
||||
public string ID { get; } = "rootLibraryProvider";
|
||||
|
||||
public string CollectionKeyName { get; set; }
|
||||
|
||||
public string Name => "Home".Localize();
|
||||
|
||||
public bool IsProtected => true;
|
||||
|
|
|
|||
|
|
@ -83,7 +83,6 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
{
|
||||
Name = "LibraryView",
|
||||
// Drop containers if ShowContainers != 1
|
||||
ContainerFilter = (container) => UserSettings.Instance.ShowContainers,
|
||||
BackgroundColor = theme.BackgroundColor,
|
||||
Border = new BorderDouble(top: 1),
|
||||
DoubleClickAction = LibraryListView.DoubleClickActions.PreviewItem
|
||||
|
|
@ -657,7 +656,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
|
||||
menuActions.Add(new LibraryAction(ActionScope.ListView)
|
||||
{
|
||||
Title = "Create Folder".Localize(),
|
||||
Title = "Create Folder...".Localize(),
|
||||
Icon = AggContext.StaticData.LoadIcon("fa-folder-new_16.png", 16, 16, ApplicationController.Instance.MenuTheme.InvertIcons),
|
||||
Action = (selectedLibraryItems, listView) =>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -77,7 +77,6 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
{
|
||||
Name = "LibraryView",
|
||||
// Drop containers if ShowContainers != 1
|
||||
ContainerFilter = (container) => UserSettings.Instance.ShowContainers,
|
||||
BackgroundColor = libraryBackground,
|
||||
Border = new BorderDouble(top: 1)
|
||||
};
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ namespace MatterHackers.MatterControl
|
|||
{
|
||||
return projectFiles;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
projectFiles = value;
|
||||
|
|
@ -65,6 +66,7 @@ namespace MatterHackers.MatterControl
|
|||
{
|
||||
return projectName;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
projectName = value;
|
||||
|
|
@ -77,6 +79,7 @@ namespace MatterHackers.MatterControl
|
|||
{
|
||||
return projectDateCreated;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
projectDateCreated = value;
|
||||
|
|
@ -109,8 +112,8 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
|
||||
string jsonString = JsonConvert.SerializeObject(this.project, Newtonsoft.Json.Formatting.Indented);
|
||||
string pathToDataFolder = Path.Combine(applicationDataPath, "data");
|
||||
if (!Directory.Exists(pathToDataFolder))
|
||||
string pathToDataFolder = Path.Combine(applicationDataPath, "data");
|
||||
if (!Directory.Exists(pathToDataFolder))
|
||||
{
|
||||
Directory.CreateDirectory(pathToDataFolder);
|
||||
}
|
||||
|
|
@ -140,6 +143,5 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
return newProject.ProjectFiles;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 28052c646960fbf2ecb1c54fdff69f7fac307f63
|
||||
Subproject commit 8fc0e4bf59d7a45e1fee86e93c30a120758c57f0
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 4a7434a815eb359fc4f679a0a351ee42507e005e
|
||||
Subproject commit f8006c885d7b12a0958ed644a491392d9849c6d7
|
||||
Loading…
Add table
Add a link
Reference in a new issue