mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-15 20:31:46 +00:00
move advanced options to dedicated submenu +
add "Use Proxy" checkbox
This commit is contained in:
102
menu.js
102
menu.js
@ -47,13 +47,6 @@ const mainMenuTemplate = (win) => [
|
|||||||
|
|
||||||
return pluginEnabledMenu(win, plugin);
|
return pluginEnabledMenu(win, plugin);
|
||||||
}),
|
}),
|
||||||
{ type: "separator" },
|
|
||||||
{
|
|
||||||
label: "Advanced options",
|
|
||||||
click: () => {
|
|
||||||
config.edit();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -67,30 +60,6 @@ const mainMenuTemplate = (win) => [
|
|||||||
config.set("options.autoUpdates", item.checked);
|
config.set("options.autoUpdates", item.checked);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: "Disable hardware acceleration",
|
|
||||||
type: "checkbox",
|
|
||||||
checked: config.get("options.disableHardwareAcceleration"),
|
|
||||||
click: (item) => {
|
|
||||||
config.set("options.disableHardwareAcceleration", item.checked);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Restart on config changes",
|
|
||||||
type: "checkbox",
|
|
||||||
checked: config.get("options.restartOnConfigChanges"),
|
|
||||||
click: (item) => {
|
|
||||||
config.set("options.restartOnConfigChanges", item.checked);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Reset App cache when app starts",
|
|
||||||
type: "checkbox",
|
|
||||||
checked: config.get("options.autoResetAppCache"),
|
|
||||||
click: (item) => {
|
|
||||||
config.set("options.autoResetAppCache", item.checked);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: "Resume last song when app starts",
|
label: "Resume last song when app starts",
|
||||||
type: "checkbox",
|
type: "checkbox",
|
||||||
@ -169,24 +138,63 @@ const mainMenuTemplate = (win) => [
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{ type: "separator" },
|
{ type: "separator" },
|
||||||
{
|
|
||||||
label: "Toggle DevTools",
|
|
||||||
// Cannot use "toggleDevTools" role in MacOS
|
|
||||||
click: () => {
|
|
||||||
const { webContents } = win;
|
|
||||||
if (webContents.isDevToolsOpened()) {
|
|
||||||
webContents.closeDevTools();
|
|
||||||
} else {
|
|
||||||
const devToolsOptions = {};
|
|
||||||
webContents.openDevTools(devToolsOptions);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: "Advanced options",
|
label: "Advanced options",
|
||||||
click: () => {
|
submenu: [
|
||||||
config.edit();
|
{
|
||||||
},
|
label: "Use Proxy",
|
||||||
|
type: "checkbox",
|
||||||
|
checked: !!config.get("options.proxy"),
|
||||||
|
click: (item) => {
|
||||||
|
const value = item.checked? "socks5://127.0.0.1:9999" : "";
|
||||||
|
config.set("options.proxy", value);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Disable hardware acceleration",
|
||||||
|
type: "checkbox",
|
||||||
|
checked: config.get("options.disableHardwareAcceleration"),
|
||||||
|
click: (item) => {
|
||||||
|
config.set("options.disableHardwareAcceleration", item.checked);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Restart on config changes",
|
||||||
|
type: "checkbox",
|
||||||
|
checked: config.get("options.restartOnConfigChanges"),
|
||||||
|
click: (item) => {
|
||||||
|
config.set("options.restartOnConfigChanges", item.checked);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Reset App cache when app starts",
|
||||||
|
type: "checkbox",
|
||||||
|
checked: config.get("options.autoResetAppCache"),
|
||||||
|
click: (item) => {
|
||||||
|
config.set("options.autoResetAppCache", item.checked);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ type: "separator" },
|
||||||
|
{
|
||||||
|
label: "Toggle DevTools",
|
||||||
|
// Cannot use "toggleDevTools" role in MacOS
|
||||||
|
click: () => {
|
||||||
|
const { webContents } = win;
|
||||||
|
if (webContents.isDevToolsOpened()) {
|
||||||
|
webContents.closeDevTools();
|
||||||
|
} else {
|
||||||
|
const devToolsOptions = {};
|
||||||
|
webContents.openDevTools(devToolsOptions);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Edit config.json",
|
||||||
|
click: () => {
|
||||||
|
config.edit();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user