2020-03-01 15:10:45 +00:00
|
|
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
2017-09-09 19:42:48 +00:00
|
|
|
import { Injectable } from '@angular/core'
|
2022-01-08 15:02:56 +00:00
|
|
|
import { ToolbarButtonProvider, ToolbarButton, TranslateService } from 'tabby-core'
|
2017-08-02 11:47:00 +00:00
|
|
|
import { TerminalService } from './services/terminal.service'
|
2017-03-24 21:24:12 +00:00
|
|
|
|
2019-03-07 01:05:26 +00:00
|
|
|
/** @hidden */
|
2017-03-24 21:24:12 +00:00
|
|
|
@Injectable()
|
2017-03-25 17:12:43 +00:00
|
|
|
export class ButtonProvider extends ToolbarButtonProvider {
|
2017-03-24 21:24:12 +00:00
|
|
|
constructor (
|
2017-08-02 11:47:00 +00:00
|
|
|
private terminal: TerminalService,
|
2022-01-08 15:02:56 +00:00
|
|
|
private translate: TranslateService,
|
2017-03-24 21:24:12 +00:00
|
|
|
) {
|
2017-03-25 17:12:43 +00:00
|
|
|
super()
|
2017-03-29 12:04:01 +00:00
|
|
|
}
|
|
|
|
|
2019-06-14 21:47:48 +00:00
|
|
|
provide (): ToolbarButton[] {
|
2019-05-11 19:28:04 +00:00
|
|
|
return [
|
|
|
|
{
|
2019-06-30 21:08:30 +00:00
|
|
|
icon: require('./icons/plus.svg'),
|
2022-01-08 15:02:56 +00:00
|
|
|
title: this.translate.instant('New terminal'),
|
2019-05-11 19:28:04 +00:00
|
|
|
touchBarNSImage: 'NSTouchBarAddDetailTemplate',
|
2020-04-11 10:37:46 +00:00
|
|
|
click: () => {
|
2019-05-11 19:28:04 +00:00
|
|
|
this.terminal.openTab()
|
2019-06-14 21:47:48 +00:00
|
|
|
},
|
2019-05-11 19:28:04 +00:00
|
|
|
},
|
|
|
|
]
|
2017-03-24 21:24:12 +00:00
|
|
|
}
|
|
|
|
}
|