|
@@ -3,6 +3,7 @@ using InABox.Clients;
|
|
|
using InABox.Core;
|
|
|
using InABox.Core.Postable;
|
|
|
using InABox.DynamicGrid;
|
|
|
+using InABox.Wpf;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Drawing;
|
|
@@ -26,7 +27,7 @@ namespace PRSDesktop
|
|
|
var result = PosterUtils.Process(model);
|
|
|
if(result is null)
|
|
|
{
|
|
|
- MessageBox.Show("Processing failed.");
|
|
|
+ MessageWindow.ShowMessage($"Processing failed", "Processing failed");
|
|
|
refresh();
|
|
|
}
|
|
|
else
|
|
@@ -46,53 +47,57 @@ namespace PRSDesktop
|
|
|
}
|
|
|
if(successCount == 0)
|
|
|
{
|
|
|
- MessageBox.Show($"Processing failed:\n - {string.Join("\n - ", failedMessages)}");
|
|
|
+ MessageWindow.ShowMessage($"Processing failed:\n - {string.Join("\n - ", failedMessages)}", "Processing failed.");
|
|
|
}
|
|
|
else if(failedMessages.Count == 0)
|
|
|
{
|
|
|
- MessageBox.Show($"Processing successful; {successCount} items processed");
|
|
|
+ MessageWindow.ShowMessage($"Processing successful; {successCount} items processed", "Processing successful.");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- MessageBox.Show($"{successCount} items succeeded, but {failedMessages.Count} failed:\n - {string.Join("\n - ", failedMessages)}");
|
|
|
+ MessageWindow.ShowMessage($"{successCount} items succeeded, but {failedMessages.Count} failed:\n - {string.Join("\n - ", failedMessages)}", "Partial success");
|
|
|
}
|
|
|
refresh();
|
|
|
}
|
|
|
}
|
|
|
catch (EmptyPostException)
|
|
|
{
|
|
|
- MessageBox.Show($"Please select at least one {typeof(T).Name}.");
|
|
|
+ MessageWindow.ShowMessage($"Please select at least one {typeof(T).Name}.", "Select items");
|
|
|
+ }
|
|
|
+ catch (PostFailedMessageException e)
|
|
|
+ {
|
|
|
+ MessageWindow.ShowMessage(e.Message, "Post failed");
|
|
|
}
|
|
|
catch (RepostedException)
|
|
|
{
|
|
|
- MessageBox.Show("At least one of the items you selected has already been processed. Processing cancelled.");
|
|
|
+ MessageWindow.ShowMessage("At least one of the items you selected has already been processed. Processing cancelled.", "Already processed");
|
|
|
}
|
|
|
catch (PostCancelledException)
|
|
|
{
|
|
|
- MessageBox.Show("Processing cancelled.");
|
|
|
+ MessageWindow.ShowMessage("Processing cancelled.", "Cancelled");
|
|
|
}
|
|
|
catch (MissingSettingsException)
|
|
|
{
|
|
|
if (configurePost is not null && Security.CanConfigurePost<T>())
|
|
|
{
|
|
|
- if (MessageBox.Show($"Processing has not been configured for {inflector.Pluralize(typeof(T).Name)}. Would you like to configure this now?",
|
|
|
- "Configure Processing?", MessageBoxButton.YesNoCancel) == MessageBoxResult.Yes)
|
|
|
+ if (MessageWindow.ShowYesNo($"Processing has not been configured for {inflector.Pluralize(typeof(T).Name)}. Would you like to configure this now?",
|
|
|
+ "Configure Processing?"))
|
|
|
{
|
|
|
configurePost();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- MessageBox.Show("Processing cancelled.");
|
|
|
+ MessageWindow.ShowMessage("Processing cancelled.", "Cancelled");
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- MessageBox.Show($"Processing has not been configured for {inflector.Pluralize(typeof(T).Name)}!");
|
|
|
+ MessageWindow.ShowMessage($"Processing has not been configured for {inflector.Pluralize(typeof(T).Name)}!", "Unconfigured");
|
|
|
}
|
|
|
}
|
|
|
catch (Exception e)
|
|
|
{
|
|
|
- MessageBox.Show($"Processing failed: {e.Message}");
|
|
|
+ MessageWindow.ShowError("Processing failed.", e);
|
|
|
refresh();
|
|
|
}
|
|
|
}
|