Skip to content

Commit

Permalink
Set filename to QLineEdit after selection
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanC committed Oct 20, 2018
1 parent 4cbd215 commit 7bd4e3c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/windows/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def __init__(self):
widget.setText(_(param["value"]))
widget.textChanged.connect(functools.partial(self.text_value_changed, widget, param))
extraWidget = QPushButton("Browse")
extraWidget.clicked.connect(functools.partial(self.selectExecutable, param))
extraWidget.clicked.connect(functools.partial(self.selectExecutable, widget, param))

elif param["type"] == "bool":
# create spinner
Expand Down Expand Up @@ -258,10 +258,12 @@ def __init__(self):
# Add stretch to bottom of layout
tabWidget.layout().addStretch()

def selectExecutable(self, param):
def selectExecutable(self, widget, param):
fileName, _ = QFileDialog.getOpenFileName(self,"Select Blender executable", "","All Files (*)")
if fileName:
log.info(fileName)
self.s.set(param["setting"], fileName)
widget.setText(fileName)

def check_for_restart(self, param):
"""Check if the app needs to restart"""
Expand Down

0 comments on commit 7bd4e3c

Please sign in to comment.