Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Disable run/interrupt/restart buttons when switching kernels
  • Loading branch information
rchiodo committed Feb 24, 2020
commit 6db5214b7af5d685ce3ffd1c0c0346f0945d4066
1 change: 1 addition & 0 deletions news/2 Fixes/9935.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Switching kernels should disable the run/interrupt/restart buttons.
7 changes: 6 additions & 1 deletion src/client/datascience/interactive-common/interactiveBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1480,7 +1480,12 @@ export abstract class InteractiveBase extends WebViewHost<IInteractiveWindowMapp
if (!this._notebook) {
return;
}
await this.commandManager.executeCommand(Commands.SwitchJupyterKernel, this._notebook);
try {
this.startProgress();
Comment thread
DonJayamanne marked this conversation as resolved.
await this.commandManager.executeCommand(Commands.SwitchJupyterKernel, this._notebook);
} finally {
this.stopProgress();
}
}
private async kernelChangeHandler(kernel: IJupyterKernelSpec | LiveKernelModel) {
// Check if we are changing to LiveKernelModel
Expand Down
2 changes: 2 additions & 0 deletions src/datascience-ui/native-editor/nativeCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ interface INativeCellBaseProps {
editorOptions: monacoEditor.editor.IEditorOptions;
themeMatplotlibPlots: boolean | undefined;
focusPending: number;
busy: boolean;
}

type INativeCellProps = INativeCellBaseProps & typeof actionCreators;
Expand Down Expand Up @@ -567,6 +568,7 @@ export class NativeCell extends React.Component<INativeCellProps> {
onClick={runCell}
tooltip={getLocString('DataScience.runCell', 'Run cell')}
hidden={this.isMarkdownCell()}
disabled={this.props.busy}
>
<Image baseTheme={this.props.baseTheme} class="image-button-image" image={ImageName.Run} />
</ImageButton>
Expand Down
1 change: 1 addition & 0 deletions src/datascience-ui/native-editor/nativeEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ ${buildSettingsCss(this.props.settings)}`}</style>
themeMatplotlibPlots={this.props.settings.themeMatplotlibPlots}
// Focus pending does not apply to native editor.
focusPending={0}
busy={this.props.busy}
/>
</ErrorBoundary>
{lastLine}
Expand Down