From c11e751eeb4d8173bb9e26dc05bed09fc5026715 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 21 Sep 2017 19:24:21 +0100 Subject: sisyphus gui : reload the table once updateFinished signal is sent --- src/frontend/gui/sisyphus-gui.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/frontend/gui/sisyphus-gui.py b/src/frontend/gui/sisyphus-gui.py index 54b52ed..7d05500 100755 --- a/src/frontend/gui/sisyphus-gui.py +++ b/src/frontend/gui/sisyphus-gui.py @@ -9,7 +9,6 @@ class Sisyphus(QtWidgets.QMainWindow): super(Sisyphus, self).__init__() uic.loadUi('ui/sisyphus-gui.ui', self) self.centerOnScreen() - self.updateSystem() self.show() self.progress.hide() @@ -40,6 +39,9 @@ class Sisyphus(QtWidgets.QMainWindow): self.input.textEdited.connect(self.filterDatabase) + self.updateThread = UpdateThread() + self.updateThread.updateFinished.connect(self.finishedUpdate) + self.installThread = InstallThread() self.install.clicked.connect(self.packageInstall) self.installThread.installFinished.connect(self.finishedInstall) @@ -56,6 +58,9 @@ class Sisyphus(QtWidgets.QMainWindow): self.orphans.clicked.connect(self.orphansRemove) self.orphansThread.orphansFinished.connect(self.finishedOrphans) + self.updateSystem() + self.finishedUpdate() + self.abort.clicked.connect(self.sisyphusExit) def setSearchField(self): @@ -103,9 +108,11 @@ class Sisyphus(QtWidgets.QMainWindow): self.loadDatabase(Sisyphus.SEARCHFIELD,Sisyphus.SEARCHTERM,Sisyphus.SEARCHFILTER) def updateSystem(self): - self.updateThread = UpdateThread() self.updateThread.start() + def finishedUpdate(self): + self.loadDatabase(Sisyphus.SEARCHFIELD,Sisyphus.SEARCHTERM,Sisyphus.SEARCHFILTER) + def packageInstall(self): indexes = self.database.selectionModel().selectedRows(1) if len(indexes) == 0: @@ -184,6 +191,7 @@ class UpdateThread(QtCore.QThread): updateFinished = QtCore.pyqtSignal() def run(self): sisyphus_pkg_system_update() + self.updateFinished.emit() class InstallThread(QtCore.QThread): installFinished = QtCore.pyqtSignal() -- cgit v1.2.3