Add visual indicator for http failures

This commit is contained in:
John Lewin 2015-12-23 17:04:29 -08:00
parent 340c972a11
commit 308b2cbc87
4 changed files with 15 additions and 4 deletions

View file

@ -43,7 +43,8 @@ namespace MatterHackers.MatterControl.CustomWidgets.LibrarySelector
public class FolderBreadCrumbWidget : FlowLayoutWidget
{
private static TextImageButtonFactory navigationButtonFactory = new TextImageButtonFactory();
Action<LibraryProvider> SwitchToLibraryProvider;
private Action<LibraryProvider> SwitchToLibraryProvider;
public FolderBreadCrumbWidget(Action<LibraryProvider> SwitchToLibraryProvider, LibraryProvider currentLibraryProvider)
{

View file

@ -40,6 +40,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
public abstract class LibraryRowItem : GuiWidget
{
public static readonly string LoadingPlaceholderToken = "!Placeholder_ItemToken!";
public static readonly string LoadFailedPlaceholderToken = "!Placeholder_LoadFailedToken!";
public bool IsSelectedItem
{

View file

@ -71,9 +71,18 @@ namespace MatterHackers.MatterControl.PrintLibrary
}
this.ItemName = libraryProvider.GetPrintItemName(itemIndex);
if(this.ItemName == LibraryRowItem.LoadingPlaceholderToken)
if(this.ItemName == LibraryRowItem.LoadingPlaceholderToken
|| this.ItemName == LibraryRowItem.LoadFailedPlaceholderToken)
{
this.ItemName = "Retrieving Contents...".Localize();
if(this.ItemName == LibraryRowItem.LoadingPlaceholderToken)
{
this.ItemName = "Retrieving Contents...".Localize();
}
else
{
this.ItemName = "Error Loading Contents".Localize();
}
this.IsViewHelperItem = true;
this.EnableSlideInActions = false;
}

View file

@ -183,7 +183,7 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
public abstract void RemoveItem(int itemIndexToRemove);
// Base implmentation simply calls RemoveItem
// Base implementation simply calls RemoveItem
public virtual void RemoveItems(int[] indexes)
{
// Remove items in reverse order