mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 00:04:15 +02:00
improvement -> adding a little delay before reloading the main window after saving the settings
This commit is contained in:
@@ -8,7 +8,7 @@ from pathlib import Path
|
|||||||
from typing import List, Type, Set, Tuple, Optional
|
from typing import List, Type, Set, Tuple, Optional
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
from PyQt5.QtCore import QThread, pyqtSignal
|
from PyQt5.QtCore import QThread, pyqtSignal, QObject
|
||||||
from PyQt5.QtGui import QIcon
|
from PyQt5.QtGui import QIcon
|
||||||
from PyQt5.QtWidgets import QWidget
|
from PyQt5.QtWidgets import QWidget
|
||||||
|
|
||||||
@@ -1100,5 +1100,12 @@ class StartAsyncAction(QThread):
|
|||||||
|
|
||||||
signal_start = pyqtSignal()
|
signal_start = pyqtSignal()
|
||||||
|
|
||||||
|
def __init__(self, delay_in_milis: int = -1, parent: Optional[QObject] = None):
|
||||||
|
super(StartAsyncAction, self).__init__(parent=parent)
|
||||||
|
self.delay = delay_in_milis
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
if self.delay > 0:
|
||||||
|
self.msleep(self.delay)
|
||||||
|
|
||||||
self.signal_start.emit()
|
self.signal_start.emit()
|
||||||
|
|||||||
@@ -347,7 +347,7 @@ class ManageWindow(QWidget):
|
|||||||
self.thread_ignore_updates = IgnorePackageUpdates(manager=self.manager)
|
self.thread_ignore_updates = IgnorePackageUpdates(manager=self.manager)
|
||||||
self._bind_async_action(self.thread_ignore_updates, finished_call=self.finish_ignore_updates)
|
self._bind_async_action(self.thread_ignore_updates, finished_call=self.finish_ignore_updates)
|
||||||
|
|
||||||
self.thread_reload = StartAsyncAction()
|
self.thread_reload = StartAsyncAction(delay_in_milis=5)
|
||||||
self.thread_reload.signal_start.connect(self._reload)
|
self.thread_reload.signal_start.connect(self._reload)
|
||||||
|
|
||||||
self.container_bottom = QWidget()
|
self.container_bottom = QWidget()
|
||||||
|
|||||||
Reference in New Issue
Block a user