|
@@ -5,6 +5,7 @@ using System.Windows.Input;
|
|
using Microsoft.Win32;
|
|
using Microsoft.Win32;
|
|
using Newtonsoft.Json;
|
|
using Newtonsoft.Json;
|
|
using PixiEditor.Helpers;
|
|
using PixiEditor.Helpers;
|
|
|
|
+using PixiEditor.Localization;
|
|
using PixiEditor.Models.Commands.Attributes;
|
|
using PixiEditor.Models.Commands.Attributes;
|
|
using PixiEditor.Models.Commands.Attributes.Commands;
|
|
using PixiEditor.Models.Commands.Attributes.Commands;
|
|
using PixiEditor.Models.Commands.Templates.Parsers;
|
|
using PixiEditor.Models.Commands.Templates.Parsers;
|
|
@@ -36,23 +37,23 @@ internal class DebugViewModel : SubViewModel<ViewModelMain>
|
|
UpdateDebugMode(preferences.GetPreference<bool>("IsDebugModeEnabled"));
|
|
UpdateDebugMode(preferences.GetPreference<bool>("IsDebugModeEnabled"));
|
|
}
|
|
}
|
|
|
|
|
|
- [Command.Debug("PixiEditor.Debug.OpenTempDirectory", @"%Temp%\PixiEditor", "Open Temp Directory", "Open Temp Directory", IconPath = "Folder.png")]
|
|
|
|
- [Command.Debug("PixiEditor.Debug.OpenLocalAppDataDirectory", @"%LocalAppData%\PixiEditor", "Open Local AppData Directory", "Open Local AppData Directory", IconPath = "Folder.png")]
|
|
|
|
- [Command.Debug("PixiEditor.Debug.OpenRoamingAppDataDirectory", @"%AppData%\PixiEditor", "Open Roaming AppData Directory", "Open Roaming AppData Directory", IconPath = "Folder.png")]
|
|
|
|
- [Command.Debug("PixiEditor.Debug.OpenCrashReportsDirectory", @"%LocalAppData%\PixiEditor\crash_logs", "Open Crash Reports Directory", "Open Crash Reports Directory", IconPath = "Folder.png")]
|
|
|
|
|
|
+ [Command.Debug("PixiEditor.Debug.OpenTempDirectory", @"%Temp%\PixiEditor", "OPEN_TEMP_DIR", "OPEN_TEMP_DIR", IconPath = "Folder.png")]
|
|
|
|
+ [Command.Debug("PixiEditor.Debug.OpenLocalAppDataDirectory", @"%LocalAppData%\PixiEditor", "OPEN_LOCAL_APPDATA_DIR", "OPEN_LOCAL_APPDATA_DIR", IconPath = "Folder.png")]
|
|
|
|
+ [Command.Debug("PixiEditor.Debug.OpenRoamingAppDataDirectory", @"%AppData%\PixiEditor", "OPEN_ROAMING_APPDATA_DIR", "OPEN_ROAMING_APPDATA_DIR", IconPath = "Folder.png")]
|
|
|
|
+ [Command.Debug("PixiEditor.Debug.OpenCrashReportsDirectory", @"%LocalAppData%\PixiEditor\crash_logs", "OPEN_CRASH_REPORTS_DIR", "OPEN_CRASH_REPORTS_DIR", IconPath = "Folder.png")]
|
|
public static void OpenFolder(string path)
|
|
public static void OpenFolder(string path)
|
|
{
|
|
{
|
|
string expandedPath = Environment.ExpandEnvironmentVariables(path);
|
|
string expandedPath = Environment.ExpandEnvironmentVariables(path);
|
|
if (!Directory.Exists(expandedPath))
|
|
if (!Directory.Exists(expandedPath))
|
|
{
|
|
{
|
|
- NoticeDialog.Show($"{expandedPath} does not exist.", "Location does not exist");
|
|
|
|
|
|
+ NoticeDialog.Show(new LocalizedString("PATH_DOES_NOT_EXIST", expandedPath), "LOCATION_DOES_NOT_EXIST");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
ProcessHelpers.ShellExecuteEV(path);
|
|
ProcessHelpers.ShellExecuteEV(path);
|
|
}
|
|
}
|
|
|
|
|
|
- [Command.Debug("PixiEditor.Debug.DumpAllCommands", "Dump All Commands", "Dump All Commands to a text file")]
|
|
|
|
|
|
+ [Command.Debug("PixiEditor.Debug.DumpAllCommands", "DUMP_ALL_COMMANDS", "DUMP_ALL_COMMANDS_DESCRIPTIVE")]
|
|
public void DumpAllCommands()
|
|
public void DumpAllCommands()
|
|
{
|
|
{
|
|
SaveFileDialog dialog = new SaveFileDialog();
|
|
SaveFileDialog dialog = new SaveFileDialog();
|
|
@@ -72,7 +73,7 @@ internal class DebugViewModel : SubViewModel<ViewModelMain>
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- [Command.Debug("PixiEditor.Debug.GenerateKeysTemplate", "Generate key bindings template", "Generates key bindings json template")]
|
|
|
|
|
|
+ [Command.Debug("PixiEditor.Debug.GenerateKeysTemplate", "GENERATE_KEY_BINDINGS_TEMPLATE", "GENERATE_KEY_BINDINGS_TEMPLATE_DESCRIPTIVE")]
|
|
public void GenerateKeysTemplate()
|
|
public void GenerateKeysTemplate()
|
|
{
|
|
{
|
|
SaveFileDialog dialog = new SaveFileDialog();
|
|
SaveFileDialog dialog = new SaveFileDialog();
|
|
@@ -105,7 +106,7 @@ internal class DebugViewModel : SubViewModel<ViewModelMain>
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- [Command.Debug("PixiEditor.Debug.ValidateShortcutMap", "Validate Shortcut Map", "Validates shortcut map")]
|
|
|
|
|
|
+ [Command.Debug("PixiEditor.Debug.ValidateShortcutMap", "VALIDATE_SHORTCUT_MAP", "VALIDATE_SHORTCUT_MAP_DESCRIPTIVE")]
|
|
public void ValidateShortcutMap()
|
|
public void ValidateShortcutMap()
|
|
{
|
|
{
|
|
OpenFileDialog dialog = new OpenFileDialog();
|
|
OpenFileDialog dialog = new OpenFileDialog();
|
|
@@ -128,18 +129,18 @@ internal class DebugViewModel : SubViewModel<ViewModelMain>
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- NoticeDialog.Show($"Empty keys: {emptyKeys}\nUnknown Commands: {unknownCommands}", "Result");
|
|
|
|
|
|
+ NoticeDialog.Show(new LocalizedString("VALIDATION_KEYS_NOTICE_DIALOG", emptyKeys, unknownCommands), "RESULT");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- [Command.Debug("PixiEditor.Debug.ClearRecentDocument", "Clear recent documents", "Clear recently opened documents")]
|
|
|
|
|
|
+ [Command.Debug("PixiEditor.Debug.ClearRecentDocument", "CLEAR_RECENT_DOCUMENTS", "CLEAR_RECENTLY_OPENED_DOCUMENTS")]
|
|
public void ClearRecentDocuments()
|
|
public void ClearRecentDocuments()
|
|
{
|
|
{
|
|
Owner.FileSubViewModel.RecentlyOpened.Clear();
|
|
Owner.FileSubViewModel.RecentlyOpened.Clear();
|
|
IPreferences.Current.UpdateLocalPreference(PreferencesConstants.RecentlyOpened, Array.Empty<object>());
|
|
IPreferences.Current.UpdateLocalPreference(PreferencesConstants.RecentlyOpened, Array.Empty<object>());
|
|
}
|
|
}
|
|
|
|
|
|
- [Command.Debug("PixiEditor.Debug.OpenCommandDebugWindow", "Open command debug window", "Open command debug window")]
|
|
|
|
|
|
+ [Command.Debug("PixiEditor.Debug.OpenCommandDebugWindow", "OPEN_CMD_DEBUG_WINDOW", "OPEN_CMD_DEBUG_WINDOW")]
|
|
public void OpenCommandDebugWindow()
|
|
public void OpenCommandDebugWindow()
|
|
{
|
|
{
|
|
Mouse.OverrideCursor = Cursors.Wait;
|
|
Mouse.OverrideCursor = Cursors.Wait;
|
|
@@ -147,28 +148,28 @@ internal class DebugViewModel : SubViewModel<ViewModelMain>
|
|
Mouse.OverrideCursor = null;
|
|
Mouse.OverrideCursor = null;
|
|
}
|
|
}
|
|
|
|
|
|
- [Command.Debug("PixiEditor.Debug.OpenInstallDirectory", "Open Installation Directory", "Open Installation Directory", IconPath = "Folder.png")]
|
|
|
|
|
|
+ [Command.Debug("PixiEditor.Debug.OpenInstallDirectory", "OPEN_INSTALLATION_DIR", "OPEN_INSTALLATION_DIR", IconPath = "Folder.png")]
|
|
public static void OpenInstallLocation()
|
|
public static void OpenInstallLocation()
|
|
{
|
|
{
|
|
ProcessHelpers.ShellExecuteEV(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
|
|
ProcessHelpers.ShellExecuteEV(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
|
|
}
|
|
}
|
|
|
|
|
|
- [Command.Debug("PixiEditor.Debug.Crash", "Crash", "Crash Application")]
|
|
|
|
|
|
+ [Command.Debug("PixiEditor.Debug.Crash", "CRASH", "CRASH_APP")]
|
|
public static void Crash() => throw new InvalidOperationException("User requested to crash :c");
|
|
public static void Crash() => throw new InvalidOperationException("User requested to crash :c");
|
|
|
|
|
|
- [Command.Debug("PixiEditor.Debug.DeleteUserPreferences", @"%appdata%\PixiEditor\user_preferences.json", "Delete User Preferences (Roaming)", "Delete User Preferences (Roaming AppData)")]
|
|
|
|
- [Command.Debug("PixiEditor.Debug.DeleteShortcutFile", @"%appdata%\PixiEditor\shortcuts.json", "Delete Shortcut File (Roaming)", "Delete Shortcut File (Roaming AppData)")]
|
|
|
|
- [Command.Debug("PixiEditor.Debug.DeleteEditorData", @"%localappdata%\PixiEditor\editor_data.json", "Delete Editor Data (Local)", "Delete Editor Data (Local AppData)")]
|
|
|
|
|
|
+ [Command.Debug("PixiEditor.Debug.DeleteUserPreferences", @"%appdata%\PixiEditor\user_preferences.json", "DELETE_USR_PREFS", "DELETE_USR_PREFS")]
|
|
|
|
+ [Command.Debug("PixiEditor.Debug.DeleteShortcutFile", @"%appdata%\PixiEditor\shortcuts.json", "DELETE_SHORTCUT_FILE", "DELETE_SHORTCUT_FILE")]
|
|
|
|
+ [Command.Debug("PixiEditor.Debug.DeleteEditorData", @"%localappdata%\PixiEditor\editor_data.json", "DELETE_EDITOR_DATA", "DELETE_EDITOR_DATA")]
|
|
public static void DeleteFile(string path)
|
|
public static void DeleteFile(string path)
|
|
{
|
|
{
|
|
string file = Environment.ExpandEnvironmentVariables(path);
|
|
string file = Environment.ExpandEnvironmentVariables(path);
|
|
if (!File.Exists(file))
|
|
if (!File.Exists(file))
|
|
{
|
|
{
|
|
- NoticeDialog.Show($"File {path} does not exist\n(Full Path: {file})", "File not found");
|
|
|
|
|
|
+ NoticeDialog.Show(new LocalizedString("File {0} does not exist\n(Full Path: {1})", path, file), "FILE_NOT_FOUND");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- OptionsDialog<string> dialog = new("Are you sure?", $"Are you sure you want to delete {path}?\nThis data will be lost for all installations.\n(Full Path: {file})")
|
|
|
|
|
|
+ OptionsDialog<string> dialog = new("ARE_YOU_SURE", new LocalizedString("ARE_YOU_SURE_PATH_FULL_PATH", path, file))
|
|
{
|
|
{
|
|
{ "Yes", x => File.Delete(file) },
|
|
{ "Yes", x => File.Delete(file) },
|
|
"Cancel"
|
|
"Cancel"
|