Quellcode durchsuchen

Merge pull request #3529 from ian-r-rose/clarify_console_clear

Clarify labels
Brian E. Granger vor 7 Jahren
Ursprung
Commit
b267a034d4

+ 2 - 2
packages/console-extension/src/index.ts

@@ -272,7 +272,7 @@ function activateConsole(app: JupyterLab, mainMenu: IMainMenu, palette: ICommand
   }
 
   commands.addCommand(CommandIDs.clear, {
-    label: 'Clear Cells',
+    label: 'Clear Console Cells',
     execute: args => {
       let current = getCurrent(args);
       if (!current) {
@@ -470,7 +470,7 @@ function activateConsole(app: JupyterLab, mainMenu: IMainMenu, palette: ICommand
   // Add a clearer to the edit menu
   mainMenu.editMenu.clearers.add({
     tracker,
-    noun: 'Console',
+    noun: 'Console Cells',
     clearCurrent: (current: ConsolePanel) => { return current.console.clear(); }
   } as IEditMenu.IClearer<ConsolePanel>);
 

+ 2 - 2
packages/mainmenu-extension/src/index.ts

@@ -174,7 +174,7 @@ function createEditMenu(app: JupyterLab, menu: EditMenu): void {
   });
   commands.addCommand(CommandIDs.clearAll, {
     label: () => {
-      const noun = Private.delegateLabel(app, menu.clearers, 'noun');
+      const noun = Private.delegateLabel(app, menu.clearers, 'pluralNoun');
       const enabled = Private.delegateEnabled(app, menu.clearers, 'clearAll')();
       return `Clear All${enabled ? ` ${noun}` : ''}`;
     },
@@ -323,7 +323,7 @@ function createKernelMenu(app: JupyterLab, menu: KernelMenu): void {
   });
 
   commands.addCommand(CommandIDs.shutdownAllKernels, {
-    label: 'Shutdown All Kernels...',
+    label: 'Shutdown All Kernels',
     isEnabled: () => {
       return app.serviceManager.sessions.running().next() !== undefined;
     },

+ 7 - 2
packages/mainmenu/src/edit.ts

@@ -106,9 +106,14 @@ namespace IEditMenu {
   export
   interface IClearer<T extends Widget> extends IMenuExtender<T> {
     /**
-     * A label for the thing to be cleared.
+     * A name for the thing to be cleared, used for labeling `clearCurrent`.
      */
-    noun: string;
+    noun?: string;
+
+    /**
+     * A plural name for the thing to be cleared, used for labeling `clearAll`.
+     */
+    pluralNoun?: string;
 
     /**
      * A function to clear the currently portion of activity.

+ 4 - 3
packages/notebook-extension/src/index.ts

@@ -804,7 +804,7 @@ function addCommands(app: JupyterLab, services: ServiceManager, tracker: Noteboo
     isEnabled
   });
   commands.addCommand(CommandIDs.restartClear, {
-    label: 'Restart Kernel & Clear Outputs',
+    label: 'Restart Kernel & Clear All Outputs',
     execute: args => {
       const current = getCurrent(args);
 
@@ -843,7 +843,7 @@ function addCommands(app: JupyterLab, services: ServiceManager, tracker: Noteboo
     isEnabled
   });
   commands.addCommand(CommandIDs.clearOutputs, {
-    label: 'Clear Outputs',
+    label: 'Clear Selected Outputs',
     execute: args => {
       const current = getCurrent(args);
 
@@ -1491,7 +1491,8 @@ function populateMenus(app: JupyterLab, mainMenu: IMainMenu, tracker: INotebookT
   // Add a clearer to the edit menu
   mainMenu.editMenu.clearers.add({
     tracker,
-    noun: 'Cell Outputs',
+    noun: 'Selected Outputs',
+    pluralNoun: 'Outputs',
     clearCurrent: (current: NotebookPanel) => {
       return NotebookActions.clearOutputs(current.notebook);
     },