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

Added save name label option #94

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
# expected fields in the configuration file for this app
configuration:

# WWFX: Save Name label
#
save_name_label:
type: str
description: Custom save dialog "Name" label text.
default_value: Name

# Startup options
#

Expand Down
17 changes: 17 additions & 0 deletions python/tk_multi_workfiles/file_save_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,23 @@ def _on_work_area_changed(self, env):
name = self._current_env.save_as_default_name or "scene"
self._ui.name_edit.setText(name)

# Setup custom name label if any.
# See also ./ui/file_save_form.py:retranslateUi()
app = sgtk.platform.current_bundle()
label_template = (
'<html><head/><body><p><span style=" font-weight:600;">'
"{}:</span></p></body></html>"
)
# Catch even if save_name_label is an empty string.
label_text = app.get_setting("save_name_label") or "Name"
text = QtGui.QApplication.translate(
"FileSaveForm",
label_template.format(label_text),
None,
QtGui.QApplication.UnicodeUTF8,
)
self._ui.name_label.setText(text)

self._ui.name_label.setVisible(name_is_used)
self._ui.name_edit.setVisible(name_is_used)

Expand Down