Skip to content

Commit

Permalink
Connect button and set the filename to be result of file dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanC committed Oct 19, 2018
1 parent 8ec3a22 commit 2cfea16
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/windows/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +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))

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

def selectExecutable(self, param):
fileName, _ = QFileDialog.getOpenFileName(self,"Select Blender executable", "","All Files (*)")
if fileName:
log.info(fileName)

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

0 comments on commit 2cfea16

Please sign in to comment.