瀏覽代碼

Use consistent naming for clearing cell outputs.

Ian Rose 7 年之前
父節點
當前提交
b8a24d35e8
共有 3 個文件被更改,包括 12 次插入6 次删除
  1. 1 1
      packages/mainmenu-extension/src/index.ts
  2. 7 2
      packages/mainmenu/src/edit.ts
  3. 4 3
      packages/notebook-extension/src/index.ts

+ 1 - 1
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}` : ''}`;
     },

+ 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);
     },