mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
make configurable --disable-direct-write flag
This commit is contained in:
@@ -78,6 +78,14 @@ export default class AppSettingTab extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
handleDisableDirectWriteClick (e) {
|
||||
let config = this.state.config
|
||||
config['disable-direct-write'] = !config['disable-direct-write']
|
||||
this.setState({
|
||||
config
|
||||
})
|
||||
}
|
||||
|
||||
handleNameSaveButtonClick (e) {
|
||||
let { dispatch } = this.props
|
||||
|
||||
@@ -156,9 +164,8 @@ export default class AppSettingTab extends React.Component {
|
||||
{
|
||||
true// !OSX
|
||||
? (
|
||||
<div className='sectionInput'>
|
||||
<label>Direct write(Windows only)</label>
|
||||
<input disabled={OSX} onKeyDown={e => this.handleConfigKeyDown(e)} type='checkbox'/>
|
||||
<div className='sectionCheck'>
|
||||
<label><input onClick={e => this.handleDisableDirectWriteClick(e)} checked={this.state.config['disable-direct-write']} disabled={OSX} type='checkbox'/>Disable Direct Write<span className='sectionCheck-warn'>It will be applied after restarting</span></label>
|
||||
</div>
|
||||
)
|
||||
: null
|
||||
|
||||
@@ -69,6 +69,18 @@ iptFocusBorderColor = #369DCD
|
||||
font-size 18px
|
||||
margin 10px 0 5px
|
||||
color brandColor
|
||||
&>.sectionCheck
|
||||
margin-bottom 5px
|
||||
height 33px
|
||||
label
|
||||
width 150px
|
||||
padding-left 15px
|
||||
line-height 33px
|
||||
.sectionCheck-warn
|
||||
font-size 12px
|
||||
margin-left 10px
|
||||
border-left 2px solid brandColor
|
||||
padding-left 5px
|
||||
&>.sectionInput
|
||||
margin-bottom 5px
|
||||
clearfix()
|
||||
|
||||
@@ -2,7 +2,6 @@ const electron = require('electron')
|
||||
const app = electron.app
|
||||
const ipc = electron.ipcMain
|
||||
const jetpack = require('fs-jetpack')
|
||||
const mainWindow = require('./main-window')
|
||||
|
||||
const defaultConfig = {
|
||||
'editor-font-size': '14',
|
||||
@@ -41,6 +40,12 @@ function saveConfig () {
|
||||
// Init
|
||||
global.config = Object.assign({}, defaultConfig, getConfig())
|
||||
|
||||
if (global.config['disable-direct-write']) {
|
||||
app.commandLine.appendSwitch('disable-direct-write')
|
||||
}
|
||||
|
||||
app.on('ready', function () {
|
||||
const mainWindow = require('./main-window')
|
||||
function applyConfig () {
|
||||
mainWindow.webContents.send('config-apply')
|
||||
}
|
||||
@@ -50,4 +55,5 @@ ipc.on('configUpdated', function (event, newConfig) {
|
||||
saveConfig()
|
||||
applyConfig()
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ const nodeIpc = require('@rokt33r/node-ipc')
|
||||
const GhReleases = require('electron-gh-releases')
|
||||
// electron.crashReporter.start()
|
||||
|
||||
require('./config')
|
||||
var mainWindow = null
|
||||
var finderProcess = null
|
||||
var finderWindow = null
|
||||
@@ -295,7 +296,6 @@ app.on('ready', function () {
|
||||
})
|
||||
|
||||
require('./hotkey')
|
||||
require('./config')
|
||||
})
|
||||
|
||||
module.exports = app
|
||||
|
||||
Reference in New Issue
Block a user