mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-23 23:54:13 +08:00
Electron 0.35.1 includes the tray fixes we contributed last week but also includes API restructuring and improvements. Most importantly, modules from electron are now imported via `require('electron')`
52 lines
1.4 KiB
CoffeeScript
52 lines
1.4 KiB
CoffeeScript
{PreferencesSectionStore,
|
|
Actions,
|
|
WorkspaceStore,
|
|
ComponentRegistry} = require 'nylas-exports'
|
|
|
|
module.exports =
|
|
|
|
activate: ->
|
|
{ipcRenderer} = require 'electron'
|
|
React = require 'react'
|
|
|
|
Cfg = PreferencesSectionStore.SectionConfig
|
|
|
|
PreferencesSectionStore.registerPreferenceSection(new Cfg {
|
|
icon: 'ic-settings-general.png'
|
|
sectionId: 'General'
|
|
displayName: 'General'
|
|
component: require './tabs/preferences-general'
|
|
order: 1
|
|
})
|
|
PreferencesSectionStore.registerPreferenceSection(new Cfg {
|
|
icon: 'ic-settings-accounts.png'
|
|
sectionId: 'Accounts'
|
|
displayName: 'Accounts'
|
|
component: require './tabs/preferences-accounts'
|
|
order: 2
|
|
})
|
|
PreferencesSectionStore.registerPreferenceSection(new Cfg {
|
|
icon: 'ic-settings-shortcuts.png'
|
|
sectionId: 'Shortcuts'
|
|
displayName: 'Shortcuts'
|
|
component: require './tabs/preferences-keymaps'
|
|
order: 3
|
|
})
|
|
|
|
WorkspaceStore.defineSheet 'Preferences', {},
|
|
split: ['Preferences']
|
|
list: ['Preferences']
|
|
|
|
PreferencesRoot = require('./preferences-root')
|
|
ComponentRegistry.register PreferencesRoot,
|
|
location: WorkspaceStore.Location.Preferences
|
|
|
|
Actions.openPreferences.listen(@_openPreferences)
|
|
ipcRenderer.on 'open-preferences', => @_openPreferences()
|
|
|
|
_openPreferences: ->
|
|
Actions.pushSheet(WorkspaceStore.Sheet.Preferences)
|
|
|
|
deactivate: ->
|
|
|
|
serialize: -> @state
|