mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 05:42:15 +01:00
Preserve comment on reset
This commit is contained in:
parent
b43b304295
commit
4d44a374ae
2 changed files with 11 additions and 2 deletions
|
|
@ -228,6 +228,10 @@ class Controller(QtCore.QObject):
|
|||
def reset_context(self):
|
||||
self.log.debug("Resetting pyblish context object")
|
||||
|
||||
comment = None
|
||||
if self.context is not None and self.context.data.get("comment"):
|
||||
comment = self.context.data["comment"]
|
||||
|
||||
self.context = pyblish.api.Context()
|
||||
|
||||
self.context._publish_states = InstanceStates.ContextType
|
||||
|
|
@ -249,6 +253,10 @@ class Controller(QtCore.QObject):
|
|||
|
||||
self.context.families = ("__context__",)
|
||||
|
||||
if comment:
|
||||
# Preserve comment on reset if user previously had a comment
|
||||
self.context.data["comment"] = comment
|
||||
|
||||
self.log.debug("Reset of pyblish context object done")
|
||||
|
||||
def reset(self):
|
||||
|
|
|
|||
|
|
@ -1138,8 +1138,9 @@ class Window(QtWidgets.QDialog):
|
|||
if self.intent_model.has_items:
|
||||
self.intent_box.setCurrentIndex(self.intent_model.default_index)
|
||||
|
||||
self.comment_box.placeholder.setVisible(False)
|
||||
self.comment_box.placeholder.setVisible(True)
|
||||
if self.comment_box.text():
|
||||
self.comment_box.placeholder.setVisible(False)
|
||||
self.comment_box.placeholder.setVisible(True)
|
||||
# Launch controller reset
|
||||
self.controller.reset()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue