Improve UI updates during processing

- This now defaults to having "animations" disabled - with the small timeout that was there '3' that didn't visually show anyway. So disabling them doesn't make much of a difference, except for that the UI correctly updates to the latest state.
This commit is contained in:
Roy Nieterau 2022-02-03 18:03:31 +01:00
parent 13266d005c
commit 36f14182cd
3 changed files with 7 additions and 12 deletions

View file

@ -11,7 +11,7 @@ import inspect
import logging
import collections
from Qt import QtCore
from Qt import QtCore, QtWidgets
import pyblish.api
import pyblish.util
@ -47,7 +47,7 @@ class MainThreadProcess(QtCore.QObject):
This approach gives ability to update UI meanwhile plugin is in progress.
"""
timer_interval = 3
timer_interval = 0
def __init__(self):
super(MainThreadProcess, self).__init__()
@ -74,6 +74,10 @@ class MainThreadProcess(QtCore.QObject):
item = self._items_to_process.popleft()
item.process()
# Process events directly after the item processed. This allows the
# to correctly show "highlighted" state for the next item to process
QtWidgets.QApplication.instance().processEvents()
def start(self):
if not self._timer.isActive():
self._timer.start()

View file

@ -24,4 +24,4 @@ TerminalFilters = {
}
# Allow animations in GUI
Animated = env_variable_to_bool("OPENPYPE_PYBLISH_ANIMATED", True)
Animated = env_variable_to_bool("OPENPYPE_PYBLISH_ANIMATED", False)

View file

@ -307,11 +307,6 @@ class Window(QtWidgets.QDialog):
on.setStartValue(0)
on.setEndValue(1)
off = QtCore.QPropertyAnimation(info_effect, b"opacity")
off.setDuration(0)
off.setStartValue(1)
off.setEndValue(0)
fade = QtCore.QPropertyAnimation(info_effect, b"opacity")
fade.setDuration(500)
fade.setStartValue(1.0)
@ -319,10 +314,6 @@ class Window(QtWidgets.QDialog):
animation_info_msg = QtCore.QSequentialAnimationGroup()
animation_info_msg.addAnimation(on)
animation_info_msg.addPause(50)
animation_info_msg.addAnimation(off)
animation_info_msg.addPause(50)
animation_info_msg.addAnimation(on)
animation_info_msg.addPause(2000)
animation_info_msg.addAnimation(fade)