Rename quick actions to command palette
This commit is contained in:
parent
90ffa92382
commit
89cb58e52d
18
myApp.js
18
myApp.js
|
|
@ -52,8 +52,8 @@ const { JSDOM } = jsdom;
|
|||
const nodeCrypto = require('crypto');
|
||||
const processInfo = require('./lib/process-info');
|
||||
const version = require('./package.json').version;
|
||||
const QuickActions = require('./src/quick-actions');
|
||||
let quickActions;
|
||||
const CommandPalette = require('./src/command-palette');
|
||||
let commandPalette;
|
||||
global.DOMParser = new JSDOM().window.DOMParser;
|
||||
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true';
|
||||
|
||||
|
|
@ -1109,7 +1109,7 @@ ipcMain.on('delete-project', (event, arg) => {
|
|||
|
||||
ipcMain.on('delete-shortcut', (event, arg) => {
|
||||
store.shortcuts = store.shortcuts.filter((keys) => keys !== arg);
|
||||
setupQuickActions();
|
||||
setupCommandPalette();
|
||||
repaintShortcuts();
|
||||
});
|
||||
|
||||
|
|
@ -1151,7 +1151,7 @@ ipcMain.on('logout', (event, arg) => {
|
|||
|
||||
mb.on('ready', () => {
|
||||
setupContextMenu();
|
||||
setupQuickActions();
|
||||
setupCommandPalette();
|
||||
});
|
||||
|
||||
if (store.access_token && store.user_id && store.username) {
|
||||
|
|
@ -1255,12 +1255,12 @@ function setupGenericContextMenu(baseMenuItems) {
|
|||
});
|
||||
}
|
||||
|
||||
function setupQuickActions() {
|
||||
if (!quickActions) {
|
||||
quickActions = new QuickActions();
|
||||
function setupCommandPalette() {
|
||||
if (!commandPalette) {
|
||||
commandPalette = new CommandPalette();
|
||||
}
|
||||
|
||||
quickActions.register({
|
||||
commandPalette.register({
|
||||
shortcut: store.shortcuts,
|
||||
});
|
||||
}
|
||||
|
|
@ -2951,7 +2951,7 @@ function addShortcut(link) {
|
|||
escapeQuotes(spinner) +
|
||||
' Add"',
|
||||
);
|
||||
setupQuickActions();
|
||||
setupCommandPalette();
|
||||
repaintShortcuts();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>GitDock Quick Actions</title>
|
||||
<title>GitDock Command Palette</title>
|
||||
<link rel="stylesheet" href="../../variables.css" />
|
||||
<link rel="stylesheet" href="bar.css" />
|
||||
<link
|
||||
|
|
@ -376,7 +376,7 @@ window.addEventListener('focus', () => {
|
|||
});
|
||||
|
||||
const hide = () => {
|
||||
gitdock.hideQuickActions();
|
||||
gitdock.hideCommandPalette();
|
||||
$search.value = '';
|
||||
search();
|
||||
};
|
||||
|
|
@ -89,7 +89,7 @@ setInterval(() => {
|
|||
}, 15000);
|
||||
getRecentlyVisited();
|
||||
|
||||
module.exports = class QuickActions {
|
||||
module.exports = class CommandPalette {
|
||||
constructor() {
|
||||
cpWindow = this.newWindow();
|
||||
cpWindow.on('blur', () => {
|
||||
|
|
@ -109,7 +109,7 @@ module.exports = class QuickActions {
|
|||
shell.openExternal(`${store.host}${arg}`);
|
||||
}
|
||||
});
|
||||
ipcMain.on('hide-quick-actions', () => {
|
||||
ipcMain.on('hide-command-palette', () => {
|
||||
cpWindow.hide();
|
||||
});
|
||||
}
|
||||
|
|
@ -118,7 +118,7 @@ module.exports = class QuickActions {
|
|||
globalShortcut.unregisterAll();
|
||||
|
||||
ipcMain.removeAllListeners('open-gitlab');
|
||||
ipcMain.removeAllListeners('hide-quick-actions');
|
||||
ipcMain.removeAllListeners('hide-command-palette');
|
||||
}
|
||||
|
||||
async open() {
|
||||
|
|
@ -145,7 +145,7 @@ module.exports = class QuickActions {
|
|||
webPreferences: {
|
||||
preload: PRELOAD_PATH,
|
||||
},
|
||||
title: 'GitDock Quick Actions',
|
||||
title: 'GitDock Command Palette',
|
||||
});
|
||||
if (show) {
|
||||
window.once('ready-to-show', () => {
|
||||
|
|
@ -3,7 +3,7 @@ const { store } = require('../../lib/store');
|
|||
|
||||
const api = {
|
||||
openGitLab: (url) => ipcRenderer.send('open-gitlab', url),
|
||||
hideQuickActions: () => ipcRenderer.send('hide-quick-actions'),
|
||||
hideCommandPalette: () => ipcRenderer.send('hide-command-palette'),
|
||||
getUsername: () => store.username,
|
||||
getFavorites: () => store['favorite-projects'],
|
||||
getBookmarks: () => store['bookmarks'],
|
||||
|
|
@ -10,7 +10,7 @@ describe('Application launch', function () {
|
|||
|
||||
stopAppAfterEach();
|
||||
|
||||
it('starts the menubar and quick actions windows', async function () {
|
||||
it('starts the menubar window', async function () {
|
||||
const windows = await this.app.windows();
|
||||
assert.equal(windows.length, 1);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue