2015-10-30 05:20:41 +08:00
|
|
|
{PreferencesSectionStore} = require 'nylas-exports'
|
2015-10-01 03:29:56 +08:00
|
|
|
|
2015-08-15 06:40:11 +08:00
|
|
|
module.exports =
|
|
|
|
activate: (@state={}) ->
|
|
|
|
ipc = require 'ipc'
|
|
|
|
React = require 'react'
|
2015-10-01 03:29:56 +08:00
|
|
|
{Actions} = require('nylas-exports')
|
2015-08-15 06:40:11 +08:00
|
|
|
|
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-10-30 05:20:41 +08:00
|
|
|
PreferencesSectionStore.registerPreferenceSection(new Cfg {
|
2015-08-15 06:40:11 +08:00
|
|
|
icon: 'ic-settings-notifications.png'
|
2015-10-30 05:20:41 +08:00
|
|
|
sectionId: 'Notifications'
|
|
|
|
displayName: 'Notifications'
|
2015-08-15 06:40:11 +08:00
|
|
|
component: require './tabs/preferences-notifications'
|
2015-10-30 05:20:41 +08:00
|
|
|
order: 4
|
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-appearance.png'
|
2015-10-30 05:20:41 +08:00
|
|
|
sectionId: 'Appearance'
|
|
|
|
displayName: 'Appearance'
|
2015-08-15 06:40:11 +08:00
|
|
|
component: require './tabs/preferences-appearance'
|
2015-10-30 05:20:41 +08:00
|
|
|
order: 5
|
2015-08-15 06:40:11 +08:00
|
|
|
})
|
2015-10-01 03:29:56 +08:00
|
|
|
|
|
|
|
Actions.openPreferences.listen(@_openPreferences)
|
|
|
|
ipc.on 'open-preferences', => @_openPreferences()
|
|
|
|
|
|
|
|
_openPreferences: ({tab} = {}) ->
|
|
|
|
{ReactRemote} = require('nylas-exports')
|
|
|
|
Preferences = require('./preferences')
|
|
|
|
ReactRemote.openWindowForComponent(Preferences, {
|
|
|
|
tag: 'preferences'
|
|
|
|
title: "Preferences"
|
|
|
|
width: 520
|
|
|
|
resizable: false
|
|
|
|
autosize: true
|
2015-10-03 08:47:53 +08:00
|
|
|
stylesheetRegex: /(preferences|nylas\-fonts)/
|
2015-10-01 03:29:56 +08:00
|
|
|
props: {
|
|
|
|
initialTab: tab
|
|
|
|
}
|
|
|
|
})
|
2015-08-15 06:40:11 +08:00
|
|
|
|
|
|
|
deactivate: ->
|
|
|
|
|
|
|
|
serialize: -> @state
|