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