summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-09-21 18:55:19 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-09-21 18:55:19 +0100
commit88c12349dd5f71af16a6398dda4684f15691ab5b (patch)
tree1bfa7013703b8ea805d442f3663f58d8e866c3fe
parent5bb51c95c6a6a45592313c575e4d68aa1504665d (diff)
sisyphus-gui : start application faster, by running the update in it's own thread
-rwxr-xr-xsrc/frontend/gui/sisyphus-gui.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/frontend/gui/sisyphus-gui.py b/src/frontend/gui/sisyphus-gui.py
index 16a7323..54b52ed 100755
--- a/src/frontend/gui/sisyphus-gui.py
+++ b/src/frontend/gui/sisyphus-gui.py
@@ -8,8 +8,8 @@ class Sisyphus(QtWidgets.QMainWindow):
def __init__(self):
super(Sisyphus, self).__init__()
uic.loadUi('ui/sisyphus-gui.ui', self)
- self.updateSystem()
self.centerOnScreen()
+ self.updateSystem()
self.show()
self.progress.hide()
@@ -35,7 +35,7 @@ class Sisyphus(QtWidgets.QMainWindow):
Sisyphus.SEARCHTERM = "'%%'"
Sisyphus.SEARCHFIELD = self.SEARCHFIELDS['Name']
- Sisyphus.SEARCHFILTER = self.SEARCHFILTERS['All']
+ Sisyphus.SEARCHFILTER = self.SEARCHFILTERS['All']
self.loadDatabase(Sisyphus.SEARCHFIELD,Sisyphus.SEARCHTERM,Sisyphus.SEARCHFILTER)
self.input.textEdited.connect(self.filterDatabase)
@@ -66,9 +66,6 @@ class Sisyphus(QtWidgets.QMainWindow):
Sisyphus.SEARCHFILTER = self.SEARCHFILTERS[self.selectfilter.currentText()]
self.loadDatabase(Sisyphus.SEARCHFIELD,Sisyphus.SEARCHTERM,Sisyphus.SEARCHFILTER)
- def updateSystem(self):
- sisyphus_pkg_system_update()
-
def centerOnScreen(self):
resolution = QtWidgets.QDesktopWidget().screenGeometry()
self.move((resolution.width() / 2) - (self.frameSize().width() / 2),
@@ -104,7 +101,11 @@ class Sisyphus(QtWidgets.QMainWindow):
search = self.input.text()
Sisyphus.SEARCHTERM = "'%" + search + "%'"
self.loadDatabase(Sisyphus.SEARCHFIELD,Sisyphus.SEARCHTERM,Sisyphus.SEARCHFILTER)
-
+
+ def updateSystem(self):
+ self.updateThread = UpdateThread()
+ self.updateThread.start()
+
def packageInstall(self):
indexes = self.database.selectionModel().selectedRows(1)
if len(indexes) == 0:
@@ -179,6 +180,11 @@ class Sisyphus(QtWidgets.QMainWindow):
def sisyphusExit(self):
self.close()
+class UpdateThread(QtCore.QThread):
+ updateFinished = QtCore.pyqtSignal()
+ def run(self):
+ sisyphus_pkg_system_update()
+
class InstallThread(QtCore.QThread):
installFinished = QtCore.pyqtSignal()
def run(self):