(
private hotkeys: HotkeysService,
private commands: CommandService,
public updater: UpdaterService,
public hostWindow: HostWindowService,
public hostApp: HostAppService,
public config: ConfigService,
public app: AppService,
platform: PlatformService,
log: LogService,
ngbModal: NgbModal,
_themes: ThemesService,
)
| 78 | private logger: Logger |
| 79 | |
| 80 | constructor ( |
| 81 | private hotkeys: HotkeysService, |
| 82 | private commands: CommandService, |
| 83 | public updater: UpdaterService, |
| 84 | public hostWindow: HostWindowService, |
| 85 | public hostApp: HostAppService, |
| 86 | public config: ConfigService, |
| 87 | public app: AppService, |
| 88 | platform: PlatformService, |
| 89 | log: LogService, |
| 90 | ngbModal: NgbModal, |
| 91 | _themes: ThemesService, |
| 92 | ) { |
| 93 | // document.querySelector('app-root')?.remove() |
| 94 | this.logger = log.create('main') |
| 95 | this.logger.info('v', platform.getAppVersion()) |
| 96 | |
| 97 | this.hotkeys.hotkey$.subscribe((hotkey: string) => { |
| 98 | if (hotkey.startsWith('tab-')) { |
| 99 | const index = parseInt(hotkey.split('-')[1]) |
| 100 | if (index <= this.app.tabs.length) { |
| 101 | this.app.selectTab(this.app.tabs[index - 1]) |
| 102 | } |
| 103 | } |
| 104 | if (this.app.activeTab) { |
| 105 | if (hotkey === 'close-tab') { |
| 106 | this.app.closeTab(this.app.activeTab, true) |
| 107 | } |
| 108 | if (hotkey === 'toggle-last-tab') { |
| 109 | this.app.toggleLastTab() |
| 110 | } |
| 111 | if (hotkey === 'next-tab') { |
| 112 | this.app.nextTab() |
| 113 | } |
| 114 | if (hotkey === 'previous-tab') { |
| 115 | this.app.previousTab() |
| 116 | } |
| 117 | if (hotkey === 'move-tab-left') { |
| 118 | this.app.moveSelectedTabLeft() |
| 119 | } |
| 120 | if (hotkey === 'move-tab-right') { |
| 121 | this.app.moveSelectedTabRight() |
| 122 | } |
| 123 | if (hotkey === 'duplicate-tab') { |
| 124 | this.app.duplicateTab(this.app.activeTab) |
| 125 | } |
| 126 | if (hotkey === 'restart-tab') { |
| 127 | this.app.duplicateTab(this.app.activeTab) |
| 128 | this.app.closeTab(this.app.activeTab, true) |
| 129 | } |
| 130 | if (hotkey === 'explode-tab' && this.app.activeTab instanceof SplitTabComponent) { |
| 131 | this.app.explodeTab(this.app.activeTab) |
| 132 | } |
| 133 | if (hotkey === 'combine-tabs' && this.app.activeTab instanceof SplitTabComponent) { |
| 134 | this.app.combineTabsInto(this.app.activeTab) |
| 135 | } |
| 136 | } |
| 137 | if (hotkey === 'reopen-tab') { |
nothing calls this directly
no test coverage detected