mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
change tabs and mark blocking filepath
This commit is contained in:
parent
856a58dc35
commit
ae7726bdef
3 changed files with 37 additions and 7 deletions
|
|
@ -139,3 +139,6 @@ class PublishReport:
|
||||||
self.logs = logs
|
self.logs = logs
|
||||||
|
|
||||||
self.crashed_plugin_paths = report_data["crashed_file_paths"]
|
self.crashed_plugin_paths = report_data["crashed_file_paths"]
|
||||||
|
self.blocking_crashed_paths = report_data.get(
|
||||||
|
"blocking_crashed_paths", []
|
||||||
|
)
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ from ayon_core.tools.utils import (
|
||||||
SeparatorWidget,
|
SeparatorWidget,
|
||||||
IconButton,
|
IconButton,
|
||||||
paint_image_with_color,
|
paint_image_with_color,
|
||||||
|
get_qt_icon,
|
||||||
)
|
)
|
||||||
from ayon_core.resources import get_image_path
|
from ayon_core.resources import get_image_path
|
||||||
from ayon_core.style import get_objected_colors
|
from ayon_core.style import get_objected_colors
|
||||||
|
|
@ -46,10 +47,13 @@ def get_pretty_milliseconds(value):
|
||||||
|
|
||||||
|
|
||||||
class PluginLoadReportModel(QtGui.QStandardItemModel):
|
class PluginLoadReportModel(QtGui.QStandardItemModel):
|
||||||
|
_blocking_icon = None
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self._traceback_by_filepath = {}
|
self._traceback_by_filepath = {}
|
||||||
self._items_by_filepath = {}
|
self._items_by_filepath = {}
|
||||||
|
self._blocking_crashed_paths = set()
|
||||||
self._is_active = True
|
self._is_active = True
|
||||||
self._need_refresh = False
|
self._need_refresh = False
|
||||||
|
|
||||||
|
|
@ -75,6 +79,7 @@ class PluginLoadReportModel(QtGui.QStandardItemModel):
|
||||||
|
|
||||||
for filepath in to_remove:
|
for filepath in to_remove:
|
||||||
self._traceback_by_filepath.pop(filepath)
|
self._traceback_by_filepath.pop(filepath)
|
||||||
|
self._blocking_crashed_paths = set(report.blocking_crashed_paths)
|
||||||
self._update_items()
|
self._update_items()
|
||||||
|
|
||||||
def _update_items(self):
|
def _update_items(self):
|
||||||
|
|
@ -91,12 +96,18 @@ class PluginLoadReportModel(QtGui.QStandardItemModel):
|
||||||
set(self._items_by_filepath) - set(self._traceback_by_filepath)
|
set(self._items_by_filepath) - set(self._traceback_by_filepath)
|
||||||
)
|
)
|
||||||
for filepath in self._traceback_by_filepath:
|
for filepath in self._traceback_by_filepath:
|
||||||
if filepath in self._items_by_filepath:
|
item = self._items_by_filepath.get(filepath)
|
||||||
continue
|
if item is None:
|
||||||
item = QtGui.QStandardItem(filepath)
|
item = QtGui.QStandardItem(filepath)
|
||||||
new_items.append(item)
|
new_items.append(item)
|
||||||
new_items_by_filepath[filepath] = item
|
new_items_by_filepath[filepath] = item
|
||||||
self._items_by_filepath[filepath] = item
|
self._items_by_filepath[filepath] = item
|
||||||
|
|
||||||
|
if filepath.replace("\\", "/") in self._blocking_crashed_paths:
|
||||||
|
item.setData(
|
||||||
|
self._get_blocking_icon(),
|
||||||
|
QtCore.Qt.DecorationRole
|
||||||
|
)
|
||||||
|
|
||||||
if new_items:
|
if new_items:
|
||||||
parent.appendRows(new_items)
|
parent.appendRows(new_items)
|
||||||
|
|
@ -113,6 +124,15 @@ class PluginLoadReportModel(QtGui.QStandardItemModel):
|
||||||
item = self._items_by_filepath.pop(filepath)
|
item = self._items_by_filepath.pop(filepath)
|
||||||
parent.removeRow(item.row())
|
parent.removeRow(item.row())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def _get_blocking_icon(cls):
|
||||||
|
if cls._blocking_icon is None:
|
||||||
|
cls._blocking_icon = get_qt_icon({
|
||||||
|
"type": "material-symbols",
|
||||||
|
"name": "block",
|
||||||
|
"color": "red",
|
||||||
|
})
|
||||||
|
return cls._blocking_icon
|
||||||
|
|
||||||
class DetailWidget(QtWidgets.QTextEdit):
|
class DetailWidget(QtWidgets.QTextEdit):
|
||||||
def __init__(self, text, *args, **kwargs):
|
def __init__(self, text, *args, **kwargs):
|
||||||
|
|
@ -856,7 +876,7 @@ class PublishReportViewerWidget(QtWidgets.QFrame):
|
||||||
report = PublishReport(report_data)
|
report = PublishReport(report_data)
|
||||||
self.set_report(report)
|
self.set_report(report)
|
||||||
|
|
||||||
def set_report(self, report):
|
def set_report(self, report: PublishReport) -> None:
|
||||||
self._ignore_selection_changes = True
|
self._ignore_selection_changes = True
|
||||||
|
|
||||||
self._report_item = report
|
self._report_item = report
|
||||||
|
|
@ -866,6 +886,10 @@ class PublishReportViewerWidget(QtWidgets.QFrame):
|
||||||
self._logs_text_widget.set_report(report)
|
self._logs_text_widget.set_report(report)
|
||||||
self._plugin_load_report_widget.set_report(report)
|
self._plugin_load_report_widget.set_report(report)
|
||||||
self._plugins_details_widget.set_report(report)
|
self._plugins_details_widget.set_report(report)
|
||||||
|
if report.blocking_crashed_paths:
|
||||||
|
self._details_tab_widget.setCurrentWidget(
|
||||||
|
self._plugin_load_report_widget
|
||||||
|
)
|
||||||
|
|
||||||
self._ignore_selection_changes = False
|
self._ignore_selection_changes = False
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -887,6 +887,9 @@ class PublisherWindow(QtWidgets.QDialog):
|
||||||
if not blocked:
|
if not blocked:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
self.set_tab_on_reset("details")
|
||||||
|
self._go_to_details_tab()
|
||||||
|
|
||||||
QtWidgets.QMessageBox.critical(
|
QtWidgets.QMessageBox.critical(
|
||||||
self,
|
self,
|
||||||
"Failed to load plugins",
|
"Failed to load plugins",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue