2015-11-24 04:20:51 +08:00
|
|
|
{PreferencesSectionStore,
|
|
|
|
Actions,
|
|
|
|
WorkspaceStore,
|
|
|
|
ComponentRegistry} = require 'nylas-exports'
|
2015-10-01 03:29:56 +08:00
|
|
|
|
2015-08-15 06:40:11 +08:00
|
|
|
module.exports =
|
2015-11-24 04:20:51 +08:00
|
|
|
|
|
|
|
activate: ->
|
2015-11-24 14:09:17 +08:00
|
|
|
{ipcRenderer} = require 'electron'
|
2015-08-15 06:40:11 +08:00
|
|
|
React = require 'react'
|
|
|
|
|
2015-10-30 05:20:41 +08:00
|
|
|
Cfg = PreferencesSectionStore.SectionConfig
|
|
|
|
|
|
|
|
PreferencesSectionStore.registerPreferenceSection(new Cfg {
|
2015-08-15 06:40:11 +08:00
|
|
|
icon: 'ic-settings-general.png'
|
2015-10-30 05:20:41 +08:00
|
|
|
sectionId: 'General'
|
|
|
|
displayName: 'General'
|
2015-08-15 06:40:11 +08:00
|
|
|
component: require './tabs/preferences-general'
|
2015-10-30 05:20:41 +08:00
|
|
|
order: 1
|
2015-08-15 06:40:11 +08:00
|
|
|
})
|
2015-10-30 05:20:41 +08:00
|
|
|
PreferencesSectionStore.registerPreferenceSection(new Cfg {
|
2015-08-15 06:40:11 +08:00
|
|
|
icon: 'ic-settings-accounts.png'
|
2015-10-30 05:20:41 +08:00
|
|
|
sectionId: 'Accounts'
|
|
|
|
displayName: 'Accounts'
|
2015-08-15 06:40:11 +08:00
|
|
|
component: require './tabs/preferences-accounts'
|
2015-10-30 05:20:41 +08:00
|
|
|
order: 2
|
2015-08-15 06:40:11 +08:00
|
|
|
})
|
2015-10-30 05:20:41 +08:00
|
|
|
PreferencesSectionStore.registerPreferenceSection(new Cfg {
|
2015-08-15 06:40:11 +08:00
|
|
|
icon: 'ic-settings-shortcuts.png'
|
2015-10-30 05:20:41 +08:00
|
|
|
sectionId: 'Shortcuts'
|
|
|
|
displayName: 'Shortcuts'
|
2015-08-15 06:40:11 +08:00
|
|
|
component: require './tabs/preferences-keymaps'
|
2015-10-30 05:20:41 +08:00
|
|
|
order: 3
|
2015-08-15 06:40:11 +08:00
|
|
|
})
|
2015-11-24 04:20:51 +08:00
|
|
|
|
|
|
|
WorkspaceStore.defineSheet 'Preferences', {},
|
|
|
|
split: ['Preferences']
|
|
|
|
list: ['Preferences']
|
|
|
|
|
|
|
|
PreferencesRoot = require('./preferences-root')
|
|
|
|
ComponentRegistry.register PreferencesRoot,
|
|
|
|
location: WorkspaceStore.Location.Preferences
|
2015-10-01 03:29:56 +08:00
|
|
|
|
|
|
|
Actions.openPreferences.listen(@_openPreferences)
|
2015-11-24 14:09:17 +08:00
|
|
|
ipcRenderer.on 'open-preferences', => @_openPreferences()
|
2015-10-01 03:29:56 +08:00
|
|
|
|
2015-11-24 04:20:51 +08:00
|
|
|
_openPreferences: ->
|
|
|
|
Actions.pushSheet(WorkspaceStore.Sheet.Preferences)
|
2015-08-15 06:40:11 +08:00
|
|
|
|
|
|
|
deactivate: ->
|
|
|
|
|
|
|
|
serialize: -> @state
|