Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
meowtec committed May 14, 2018
1 parent c3210b6 commit 638c264
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion modules/__tests__/renderer/deamon.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as path from 'path'
import { createStore } from '../../renderer/store/store'
import Daemon from '../../renderer/store/daemon'
import actions from '../../renderer/store/actionCreaters'
import controller from '../../backend/controller'
import app from '../../backend/app'
import { saveFilesTmp } from '../../common/file-utils'
import { sleep } from '../../common/utils'
import { IImageFile, IOptimizeOptions, ITaskItem, TaskStatus } from '../../common/constants'
Expand Down
2 changes: 1 addition & 1 deletion modules/__tests__/renderer/store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import '../_tools/before-test'
import * as path from 'path'
import { createStore } from '../../renderer/store/store'
import actions from '../../renderer/store/actionCreaters'
import controller from '../../backend/controller'
import app from '../../backend/app'
import {
IImageFile,
IOptimizeOptions,
Expand Down
4 changes: 2 additions & 2 deletions modules/backend/controller.ts → modules/backend/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import * as menuActions from './menu-actions'
import { detectImageMagick } from './imagemagick'
import __ from '../locales'

class Controller {
class App {
private windows: number[] = []
private menu = menuManager

Expand Down Expand Up @@ -171,4 +171,4 @@ class Controller {
}
}

export default new Controller()
export default new App()
4 changes: 2 additions & 2 deletions modules/backend/menu-actions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as os from 'os'
import { Menu, dialog, shell } from 'electron'
import { EventEmitter } from 'events'
import controller from './controller'
import app from './app'
import __ from '../locales'
import pkg from '../../package.json'

Expand Down Expand Up @@ -40,6 +40,6 @@ export const open = () => {
}],
properties: properties as any,
}, filePaths => {
controller.receiveFiles(filePaths)
app.receiveFiles(filePaths)
})
}
2 changes: 1 addition & 1 deletion modules/backend/menu.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { EventEmitter } from 'events'
import { Menu } from 'electron'
import controller from './controller'
import app from './app'
import { SaveType } from '../common/constants'
import * as menuActions from './menu-actions'
import { isDev } from './dev'
Expand Down
6 changes: 3 additions & 3 deletions modules/backend/updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ import {
IUpdateInfo,
} from '../common/constants'
import __ from '../locales'
import controller from './controller'
import app from './app'

autoUpdater.logger = log
autoUpdater.autoDownload = false

autoUpdater.on('update-available', async (info: IUpdateInfo) => {
log.info('update available', info.version, info.path)

await controller.ready
await app.ready

const win = controller.getMainWindow()
const win = app.getMainWindow()
win && win.webContents.send(IpcChannel.APP_UPDATE, info)
})

Expand Down
8 changes: 4 additions & 4 deletions modules/bootstrap.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { app, BrowserWindow } from 'electron'
import { url } from './backend/dev'
import controller from './backend/controller'
import imagine from './backend/app'
import updater from './backend/updater'
import { cleanTmpdir } from './common/file-utils'
import { setup as setupLocales } from './locales/'
Expand All @@ -13,15 +13,15 @@ log.transports.file.level = 'info'
app.on('ready', (launchInfo) => {
log.info('app launch', process.argv)

controller.receiveFiles(process.argv.slice(1))
imagine.receiveFiles(process.argv.slice(1))

setupLocales()

controller.start()
imagine.start()

updater.checkForUpdates()
})

app.on('open-file', (e, filePath) => {
controller.receiveFiles([filePath])
imagine.receiveFiles([filePath])
})

0 comments on commit 638c264

Please sign in to comment.