Merge pull request #2788 from larsbrubaker/design_tools
Made the default library folders sorted
This commit is contained in:
commit
3fe0f9b3e3
3 changed files with 13 additions and 2 deletions
|
|
@ -437,7 +437,6 @@ namespace MatterHackers.MatterControl
|
||||||
() => new SqliteLibraryContainer(rootLibraryCollection.Id)));
|
() => new SqliteLibraryContainer(rootLibraryCollection.Id)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
this.Library.RegisterRootProvider(
|
this.Library.RegisterRootProvider(
|
||||||
new DynamicContainerLink(
|
new DynamicContainerLink(
|
||||||
() => "Print History".Localize(),
|
() => "Print History".Localize(),
|
||||||
|
|
|
||||||
|
|
@ -148,9 +148,21 @@ namespace MatterHackers.MatterControl.Library
|
||||||
public void RegisterRootProvider(ILibraryContainerLink containerItem)
|
public void RegisterRootProvider(ILibraryContainerLink containerItem)
|
||||||
{
|
{
|
||||||
libraryProviders.Add(containerItem);
|
libraryProviders.Add(containerItem);
|
||||||
|
libraryProviders.Sort(SortOnName);
|
||||||
OnLibraryItemsChanged();
|
OnLibraryItemsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int SortOnName(ILibraryContainerLink x, ILibraryContainerLink y)
|
||||||
|
{
|
||||||
|
if (x != null && x.Name != null
|
||||||
|
&& y != null && y.Name != null)
|
||||||
|
{
|
||||||
|
return string.Compare(x.Name, y.Name, StringComparison.OrdinalIgnoreCase);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
public void RegisterCreator(ILibraryContentItem libraryItem)
|
public void RegisterCreator(ILibraryContentItem libraryItem)
|
||||||
{
|
{
|
||||||
this.RootLibaryContainer.Items.Add(libraryItem);
|
this.RootLibaryContainer.Items.Add(libraryItem);
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit f3d01e4979302480603faf8a50d20a73d4d7110a
|
Subproject commit 4d5dcefa3359fe47b413d40a008595564009bd22
|
||||||
Loading…
Add table
Add a link
Reference in a new issue