Merge pull request #3186 from maschs/ms-safeModeThemes

Load the default themes in safe mode
This commit is contained in:
Kevin Sawicki
2014-08-11 14:51:14 -07:00
3 changed files with 17 additions and 2 deletions

View File

@@ -156,7 +156,7 @@ class Atom extends Model
@keymaps = new KeymapManager({configDirPath, resourcePath})
@keymap = @keymaps # Deprecated
@packages = new PackageManager({devMode, configDirPath, resourcePath, safeMode})
@themes = new ThemeManager({packageManager: @packages, configDirPath, resourcePath})
@themes = new ThemeManager({packageManager: @packages, configDirPath, resourcePath, safeMode})
@contextMenu = new ContextMenuManager(devMode)
@menu = new MenuManager({resourcePath})
@clipboard = new Clipboard()

View File

@@ -16,7 +16,7 @@ module.exports =
class ThemeManager
Emitter.includeInto(this)
constructor: ({@packageManager, @resourcePath, @configDirPath}) ->
constructor: ({@packageManager, @resourcePath, @configDirPath, @safeMode}) ->
@lessCache = null
@packageManager.registerPackageActivator(this, ['theme'])
@@ -46,6 +46,7 @@ class ThemeManager
#
# Returns an array of theme names in the order that they should be activated.
getEnabledThemeNames: ->
return ['atom-dark-ui', 'atom-dark-syntax'] if @safeMode
themeNames = atom.config.get('core.themes') ? []
themeNames = [themeNames] unless _.isArray(themeNames)
themeNames = themeNames.filter (themeName) ->