Browse Source

Merge stuff

Krzysztof Krysiński 2 years ago
parent
commit
c08139a09e

+ 5 - 0
src/PixiEditor/Data/Localization/Languages/en.json

@@ -549,6 +549,11 @@
   "ERROR_SAVE_LOCATION": "Couldn't save the file to the specified location",
   "ERROR_SAVE_LOCATION": "Couldn't save the file to the specified location",
   "ERROR_WHILE_SAVING": "An internal error occured while saving. Please try again.",
   "ERROR_WHILE_SAVING": "An internal error occured while saving. Please try again.",
   "UNKNOWN_ERROR_SAVING": "An error occured while saving.",
   "UNKNOWN_ERROR_SAVING": "An error occured while saving.",
+  "SECURITY_ERROR": "Security error",
+  "SECURITY_ERROR_MSG": "No rights to write to the specified location.",
+  "IO_ERROR": "IO error",
+  "IO_ERROR_MSG": "Error while writing to disk.",
+
   "FAILED_ASSOCIATE_LOSPEC": "Failed to associate Lospec Palette protocol.",
   "FAILED_ASSOCIATE_LOSPEC": "Failed to associate Lospec Palette protocol.",
   "FAILED_ASSOCIATE_PIXI": "Failed to associate .pixi file with PixiEditor.",
   "FAILED_ASSOCIATE_PIXI": "Failed to associate .pixi file with PixiEditor.",
   "SHORTCUTS_CORRUPTED_TITLE": "Corrupted shortcuts file",
   "SHORTCUTS_CORRUPTED_TITLE": "Corrupted shortcuts file",

+ 2 - 4
src/PixiEditor/ViewModels/SubViewModels/Main/DebugViewModel.cs

@@ -66,8 +66,6 @@ internal class DebugViewModel : SubViewModel<ViewModelMain>
         UpdateDebugMode(preferences.GetPreference<bool>("IsDebugModeEnabled"));
         UpdateDebugMode(preferences.GetPreference<bool>("IsDebugModeEnabled"));
     }
     }
 
 
-    [Command.Debug("PixiEditor.Debug.OpenTempDirectory", @"%Temp%\PixiEditor", "OPEN_TEMP_DIR", "OPEN_TEMP_DIR", IconPath = "Folder.png")]
-    [Command.Debug("PixiEditor.Debug.OpenRoamingAppDataDirectory", @"%AppData%\PixiEditor", "OPEN_ROAMING_APPDATA_DIR", "OPEN_ROAMING_APPDATA_DIR", IconPath = "Folder.png")]
     public static void OpenFolder(string path)
     public static void OpenFolder(string path)
     {
     {
         if (!Directory.Exists(path))
         if (!Directory.Exists(path))
@@ -88,14 +86,14 @@ internal class DebugViewModel : SubViewModel<ViewModelMain>
         OpenFolder(path);
         OpenFolder(path);
     }
     }
 
 
-    [Command.Debug("PixiEditor.Debug.OpenRoamingAppDataDirectory", @"PixiEditor", "Open Roaming AppData Directory", "Open Roaming AppData Directory", IconPath = "Folder.png")]
+    [Command.Debug("PixiEditor.Debug.OpenRoamingAppDataDirectory", @"%AppData%\PixiEditor", "OPEN_ROAMING_APPDATA_DIR", "OPEN_ROAMING_APPDATA_DIR", IconPath = "Folder.png")]
     public static void OpenAppDataFolder(string subDirectory)
     public static void OpenAppDataFolder(string subDirectory)
     {
     {
         var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), subDirectory);
         var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), subDirectory);
         OpenFolder(path);
         OpenFolder(path);
     }
     }
 
 
-    [Command.Debug("PixiEditor.Debug.OpenTempDirectory", @"PixiEditor", "Open Temp Directory", "Open Temp Directory", IconPath = "Folder.png")]
+    [Command.Debug("PixiEditor.Debug.OpenTempDirectory", @"%Temp%\PixiEditor", "OPEN_TEMP_DIR", "OPEN_TEMP_DIR", IconPath = "Folder.png")]
     public static void OpenTempFolder(string subDirectory)
     public static void OpenTempFolder(string subDirectory)
     {
     {
         var path = Path.Combine(Path.GetTempPath(), subDirectory);
         var path = Path.Combine(Path.GetTempPath(), subDirectory);

+ 2 - 2
src/PixiEditor/ViewModels/SubViewModels/Main/FileViewModel.cs

@@ -330,10 +330,10 @@ internal class FileViewModel : SubViewModel<ViewModelMain>
                 NoticeDialog.Show("INTERNAL_ERROR", "ERROR_WHILE_SAVING");
                 NoticeDialog.Show("INTERNAL_ERROR", "ERROR_WHILE_SAVING");
                 break;
                 break;
             case DialogSaveResult.SecurityError:
             case DialogSaveResult.SecurityError:
-                NoticeDialog.Show(title: "Security error", message: "No rights to write to the specified location.");
+                NoticeDialog.Show(title: "SECURITY_ERROR", message: "SECURITY_ERROR_MSG");
                 break;
                 break;
             case DialogSaveResult.IoError:
             case DialogSaveResult.IoError:
-                NoticeDialog.Show(title: "IO error", message: "Error while writing to disk.");
+                NoticeDialog.Show(title: "IO_ERROR", message: "IO_ERROR_MSG");
                 break;
                 break;
             case DialogSaveResult.UnknownError:
             case DialogSaveResult.UnknownError:
                 NoticeDialog.Show("ERROR", "UNKNOWN_ERROR_SAVING");
                 NoticeDialog.Show("ERROR", "UNKNOWN_ERROR_SAVING");

+ 1 - 1
src/PixiEditor/ViewModels/SubViewModels/Main/MiscViewModel.cs

@@ -20,7 +20,7 @@ internal class MiscViewModel : SubViewModel<ViewModelMain>
     [Command.Basic("PixiEditor.Links.OpenRepository", "https://github.com/PixiEditor/PixiEditor", "REPOSITORY", "OPEN_REPOSITORY", IconPath = "Globe.png")]
     [Command.Basic("PixiEditor.Links.OpenRepository", "https://github.com/PixiEditor/PixiEditor", "REPOSITORY", "OPEN_REPOSITORY", IconPath = "Globe.png")]
     [Command.Basic("PixiEditor.Links.OpenLicense", "https://github.com/PixiEditor/PixiEditor/blob/master/LICENSE", "LICENSE", "OPEN_LICENSE", IconPath = "Globe.png")]
     [Command.Basic("PixiEditor.Links.OpenLicense", "https://github.com/PixiEditor/PixiEditor/blob/master/LICENSE", "LICENSE", "OPEN_LICENSE", IconPath = "Globe.png")]
     [Command.Basic("PixiEditor.Links.OpenOtherLicenses", "https://pixieditor.net/docs/Third-party-licenses", "THIRD_PARTY_LICENSES", "OPEN_THIRD_PARTY_LICENSES", IconPath = "Globe.png")]
     [Command.Basic("PixiEditor.Links.OpenOtherLicenses", "https://pixieditor.net/docs/Third-party-licenses", "THIRD_PARTY_LICENSES", "OPEN_THIRD_PARTY_LICENSES", IconPath = "Globe.png")]
-    public static void OpenHyperlink(string url)
+    public static async Task OpenHyperlink(string url)
     {
     {
         try
         try
         {
         {