diff --git a/package.json b/package.json
index a9f8feb6..7d72e55b 100644
--- a/package.json
+++ b/package.json
@@ -35,7 +35,7 @@
]
},
"dependencies": {
- "@picgo/i18n": "^0.0.4",
+ "@picgo/i18n": "^1.0.0",
"@picgo/store": "^1.0.3",
"axios": "^0.19.0",
"core-js": "^3.3.2",
diff --git a/src/main/events/ipcList.ts b/src/main/events/ipcList.ts
index 4633a2c5..20c3a032 100644
--- a/src/main/events/ipcList.ts
+++ b/src/main/events/ipcList.ts
@@ -177,7 +177,7 @@ export default {
})
ipcMain.on(SHOW_MAIN_PAGE_MENU, () => {
const window = windowManager.get(IWindowList.SETTING_WINDOW)!
- const menu = buildMainPageMenu()
+ const menu = buildMainPageMenu(window)
menu.popup({
window
})
diff --git a/src/main/events/remotes/menu.ts b/src/main/events/remotes/menu.ts
index 568d5853..a2e9672f 100644
--- a/src/main/events/remotes/menu.ts
+++ b/src/main/events/remotes/menu.ts
@@ -9,7 +9,7 @@ import {
import { privacyManager } from '~/main/utils/privacyManager'
import pkg from 'root/package.json'
import GuiApi from 'apis/gui'
-import { PICGO_CONFIG_PLUGIN, PICGO_HANDLE_PLUGIN_ING, PICGO_TOGGLE_PLUGIN } from '~/universal/events/constants'
+import { PICGO_CONFIG_PLUGIN, PICGO_HANDLE_PLUGIN_ING, PICGO_TOGGLE_PLUGIN, SHOW_MAIN_PAGE_DONATION, SHOW_MAIN_PAGE_QRCODE } from '~/universal/events/constants'
import picgoCoreIPC from '~/main/events/picgoCoreIPC'
import { PicGo as PicGoCore } from 'picgo'
import { T } from '~/universal/i18n'
@@ -87,7 +87,7 @@ const buildMiniPageMenu = () => {
return Menu.buildFromTemplate(template)
}
-const buildMainPageMenu = () => {
+const buildMainPageMenu = (win: BrowserWindow) => {
const template = [
{
label: T('ABOUT'),
@@ -102,14 +102,19 @@ const buildMainPageMenu = () => {
{
label: T('SPONSOR_PICGO'),
click () {
- // TODO: show donation
+ win?.webContents?.send(SHOW_MAIN_PAGE_DONATION)
}
},
{
label: T('SHOW_PICBED_QRCODE'),
click () {
- // TODO: qrcode
- // _this.qrcodeVisible = true
+ win?.webContents?.send(SHOW_MAIN_PAGE_QRCODE)
+ }
+ },
+ {
+ label: T('SHOW_DEVTOOLS'),
+ click () {
+ win?.webContents?.openDevTools()
}
},
{
diff --git a/src/renderer/layouts/Main.vue b/src/renderer/layouts/Main.vue
index 2b82d181..2cbdd81b 100644
--- a/src/renderer/layouts/Main.vue
+++ b/src/renderer/layouts/Main.vue
@@ -158,7 +158,9 @@ import InputBoxDialog from '@/components/InputBoxDialog.vue'
import {
MINIMIZE_WINDOW,
CLOSE_WINDOW,
- SHOW_MAIN_PAGE_MENU
+ SHOW_MAIN_PAGE_MENU,
+ SHOW_MAIN_PAGE_QRCODE,
+ SHOW_MAIN_PAGE_DONATION
} from '~/universal/events/constants'
@Component({
name: 'main-page',
@@ -184,6 +186,12 @@ export default class extends Vue {
ipcRenderer.send('getPicBeds')
ipcRenderer.on('getPicBeds', this.getPicBeds)
this.handleGetPicPeds()
+ ipcRenderer.on(SHOW_MAIN_PAGE_QRCODE, () => {
+ this.qrcodeVisible = true
+ })
+ ipcRenderer.on(SHOW_MAIN_PAGE_DONATION, () => {
+ this.visible = true
+ })
}
@Watch('choosedPicBedForQRCode')
diff --git a/src/renderer/pages/PicGoSetting.vue b/src/renderer/pages/PicGoSetting.vue
index 80f3a816..1f2f3e0d 100644
--- a/src/renderer/pages/PicGoSetting.vue
+++ b/src/renderer/pages/PicGoSetting.vue
@@ -4,11 +4,11 @@
{{ $T('PICGO_SETTINGS') }} -
-
+