allow removing shell integration (fixes #682)

This commit is contained in:
Eugene Pankov
2019-05-17 22:05:53 +02:00
parent f3edf9a469
commit b54d99ff3d
7 changed files with 55 additions and 26 deletions

View File

@@ -20,14 +20,6 @@ ngb-tabset.vertical(type='pills', [activeId]='activeTab')
i.fas.fa-bug
span Report a problem
.form-line(*ngIf='!isShellIntegrationInstalled')
.header
.title Shell integration
.description Allows quickly opening a terminal in the selected folder
button.btn.btn-primary((click)='installShellIntegration()')
i.fas.fa-check
span Install
.form-line
.header
.title Theme
@@ -106,6 +98,12 @@ ngb-tabset.vertical(type='pills', [activeId]='activeTab')
step='0.01'
)
.form-line(*ngIf='hostApp.platform !== Platform.Linux')
.header
.title Shell integration
.description Allows quickly opening a terminal in the selected folder
toggle([ngModel]='isShellIntegrationInstalled', (ngModelChange)='toggleShellIntegration()')
.form-line
.header
.title Window frame

View File

@@ -81,6 +81,15 @@ export class SettingsTabComponent extends BaseTabComponent {
this.isShellIntegrationInstalled = await this.shellIntegration.isInstalled()
}
async toggleShellIntegration () {
if (!this.isShellIntegrationInstalled) {
await this.shellIntegration.install()
} else {
await this.shellIntegration.remove()
}
this.isShellIntegrationInstalled = await this.shellIntegration.isInstalled()
}
async getRecoveryToken (): Promise<any> {
return { type: 'app:settings' }
}
@@ -114,11 +123,6 @@ export class SettingsTabComponent extends BaseTabComponent {
}
}
async installShellIntegration () {
await this.shellIntegration.install()
this.isShellIntegrationInstalled = true
}
getHotkey (id: string) {
let ptr = this.config.store.hotkeys
for (let token of id.split(/\./g)) {