From ff76c815b15a4bb3ceda0ef3cf6d5adb73f535e2 Mon Sep 17 00:00:00 2001
From: syuilo <syuilotan@yahoo.co.jp>
Date: Sun, 30 Sep 2018 23:03:21 +0900
Subject: [PATCH] =?UTF-8?q?=E3=83=86=E3=83=BC=E3=83=9E=E3=82=A4=E3=83=B3?=
 =?UTF-8?q?=E3=82=B9=E3=83=88=E3=83=BC=E3=83=AB=E6=99=82=E3=81=AE=E5=8B=95?=
 =?UTF-8?q?=E4=BD=9C=E3=82=92=E3=82=8F=E3=81=8B=E3=82=8A=E3=82=84=E3=81=99?=
 =?UTF-8?q?=E3=81=8F=E3=81=97=E3=81=9F=E3=82=8A=E3=83=86=E3=83=BC=E3=83=9E?=
 =?UTF-8?q?=E3=82=92=E3=82=A2=E3=83=B3=E3=82=A4=E3=83=B3=E3=82=B9=E3=83=88?=
 =?UTF-8?q?=E3=83=BC=E3=83=AB=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86?=
 =?UTF-8?q?=E3=81=AB=E3=81=97=E3=81=9F=E3=82=8A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 locales/ja-JP.yml                                |  3 +++
 src/client/app/common/views/components/theme.vue | 12 +++++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml
index 46dea949d2..366c4a33cd 100644
--- a/locales/ja-JP.yml
+++ b/locales/ja-JP.yml
@@ -291,6 +291,7 @@ common/views/components/theme.vue:
   install-a-theme: "テーマのインストール"
   theme-code: "テーマコード"
   install: "インストール"
+  installed: "「{}」をインストールしました"
   create-a-theme: "テーマの作成"
   save-created-theme: "テーマを保存"
   primary-color: "プライマリ カラー"
@@ -306,6 +307,8 @@ common/views/components/theme.vue:
   saved: "保存しました"
   installed-themes: "インストールされたテーマ"
   select-theme: "テーマを選択してください"
+  uninstall: "アンインストール"
+  uninstalled: "「{}」をアンインストールしました"
 
 common/views/components/cw-button.vue:
   hide: "隠す"
diff --git a/src/client/app/common/views/components/theme.vue b/src/client/app/common/views/components/theme.vue
index 27888d1e85..56b07da498 100644
--- a/src/client/app/common/views/components/theme.vue
+++ b/src/client/app/common/views/components/theme.vue
@@ -58,13 +58,13 @@
 		<ui-textarea readonly :value="selectedInstalledThemeCode">
 			<span>%i18n:@theme-code%</span>
 		</ui-textarea>
+		<ui-button @click="uninstall()">%i18n:@uninstall%</ui-button>
 	</details>
 </div>
 </template>
 
 <script lang="ts">
 import Vue from 'vue';
-import { apiUrl, docsUrl } from '../../../config';
 import { lightTheme, darkTheme, builtinThemes, applyTheme } from '../../../theme';
 import { Chrome } from 'vue-color';
 import * as uuid from 'uuid';
@@ -151,6 +151,16 @@ export default Vue.extend({
 			this.$store.commit('device/set', {
 				key: 'themes', value: themes
 			});
+			alert('%i18n:@installed%'.replace('{}', theme.meta.name));
+		},
+
+		uninstall() {
+			const theme = this.installedThemes.find(x => x.meta.id == this.selectedInstalledTheme);
+			const themes = this.$store.state.device.themes.filter(t => t.meta.id != theme.meta.id);
+			this.$store.commit('device/set', {
+				key: 'themes', value: themes
+			});
+			alert('%i18n:@uninstalled%'.replace('{}', theme.meta.name));
 		},
 
 		preview() {
-- 
GitLab