Skip to content

Commit

Permalink
Merge pull request #6299 from jasongrout/logout-menu-name
Browse files Browse the repository at this point in the history
Log out and Shut down are two words when used as verbs
  • Loading branch information
blink1073 committed May 2, 2019
2 parents fe59e85 + 8d8cbb2 commit 0e1e34e
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 20 deletions.
2 changes: 1 addition & 1 deletion examples/filebrowser/src/index.ts
Expand Up @@ -194,7 +194,7 @@ function createApp(manager: ServiceManager.IManager): void {
}
});
commands.addCommand('file-shutdown-kernel', {
label: 'Shutdown Kernel',
label: 'Shut Down Kernel',
icon: 'fa fa-stop-circle-o',
execute: () => {
return fbWidget.shutdownKernels();
Expand Down
2 changes: 1 addition & 1 deletion packages/apputils/src/clientsession.tsx
Expand Up @@ -370,7 +370,7 @@ export class ClientSession implements IClientSession {
if (this._session) {
if (this.kernelPreference.shutdownOnClose) {
this._session.shutdown().catch(reason => {
console.error(`Kernel not shutdown ${reason}`);
console.error(`Kernel not shut down ${reason}`);
});
}
this._session = null;
Expand Down
6 changes: 3 additions & 3 deletions packages/console-extension/src/index.ts
Expand Up @@ -428,14 +428,14 @@ async function activateConsole(
});

commands.addCommand(CommandIDs.closeAndShutdown, {
label: 'Close and Shutdown…',
label: 'Close and Shut Down…',
execute: args => {
const current = getCurrent(args);
if (!current) {
return;
}
return showDialog({
title: 'Shutdown the console?',
title: 'Shut down the console?',
body: `Are you sure you want to close "${current.title.label}"?`,
buttons: [Dialog.cancelButton(), Dialog.warnButton()]
}).then(result => {
Expand Down Expand Up @@ -509,7 +509,7 @@ async function activateConsole(
name: 'Console',
closeAndCleanup: (current: ConsolePanel) => {
return showDialog({
title: 'Shutdown the console?',
title: 'Shut down the console?',
body: `Are you sure you want to close "${current.title.label}"?`,
buttons: [Dialog.cancelButton(), Dialog.warnButton()]
}).then(result => {
Expand Down
2 changes: 1 addition & 1 deletion packages/filebrowser-extension/src/index.ts
Expand Up @@ -625,7 +625,7 @@ function addCommands(
}
},
iconClass: 'jp-MaterialIcon jp-StopIcon',
label: 'Shutdown Kernel'
label: 'Shut Down Kernel'
});

commands.addCommand(CommandIDs.toggleBrowser, {
Expand Down
2 changes: 1 addition & 1 deletion packages/filebrowser/src/listing.ts
Expand Up @@ -440,7 +440,7 @@ export class DirListing extends Widget {
return undefined;
})
.catch(error => {
void showErrorMessage('Shutdown kernel', error);
void showErrorMessage('Shut down kernel', error);
});
}

Expand Down
16 changes: 10 additions & 6 deletions packages/mainmenu-extension/src/index.ts
Expand Up @@ -207,6 +207,10 @@ const plugin: JupyterFrontEndPlugin<IMainMenu> = {
command: CommandIDs.shutdown,
category: 'Main Area'
});
palette.addItem({
command: CommandIDs.logout,
category: 'Main Area'
});
}

palette.addItem({
Expand Down Expand Up @@ -348,7 +352,7 @@ export function createFileMenu(
});

commands.addCommand(CommandIDs.shutdown, {
label: 'Shutdown',
label: 'Shut Down',
caption: 'Shut down JupyterLab',
execute: () => {
return showDialog({
Expand Down Expand Up @@ -392,7 +396,7 @@ export function createFileMenu(
});

commands.addCommand(CommandIDs.logout, {
label: 'Logout',
label: 'Log Out',
caption: 'Log out of JupyterLab',
execute: () => {
router.navigate('/logout', { hard: true });
Expand Down Expand Up @@ -506,23 +510,23 @@ export function createKernelMenu(app: JupyterFrontEnd, menu: KernelMenu): void {
});

commands.addCommand(CommandIDs.shutdownKernel, {
label: 'Shutdown Kernel',
label: 'Shut Down Kernel',
isEnabled: Private.delegateEnabled(app, menu.kernelUsers, 'shutdownKernel'),
execute: Private.delegateExecute(app, menu.kernelUsers, 'shutdownKernel')
});

commands.addCommand(CommandIDs.shutdownAllKernels, {
label: 'Shutdown All Kernels…',
label: 'Shut Down All Kernels…',
isEnabled: () => {
return app.serviceManager.sessions.running().next() !== undefined;
},
execute: () => {
return showDialog({
title: 'Shutdown All?',
title: 'Shut Down All?',
body: 'Shut down all kernels?',
buttons: [
Dialog.cancelButton(),
Dialog.warnButton({ label: 'SHUTDOWN' })
Dialog.warnButton({ label: 'SHUT DOWN ALL' })
]
}).then(result => {
if (result.button.accept) {
Expand Down
6 changes: 3 additions & 3 deletions packages/notebook-extension/src/index.ts
Expand Up @@ -1089,7 +1089,7 @@ function addCommands(
isEnabled
});
commands.addCommand(CommandIDs.closeAndShutdown, {
label: 'Close and Shutdown',
label: 'Close and Shut Down',
execute: args => {
const current = getCurrent(args);

Expand All @@ -1100,7 +1100,7 @@ function addCommands(
const fileName = current.title.label;

return showDialog({
title: 'Shutdown the notebook?',
title: 'Shut down the notebook?',
body: `Are you sure you want to close "${fileName}"?`,
buttons: [Dialog.cancelButton(), Dialog.warnButton()]
}).then(result => {
Expand Down Expand Up @@ -1927,7 +1927,7 @@ function populateMenus(
closeAndCleanup: (current: NotebookPanel) => {
const fileName = current.title.label;
return showDialog({
title: 'Shutdown the notebook?',
title: 'Shut down the notebook?',
body: `Are you sure you want to close "${fileName}"?`,
buttons: [Dialog.cancelButton(), Dialog.warnButton()]
}).then(result => {
Expand Down
11 changes: 7 additions & 4 deletions packages/running/src/index.tsx
Expand Up @@ -173,7 +173,7 @@ function Item<M>(props: SessionProps<M> & { model: M }) {
className={`${SHUTDOWN_BUTTON_CLASS} jp-mod-styled`}
onClick={() => props.shutdown(model)}
>
SHUTDOWN
SHUT DOWN
</button>
</li>
);
Expand Down Expand Up @@ -218,8 +218,11 @@ function List<M>(props: SessionProps<M>) {
function Section<M>(props: SessionProps<M>) {
function onShutdown() {
void showDialog({
title: `Shutdown All ${props.name} Sessions?`,
buttons: [Dialog.cancelButton(), Dialog.warnButton({ label: 'SHUTDOWN' })]
title: `Shut Down All ${props.name} Sessions?`,
buttons: [
Dialog.cancelButton(),
Dialog.warnButton({ label: 'SHUT DOWN ALL' })
]
}).then(result => {
if (result.button.accept) {
props.manager.shutdownAll();
Expand All @@ -233,7 +236,7 @@ function Section<M>(props: SessionProps<M>) {
<header className={SECTION_HEADER_CLASS}>
<h2>{props.name} Sessions</h2>
<ToolbarButtonComponent
tooltip={`Shutdown All ${props.name} Sessions…`}
tooltip={`Shut Down All ${props.name} Sessions…`}
iconClassName="jp-CloseIcon"
onClick={onShutdown}
/>
Expand Down

0 comments on commit 0e1e34e

Please sign in to comment.