mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
Added toggle for keeping original names of publishes
This commit is contained in:
parent
92ecc854c9
commit
3faee05cf6
2 changed files with 23 additions and 5 deletions
|
|
@ -40,6 +40,8 @@ class PushToContextController:
|
|||
|
||||
self.set_source(project_name, version_id)
|
||||
|
||||
self._use_original_name = False
|
||||
|
||||
|
||||
# Events system
|
||||
def emit_event(self, topic, data=None, source=None):
|
||||
|
|
@ -315,6 +317,8 @@ class PushToContextController:
|
|||
return product_name
|
||||
|
||||
def _check_submit_validations(self):
|
||||
if self._use_original_name:
|
||||
return True
|
||||
if not self._user_values.is_valid:
|
||||
return False
|
||||
|
||||
|
|
@ -339,10 +343,8 @@ class PushToContextController:
|
|||
)
|
||||
|
||||
def _submit_callback(self):
|
||||
process_item_id = self._process_item_id
|
||||
if process_item_id is None:
|
||||
return
|
||||
self._integrate_model.integrate_item(process_item_id)
|
||||
for process_item_id in self._process_item_ids:
|
||||
self._integrate_model.integrate_item(process_item_id)
|
||||
self._emit_event("submit.finished", {})
|
||||
if process_item_id == self._process_item_id:
|
||||
self._process_item_id = None
|
||||
|
|
|
|||
|
|
@ -133,6 +133,7 @@ class PushToContextSelectWindow(QtWidgets.QWidget):
|
|||
inputs_widget = QtWidgets.QWidget(main_splitter)
|
||||
|
||||
new_folder_checkbox = NiceCheckbox(True, parent=inputs_widget)
|
||||
original_names_checkbox = NiceCheckbox(False, parent=inputs_widget)
|
||||
|
||||
folder_name_input = PlaceholderLineEdit(inputs_widget)
|
||||
folder_name_input.setPlaceholderText("< Name of new folder >")
|
||||
|
|
@ -151,6 +152,8 @@ class PushToContextSelectWindow(QtWidgets.QWidget):
|
|||
inputs_layout.addRow("Create new folder", new_folder_checkbox)
|
||||
inputs_layout.addRow("New folder name", folder_name_input)
|
||||
inputs_layout.addRow("Variant", variant_input)
|
||||
inputs_layout.addRow(
|
||||
"Use original product names", original_names_checkbox)
|
||||
inputs_layout.addRow("Comment", comment_input)
|
||||
|
||||
main_splitter.addWidget(context_widget)
|
||||
|
|
@ -250,6 +253,8 @@ class PushToContextSelectWindow(QtWidgets.QWidget):
|
|||
variant_input.textChanged.connect(self._on_variant_change)
|
||||
comment_input.textChanged.connect(self._on_comment_change)
|
||||
library_only_checkbox.stateChanged.connect(self._on_library_only_change)
|
||||
original_names_checkbox.stateChanged.connect(
|
||||
self._on_original_names_change)
|
||||
|
||||
publish_btn.clicked.connect(self._on_select_click)
|
||||
cancel_btn.clicked.connect(self._on_close_click)
|
||||
|
|
@ -408,8 +413,15 @@ class PushToContextSelectWindow(QtWidgets.QWidget):
|
|||
"""Change toggle state, reset filter, recalculate dropdown"""
|
||||
state = bool(state)
|
||||
self._projects_combobox.set_standard_filter_enabled(state)
|
||||
self._projects_combobox.refresh()
|
||||
|
||||
def _on_original_names_change(self, state: int) -> None:
|
||||
use_original_name = bool(state)
|
||||
self._new_folder_name_enabled = not use_original_name
|
||||
self._new_folder_checkbox.setEnabled(not use_original_name)
|
||||
self._folder_name_input.setEnabled(not use_original_name)
|
||||
self._variant_input.setEnabled(not use_original_name)
|
||||
self._controller._use_original_name = use_original_name
|
||||
self.refresh()
|
||||
|
||||
def _on_user_input_timer(self):
|
||||
folder_name_enabled = self._new_folder_name_enabled
|
||||
|
|
@ -466,6 +478,8 @@ class PushToContextSelectWindow(QtWidgets.QWidget):
|
|||
self._header_label.setText(self._controller.get_source_label())
|
||||
|
||||
def _invalidate_new_folder_name(self, folder_name, is_valid):
|
||||
if self._controller._use_original_name:
|
||||
is_valid = True
|
||||
self._tasks_widget.setVisible(folder_name is None)
|
||||
if self._folder_is_valid is is_valid:
|
||||
return
|
||||
|
|
@ -478,6 +492,8 @@ class PushToContextSelectWindow(QtWidgets.QWidget):
|
|||
)
|
||||
|
||||
def _invalidate_variant(self, is_valid):
|
||||
if self._controller._use_original_name:
|
||||
is_valid = True
|
||||
if self._variant_is_valid is is_valid:
|
||||
return
|
||||
self._variant_is_valid = is_valid
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue