"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "app/lib/app.ts" between
tabby-1.0.181.tar.gz and tabby-1.0.183.tar.gz

About: Tabby is a modern cross-platform terminal emulator, SSH and serial client.

app.ts  (tabby-1.0.181):app.ts  (tabby-1.0.183)
import { app, ipcMain, Menu, Tray, shell, screen, globalShortcut, MenuItemConstr uctorOptions } from 'electron' import { app, ipcMain, Menu, Tray, shell, screen, globalShortcut, MenuItemConstr uctorOptions, WebContents } from 'electron'
import promiseIpc from 'electron-promise-ipc' import promiseIpc from 'electron-promise-ipc'
import * as remote from '@electron/remote/main' import * as remote from '@electron/remote/main'
import { exec } from 'mz/child_process' import { exec } from 'mz/child_process'
import * as path from 'path' import * as path from 'path'
import * as fs from 'fs' import * as fs from 'fs'
import { Subject, throttleTime } from 'rxjs' import { Subject, throttleTime } from 'rxjs'
import { saveConfig } from './config' import { saveConfig } from './config'
import { Window, WindowOptions } from './window' import { Window, WindowOptions } from './window'
import { pluginManager } from './pluginManager' import { pluginManager } from './pluginManager'
skipping to change at line 34 skipping to change at line 34
private globalHotkey$ = new Subject<void>() private globalHotkey$ = new Subject<void>()
private quitRequested = false private quitRequested = false
userPluginsPath: string userPluginsPath: string
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-type s // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-type s
constructor (private configStore: any) { constructor (private configStore: any) {
remote.initialize() remote.initialize()
this.useBuiltinGraphics() this.useBuiltinGraphics()
this.ptyManager.init(this) this.ptyManager.init(this)
ipcMain.on('app:config-change', (_event, config) => { ipcMain.handle('app:save-config', async (event, config) => {
this.broadcast('host:config-change', config) await saveConfig(config)
this.configStore = config this.broadcastExcept('host:config-change', event.sender, config)
})
ipcMain.on('app:save-config', (_event, data) => {
saveConfig(data)
}) })
ipcMain.on('app:register-global-hotkey', (_event, specs) => { ipcMain.on('app:register-global-hotkey', (_event, specs) => {
globalShortcut.unregisterAll() globalShortcut.unregisterAll()
for (const spec of specs) { for (const spec of specs) {
globalShortcut.register(spec, () => this.globalHotkey$.next()) globalShortcut.register(spec, () => this.globalHotkey$.next())
} }
}) })
this.globalHotkey$.pipe(throttleTime(100)).subscribe(() => { this.globalHotkey$.pipe(throttleTime(100)).subscribe(() => {
skipping to change at line 174 skipping to change at line 170
window.present() window.present()
} }
} }
broadcast (event: string, ...args: any[]): void { broadcast (event: string, ...args: any[]): void {
for (const window of this.windows) { for (const window of this.windows) {
window.send(event, ...args) window.send(event, ...args)
} }
} }
broadcastExcept (event: string, except: WebContents, ...args: any[]): void {
for (const window of this.windows) {
if (window.webContents.id === except.id) {
window.send(event, ...args)
}
}
}
async send (event: string, ...args: any[]): Promise<void> { async send (event: string, ...args: any[]): Promise<void> {
if (!this.hasWindows()) { if (!this.hasWindows()) {
await this.newWindow() await this.newWindow()
} }
this.windows.filter(w => !w.isDestroyed())[0].send(event, ...args) this.windows.filter(w => !w.isDestroyed())[0].send(event, ...args)
} }
enableTray (): void { enableTray (): void {
if (this.tray || process.platform === 'linux') { if (this.tray || process.platform === 'linux') {
return return
 End of changes. 3 change blocks. 
8 lines changed or deleted 12 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)