Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locate Blender executable via File Manager #2255

Merged
merged 11 commits into from
Oct 24, 2018
Prev Previous commit
Next Next commit
Add button to browse to the executable location
  • Loading branch information
DylanC committed Oct 18, 2018
commit 8ec3a221bffc62b18108460aaa675b49e2fedbe8
2 changes: 1 addition & 1 deletion src/settings/_default.settings
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
{
"value": "blender",
"title": "Blender Command (path)",
"type": "text",
"type": "browse",
"category": "General",
"setting": "blender_command"
},
Expand Down
9 changes: 9 additions & 0 deletions src/windows/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def __init__(self):

# Create Label
widget = None
extraWidget = None
label = QLabel()
label.setText(_(param["title"]))
label.setToolTip(_(param["title"]))
Expand Down Expand Up @@ -167,6 +168,13 @@ def __init__(self):
widget.setText(_(param["value"]))
widget.textChanged.connect(functools.partial(self.text_value_changed, widget, param))

elif param["type"] == "browse":
# create QLineEdit
widget = QLineEdit()
widget.setText(_(param["value"]))
widget.textChanged.connect(functools.partial(self.text_value_changed, widget, param))
extraWidget = QPushButton("Browse")

elif param["type"] == "bool":
# create spinner
widget = QCheckBox()
Expand Down Expand Up @@ -238,6 +246,7 @@ def __init__(self):
layout_hbox = QHBoxLayout()
layout_hbox.addWidget(label)
layout_hbox.addWidget(widget)
layout_hbox.addWidget(extraWidget)

# Add widget to layout
tabWidget.layout().addLayout(layout_hbox)
Expand Down