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

SHOT-2850 Small update to the task_required UI display #130

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
22 changes: 19 additions & 3 deletions python/tk_multi_publish2/dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -1656,15 +1656,31 @@ def _validate_task_required(self):
# disable buttons
self.ui.publish.setEnabled(False)
self.ui.validate.setEnabled(False)
# change task label color to RED
self.ui.context_widget.ui.task_label.setStyleSheet("color: red")
# change task label color to SG_ALERT_COLOR
self.ui.context_widget.ui.task_label.setStyleSheet(
"color: "
+ sgtk.platform.current_bundle().style_constants["SG_ALERT_COLOR"]
)
# Also change the text and color of the parent label
self.ui.context_widget.ui.label.setText(
"Task Required is turned ON in your configuration."
"Please select a Task to continue."
)
self.ui.context_widget.ui.label.setStyleSheet(
"color: "
+ sgtk.platform.current_bundle().style_constants["SG_HIGHLIGHT_COLOR"]
)
else:
# enable buttons
self.ui.publish.setEnabled(True)
self.ui.validate.setEnabled(True)

# change task label color to the default value
# change task label color and text back to the default values
self.ui.context_widget.ui.task_label.setStyleSheet("")
self.ui.context_widget.ui.label.setText(
"Task and Entity Link to apply to the selected item:"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should be calling the enable_editing method, and passing the message rather than directly modifying the label. Or using the context_label. I don't think the ui property is intended to be public, despite it not having _ at the beginning.
This also applies further up on line 1665.

Also I assume this works when you select an item, but what happens when you select the summary (visible when you have more than 2 root items), the message should be different I think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to add another comment to Phil's :)
When you have more than one item in your publisher and if some of your items has been setup correclty (aka are linked to a Task), the "error" message still appears for these items. Maybe we should update the message according to the selected item.

)
self.ui.context_widget.ui.label.setStyleSheet("")


class _TaskSelection(object):
Expand Down