Skip to content

Commit

Permalink
Add ability to set the custom icons folder path. (vscode-icons#1087)
Browse files Browse the repository at this point in the history
* Add ability to set the custom icons folder path.

* Add Chinese (Simplified) translation.

* Apply proposed changes.

* Add German translation.

* Add Itallian translation.

* Add Spanish translation.

* Apply function renamings.

* Refactor 'restoreManifest' to use straightly the  'generateJson' func.

* Add Russian translation.

* Resolve conflicts.

* Resolve conflicts again.
  • Loading branch information
JimiC authored and robertohuertasm committed Jul 25, 2017
1 parent 8e7a66c commit 1a9bd25
Show file tree
Hide file tree
Showing 22 changed files with 356 additions and 146 deletions.
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@
"default": false,
"description": "%configuration.presets.foldersAllDefaultIcon.description%"
},
"vsicons.customIconFolderPath": {
"type": "string",
"default": "",
"description": "%configuration.customIconFolderPath.description%"
},
"vsicons.associations.files": {
"type": "array",
"default": [],
Expand Down
3 changes: 2 additions & 1 deletion package.nls.de.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"command.restoreIcons.title": "Icon-Manifest zurücksetzen",
"command.resetProjectDetectionDefaults.title": "Projekterkennung auf Standardwerte zurücksetzen",
"configuration.title": "vscode-icons Konfiguration",
"configuration.dontShowNewVersionMessage.description": "Wenn auf 'true' gesetzt, zeigt die Erweiterung keine Benachrichtigung nach dem Installieren einer neuen Version an",
"configuration.dontShowNewVersionMessage.description": "Wenn auf 'true' gesetzt, zeigt die Erweiterung keine Benachrichtigung nach dem Installieren einer neuen Version an.",
"configuration.dontShowConfigManuallyChangedMessage.description": "Wenn auf 'true' gesetzt, wird bei manuellen Änderungen an der Konfiguration keine 'Neu starten'-Nachricht angezeigt.",
"configuration.projectDetection.autoReload.description": "Wenn auf 'true' gesetzt, wird die Erweiterung nach Erkennen eines Projektes Code automatisch neu starten.",
"configuration.projectDetection.disableDetect.description": "Wenn auf 'true' gesetzt, wird die Erweiterung nach zukünftigen Projekten, für die es optimierte Icons gibt, nicht weiter suchen.",
Expand All @@ -20,6 +20,7 @@
"configuration.presets.jsonOfficial.description": "Wenn auf 'true' gesetzt, wird die Erweiterung das offizielle JSON Icon benutzen.",
"configuration.presets.hideFolders.description": "Wenn auf 'true' gesetzt, werden keine Ordner-Icons angezeigt.",
"configuration.presets.foldersAllDefaultIcon.description": "Wenn auf 'true' gesetzt, werden keine speziellen Ordner-Icons angezeigt.",
"configuration.customIconFolderPath.description": "Der absolute Pfad zu dem Oberverzeichnis wo die benutzerdefinierten Icons in einem Unterordner liegen.",
"configuration.associations.files.description": "Diese benutzerdefinierten Datei-Icon-Zuweisungen werden die standardmäßigen Zuweisungen überschreiben.",
"configuration.associations.folders.description": "Diese benutzerdefinierten Ordner-Icon-Zuweisungen werden die standardmäßigen Zuweisungen überschreiben.",
"configuration.associations.fileDefault.file.description": "Mittels dieser Einstellung ist es dir möglich, ein anderes standardmäßiges, dunkleres Datei-Icon zuzuweisen.",
Expand Down
1 change: 1 addition & 0 deletions package.nls.es.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"configuration.presets.jsonOfficial.description": "Si 'true', la extensión usará el icono oficial de JSON.",
"configuration.presets.hideFolders.description": "Si 'true', los iconos de carpeta no serán visibles.",
"configuration.presets.foldersAllDefaultIcon.description": "Si 'true', todas las carpetas tendrán el mismo icono genérico.",
"configuration.customIconFolderPath.description": "La ruta física del directorio padre del directorio de iconos personalizados que reside en la máquina local.",
"configuration.associations.files.description": "Estas asociaciones personalizadas sobrescribirán las asosociaciones de archivo definidas por defecto.",
"configuration.associations.folders.description": "Estas asociaciones personalizadas sobrescribirán las asosociaciones de carpeta definidas por defecto.",
"configuration.associations.fileDefault.file.description": "Este ajuste permite cambiar el icono de archivo por defecto para los temas oscuros.",
Expand Down
1 change: 1 addition & 0 deletions package.nls.it.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"configuration.presets.jsonOfficial.description": "Se 'true', l'estensione userà l'icona ufficiale JSON.",
"configuration.presets.hideFolders.description": "Se 'true', tutte le icone delle cartelle saranno nascoste.",
"configuration.presets.foldersAllDefaultIcon.description": "Se 'true', tutte le cartelle avranno l'icona predefinita.",
"configuration.customIconFolderPath.description": "Il percorso fisico alla cartella padre, dove la cartella delle icone personalizzate risiede sulla macchina locale.",
"configuration.associations.files.description": "Queste associazioni personalizzate sovrascriveranno le associazioni delle icone per file predefinite.",
"configuration.associations.folders.description": "Queste associazioni personalizzate sovrascriveranno le associazioni delle icone per cartelle predefinite.",
"configuration.associations.fileDefault.file.description": "Questa impostazione ti premetterà di cambiare l'icona oscura per file predefinita.",
Expand Down
1 change: 1 addition & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"configuration.presets.jsonOfficial.description": "If set to true, the extension will use the official JSON icon.",
"configuration.presets.hideFolders.description": "If set to true, all folders will be hidden.",
"configuration.presets.foldersAllDefaultIcon.description": "If set to true, all folders will have the default folder icon.",
"configuration.customIconFolderPath.description": "The physical path to the parent folder where the custom icons folder resides on your local machine",
"configuration.associations.files.description": "These custom associations will override the file icon associations defined by default.",
"configuration.associations.folders.description": "These custom associations will override the folder icon associations defined by default.",
"configuration.associations.fileDefault.file.description": "This setting will let you change default dark file icon.",
Expand Down
1 change: 1 addition & 0 deletions package.nls.ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"configuration.presets.jsonOfficial.description": "Если установлено значение true, будет применяться официальный значок JSON файла",
"configuration.presets.hideFolders.description": "Если установлено значение true, все значки папок будут скрыты",
"configuration.presets.foldersAllDefaultIcon.description": "Если установлено значение true, все папки будут иметь стандартный значок",
"configuration.customIconFolderPath.description": "Абсолютный путь до директории на этом компьютере в которой находится папка с пользовательскими значками",
"configuration.associations.files.description": "Эти настройки переопределят настройки значков файлов по-умолчанию",
"configuration.associations.folders.description": "Эти настройки переопределят настройки значков папок по-умолчанию",
"configuration.associations.fileDefault.file.description": "Настройка позволяет переопределить темный значок файла по-умолчанию",
Expand Down
1 change: 1 addition & 0 deletions package.nls.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"configuration.presets.jsonOfficial.description": "",
"configuration.presets.hideFolders.description": "",
"configuration.presets.foldersAllDefaultIcon.description": "",
"configuration.customIconFolderPath.description": "",
"configuration.associations.files.description": "",
"configuration.associations.folders.description": "",
"configuration.associations.fileDefault.file.description": "",
Expand Down
1 change: 1 addition & 0 deletions package.nls.zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"configuration.presets.jsonOfficial.description": "如果设置成 true,插件会自动使用官方 JSON 图标",
"configuration.presets.hideFolders.description": "如果设置成 true,所有文件夹会隐藏",
"configuration.presets.foldersAllDefaultIcon.description": "如果设置成 true,所有文件夹会恢复成默认图标",
"configuration.customIconFolderPath.description": "指向位于您的计算机上含自定义图标的文件夹的父文件夹的物理路径",
"configuration.associations.files.description": "这些自定义设置会覆盖掉系统默认的文件图标设置",
"configuration.associations.folders.description": "这些自定义设置会覆盖掉系统默认的文件夹图标设置",
"configuration.associations.fileDefault.file.description": "这个设置会改变默认的深色文件图标",
Expand Down
11 changes: 3 additions & 8 deletions src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@ function generateManifest(
customFiles: models.IFileCollection,
customFolders: models.IFolderCollection,
projectDetectionResult: models.IProjectDetectionResult = null): void {
const iconGenerator = new iconManifest.IconGenerator(vscode, iconManifest.schema);
const vsicons = getVsiconsConfig();
const iconGenerator = new iconManifest.IconGenerator(vscode, iconManifest.schema, vsicons.customIconFolderPath);
const hasProjectDetectionResult = projectDetectionResult &&
typeof projectDetectionResult === 'object' &&
'value' in projectDetectionResult;
Expand Down Expand Up @@ -312,13 +312,8 @@ function generateManifest(
}

function restoreManifest(): void {
const iconGenerator = new iconManifest.IconGenerator(vscode, iconManifest.schema, true);
const json = iconManifest.mergeConfig(
null,
files,
null,
folders,
iconGenerator);
const iconGenerator = new iconManifest.IconGenerator(vscode, iconManifest.schema, '', /*avoidCustomDetection*/ true);
const json = iconGenerator.generateJson(files, folders);
iconGenerator.persist(extensionSettings.iconJsonFileName, json);
}

Expand Down
4 changes: 2 additions & 2 deletions src/icon-manifest/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import { vscode } from '../utils';
import { schema } from './defaultSchema';
import { extensionSettings } from '../settings';

const iconGenerator = new IconGenerator(vscode, schema, true);
const iconGenerator = new IconGenerator(vscode, schema, '', /*avoidCustomDetection*/ true);
const json = iconGenerator.generateJson(files, folders);
iconGenerator.persist(extensionSettings.iconJsonFileName, json, true);
iconGenerator.persist(extensionSettings.iconJsonFileName, json, /*updatePackageJson*/ true);
Loading

0 comments on commit 1a9bd25

Please sign in to comment.