Change message confirmation dialogs from modal to async w/callback.

This commit is contained in:
kevinepope 2014-10-21 21:20:09 -07:00
parent b7da8de443
commit e936fe98f7
20 changed files with 158 additions and 98 deletions

View file

@ -314,6 +314,7 @@ namespace MatterHackers.MatterControl.PrintHistory
public void ShowCantFindFileMessage(PrintItemWrapper printItemWrapper)
{
itemToRemove = printItemWrapper;
UiThread.RunOnIdle((state) =>
{
string maxLengthName = printItemWrapper.FileLocation;
@ -328,12 +329,18 @@ namespace MatterHackers.MatterControl.PrintHistory
string notFoundMessage = LocalizedString.Get("Oops! Could not find this file:");
string message = "{0}:\n'{1}'".FormatWith(notFoundMessage, maxLengthName);
string titleLabel = LocalizedString.Get("Item not Found");
if (StyledMessageBox.ShowMessageBox(message, titleLabel, StyledMessageBox.MessageType.OK))
{
QueueData.Instance.RemoveIndexOnIdle(QueueData.Instance.GetIndex(printItemWrapper));
}
StyledMessageBox.ShowMessageBox(onConfirmRemove, message, titleLabel, StyledMessageBox.MessageType.OK);
});
}
PrintItemWrapper itemToRemove;
void onConfirmRemove(bool messageBoxResponse)
{
if (messageBoxResponse)
{
QueueData.Instance.RemoveIndexOnIdle(QueueData.Instance.GetIndex(itemToRemove));
}
}
PartPreviewMainWindow partPreviewWindow;
private void OpenPartPreviewWindow(PrintItem printItem, View3DWidget.AutoRotate autoRotate)