Formatted store and settings, added label elements to all inputs in settings, renamed keybinds to keybindings, optimised some code
This commit is contained in:
parent
796a717dca
commit
c9a5fc546f
4 changed files with 1160 additions and 985 deletions
|
@ -49,7 +49,7 @@ export class Store {
|
||||||
"tab": "home",
|
"tab": "home",
|
||||||
"dynamicData": ""
|
"dynamicData": ""
|
||||||
},
|
},
|
||||||
"keybind": {
|
"keybindings": {
|
||||||
"search": [
|
"search": [
|
||||||
process.platform == "darwin" ? "Command" : "Control",
|
process.platform == "darwin" ? "Command" : "Control",
|
||||||
"S"
|
"S"
|
||||||
|
|
|
@ -6,6 +6,7 @@ import {app, dialog, ipcMain, Notification, shell } from "electron";
|
||||||
import fetch from "electron-fetch";
|
import fetch from "electron-fetch";
|
||||||
import {AppImageUpdater, NsisUpdater} from "electron-updater";
|
import {AppImageUpdater, NsisUpdater} from "electron-updater";
|
||||||
import * as log from "electron-log";
|
import * as log from "electron-log";
|
||||||
|
import ElectronStore from "electron-store";
|
||||||
|
|
||||||
export class utils {
|
export class utils {
|
||||||
|
|
||||||
|
@ -79,6 +80,14 @@ export class utils {
|
||||||
return Store.cfg.store
|
return Store.cfg.store
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the store instance
|
||||||
|
* @returns {Store}
|
||||||
|
*/
|
||||||
|
static getStoreInstance(): ElectronStore {
|
||||||
|
return Store.cfg
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a store value
|
* Sets a store value
|
||||||
* @param key
|
* @param key
|
||||||
|
|
|
@ -2,12 +2,6 @@ import {app, Menu, shell} from "electron";
|
||||||
import {utils} from "../base/utils";
|
import {utils} from "../base/utils";
|
||||||
|
|
||||||
export default class Thumbar {
|
export default class Thumbar {
|
||||||
/**
|
|
||||||
* Private variables for interaction in plugins
|
|
||||||
*/
|
|
||||||
private _win: any;
|
|
||||||
private _app: any;
|
|
||||||
private _store: any;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base Plugin Details (Eventually implemented into a GUI in settings)
|
* Base Plugin Details (Eventually implemented into a GUI in settings)
|
||||||
|
@ -15,27 +9,225 @@ export default class Thumbar {
|
||||||
public name: string = 'Menubar Plugin';
|
public name: string = 'Menubar Plugin';
|
||||||
public description: string = 'Creates the menubar';
|
public description: string = 'Creates the menubar';
|
||||||
public version: string = '1.0.0';
|
public version: string = '1.0.0';
|
||||||
public author: string = 'Core / Quacksire';
|
public author: string = 'Core';
|
||||||
|
public contributors: string[] = ['Core', 'Qwack', 'Monochromish'];
|
||||||
/**
|
|
||||||
* Thumbnail Toolbar Assets
|
|
||||||
* NATIVE-IMAGE DOESN'T SUPPORT SVG
|
|
||||||
private icons: { [key: string]: Electron.NativeImage } = {
|
|
||||||
remoteIcon: nativeImage.createFromPath(join(utils.getPath('rendererPath'), 'views/svg/smartphone.svg')).toPNG(),
|
|
||||||
soundIcon: nativeImage.createFromPath(join(utils.getPath('rendererPath'), 'views/svg/headphones.svg')).toPNG(),
|
|
||||||
aboutIcon: nativeImage.createFromPath(join(utils.getPath('rendererPath'), 'views/svg/info.svg')).toPNG(),
|
|
||||||
settingsIcon: nativeImage.createFromPath(join(utils.getPath('rendererPath'), 'views/svg/settings.svg')).toPNG(),
|
|
||||||
logoutIcon: nativeImage.createFromPath(join(utils.getPath('rendererPath'), 'views/svg/log-out.svg')).toPNG(),
|
|
||||||
ciderIcon: nativeImage.createFromPath(join(utils.getPath('rendererPath'), 'assets/logocute.png')).toPNG(),
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Menubar Assets
|
* Menubar Assets
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
private isMac: boolean = process.platform === 'darwin';
|
private isMac: boolean = process.platform === 'darwin';
|
||||||
private _menuTemplate: any;
|
private _menuTemplate: any = [
|
||||||
|
{
|
||||||
|
label: app.getName(),
|
||||||
|
submenu: [
|
||||||
|
{
|
||||||
|
label: 'About',
|
||||||
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('about')`)
|
||||||
|
},
|
||||||
|
{type: 'separator'},
|
||||||
|
{
|
||||||
|
label: 'Settings',
|
||||||
|
accelerator: utils.getStoreValue("general.keybindings.settings").join('+'),
|
||||||
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('settings')`)
|
||||||
|
},
|
||||||
|
{type: 'separator'},
|
||||||
|
{role: 'services'},
|
||||||
|
{type: 'separator'},
|
||||||
|
{role: 'hide'},
|
||||||
|
{role: 'hideOthers'},
|
||||||
|
{role: 'unhide'},
|
||||||
|
{type: 'separator'},
|
||||||
|
{role: 'quit'}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'View',
|
||||||
|
submenu: [
|
||||||
|
{role: 'reload'},
|
||||||
|
{role: 'forceReload'},
|
||||||
|
{role: 'toggleDevTools'},
|
||||||
|
{type: 'separator'},
|
||||||
|
{role: 'resetZoom'},
|
||||||
|
{role: 'zoomIn'},
|
||||||
|
{role: 'zoomOut'},
|
||||||
|
{type: 'separator'},
|
||||||
|
{role: 'togglefullscreen'},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Window',
|
||||||
|
submenu: [
|
||||||
|
{role: 'minimize'},
|
||||||
|
{
|
||||||
|
label: 'Show',
|
||||||
|
click: () => utils.getWindow().show()
|
||||||
|
},
|
||||||
|
{role: 'zoom'},
|
||||||
|
...(this.isMac ? [
|
||||||
|
{type: 'separator'},
|
||||||
|
{role: 'front'},
|
||||||
|
{role: 'close'},
|
||||||
|
] : [
|
||||||
|
{role: 'close'},
|
||||||
|
]),
|
||||||
|
|
||||||
|
{
|
||||||
|
label: 'Edit',
|
||||||
|
submenu: [
|
||||||
|
{role: 'undo'},
|
||||||
|
{role: 'redo'},
|
||||||
|
{type: 'separator'},
|
||||||
|
{role: 'cut'},
|
||||||
|
{role: 'copy'},
|
||||||
|
{role: 'paste'},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{type: 'separator'},
|
||||||
|
{
|
||||||
|
label: 'Toggle Private Session',
|
||||||
|
accelerator: utils.getStoreValue("general.keybindings.togglePrivateSession").join('+'),
|
||||||
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.cfg.general.privateEnabled = !app.cfg.general.privateEnabled`)
|
||||||
|
},
|
||||||
|
{type: 'separator'},
|
||||||
|
{
|
||||||
|
label: 'Web Remote',
|
||||||
|
accelerator: utils.getStoreValue("general.keybindings.webRemote").join('+'),
|
||||||
|
sublabel: 'Opens in external window',
|
||||||
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('remote-pair')`)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Audio Settings',
|
||||||
|
accelerator: utils.getStoreValue("general.keybindings.audioSettings").join('+'),
|
||||||
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.modals.audioSettings = true`)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Plug-in Menu',
|
||||||
|
accelerator: utils.getStoreValue("general.keybindings.pluginMenu").join('+'),
|
||||||
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.modals.pluginMenu = true`)
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Controls',
|
||||||
|
submenu: [
|
||||||
|
{
|
||||||
|
label: 'Pause / Play',
|
||||||
|
accelerator: 'Space',
|
||||||
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.SpacePause()`)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Next',
|
||||||
|
accelerator: 'CommandOrControl+Right',
|
||||||
|
click: () => utils.getWindow().webContents.executeJavaScript(`MusicKitInterop.next()`)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Previous',
|
||||||
|
accelerator: 'CommandOrControl+Left',
|
||||||
|
click: () => utils.getWindow().webContents.executeJavaScript(`MusicKitInterop.previous()`)
|
||||||
|
},
|
||||||
|
{type: 'separator'},
|
||||||
|
{
|
||||||
|
label: 'Volume Up',
|
||||||
|
accelerator: 'CommandOrControl+Up',
|
||||||
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.volumeUp()`)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Volume Down',
|
||||||
|
accelerator: 'CommandOrControl+Down',
|
||||||
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.volumeDown()`)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Browse',
|
||||||
|
accelerator: utils.getStoreValue("general.keybindings.browse").join('+'),
|
||||||
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('browse')`)
|
||||||
|
},
|
||||||
|
{type: 'separator'},
|
||||||
|
{
|
||||||
|
label: 'Artists',
|
||||||
|
accelerator: utils.getStoreValue("general.keybindings.artists").join('+'),
|
||||||
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('library-artists')`)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Search',
|
||||||
|
accelerator: utils.getStoreValue("general.keybindings.search").join('+'),
|
||||||
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('search')`)
|
||||||
|
},
|
||||||
|
{type: 'separator'},
|
||||||
|
{
|
||||||
|
label: 'Album',
|
||||||
|
accelerator: utils.getStoreValue("general.keybindings.albums").join('+'),
|
||||||
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('library-albums')`)
|
||||||
|
},
|
||||||
|
{type: 'separator'},
|
||||||
|
{
|
||||||
|
label: 'Cast To Devices',
|
||||||
|
accelerator: utils.getStoreValue("general.keybindings.castToDevices").join('+'),
|
||||||
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.modals.castMenu = true`)
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Account',
|
||||||
|
submenu: [
|
||||||
|
{
|
||||||
|
label: 'Account Settings',
|
||||||
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('apple-account-settings')`)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Sign Out',
|
||||||
|
click: () => utils.getWindow().webContents.executeJavaScript(`app.unauthorize()`)
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Support',
|
||||||
|
role: 'help',
|
||||||
|
submenu: [
|
||||||
|
{
|
||||||
|
label: 'Discord',
|
||||||
|
click: () => shell.openExternal("https://discord.gg/AppleMusic").catch(console.error)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'GitHub Wiki',
|
||||||
|
click: () => shell.openExternal("https://github.com/ciderapp/Cider/wiki/Troubleshooting").catch(console.error)
|
||||||
|
},
|
||||||
|
{type: 'separator'},
|
||||||
|
{
|
||||||
|
label: 'Report a...',
|
||||||
|
submenu: [
|
||||||
|
{
|
||||||
|
label: 'Bug',
|
||||||
|
click: () => shell.openExternal("https://github.com/ciderapp/Cider/issues/new?assignees=&labels=bug%2Ctriage&template=bug_report.yaml&title=%5BBug%5D%3A+").catch(console.error)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Feature Request',
|
||||||
|
click: () => shell.openExternal("https://github.com/ciderapp/Cider/discussions/new?category=feature-request").catch(console.error)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Translation Report/Request',
|
||||||
|
click: () => shell.openExternal("https://github.com/ciderapp/Cider/issues/new?assignees=&labels=%F0%9F%8C%90+Translations&template=translation.yaml&title=%5BTranslation%5D%3A+").catch(console.error)
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{type: 'separator'},
|
||||||
|
{
|
||||||
|
label: 'View License',
|
||||||
|
click: () => shell.openExternal("https://github.com/ciderapp/Cider/blob/main/LICENSE").catch(console.error)
|
||||||
|
},
|
||||||
|
{type: 'separator'},
|
||||||
|
{
|
||||||
|
label: 'Toggle Developer Tools',
|
||||||
|
accelerator: utils.getStoreValue("general.keybindings.openDeveloperTools").join('+'),
|
||||||
|
click: () => utils.getWindow().webContents.openDevTools()
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Open Configuration File in Editor',
|
||||||
|
click: () => utils.getStoreInstance().openInEditor()
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
/*******************************************************************************************
|
/*******************************************************************************************
|
||||||
* Public Methods
|
* Public Methods
|
||||||
|
@ -44,230 +236,14 @@ export default class Thumbar {
|
||||||
/**
|
/**
|
||||||
* Runs on plugin load (Currently run on application start)
|
* Runs on plugin load (Currently run on application start)
|
||||||
*/
|
*/
|
||||||
constructor(utils: { getApp: () => any; getStore: () => any; getWindow: () => any; }) {
|
constructor(_utils: utils) {
|
||||||
this._app = utils.getApp();
|
|
||||||
this._store = utils.getStore();
|
|
||||||
|
|
||||||
this._menuTemplate = [
|
|
||||||
{
|
|
||||||
label: app.getName(),
|
|
||||||
submenu: [
|
|
||||||
{
|
|
||||||
label: 'About',
|
|
||||||
click: () => this._win.webContents.executeJavaScript(`app.appRoute('about')`)
|
|
||||||
},
|
|
||||||
{type: 'separator'},
|
|
||||||
{
|
|
||||||
label: 'Settings',
|
|
||||||
accelerator: this._store.general.keybind.settings.join('+'),
|
|
||||||
click: () => this._win.webContents.executeJavaScript(`app.appRoute('settings')`)
|
|
||||||
},
|
|
||||||
{type: 'separator'},
|
|
||||||
{role: 'services'},
|
|
||||||
{type: 'separator'},
|
|
||||||
{role: 'hide'},
|
|
||||||
{role: 'hideOthers'},
|
|
||||||
{role: 'unhide'},
|
|
||||||
{type: 'separator'},
|
|
||||||
{role: 'quit'}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'View',
|
|
||||||
submenu: [
|
|
||||||
{role: 'reload'},
|
|
||||||
{role: 'forceReload'},
|
|
||||||
{role: 'toggleDevTools'},
|
|
||||||
{type: 'separator'},
|
|
||||||
{role: 'resetZoom'},
|
|
||||||
{role: 'zoomIn'},
|
|
||||||
{role: 'zoomOut'},
|
|
||||||
{type: 'separator'},
|
|
||||||
{role: 'togglefullscreen'},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Window',
|
|
||||||
submenu: [
|
|
||||||
{role: 'minimize'},
|
|
||||||
{
|
|
||||||
label: 'Show',
|
|
||||||
click: () => utils.getWindow().show()
|
|
||||||
},
|
|
||||||
{role: 'zoom'},
|
|
||||||
...(this.isMac ? [
|
|
||||||
{type: 'separator'},
|
|
||||||
{role: 'front'},
|
|
||||||
{role: 'close'},
|
|
||||||
] : [
|
|
||||||
{role: 'close'},
|
|
||||||
]),
|
|
||||||
|
|
||||||
{
|
|
||||||
label: 'Edit',
|
|
||||||
submenu: [
|
|
||||||
{role: 'undo'},
|
|
||||||
{role: 'redo'},
|
|
||||||
{type: 'separator'},
|
|
||||||
{role: 'cut'},
|
|
||||||
{role: 'copy'},
|
|
||||||
{role: 'paste'},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{type: 'separator'},
|
|
||||||
{
|
|
||||||
label: 'Toggle Private Session',
|
|
||||||
accelerator: this._store.general.keybind.togglePrivateSession.join('+'),
|
|
||||||
click: () => this._win.webContents.executeJavaScript(`app.cfg.general.privateEnabled = !app.cfg.general.privateEnabled`)
|
|
||||||
},
|
|
||||||
{type: 'separator'},
|
|
||||||
{
|
|
||||||
label: 'Web Remote',
|
|
||||||
accelerator: this._store.general.keybind.webRemote.join('+'),
|
|
||||||
sublabel: 'Opens in external window',
|
|
||||||
click: () => this._win.webContents.executeJavaScript(`app.appRoute('remote-pair')`)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Audio Settings',
|
|
||||||
accelerator: this._store.general.keybind.audioSettings.join('+'),
|
|
||||||
click: () => this._win.webContents.executeJavaScript(`app.modals.audioSettings = true`)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Plug-in Menu',
|
|
||||||
accelerator: this._store.general.keybind.pluginMenu.join('+'),
|
|
||||||
click: () => this._win.webContents.executeJavaScript(`app.modals.pluginMenu = true`)
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Controls',
|
|
||||||
submenu: [
|
|
||||||
{
|
|
||||||
label: 'Pause / Play',
|
|
||||||
accelerator: 'Space',
|
|
||||||
click: () => this._win.webContents.executeJavaScript(`app.SpacePause()`)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Next',
|
|
||||||
accelerator: 'CommandOrControl+Right',
|
|
||||||
click: () => this._win.webContents.executeJavaScript(`MusicKitInterop.next()`)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Previous',
|
|
||||||
accelerator: 'CommandOrControl+Left',
|
|
||||||
click: () => this._win.webContents.executeJavaScript(`MusicKitInterop.previous()`)
|
|
||||||
},
|
|
||||||
{type: 'separator'},
|
|
||||||
{
|
|
||||||
label: 'Volume Up',
|
|
||||||
accelerator: 'CommandOrControl+Up',
|
|
||||||
click: () => this._win.webContents.executeJavaScript(`app.volumeUp()`)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Volume Down',
|
|
||||||
accelerator: 'CommandOrControl+Down',
|
|
||||||
click: () => this._win.webContents.executeJavaScript(`app.volumeDown()`)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Browse',
|
|
||||||
accelerator: this._store.general.keybind.browse.join('+'),
|
|
||||||
click: () => this._win.webContents.executeJavaScript(`app.appRoute('browse')`)
|
|
||||||
},
|
|
||||||
{type: 'separator'},
|
|
||||||
{
|
|
||||||
label: 'Artists',
|
|
||||||
accelerator: this._store.general.keybind.artists.join('+'),
|
|
||||||
click: () => this._win.webContents.executeJavaScript(`app.appRoute('library-artists')`)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Search',
|
|
||||||
accelerator: this._store.general.keybind.search.join('+'),
|
|
||||||
click: () => this._win.webContents.executeJavaScript(`app.appRoute('search')`)
|
|
||||||
},
|
|
||||||
{type: 'separator'},
|
|
||||||
{
|
|
||||||
label: 'Album',
|
|
||||||
accelerator: this._store.general.keybind.albums.join('+'),
|
|
||||||
click: () => this._win.webContents.executeJavaScript(`app.appRoute('library-albums')`)
|
|
||||||
},
|
|
||||||
{type: 'separator'},
|
|
||||||
{
|
|
||||||
label: 'Cast To Devices',
|
|
||||||
accelerator: this._store.general.keybind.castToDevices.join('+'),
|
|
||||||
click: () => this._win.webContents.executeJavaScript(`app.modals.castMenu = true`)
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Account',
|
|
||||||
submenu: [
|
|
||||||
{
|
|
||||||
label: 'Account Settings',
|
|
||||||
click: () => this._win.webContents.executeJavaScript(`app.appRoute('apple-account-settings')`)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Sign Out',
|
|
||||||
click: () => this._win.webContents.executeJavaScript(`app.unauthorize()`)
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Support',
|
|
||||||
role: 'help',
|
|
||||||
submenu: [
|
|
||||||
{
|
|
||||||
label: 'Discord',
|
|
||||||
click: () => shell.openExternal("https://discord.gg/AppleMusic").catch(console.error)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'GitHub Wiki',
|
|
||||||
click: () => shell.openExternal("https://github.com/ciderapp/Cider/wiki/Troubleshooting").catch(console.error)
|
|
||||||
},
|
|
||||||
{type: 'separator'},
|
|
||||||
{
|
|
||||||
label: 'Report a...',
|
|
||||||
submenu: [
|
|
||||||
{
|
|
||||||
label: 'Bug',
|
|
||||||
click: () => shell.openExternal("https://github.com/ciderapp/Cider/issues/new?assignees=&labels=bug%2Ctriage&template=bug_report.yaml&title=%5BBug%5D%3A+").catch(console.error)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Feature Request',
|
|
||||||
click: () => shell.openExternal("https://github.com/ciderapp/Cider/discussions/new?category=feature-request").catch(console.error)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Translation Report/Request',
|
|
||||||
click: () => shell.openExternal("https://github.com/ciderapp/Cider/issues/new?assignees=&labels=%F0%9F%8C%90+Translations&template=translation.yaml&title=%5BTranslation%5D%3A+").catch(console.error)
|
|
||||||
},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{type: 'separator'},
|
|
||||||
{
|
|
||||||
label: 'View License',
|
|
||||||
click: () => shell.openExternal("https://github.com/ciderapp/Cider/blob/main/LICENSE").catch(console.error)
|
|
||||||
},
|
|
||||||
{type: 'separator'},
|
|
||||||
{
|
|
||||||
label: 'Toggle Developer Tools',
|
|
||||||
accelerator: this._store.general.keybind.openDeveloperTools.join('+'),
|
|
||||||
click: () => this._win.webContents.openDevTools()
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Open Configuration File in Editor',
|
|
||||||
click: () => this._store.openInEditor()
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
console.debug(`[Plugin][${this.name}] Loading Complete.`);
|
console.debug(`[Plugin][${this.name}] Loading Complete.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runs on app ready
|
* Runs on app ready
|
||||||
*/
|
*/
|
||||||
onReady(win: Electron.BrowserWindow): void {
|
onReady(_win: Electron.BrowserWindow): void {
|
||||||
this._win = win;
|
|
||||||
const menu = Menu.buildFromTemplate(this._menuTemplate);
|
const menu = Menu.buildFromTemplate(this._menuTemplate);
|
||||||
Menu.setApplicationMenu(menu)
|
Menu.setApplicationMenu(menu)
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue