From 4d96a26cd0f71aa84bc8fe7a60d507fe2b6b974d Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Wed, 1 Mar 2017 13:48:49 -0800 Subject: [PATCH] Moved all the easy static localized strings to non-static strings --- AboutPage/UpdateControlView.cs | 4 ++-- .../ApplicationSettings/ApplicationSettingsView.cs | 4 ++-- History/PrintHistoryData.cs | 11 ++++++----- PartPreviewWindow/View3D/View3DCreateSelectionData.cs | 4 ++-- PartPreviewWindow/ViewGcodeBasic.cs | 8 ++++---- PrinterControls/TerminalWindow/TerminalWidget.cs | 4 ++-- Queue/PrintItemWrapper.cs | 7 +++---- SetupWizard/CopyGuestProfilesToUser.cs | 2 +- SetupWizard/ImportSettingsPage.cs | 11 ++++++----- SlicerConfiguration/SliceSettingsDetailControl.cs | 4 ++-- 10 files changed, 30 insertions(+), 29 deletions(-) diff --git a/AboutPage/UpdateControlView.cs b/AboutPage/UpdateControlView.cs index 282b59c7d..9c48db9de 100644 --- a/AboutPage/UpdateControlView.cs +++ b/AboutPage/UpdateControlView.cs @@ -127,8 +127,8 @@ namespace MatterHackers.MatterControl UpdateControlData.Instance.InitiateUpdateDownload(); } - static string recommendedUpdateAvailable = "There is a recommended update available.".Localize(); - static string requiredUpdateAvailable = "There is a required update available.".Localize(); + string recommendedUpdateAvailable = "There is a recommended update available.".Localize(); + string requiredUpdateAvailable = "There is a required update available.".Localize(); private void UpdateStatusChanged(object sender, EventArgs e) { diff --git a/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs b/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs index 4040bf525..b77515d6f 100644 --- a/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs +++ b/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs @@ -502,8 +502,8 @@ namespace MatterHackers.MatterControl.ConfigurationPage return buttonRow; } - private static string rebuildThumbnailsMessage = "You are switching to a different thumbnail rendering mode. If you want, your current thumbnails can be removed and recreated in the new style. You can switch back and forth at any time. There will be some processing overhead while the new thumbnails are created.\n\nDo you want to rebuild your existing thumbnails now?".Localize(); - private static string rebuildThumbnailsTitle = "Rebuild Thumbnails Now".Localize(); + private string rebuildThumbnailsMessage = "You are switching to a different thumbnail rendering mode. If you want, your current thumbnails can be removed and recreated in the new style. You can switch back and forth at any time. There will be some processing overhead while the new thumbnails are created.\n\nDo you want to rebuild your existing thumbnails now?".Localize(); + private string rebuildThumbnailsTitle = "Rebuild Thumbnails Now".Localize(); private void AddHandlers() { diff --git a/History/PrintHistoryData.cs b/History/PrintHistoryData.cs index b24de40bf..65ba0f081 100644 --- a/History/PrintHistoryData.cs +++ b/History/PrintHistoryData.cs @@ -42,15 +42,16 @@ namespace MatterHackers.MatterControl.PrintHistory { public static class PrintRecovery { - static string recoverPrint = "Recover Print".Localize(); - static string cancelRecovery = "Cancel".Localize(); - static string printRecoveryWarningMessage = "WARNING: In order to perform print recovery, your printer must move down to reach its home position.\nIf your print is too large, part of your printer may collide with it when moving down.\nMake sure it is safe to perform this operation before proceeding.".Localize(); - static string printRecoveryMessage = "It appears your last print failed to complete.\n\nWould your like to attempt to recover from the last know position?".Localize(); - static string recoverPrintTitle = "Recover Last Print".Localize(); static PrintTask lastPrintTask; public static void CheckIfNeedToRecoverPrint(object sender, EventArgs e) { + string recoverPrint = "Recover Print".Localize(); + string cancelRecovery = "Cancel".Localize(); + string printRecoveryWarningMessage = "WARNING: In order to perform print recovery, your printer must move down to reach its home position.\nIf your print is too large, part of your printer may collide with it when moving down.\nMake sure it is safe to perform this operation before proceeding.".Localize(); + string printRecoveryMessage = "It appears your last print failed to complete.\n\nWould your like to attempt to recover from the last know position?".Localize(); + string recoverPrintTitle = "Recover Last Print".Localize(); + foreach (PrintTask lastPrint in PrintHistoryData.Instance.GetHistoryItems(1)) { if (!lastPrint.PrintComplete // Top Print History Item is not complete diff --git a/PartPreviewWindow/View3D/View3DCreateSelectionData.cs b/PartPreviewWindow/View3D/View3DCreateSelectionData.cs index 7f13ffcd6..e8f27e743 100644 --- a/PartPreviewWindow/View3D/View3DCreateSelectionData.cs +++ b/PartPreviewWindow/View3D/View3DCreateSelectionData.cs @@ -40,8 +40,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { public partial class View3DWidget { - private static string PartsNotPrintableMessage = "Parts are not on the bed or outside the print area.\n\nWould you like to center them on the bed?".Localize(); - private static string PartsNotPrintableTitle = "Parts not in print area".Localize(); + private string PartsNotPrintableMessage = "Parts are not on the bed or outside the print area.\n\nWould you like to center them on the bed?".Localize(); + private string PartsNotPrintableTitle = "Parts not in print area".Localize(); private void CreateSelectionData() { diff --git a/PartPreviewWindow/ViewGcodeBasic.cs b/PartPreviewWindow/ViewGcodeBasic.cs index 4b8056938..016f2fa9e 100644 --- a/PartPreviewWindow/ViewGcodeBasic.cs +++ b/PartPreviewWindow/ViewGcodeBasic.cs @@ -80,10 +80,10 @@ namespace MatterHackers.MatterControl.PartPreviewWindow public delegate Vector2 GetSizeFunction(); - private static string slicingErrorMessage = "Slicing Error.\nPlease review your slice settings.".Localize(); - private static string pressGenerateMessage = "Press 'generate' to view layers".Localize(); - private static string fileNotFoundMessage = "File not found on disk.".Localize(); - private static string fileTooBigToLoad = "GCode file too big to preview ({0}).".Localize(); + private string slicingErrorMessage = "Slicing Error.\nPlease review your slice settings.".Localize(); + private string pressGenerateMessage = "Press 'generate' to view layers".Localize(); + private string fileNotFoundMessage = "File not found on disk.".Localize(); + private string fileTooBigToLoad = "GCode file too big to preview ({0}).".Localize(); private Vector2 bedCenter; private Vector3 viewerVolume; diff --git a/PrinterControls/TerminalWindow/TerminalWidget.cs b/PrinterControls/TerminalWindow/TerminalWidget.cs index 35625ffd1..df0e3f6ae 100644 --- a/PrinterControls/TerminalWindow/TerminalWidget.cs +++ b/PrinterControls/TerminalWindow/TerminalWidget.cs @@ -217,8 +217,8 @@ namespace MatterHackers.MatterControl } #endif - readonly static string writeFaildeWaring = "WARNING: Write Failed!".Localize(); - readonly static string cantAccessPath = "Can't access '{0}'.".Localize(); + string writeFaildeWaring = "WARNING: Write Failed!".Localize(); + string cantAccessPath = "Can't access '{0}'.".Localize(); private void onExportLogFileSelected(SaveFileDialogParams saveParams) { diff --git a/Queue/PrintItemWrapper.cs b/Queue/PrintItemWrapper.cs index efc3582a2..1546d4c82 100644 --- a/Queue/PrintItemWrapper.cs +++ b/Queue/PrintItemWrapper.cs @@ -46,11 +46,10 @@ namespace MatterHackers.MatterControl.PrintQueue public event EventHandler SlicingDone; public event EventHandler SlicingOutputMessage; - private static string fileNotFound = "File Not Found\n'{0}'".Localize(); - private static string readyToPrint = "Ready to Print".Localize(); - - private static string slicingError = "Slicing Error".Localize(); + private string fileNotFound = "File Not Found\n'{0}'".Localize(); + private string readyToPrint = "Ready to Print".Localize(); + private string slicingError = "Slicing Error".Localize(); private bool doneSlicing; diff --git a/SetupWizard/CopyGuestProfilesToUser.cs b/SetupWizard/CopyGuestProfilesToUser.cs index 7458c4077..ea9d02e96 100644 --- a/SetupWizard/CopyGuestProfilesToUser.cs +++ b/SetupWizard/CopyGuestProfilesToUser.cs @@ -42,7 +42,7 @@ namespace MatterHackers.MatterControl { public class CopyGuestProfilesToUser : WizardPage { - static string importMessage = "It's time to copy your existing printer settings to your MatterHackers account. Once copied, these printers will be available whenever you sign in to MatterControl. Printers that are not copied will only be available when not signed in.".Localize(); + string importMessage = "It's time to copy your existing printer settings to your MatterHackers account. Once copied, these printers will be available whenever you sign in to MatterControl. Printers that are not copied will only be available when not signed in.".Localize(); List checkBoxes = new List(); diff --git a/SetupWizard/ImportSettingsPage.cs b/SetupWizard/ImportSettingsPage.cs index 25d5a0abc..9caa30f7a 100644 --- a/SetupWizard/ImportSettingsPage.cs +++ b/SetupWizard/ImportSettingsPage.cs @@ -40,7 +40,7 @@ namespace MatterHackers.MatterControl { public class SelectPartsOfPrinterToImport : WizardPage { - private static string importMessage = "Select what you would like to merge into your current profile.".Localize(); + private string importMessage = "Select what you would like to merge into your current profile.".Localize(); private string settingsFilePath; private PrinterSettings settingsToImport; @@ -239,7 +239,8 @@ namespace MatterHackers.MatterControl if (!isMergeIntoUserLayer) { string sourceName = isMergeIntoUserLayer ? Path.GetFileNameWithoutExtension(settingsFilePath) : destinationLayer[SettingsKey.layer_name]; - successMessage = ImportSettingsPage.importSettingSuccessMessage.FormatWith(sourceName, sectionName); + string importSettingSuccessMessage = "You have successfully imported a new {1} setting. You can find '{0}' in your list of {1} settings.".Localize(); + successMessage = importSettingSuccessMessage.FormatWith(sourceName, sectionName); } WizardWindow.ChangeToPage(new ImportSucceeded(successMessage) @@ -250,7 +251,7 @@ namespace MatterHackers.MatterControl } } - private static string importPrinterSuccessMessage = "Settings have been merged into your current printer.".Localize(); + private string importPrinterSuccessMessage = "Settings have been merged into your current printer.".Localize(); } public class ImportSucceeded : WizardPage @@ -399,8 +400,8 @@ namespace MatterHackers.MatterControl return container; } - private static string importPrinterSuccessMessage = "You have successfully imported a new printer profile. You can find '{0}' in your list of available printers.".Localize(); - internal static string importSettingSuccessMessage = "You have successfully imported a new {1} setting. You can find '{0}' in your list of {1} settings.".Localize(); + protected string importPrinterSuccessMessage = "You have successfully imported a new printer profile. You can find '{0}' in your list of available printers.".Localize(); + protected string importSettingSuccessMessage = "You have successfully imported a new {1} setting. You can find '{0}' in your list of {1} settings.".Localize(); private void ImportSettingsFile(string settingsFilePath) { diff --git a/SlicerConfiguration/SliceSettingsDetailControl.cs b/SlicerConfiguration/SliceSettingsDetailControl.cs index 674bb5f4d..27073c86f 100644 --- a/SlicerConfiguration/SliceSettingsDetailControl.cs +++ b/SlicerConfiguration/SliceSettingsDetailControl.cs @@ -18,8 +18,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration private CheckBox showHelpBox; private TupleList> slicerOptionsMenuItems; - private static string resetToDefaultsMessage = "Resetting to default values will remove your current overrides and restore your original printer settings.\nAre you sure you want to continue?".Localize(); - private static string resetToDefaultsWindowTitle = "Revert Settings".Localize(); + string resetToDefaultsMessage = "Resetting to default values will remove your current overrides and restore your original printer settings.\nAre you sure you want to continue?".Localize(); + string resetToDefaultsWindowTitle = "Revert Settings".Localize(); bool primarySettingsView; public SliceSettingsDetailControl(List layerCascade)