Skip to content
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
18 changes: 18 additions & 0 deletions python/tk_multi_publish2/api/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class PublishItem(object):
__slots__ = [
"_active",
"_allows_context_change",
"_allows_context_widget",
"_children",
"_context",
"_created_temp_files",
Expand Down Expand Up @@ -179,6 +180,7 @@ def __init__(self, name, type_spec, type_display, parent=None):

self._active = True
self._allows_context_change = True
self._allows_context_widget = False
self._children = []
self._context = None
self._created_temp_files = []
Expand Down Expand Up @@ -631,6 +633,22 @@ def context_change_allowed(self, allow):
"""
self._allows_context_change = allow

@property
def context_widget(self):
"""
Enable/disable context change for this item.

Default is ``True``
"""
return self._allows_context_widget

@context_widget.setter
def context_widget(self, allow):
"""
Enable/disable context change for this item.
"""
self._allows_context_widget = allow
Copy link

Choose a reason for hiding this comment

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

Black would make changes.
trailing whitespace


@property
def description(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion python/tk_multi_publish2/dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ def _create_item_details(self, tree_item):
# Items with default thumbnails should still be able to have override thumbnails set by the user
self.ui.item_thumbnail.setEnabled(True)

if item.parent.is_root:
if item.parent.is_root or item.context_widget:
self.ui.context_widget.show()

if item.context_change_allowed:
Expand Down