custom MessageBox for YesNo/YesNoCancel button modes

This commit is contained in:
n00mkrad
2022-07-24 22:30:30 +02:00
parent 54fb84de23
commit e6034a87b4
15 changed files with 165 additions and 45 deletions

View File

@@ -14,6 +14,7 @@ using Flowframes.MiscUtils;
using Flowframes.Os;
using System.Collections.Generic;
using Newtonsoft.Json;
using Flowframes.Ui;
namespace Flowframes.Main
{
@@ -68,7 +69,7 @@ namespace Flowframes.Main
catch (Exception e)
{
Logger.Log("FramesToVideo Error: " + e.Message, false);
MessageBox.Show("An error occured while trying to convert the interpolated frames to a video.\nCheck the log for details.");
UiUtils.ShowMessageBox("An error occured while trying to convert the interpolated frames to a video.\nCheck the log for details.", UiUtils.MessageType.Error);
}
}
@@ -252,7 +253,7 @@ namespace Flowframes.Main
Logger.Log("ChunksToVideo Error: " + e.Message, isBackup);
if (!isBackup)
MessageBox.Show("An error occured while trying to merge the video chunks.\nCheck the log for details.");
UiUtils.ShowMessageBox("An error occured while trying to merge the video chunks.\nCheck the log for details.", UiUtils.MessageType.Error);
}
Logger.Log($"Merged video chunks in {sw}", true);

View File

@@ -242,7 +242,7 @@ namespace Flowframes
{
if (!BatchProcessing.busy && IoUtils.GetAmountOfFiles(Path.Combine(currentSettings.tempFolder, Paths.resumeDir), true) > 0)
{
DialogResult dialogResult = MessageBox.Show($"Delete the temp folder (Yes) or keep it for resuming later (No)?", "Delete temporary files?", MessageBoxButtons.YesNo);
DialogResult dialogResult = UiUtils.ShowMessageBox($"Delete the temp folder (Yes) or keep it for resuming later (No)?", "Delete temporary files?", MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.Yes)
Task.Run(async () => { await IoUtils.TryDeleteIfExistsAsync(currentSettings.tempFolder); });

View File

@@ -135,7 +135,7 @@ namespace Flowframes.Main
public static async Task Reset()
{
DialogResult dialog = MessageBox.Show($"Are you sure you want to remove all temporary files?", "Are you sure?", MessageBoxButtons.YesNo);
DialogResult dialog = UiUtils.ShowMessageBox($"Are you sure you want to remove all temporary files?", "Are you sure?", MessageBoxButtons.YesNo);
if (dialog == DialogResult.Yes)
await Cleanup(true);

View File

@@ -225,7 +225,7 @@ namespace Flowframes.Main
{
string enc = FfmpegUtils.GetEnc(FfmpegUtils.GetCodec(I.currentSettings.outMode));
float maxAv1Fps = 480;
float maxAv1Fps = 240;
if (enc.ToLower().Contains("av1") && encodeFps > maxAv1Fps)
{