mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge pull request #6176 from ynput/bugfix/publisher-window-as-dialog
Publisher window as dialog
This commit is contained in:
parent
3ae066e1dc
commit
c3d6c4c8f1
1 changed files with 10 additions and 30 deletions
|
|
@ -41,7 +41,7 @@ from .widgets import (
|
|||
)
|
||||
|
||||
|
||||
class PublisherWindow(QtWidgets.QWidget):
|
||||
class PublisherWindow(QtWidgets.QDialog):
|
||||
"""Main window of publisher."""
|
||||
default_width = 1300
|
||||
default_height = 800
|
||||
|
|
@ -49,7 +49,7 @@ class PublisherWindow(QtWidgets.QWidget):
|
|||
publish_footer_spacer = 2
|
||||
|
||||
def __init__(self, parent=None, controller=None, reset_on_show=None):
|
||||
super(PublisherWindow, self).__init__()
|
||||
super(PublisherWindow, self).__init__(parent)
|
||||
|
||||
self.setObjectName("PublishWindow")
|
||||
|
||||
|
|
@ -291,12 +291,6 @@ class PublisherWindow(QtWidgets.QWidget):
|
|||
controller.event_system.add_callback(
|
||||
"publish.process.stopped", self._on_publish_stop
|
||||
)
|
||||
controller.event_system.add_callback(
|
||||
"publish.process.instance.changed", self._on_instance_change
|
||||
)
|
||||
controller.event_system.add_callback(
|
||||
"publish.process.plugin.changed", self._on_plugin_change
|
||||
)
|
||||
controller.event_system.add_callback(
|
||||
"show.card.message", self._on_overlay_message
|
||||
)
|
||||
|
|
@ -325,7 +319,6 @@ class PublisherWindow(QtWidgets.QWidget):
|
|||
"copy_report.request", self._copy_report
|
||||
)
|
||||
|
||||
|
||||
# Store extra header widget for TrayPublisher
|
||||
# - can be used to add additional widgets to header between context
|
||||
# label and help button
|
||||
|
|
@ -488,8 +481,14 @@ class PublisherWindow(QtWidgets.QWidget):
|
|||
app.removeEventFilter(self)
|
||||
|
||||
def keyPressEvent(self, event):
|
||||
# Ignore escape button to close window
|
||||
if event.key() == QtCore.Qt.Key_Escape:
|
||||
if event.key() in {
|
||||
# Ignore escape button to close window
|
||||
QtCore.Qt.Key_Escape,
|
||||
# Ignore enter keyboard event which by default triggers
|
||||
# first available button in QDialog
|
||||
QtCore.Qt.Key_Enter,
|
||||
QtCore.Qt.Key_Return,
|
||||
}:
|
||||
event.accept()
|
||||
return
|
||||
|
||||
|
|
@ -555,18 +554,6 @@ class PublisherWindow(QtWidgets.QWidget):
|
|||
self._reset_on_show = False
|
||||
self.reset()
|
||||
|
||||
def _make_sure_on_top(self):
|
||||
"""Raise window to top and activate it.
|
||||
|
||||
This may not work for some DCCs without Qt.
|
||||
"""
|
||||
|
||||
if not self._window_is_visible:
|
||||
self.show()
|
||||
|
||||
self.setWindowState(QtCore.Qt.WindowActive)
|
||||
self.raise_()
|
||||
|
||||
def _checks_before_save(self, explicit_save):
|
||||
"""Save of changes may trigger some issues.
|
||||
|
||||
|
|
@ -879,12 +866,6 @@ class PublisherWindow(QtWidgets.QWidget):
|
|||
if self._is_on_create_tab():
|
||||
self._go_to_publish_tab()
|
||||
|
||||
def _on_instance_change(self):
|
||||
self._make_sure_on_top()
|
||||
|
||||
def _on_plugin_change(self):
|
||||
self._make_sure_on_top()
|
||||
|
||||
def _on_publish_validated_change(self, event):
|
||||
if event["value"]:
|
||||
self._validate_btn.setEnabled(False)
|
||||
|
|
@ -895,7 +876,6 @@ class PublisherWindow(QtWidgets.QWidget):
|
|||
self._comment_input.setText("")
|
||||
|
||||
def _on_publish_stop(self):
|
||||
self._make_sure_on_top()
|
||||
self._set_publish_overlay_visibility(False)
|
||||
self._reset_btn.setEnabled(True)
|
||||
self._stop_btn.setEnabled(False)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue