|
@@ -195,23 +195,11 @@ namespace PixiEditor.ViewModels.SubViewModels.Main
|
|
}
|
|
}
|
|
catch (CorruptedFileException ex)
|
|
catch (CorruptedFileException ex)
|
|
{
|
|
{
|
|
- MessageBox.Show(ex.Message, "Failed to open file.", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
|
|
|
|
+ NoticeDialog.Show(ex.Message, "Failed to open file.");
|
|
}
|
|
}
|
|
catch (OldFileFormatException)
|
|
catch (OldFileFormatException)
|
|
{
|
|
{
|
|
- MessageBoxResult result = MessageBox.Show("This pixi file uses the old file format and is insecure.\nOnly continue if you trust the source of the file", "Old file format", MessageBoxButton.OKCancel);
|
|
|
|
-
|
|
|
|
- if (result == MessageBoxResult.OK)
|
|
|
|
- {
|
|
|
|
- try
|
|
|
|
- {
|
|
|
|
- OpenDocument(path, true);
|
|
|
|
- }
|
|
|
|
- catch (CorruptedFileException ex)
|
|
|
|
- {
|
|
|
|
- MessageBox.Show(ex.Message, "Failed to open file.", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ NoticeDialog.Show("This pixi file uses the old file format and can't be opened", "Old file format");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -240,18 +228,9 @@ namespace PixiEditor.ViewModels.SubViewModels.Main
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private void OpenDocument(string path, bool openOld = false)
|
|
|
|
|
|
+ private void OpenDocument(string path)
|
|
{
|
|
{
|
|
- Document document;
|
|
|
|
-
|
|
|
|
- if (openOld)
|
|
|
|
- {
|
|
|
|
- document = Importer.ImportOldDocument(path);
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- document = Importer.ImportDocument(path);
|
|
|
|
- }
|
|
|
|
|
|
+ Document document = Importer.ImportDocument(path);
|
|
|
|
|
|
if (Owner.BitmapManager.Documents.Select(x => x.DocumentFilePath).All(y => y != path))
|
|
if (Owner.BitmapManager.Documents.Select(x => x.DocumentFilePath).All(y => y != path))
|
|
{
|
|
{
|