Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workfiles: Always refresh workfiles tool on show #441

Merged
2 commits merged into from
Apr 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions client/ayon_core/tools/workfiles/widgets/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ def __init__(self, controller=None, parent=None):
overlay_invalid_host = InvalidHostOverlay(self)
overlay_invalid_host.setVisible(False)

first_show_timer = QtCore.QTimer()
first_show_timer.setSingleShot(True)
first_show_timer.setInterval(50)
show_timer = QtCore.QTimer()
show_timer.setSingleShot(True)
show_timer.setInterval(50)

first_show_timer.timeout.connect(self._on_first_show)
show_timer.timeout.connect(self._on_show)

controller.register_event_callback(
"save_as.finished",
Expand Down Expand Up @@ -159,7 +159,7 @@ def __init__(self, controller=None, parent=None):
self._tasks_widget = tasks_widget
self._side_panel = side_panel

self._first_show_timer = first_show_timer
self._show_timer = show_timer

self._post_init()

Expand Down Expand Up @@ -287,9 +287,9 @@ def refresh(self):

def showEvent(self, event):
super(WorkfilesToolWindow, self).showEvent(event)
self._show_timer.start()
if self._first_show:
self._first_show = False
self._first_show_timer.start()
self.setStyleSheet(style.load_stylesheet())

def keyPressEvent(self, event):
Expand All @@ -303,9 +303,8 @@ def keyPressEvent(self, event):

pass

def _on_first_show(self):
if not self._controller_refreshed:
self.refresh()
def _on_show(self):
self.refresh()

def _on_file_text_filter_change(self, text):
self._files_widget.set_text_filter(text)
Expand Down
Loading