disable export if printer not setup

show reason why export is disabled

issue: MatterHackers/MCCentral#4573
Export should follow the same rules as printer/setup buttons
This commit is contained in:
Lars Brubaker 2018-11-29 17:35:08 -08:00
parent 33d4ed529c
commit 726b14f9c0
9 changed files with 66 additions and 8 deletions

View file

@ -74,6 +74,24 @@ namespace MatterHackers.MatterControl
// Skip plugins which are invalid for the current printer
if (!plugin.Enabled)
{
if (!string.IsNullOrEmpty(plugin.DissabledReason))
{
// add a message to let us know why not enabled
var disabledPluginButton = new RadioButton(new RadioImageWidget(plugin.ButtonText, theme.TextColor, plugin.Icon))
{
HAnchor = HAnchor.Left,
Margin = commonMargin,
Cursor = Cursors.Hand,
Name = plugin.ButtonText + " Button",
Enabled = false
};
contentRow.AddChild(disabledPluginButton);
contentRow.AddChild(new TextWidget("Disabled: {0}".Localize().FormatWith(plugin.DissabledReason), textColor: theme.PrimaryAccentColor)
{
Margin = new BorderDouble(left: 80),
HAnchor = HAnchor.Left
});
}
continue;
}