From 19af4793551d652c0aac60177dfa7f71f334a813 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 16 Sep 2017 17:57:36 +0100 Subject: rearrange gui frontend code --- src/frontend/gui/sisyphus-gui.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/frontend/gui/sisyphus-gui.py b/src/frontend/gui/sisyphus-gui.py index 6b49d58..6a34117 100755 --- a/src/frontend/gui/sisyphus-gui.py +++ b/src/frontend/gui/sisyphus-gui.py @@ -16,8 +16,8 @@ class Sisyphus(QtWidgets.QMainWindow): self.install.clicked.connect(self.install_package) self.uninstall.clicked.connect(self.uninstall_package) - self.orphans.clicked.connect(self.remove_orphans) self.upgrade.clicked.connect(self.upgrade_system) + self.orphans.clicked.connect(self.remove_orphans) self.abort.clicked.connect(self.exit_sisyphus) self.progress.hide() @@ -28,12 +28,12 @@ class Sisyphus(QtWidgets.QMainWindow): self.uninstall_thread = UninstallThread() self.uninstall_thread.uninstallFinished.connect(self.uninstall_finished) - self.orphans_thread = OrphansThread() - self.orphans_thread.orphansFinished.connect(self.orphans_finished) - self.upgrade_thread = UpgradeThread() self.upgrade_thread.upgradeFinished.connect(self.upgrade_finished) + self.orphans_thread = OrphansThread() + self.orphans_thread.orphansFinished.connect(self.orphans_finished) + def centerOnScreen(self): resolution = QtWidgets.QDesktopWidget().screenGeometry() self.move((resolution.width() / 2) - (self.frameSize().width() / 2), @@ -65,25 +65,25 @@ class Sisyphus(QtWidgets.QMainWindow): self.progress.hide() self.show_buttons() - def remove_orphans(self): + def upgrade_system(self): self.hide_buttons() self.progress.setRange(0,0) self.progress.show() - self.orphans_thread.start() + self.upgrade_thread.start() - def orphans_finished(self): + def upgrade_finished(self): self.progress.setRange(0,1) self.progress.setValue(1) self.progress.hide() self.show_buttons() - def upgrade_system(self): + def remove_orphans(self): self.hide_buttons() self.progress.setRange(0,0) self.progress.show() - self.upgrade_thread.start() + self.orphans_thread.start() - def upgrade_finished(self): + def orphans_finished(self): self.progress.setRange(0,1) self.progress.setValue(1) self.progress.hide() @@ -160,18 +160,18 @@ class UninstallThread(QtCore.QThread): sisyphus_pkg_auto_uninstall(PKGLIST.split()) self.uninstallFinished.emit() -class OrphansThread(QtCore.QThread): - orphansFinished = QtCore.pyqtSignal() - def run(self): - sisyphus_pkg_auto_remove_orphans() - self.orphansFinished.emit() - class UpgradeThread(QtCore.QThread): upgradeFinished = QtCore.pyqtSignal() def run(self): sisyphus_pkg_auto_system_upgrade() self.upgradeFinished.emit() +class OrphansThread(QtCore.QThread): + orphansFinished = QtCore.pyqtSignal() + def run(self): + sisyphus_pkg_auto_remove_orphans() + self.orphansFinished.emit() + if __name__ == '__main__': app = QtWidgets.QApplication(sys.argv) window = Sisyphus() -- cgit v1.2.3