add ability to create directory if it doesn't exist
This commit is contained in:
parent
edda2c2dff
commit
eac86341aa
1 changed files with 27 additions and 9 deletions
|
@ -3,6 +3,7 @@ using Ryujinx.HLE.FileSystem;
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
using GUI = Gtk.Builder.ObjectAttribute;
|
using GUI = Gtk.Builder.ObjectAttribute;
|
||||||
|
|
||||||
|
@ -40,10 +41,28 @@ namespace Ryujinx.Ui
|
||||||
|
|
||||||
if (!Directory.Exists(saveDir))
|
if (!Directory.Exists(saveDir))
|
||||||
{
|
{
|
||||||
GtkDialog.CreateErrorDialog($"Could not find save location for {titleName} [{titleId}]");
|
MessageDialog messageDialog = new MessageDialog(null, DialogFlags.Modal, MessageType.Question, ButtonsType.YesNo, null)
|
||||||
|
{
|
||||||
|
Title = "Ryujinx",
|
||||||
|
Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.Icon.png"),
|
||||||
|
Text = $"Could not find save directory for {titleName} [{titleId}]",
|
||||||
|
SecondaryText = "Would you like to create the directory?",
|
||||||
|
WindowPosition = WindowPosition.Center
|
||||||
|
};
|
||||||
|
|
||||||
|
if (messageDialog.Run() == (int)ResponseType.Yes)
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(saveDir);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
messageDialog.Dispose();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
messageDialog.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
Process.Start(new ProcessStartInfo()
|
Process.Start(new ProcessStartInfo()
|
||||||
{
|
{
|
||||||
FileName = saveDir,
|
FileName = saveDir,
|
||||||
|
@ -52,5 +71,4 @@ namespace Ryujinx.Ui
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue