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

Workfiles: Browse and Save As button only enabled when in valid context #1085

Merged
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
6 changes: 5 additions & 1 deletion client/ayon_core/tools/workfiles/widgets/files_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ def __init__(self, controller, parent):

# Initial setup
workarea_btn_open.setEnabled(False)
workarea_btn_browse.setEnabled(False)
workarea_btn_save.setEnabled(False)
published_btn_copy_n_open.setEnabled(False)
published_btn_change_context.setEnabled(False)
published_btn_cancel.setVisible(False)
Expand Down Expand Up @@ -278,8 +280,9 @@ def _update_published_btns_state(self):
self._published_btn_change_context.setEnabled(enabled)

def _update_workarea_btns_state(self):
enabled = self._is_save_enabled
enabled = self._is_save_enabled and self._valid_selected_context
self._workarea_btn_save.setEnabled(enabled)
self._workarea_btn_browse.setEnabled(self._valid_selected_context)

def _on_published_repre_changed(self, event):
self._valid_representation_id = event["representation_id"] is not None
Expand All @@ -294,6 +297,7 @@ def _on_task_changed(self, event):
and self._selected_task_id is not None
)
self._update_published_btns_state()
self._update_workarea_btns_state()

def _on_published_save_clicked(self):
result = self._exec_save_as_dialog()
Expand Down
Loading