mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
added report page to window
This commit is contained in:
parent
bd9a987f7b
commit
acb167c0d4
4 changed files with 24 additions and 10 deletions
|
|
@ -11,7 +11,8 @@ from .widgets import (
|
|||
)
|
||||
from .publish_widget import PublishFrame
|
||||
from .tabs_widget import PublisherTabsWidget
|
||||
from .overview_widget import CreateOverviewWidget
|
||||
from .overview_widget import OverviewWidget
|
||||
from .validations_widget import ValidationsWidget
|
||||
|
||||
|
||||
__all__ = (
|
||||
|
|
@ -27,5 +28,6 @@ __all__ = (
|
|||
"PublishFrame",
|
||||
|
||||
"PublisherTabsWidget",
|
||||
"CreateOverviewWidget",
|
||||
"OverviewWidget",
|
||||
"ValidationsWidget",
|
||||
)
|
||||
|
|
|
|||
|
|
@ -13,13 +13,13 @@ from .widgets import (
|
|||
from .create_widget import CreateWidget
|
||||
|
||||
|
||||
class CreateOverviewWidget(QtWidgets.QFrame):
|
||||
class OverviewWidget(QtWidgets.QFrame):
|
||||
active_changed = QtCore.Signal()
|
||||
instance_context_changed = QtCore.Signal()
|
||||
create_requested = QtCore.Signal()
|
||||
|
||||
def __init__(self, controller, parent):
|
||||
super(CreateOverviewWidget, self).__init__(parent)
|
||||
super(OverviewWidget, self).__init__(parent)
|
||||
|
||||
self._refreshing_instances = False
|
||||
self._controller = controller
|
||||
|
|
|
|||
|
|
@ -400,7 +400,7 @@ class VerticallScrollArea(QtWidgets.QScrollArea):
|
|||
return super(VerticallScrollArea, self).eventFilter(obj, event)
|
||||
|
||||
|
||||
class ValidationsWidget(QtWidgets.QWidget):
|
||||
class ValidationsWidget(QtWidgets.QFrame):
|
||||
"""Widgets showing validation error.
|
||||
|
||||
This widget is shown if validation error/s happened during validation part.
|
||||
|
|
@ -418,11 +418,10 @@ class ValidationsWidget(QtWidgets.QWidget):
|
|||
│ Publish buttons │
|
||||
└───────────────────────────────┘
|
||||
"""
|
||||
|
||||
def __init__(self, controller, parent):
|
||||
super(ValidationsWidget, self).__init__(parent)
|
||||
|
||||
self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
|
||||
|
||||
errors_scroll = VerticallScrollArea(self)
|
||||
errors_scroll.setWidgetResizable(True)
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@ from openpype.tools.utils import (
|
|||
from .publish_report_viewer import PublishReportViewerWidget
|
||||
from .control import PublisherController
|
||||
from .widgets import (
|
||||
CreateOverviewWidget,
|
||||
OverviewWidget,
|
||||
ValidationsWidget,
|
||||
PublishFrame,
|
||||
|
||||
PublisherTabsWidget,
|
||||
|
|
@ -124,10 +125,12 @@ class PublisherWindow(QtWidgets.QDialog):
|
|||
content_layout.addWidget(content_stacked_widget, 1)
|
||||
|
||||
# Overview - create and attributes part
|
||||
overview_widget = CreateOverviewWidget(
|
||||
overview_widget = OverviewWidget(
|
||||
controller, content_stacked_widget
|
||||
)
|
||||
|
||||
report_widget = ValidationsWidget(controller, parent)
|
||||
|
||||
# Details - Publish details
|
||||
publish_details_widget = PublishReportViewerWidget(
|
||||
content_stacked_widget
|
||||
|
|
@ -145,6 +148,7 @@ class PublisherWindow(QtWidgets.QDialog):
|
|||
QtWidgets.QStackedLayout.StackAll
|
||||
)
|
||||
content_stacked_layout.addWidget(overview_widget)
|
||||
content_stacked_layout.addWidget(report_widget)
|
||||
content_stacked_layout.addWidget(publish_details_widget)
|
||||
content_stacked_layout.addWidget(publish_frame)
|
||||
|
||||
|
|
@ -189,6 +193,7 @@ class PublisherWindow(QtWidgets.QDialog):
|
|||
self._content_stacked_layout = content_stacked_layout
|
||||
|
||||
self._overview_widget = overview_widget
|
||||
self._report_widget = report_widget
|
||||
self._publish_details_widget = publish_details_widget
|
||||
self._publish_frame = publish_frame
|
||||
|
||||
|
|
@ -252,7 +257,10 @@ class PublisherWindow(QtWidgets.QDialog):
|
|||
)
|
||||
self._update_publish_details_widget()
|
||||
|
||||
# TODO handle rest of conditions
|
||||
elif new_tab == "report":
|
||||
self._content_stacked_layout.setCurrentWidget(
|
||||
self._report_widget
|
||||
)
|
||||
|
||||
def _on_context_or_active_change(self):
|
||||
self._validate_create_instances()
|
||||
|
|
@ -319,6 +327,8 @@ class PublisherWindow(QtWidgets.QDialog):
|
|||
|
||||
self._comment_input.setVisible(False)
|
||||
self._create_tab.setEnabled(False)
|
||||
|
||||
self._report_widget.clear()
|
||||
if self._tabs_widget.is_current_tab(self._create_tab):
|
||||
self._tabs_widget.set_current_tab("publish")
|
||||
|
||||
|
|
@ -346,6 +356,9 @@ class PublisherWindow(QtWidgets.QDialog):
|
|||
self._publish_btn.setEnabled(publish_enabled)
|
||||
self._update_publish_details_widget()
|
||||
|
||||
validation_errors = self._controller.get_validation_errors()
|
||||
self._report_widget.set_errors(validation_errors)
|
||||
|
||||
def _validate_create_instances(self):
|
||||
if not self._controller.host_is_valid:
|
||||
self._set_footer_enabled(True)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue