From 6722b69cbf786df2b12811c4b9e01c201f22dcd3 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Thu, 11 May 2023 00:31:51 +0900 Subject: [PATCH] Display thirdparty licenses --- src/config/locales/en/translation.json | 6 +- src/main/index.ts | 30 ++--- .../components/TimelineSpace/Modals.vue | 5 +- .../TimelineSpace/Modals/Shortcut.vue | 2 +- .../TimelineSpace/Modals/Thirdparty.vue | 105 ++++++++++++++++++ 5 files changed, 130 insertions(+), 18 deletions(-) create mode 100644 src/renderer/components/TimelineSpace/Modals/Thirdparty.vue diff --git a/src/config/locales/en/translation.json b/src/config/locales/en/translation.json index e134a381..28818446 100644 --- a/src/config/locales/en/translation.json +++ b/src/config/locales/en/translation.json @@ -34,7 +34,8 @@ "jump_to": "Jump to" }, "help": { - "name": "Help" + "name": "Help", + "thirdparty": "Thirdparty licenses" } }, "global_header": { @@ -303,6 +304,9 @@ "comment": "Additional comments", "cancel": "Cancel", "ok": "Report" + }, + "thirdparty": { + "title": "Thirdparty licenses" } }, "cards": { diff --git a/src/main/index.ts b/src/main/index.ts index 07856ec8..2095b81e 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -790,22 +790,16 @@ ipcMain.handle('list-fonts', async (_: IpcMainInvokeEvent) => { }) // Settings -ipcMain.handle( - 'get-account-setting', - async (_: IpcMainInvokeEvent, accountId: number): Promise => { - const setting = await getSetting(db, accountId) - return setting - } -) +ipcMain.handle('get-account-setting', async (_: IpcMainInvokeEvent, accountId: number): Promise => { + const setting = await getSetting(db, accountId) + return setting +}) -ipcMain.handle( - 'update-account-setting', - async (_: IpcMainInvokeEvent, setting: Setting): Promise => { - console.log(setting) - const res = await createOrUpdateSetting(db, setting) - return res - } -) +ipcMain.handle('update-account-setting', async (_: IpcMainInvokeEvent, setting: Setting): Promise => { + console.log(setting) + const res = await createOrUpdateSetting(db, setting) + return res +}) // Cache ipcMain.handle('get-cache-hashtags', async (_: IpcMainInvokeEvent) => { @@ -1047,6 +1041,12 @@ const ApplicationMenu = (accountsChange: Array, menu click: () => { mainWindow!.webContents.send('open-shortcuts-list') } + }, + { + label: i18n.t('main_menu.help.thirdparty'), + click: () => { + mainWindow!.webContents.send('open-thirdparty-modal') + } } ] } diff --git a/src/renderer/components/TimelineSpace/Modals.vue b/src/renderer/components/TimelineSpace/Modals.vue index b6b440f8..0acbeaed 100644 --- a/src/renderer/components/TimelineSpace/Modals.vue +++ b/src/renderer/components/TimelineSpace/Modals.vue @@ -7,6 +7,7 @@ + @@ -20,6 +21,7 @@ import AddListMember from './Modals/AddListMember.vue' import MuteConfirm from './Modals/MuteConfirm.vue' import Shortcut from './Modals/Shortcut.vue' import Report from './Modals/Report.vue' +import Thirdparty from './Modals/Thirdparty.vue' export default defineComponent({ name: 'modals', @@ -30,7 +32,8 @@ export default defineComponent({ AddListMember, MuteConfirm, Shortcut, - Report + Report, + Thirdparty }, setup() { const store = useStore() diff --git a/src/renderer/components/TimelineSpace/Modals/Shortcut.vue b/src/renderer/components/TimelineSpace/Modals/Shortcut.vue index 7b667c21..50d26a59 100644 --- a/src/renderer/components/TimelineSpace/Modals/Shortcut.vue +++ b/src/renderer/components/TimelineSpace/Modals/Shortcut.vue @@ -1,6 +1,6 @@