|
@@ -202,6 +202,11 @@ export interface PluginManagerFace {
|
|
|
approveBuildsAndRetry: () => void
|
|
approveBuildsAndRetry: () => void
|
|
|
/** Leave the check or the failed screen for the spec, or ask the Host to stop the run and wait for its cleanup. */
|
|
/** Leave the check or the failed screen for the spec, or ask the Host to stop the run and wait for its cleanup. */
|
|
|
cancelInstall: () => void
|
|
cancelInstall: () => void
|
|
|
|
|
+ /**
|
|
|
|
|
+ * While the Host runs the install, ask it to stop and close the dialog once
|
|
|
|
|
+ * it confirms; the dialog stays when it cannot. Otherwise nothing.
|
|
|
|
|
+ */
|
|
|
|
|
+ cancelInstallAndClose: () => void
|
|
|
toggleInstallDetails: () => void
|
|
toggleInstallDetails: () => void
|
|
|
/** Enable the bundle the finished install added, then close the dialog and mark it in the list. */
|
|
/** Enable the bundle the finished install added, then close the dialog and mark it in the list. */
|
|
|
enableInstalled: () => void
|
|
enableInstalled: () => void
|
|
@@ -374,6 +379,7 @@ export class PluginManagerController {
|
|
|
runInstall: () => { void this.runInstall() },
|
|
runInstall: () => { void this.runInstall() },
|
|
|
approveBuildsAndRetry: () => { void this.approveBuildsAndRetry() },
|
|
approveBuildsAndRetry: () => { void this.approveBuildsAndRetry() },
|
|
|
cancelInstall: () => { void this.cancelInstall() },
|
|
cancelInstall: () => { void this.cancelInstall() },
|
|
|
|
|
+ cancelInstallAndClose: () => { void this.cancelInstall(true) },
|
|
|
toggleInstallDetails: () => { this.patchInstall({ detailsOpen: !this.getSnapshot().install.detailsOpen }) },
|
|
toggleInstallDetails: () => { this.patchInstall({ detailsOpen: !this.getSnapshot().install.detailsOpen }) },
|
|
|
enableInstalled: () => { void this.enableInstalled() },
|
|
enableInstalled: () => { void this.enableInstalled() },
|
|
|
clearHighlight: () => { if (this.getSnapshot().highlight !== null) this.patch({ highlight: null }) },
|
|
clearHighlight: () => { if (this.getSnapshot().highlight !== null) this.patch({ highlight: null }) },
|
|
@@ -595,10 +601,11 @@ export class PluginManagerController {
|
|
|
* Leave the check or the failed screen for the spec at once; a Host-owned
|
|
* Leave the check or the failed screen for the spec at once; a Host-owned
|
|
|
* run is asked to stop and the dialog waits for the Host's word, since
|
|
* run is asked to stop and the dialog waits for the Host's word, since
|
|
|
* neither a dropped RPC nor a closed connection means pnpm has stopped.
|
|
* neither a dropped RPC nor a closed connection means pnpm has stopped.
|
|
|
|
|
+ * @param closeAfter - stop only a running install, and close the dialog once the Host confirms the stop.
|
|
|
*/
|
|
*/
|
|
|
- private async cancelInstall(): Promise<void> {
|
|
|
|
|
|
|
+ private async cancelInstall(closeAfter = false): Promise<void> {
|
|
|
const install = this.getSnapshot().install
|
|
const install = this.getSnapshot().install
|
|
|
- if (install.phase === 'checking' || install.phase === 'failed') {
|
|
|
|
|
|
|
+ if (!closeAfter && (install.phase === 'checking' || install.phase === 'failed')) {
|
|
|
this.abortInspect()
|
|
this.abortInspect()
|
|
|
this.offerSpecAgain()
|
|
this.offerSpecAgain()
|
|
|
return
|
|
return
|
|
@@ -614,7 +621,9 @@ export class PluginManagerController {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
if (result.value.status === 'cancelled') {
|
|
if (result.value.status === 'cancelled') {
|
|
|
- this.offerSpecAgain({ kind: 'cancelled', seq: ++this.noticeSeq })
|
|
|
|
|
|
|
+ const notice: ManagerNotice = { kind: 'cancelled', seq: ++this.noticeSeq }
|
|
|
|
|
+ if (closeAfter) this.patch({ install: IDLE_INSTALL, notice })
|
|
|
|
|
+ else this.offerSpecAgain(notice)
|
|
|
void this.load()
|
|
void this.load()
|
|
|
} else if (result.value.status === 'too-late') {
|
|
} else if (result.value.status === 'too-late') {
|
|
|
this.patchInstall({ phase: 'applying' })
|
|
this.patchInstall({ phase: 'applying' })
|