From b519a8718fd00945d6394ab3564706ed448a4bcf Mon Sep 17 00:00:00 2001 From: Souryo Date: Sat, 2 Sep 2017 15:44:39 -0400 Subject: [PATCH] UI: Improved error handling in config wizard --- GUI.NET/Dependencies/resources.ca.xml | 6 +++++- GUI.NET/Dependencies/resources.en.xml | 3 ++- GUI.NET/Dependencies/resources.es.xml | 3 ++- GUI.NET/Dependencies/resources.fr.xml | 3 ++- GUI.NET/Dependencies/resources.ja.xml | 3 ++- GUI.NET/Dependencies/resources.pt.xml | 5 +++-- GUI.NET/Dependencies/resources.ru.xml | 3 ++- GUI.NET/Dependencies/resources.uk.xml | 5 +++-- GUI.NET/Forms/frmConfigWizard.cs | 15 +++++++++++++-- 9 files changed, 34 insertions(+), 12 deletions(-) diff --git a/GUI.NET/Dependencies/resources.ca.xml b/GUI.NET/Dependencies/resources.ca.xml index fef9bfe2..1c9fb2b3 100644 --- a/GUI.NET/Dependencies/resources.ca.xml +++ b/GUI.NET/Dependencies/resources.ca.xml @@ -610,6 +610,10 @@ Mesen ha sigut incapaç de trobar cap joc. + The selected folder cannot be written to - please select another folder and try again. Details: {0} + The following path overrides are invalid: {0} Please use valid and writable folders and try again. + All files will be copied from: {0} to {1} Once the copy is completed, Mesen will restart. Continue? + Pista següent (Manteniu per avançar ràpidament) [sense nom] [desconegut] @@ -622,7 +626,7 @@ Fitxer no trobat: {0} La bios seleccionada no és vàlida. - Aquesta opció permet a Mesen carregar els paquets d'alta resolució d'HDNes que trobi. Els paquets d'alta resolució han d'estar a la carpeta "HdPacks" dins d'una altra carpeta amb el mateix nom que la ROM. Exemple: Posem per cas que tenim una rom anomenada "LaMevaRom.nes", el seu paquet hauria d'estar a "HdPacks\LaMevaRom\hires.txt". Nota: El suport per paquets d'alta resolució encara no és perfecte, ja que romanen algunes limitacions. + Aquesta opció permet a Mesen carregar els paquets d'alta resolució d'HDNes que trobi. Els paquets d'alta resolució han d'estar a la carpeta "HdPacks" dins d'una altra carpeta amb el mateix nom que la ROM. Exemple: Posem per cas que tenim una rom anomenada "LaMevaRom.nes", el seu paquet hauria d'estar a "HdPacks\LaMevaRom\hires.txt". Tria el tipus d'escalat i filtre de vídeo que s'utilitzaran quan es generin els fitxers PNG per al paquet d'alta resolució. Fes servir els filtres de preescalat per a generar les tiles a una escala major sense aplicar cap transformació als píxels. Aquesta opció només està disponible per a jocs de RAM de tipus CHR. Els jocs de RAM de tipus CHR no tenen "bancs" fixos - van sent creats dinàmicament pel codi del joc. Aquesta opció altera el funcionament a l'hora d'agrupar les tiles als fitxers PNG - un banc petit normalment donarà a lloc a menys fitxers PNG (tot i que depenent en el codi del joc, valors més alts poden produir millors resultats). Quan aquesta opció està activada, les tiles als fitxers PNG s'ordenen per la freqüència amb les que es mostren a la pantalla mentre s'estigui gravant (les paletes més comunes s'agruparan conjuntament al primer fitxer per a un nombre de banc específic. Si aquesta casella està desmarcada, els fitxers PNG s'ordenaran per paleta - en aquest cas, cada fitxer PNG contindrà només 4 colors diferents. diff --git a/GUI.NET/Dependencies/resources.en.xml b/GUI.NET/Dependencies/resources.en.xml index 302842d7..0d243a48 100644 --- a/GUI.NET/Dependencies/resources.en.xml +++ b/GUI.NET/Dependencies/resources.en.xml @@ -31,6 +31,7 @@ Mesen could not find any games to load. + The selected folder cannot be written to - please select another folder and try again. Details: {0} The following path overrides are invalid: {0} Please use valid and writable folders and try again. All files will be copied from: {0} to {1} Once the copy is completed, Mesen will restart. Continue? @@ -50,7 +51,7 @@ File not found: {0} The selected bios file is invalid. - This option allows Mesen to load HDNes-format HD packs if they are found. HD Packs should be placed in the "HdPacks" folder in a subfolder matching the name of the ROM. e.g: MyRom.nes should have their HD Pack in "HdPacks\MyRom\hires.txt". Note: Support for HD Packs is a work in progress and some limitations remain. + This option allows Mesen to load HDNes-format HD packs if they are found. HD Packs should be placed in the "HdPacks" folder in a subfolder matching the name of the ROM. e.g: MyRom.nes should have their HD Pack in "HdPacks\MyRom\hires.txt". Selects the scale and video filter to use when generating the PNG files for the HD Pack. Use the "Prescale" filters to generate the tiles at a larger scale without applying any transformation to the pixels. This option is only available for CHR RAM games. CHR RAM games have no fixed "banks" - they are dynamically created by the game's code. This option alters the HD Pack Builder's behavior when grouping the tiles into the PNG files - a smaller bank size will usually result in less PNG files (but depending on the game's code, it larger values may produce better results). When this option is enabled, the tiles in PNG files are sorted by the frequency at which they are shown on the screen while recording (more common palettes will be grouped together in the first PNG for a specific bank number. If this option is unchecked, the PNGs will be sorted by palette - each PNG will only contain up to 4 different colors in this case. diff --git a/GUI.NET/Dependencies/resources.es.xml b/GUI.NET/Dependencies/resources.es.xml index 732b2796..dcd2253d 100644 --- a/GUI.NET/Dependencies/resources.es.xml +++ b/GUI.NET/Dependencies/resources.es.xml @@ -644,6 +644,7 @@ Mesen no puede encontrar ningún juego para cargar. + The selected folder cannot be written to - please select another folder and try again. Details: {0} The following path overrides are invalid: {0} Please use valid and writable folders and try again. All files will be copied from: {0} to {1} Once the copy is completed, Mesen will restart. Continue? @@ -659,7 +660,7 @@ Archivo no encontrado: {0} La bios seleccionada no es válida. - Esta opción permite los paquetes de gráficos en alta resolución de carga Mesen en el mismo formato que los del emulador HDNes. Los paquetes de alta resolución deberán ser colocados en los "HdPacks" en una subcarpeta con el nombre de la ROM. Ejemplo: Un paquete para "MiRom.nes" debe estar colocado en "HdPacks\MiRom\hires.txt". Nota: El soporte para paquetes de alta resolución aún no es perfecto - algunas limitaciones siguen presentes. + Esta opción permite los paquetes de gráficos en alta resolución de carga Mesen en el mismo formato que los del emulador HDNes. Los paquetes de alta resolución deberán ser colocados en los "HdPacks" en una subcarpeta con el nombre de la ROM. Ejemplo: Un paquete para "MiRom.nes" debe estar colocado en "HdPacks\MiRom\hires.txt". Escoge el tipo de escalado y filtro de vídeo a usar cuando se generen los ficheros PNG para el paquete de alta resolución. Usa los filtros "Prescale" para generar las tiles a una escala mayor sin aplicar ninguna transformación a los píxeles. Esta opción solo está disponible para juegos de RAM tipo CHR. Los juegos de RAM tipo CHR no tienen "bancos" fijos - van siendo creados dinámicamente por el código del juego. Esta opción altera el funcionamiento a la hora de agrupar tiles en los ficheros PNG - un banco pequeño normalmente dará lugar a menos archivos PNG (aunque dependiendo en el código del juego, valores más altos pueden producir mejores resultados). Cuando esta opción está habilitada, las tiles en los ficheros PNG se ordenan por la frecuencia en que se muestren en la pantalla mientras se esté grabando (paletas más comunes se agruparan conjuntamente en el primer archivo para un número de banco específico. Si esta casilla está desmarcada, los archivos PNG se ordenarán por paleta - en ese caso, cada archivo PNG contendrá solamente 4 colores diferentes. diff --git a/GUI.NET/Dependencies/resources.fr.xml b/GUI.NET/Dependencies/resources.fr.xml index cc4b0d65..d3d5ca9a 100644 --- a/GUI.NET/Dependencies/resources.fr.xml +++ b/GUI.NET/Dependencies/resources.fr.xml @@ -655,6 +655,7 @@ Mesen n'a pas trouvé de jeu sur votre disque. + Impossible d'écrire dans le dossier choisi - veuillez choisir un autre dossier et essayer à nouveau. Détails: {0} Les dossiers suivants sont invalides : {0} Veuillez entrer des noms de dossier valides et essayer à nouveau. Tous les fichiers seront copiés du dossier: {0} au dossier {1} Une fois la copie terminée, Mesen redémarrera. Voulez-vous continuer? @@ -674,7 +675,7 @@ Fichier non trouvé: {0} Le bios sélectionné est invalide. - Cette option permet à Mesen de charger des packages de graphiques haute-résolution dans le même format que l'émulateur HDNes. Les packages haute-résolution doivent être placés dans le dossier "HdPacks", dans un sous-dossier correspondant au nom du ROM. Exemple : Un package pour "MonRom.nes" doit être placé dans "HdPacks\MonRom\hires.txt". Note: Le support pour les packages haute-résolution n'est pas encore parfait - certaines limitations sont encore présentes. + Cette option permet à Mesen de charger des packages de graphiques haute-résolution dans le même format que l'émulateur HDNes. Les packages haute-résolution doivent être placés dans le dossier "HdPacks", dans un sous-dossier correspondant au nom du ROM. Exemple : Un package pour "MonRom.nes" doit être placé dans "HdPacks\MonRom\hires.txt". Sélectionne la taille et le filtre à utiliser lors de la génération des fichiers PNG pour le HD Pack. Utilisez les filtres "Prescale" pour générer l'image avec une plus grande taille sans appliquer un filtre aux pixels. Cette option est uniquement disponible pour les jeux de type CHR RAM. Les jeux CHR RAM n'ont pas de banques CHR prédéfinies - elles sont générées dynamiquement par le code. Cette option altère la façon dont le créateur de HD Packs groupe les tiles dans les fichiers PNG. Une taille de banque plus petite résulte généralement en moins de fichier PNG différents (mais les résultats varient d'un jeu à l'autre - une plus grosse valeur peut être mieux selon le jeu). Quand cette option est activée, les tiles sont triés selon la fréquence à laquelle elles apparaissent à l'écran pendant l'enregistrement (les palettes de couleurs plus fréquentes seront regroupées dans la même image PNG pour une banque donnée. Si cette option est désactivée, les tiles seront regroupées par palette, donc chaque image PNG comportera au plus 4 couleurs différentes. diff --git a/GUI.NET/Dependencies/resources.ja.xml b/GUI.NET/Dependencies/resources.ja.xml index f608b240..c8b62af5 100644 --- a/GUI.NET/Dependencies/resources.ja.xml +++ b/GUI.NET/Dependencies/resources.ja.xml @@ -638,6 +638,7 @@ Mesenはゲームファイルを見つかりませんでした。 + 指定されたフォルダに書き込むことは出来ません。他のフォルダを選択してください。 エラーの詳細: {0} 次のフォルダには書き込むことが出来ません: {0} 書き込むことが出来るフォルダを選択してください。 全てのファイルが {0} から {1} にコピーされます。 コピーが終わったら、Mesenが再起動します. よろしいですか? @@ -657,7 +658,7 @@ ファイルが見つかりません: {0} 選んだBIOSファイルは使えません。 - このオプションを有効にすれば、MesenはHDNesのようにHDパックをロード出来るようになります。 HDパックはMesenのフォルダの中にある「HdPacks」のフォルダにゲームと同じ名前のサブフォルダに置くと自動的にロードされます。 例)ゲームファイルは「MyRom.nes」なら、「HdPacks\MyRom」にHDパックを置くとロードされます。 この機能はまだ開発中で、不完全なところがあります、ご了承ください。 + このオプションを有効にすれば、MesenはHDNesのようにHDパックをロード出来るようになります。 HDパックはMesenのフォルダの中にある「HdPacks」のフォルダにゲームと同じ名前のサブフォルダに置くと自動的にロードされます。 例)ゲームファイルは「MyRom.nes」なら、「HdPacks\MyRom」にHDパックを置くとロードされます。 Selects the scale and video filter to use when generating the PNG files for the HD Pack. Use the "Prescale" filters to generate the tiles at a larger scale without applying any transformation to the pixels. This option is only available for CHR RAM games. CHR RAM games have no fixed "banks" - they are dynamically created by the game's code. This option alters the HD Pack Builder's behavior when grouping the tiles into the PNG files - a smaller bank size will usually result in less PNG files (but depending on the game's code, it larger values may produce better results). When this option is enabled, the tiles in PNG files are sorted by the frequency at which they are shown on the screen while recording (more common palettes will be grouped together in the first PNG for a specific bank number. If this option is unchecked, the PNGs will be sorted by palette - each PNG will only contain up to 4 different colors in this case. diff --git a/GUI.NET/Dependencies/resources.pt.xml b/GUI.NET/Dependencies/resources.pt.xml index 480316eb..7edd956f 100644 --- a/GUI.NET/Dependencies/resources.pt.xml +++ b/GUI.NET/Dependencies/resources.pt.xml @@ -643,7 +643,8 @@ Warning: This will reset ALL of settings and cannot be undone! Continue? Mesen não encontrou nenhum jogo para carregar. - + + The selected folder cannot be written to - please select another folder and try again. Details: {0} The following path overrides are invalid: {0} Please use valid and writable folders and try again. All files will be copied from: {0} to {1} Once the copy is completed, Mesen will restart. Continue? @@ -659,7 +660,7 @@ Arquivo não encontrado: {0} A bios selecionada não é válida. - Esta opção permite os pacotes de gráficos de alta resolução sejam carregados no mesmo formato que os do emulador HDNes. Os pacotes de alta resolução devem ser colocados nos "HdPacks" em uma subpasta com o mesmo nome da ROM. Exemplo: Um pacote para "MinhaRom.nes" deve ser colocado em "HdPacks\MinhaRom\hires.txt". Nota: O suporte para os pacotes de alta resolução não é perfeito - algumas limitações seguem presentes. + Esta opção permite os pacotes de gráficos de alta resolução sejam carregados no mesmo formato que os do emulador HDNes. Os pacotes de alta resolução devem ser colocados nos "HdPacks" em uma subpasta com o mesmo nome da ROM. Exemplo: Um pacote para "MinhaRom.nes" deve ser colocado em "HdPacks\MinhaRom\hires.txt". Selects the scale and video filter to use when generating the PNG files for the HD Pack. Use the "Prescale" filters to generate the tiles at a larger scale without applying any transformation to the pixels. This option is only available for CHR RAM games. CHR RAM games have no fixed "banks" - they are dynamically created by the game's code. This option alters the HD Pack Builder's behavior when grouping the tiles into the PNG files - a smaller bank size will usually result in less PNG files (but depending on the game's code, it larger values may produce better results). When this option is enabled, the tiles in PNG files are sorted by the frequency at which they are shown on the screen while recording (more common palettes will be grouped together in the first PNG for a specific bank number. If this option is unchecked, the PNGs will be sorted by palette - each PNG will only contain up to 4 different colors in this case. diff --git a/GUI.NET/Dependencies/resources.ru.xml b/GUI.NET/Dependencies/resources.ru.xml index dc58dce5..a770e549 100644 --- a/GUI.NET/Dependencies/resources.ru.xml +++ b/GUI.NET/Dependencies/resources.ru.xml @@ -645,6 +645,7 @@ Mesen could not find any games to load. + The selected folder cannot be written to - please select another folder and try again. Details: {0} The following path overrides are invalid: {0} Please use valid and writable folders and try again. All files will be copied from: {0} to {1} Once the copy is completed, Mesen will restart. Continue? @@ -664,7 +665,7 @@ Файл не найден: {0} Выбранный биос некорректный. - Данная опция позволяет использовать HD packs для эмулятора HDNes если они найдены. HD Packs должны быть помещены в папку "HdPacks" в папке с именем совпадающем с именем ROM. например: HD Pack для MyRom.nes должны лежать в "HdPacks\MyRom\hires.txt". Замечание: Поддержка HD Packs не закончена и имеет ряд ограничений. + Данная опция позволяет использовать HD packs для эмулятора HDNes если они найдены. HD Packs должны быть помещены в папку "HdPacks" в папке с именем совпадающем с именем ROM. например: HD Pack для MyRom.nes должны лежать в "HdPacks\MyRom\hires.txt". Selects the scale and video filter to use when generating the PNG files for the HD Pack. Use the "Prescale" filters to generate the tiles at a larger scale without applying any transformation to the pixels. This option is only available for CHR RAM games. CHR RAM games have no fixed "banks" - they are dynamically created by the game's code. This option alters the HD Pack Builder's behavior when grouping the tiles into the PNG files - a smaller bank size will usually result in less PNG files (but depending on the game's code, it larger values may produce better results). When this option is enabled, the tiles in PNG files are sorted by the frequency at which they are shown on the screen while recording (more common palettes will be grouped together in the first PNG for a specific bank number. If this option is unchecked, the PNGs will be sorted by palette - each PNG will only contain up to 4 different colors in this case. diff --git a/GUI.NET/Dependencies/resources.uk.xml b/GUI.NET/Dependencies/resources.uk.xml index 5b6d0fec..0ae3c3a8 100644 --- a/GUI.NET/Dependencies/resources.uk.xml +++ b/GUI.NET/Dependencies/resources.uk.xml @@ -644,7 +644,8 @@ Warning: This will reset ALL of settings and cannot be undone! Continue? Mesen не зміг знайти будь-які ігри для завантаження. - + + The selected folder cannot be written to - please select another folder and try again. Details: {0} The following path overrides are invalid: {0} Please use valid and writable folders and try again. All files will be copied from: {0} to {1} Once the copy is completed, Mesen will restart. Continue? @@ -664,7 +665,7 @@ Файл не знайдено: {0} Обраний биос некоректний. - Дана опція дозволяє використовувати HD packs для емулятора HDNes якщо вони знайдени. HD Packs повинні бути поміщені в папку "HdPacks" в папці з ім'ям збігається з ім'ям ROM. наприклад: HD Pack для MyRom.nes повинні лежати в "HdPacks\MyRom\hires.txt". Зауваження: Підтримка HD Packs не закінчена і має ряд обмежень. + Дана опція дозволяє використовувати HD packs для емулятора HDNes якщо вони знайдени. HD Packs повинні бути поміщені в папку "HdPacks" в папці з ім'ям збігається з ім'ям ROM. наприклад: HD Pack для MyRom.nes повинні лежати в "HdPacks\MyRom\hires.txt". Selects the scale and video filter to use when generating the PNG files for the HD Pack. Use the "Prescale" filters to generate the tiles at a larger scale without applying any transformation to the pixels. This option is only available for CHR RAM games. CHR RAM games have no fixed "banks" - they are dynamically created by the game's code. This option alters the HD Pack Builder's behavior when grouping the tiles into the PNG files - a smaller bank size will usually result in less PNG files (but depending on the game's code, it larger values may produce better results). When this option is enabled, the tiles in PNG files are sorted by the frequency at which they are shown on the screen while recording (more common palettes will be grouped together in the first PNG for a specific bank number. If this option is unchecked, the PNGs will be sorted by palette - each PNG will only contain up to 4 different colors in this case. diff --git a/GUI.NET/Forms/frmConfigWizard.cs b/GUI.NET/Forms/frmConfigWizard.cs index aa1e5ca4..f6f375ad 100644 --- a/GUI.NET/Forms/frmConfigWizard.cs +++ b/GUI.NET/Forms/frmConfigWizard.cs @@ -122,8 +122,19 @@ namespace Mesen.GUI.Forms private void btnOk_Click(object sender, EventArgs e) { - this.InitializeConfig(); - this.Close(); + string targetFolder = radStoragePortable.Checked ? ConfigManager.DefaultPortableFolder : ConfigManager.DefaultDocumentsFolder; + string testFile = Path.Combine(targetFolder, "test.txt"); + try { + if(!Directory.Exists(targetFolder)) { + Directory.CreateDirectory(targetFolder); + } + File.WriteAllText(testFile, "test"); + File.Delete(testFile); + this.InitializeConfig(); + this.Close(); + } catch(Exception ex) { + MesenMsgBox.Show("CannotWriteToFolder", MessageBoxButtons.OK, MessageBoxIcon.Error, ex.ToString()); + } } private void lblCancel_Click(object sender, EventArgs e)