Add share redemption.
This commit is contained in:
parent
19eed1e124
commit
14a6834669
6 changed files with 59 additions and 3 deletions
|
|
@ -351,6 +351,20 @@ namespace MatterHackers.MatterControl
|
|||
}
|
||||
}
|
||||
|
||||
public void SwitchToSharedLibrary()
|
||||
{
|
||||
// Switch to the shared library
|
||||
LibraryProviderSelector libraryProviderSelector = CurrentLibraryDataView.CurrentLibraryProvider.GetRootProvider() as LibraryProviderSelector;
|
||||
if (libraryProviderSelector != null)
|
||||
{
|
||||
LibraryProvider sharedProvider = libraryProviderSelector.GetSharedLibrary();
|
||||
UiThread.RunOnIdle(() =>
|
||||
{
|
||||
CurrentLibraryDataView.CurrentLibraryProvider = sharedProvider;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void ChangeCloudSyncStatus(bool userAuthenticated)
|
||||
{
|
||||
CloudSyncStatusChanged.CallEvents(this, new CloudSyncEventArgs() { IsAuthenticated = userAuthenticated });
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ namespace MatterHackers.MatterControl
|
|||
//Add the menu items to the menu itself
|
||||
foreach (Tuple<string, Func<bool>> item in menuItems)
|
||||
{
|
||||
MenuDropList.MenuItemsPadding = new BorderDouble(8, 4, 8, 4) * TextWidget.GlobalPointSizeScaleRatio;
|
||||
MenuDropList.AddItem(item.Item1, pointSize: 10);
|
||||
MenuDropList.MenuItemsPadding = new BorderDouble(8, 6, 8, 6) * TextWidget.GlobalPointSizeScaleRatio;
|
||||
MenuDropList.AddItem(item.Item1, pointSize: 11);
|
||||
}
|
||||
MenuDropList.Padding = padding;
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
public event EventHandler<StringEventArgs> AddLocalFolderToLibrary;
|
||||
public EventHandler RedeemDesignCode;
|
||||
public EventHandler EnterShareCode;
|
||||
|
||||
public MenuOptionFile()
|
||||
: base("File".Localize())
|
||||
|
|
@ -36,7 +37,7 @@ namespace MatterHackers.MatterControl
|
|||
{"Add File To Queue".Localize(), importFile_Click},
|
||||
//{"Add Folder To Library".Localize(), addFolderToLibrar_Click},
|
||||
{"Redeem Design Code".Localize(), redeemDesignCode_Click},
|
||||
//{"Enter Share Code".Localize(), redeemDesignCode_Click},
|
||||
{"Enter Share Code".Localize(), enterShareCode_Click},
|
||||
{"------------------------", nothing_Click},
|
||||
{"Exit".Localize(), exit_Click},
|
||||
};
|
||||
|
|
@ -57,6 +58,16 @@ namespace MatterHackers.MatterControl
|
|||
return true;
|
||||
}
|
||||
|
||||
private bool enterShareCode_Click()
|
||||
{
|
||||
if (EnterShareCode != null)
|
||||
{
|
||||
EnterShareCode(this, null);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool addFolderToLibrar_Click()
|
||||
{
|
||||
if (AddLocalFolderToLibrary != null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue