path-selector: display path instead of name
This commit is contained in:
@@ -18,7 +18,6 @@ class PathSelector extends React.Component {
|
|||||||
return {
|
return {
|
||||||
className: PropTypes.string,
|
className: PropTypes.string,
|
||||||
dialog: PropTypes.object,
|
dialog: PropTypes.object,
|
||||||
displayValue: PropTypes.string,
|
|
||||||
id: PropTypes.string,
|
id: PropTypes.string,
|
||||||
onChange: PropTypes.func,
|
onChange: PropTypes.func,
|
||||||
title: PropTypes.string.isRequired,
|
title: PropTypes.string.isRequired,
|
||||||
@@ -34,7 +33,7 @@ class PathSelector extends React.Component {
|
|||||||
handleClick () {
|
handleClick () {
|
||||||
const opts = Object.assign({
|
const opts = Object.assign({
|
||||||
defaultPath: this.props.value && path.dirname(this.props.value),
|
defaultPath: this.props.value && path.dirname(this.props.value),
|
||||||
properties: [ 'openFile', 'openDirectory' ]
|
properties: ['openFile', 'openDirectory']
|
||||||
}, this.props.dialog)
|
}, this.props.dialog)
|
||||||
|
|
||||||
remote.dialog.showOpenDialog(
|
remote.dialog.showOpenDialog(
|
||||||
@@ -67,8 +66,7 @@ class PathSelector extends React.Component {
|
|||||||
const textFieldStyle = {
|
const textFieldStyle = {
|
||||||
flex: '1'
|
flex: '1'
|
||||||
}
|
}
|
||||||
|
const text = this.props.value || ''
|
||||||
const text = this.props.displayValue || this.props.value || ''
|
|
||||||
const buttonStyle = {
|
const buttonStyle = {
|
||||||
marginLeft: 10
|
marginLeft: 10
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,7 +101,6 @@ class PreferencesPage extends React.Component {
|
|||||||
title: 'Select media player app',
|
title: 'Select media player app',
|
||||||
properties: ['openFile']
|
properties: ['openFile']
|
||||||
}}
|
}}
|
||||||
displayValue={playerName}
|
|
||||||
onChange={this.handleExternalPlayerPathChange}
|
onChange={this.handleExternalPlayerPathChange}
|
||||||
title='External player'
|
title='External player'
|
||||||
value={playerPath}
|
value={playerPath}
|
||||||
|
|||||||
Reference in New Issue
Block a user