From 76065a9f0fd1038c8bf92621fe393b98e12ceb9f Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 17 Sep 2017 20:56:22 +0100 Subject: sisyphus-gui : don't execute(install/remove) anything if no package is selected, and warn user about it --- src/frontend/gui/sisyphus-gui.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'src/frontend') diff --git a/src/frontend/gui/sisyphus-gui.py b/src/frontend/gui/sisyphus-gui.py index b13b11b..49a153c 100755 --- a/src/frontend/gui/sisyphus-gui.py +++ b/src/frontend/gui/sisyphus-gui.py @@ -75,12 +75,13 @@ class Sisyphus(QtWidgets.QMainWindow): def packageInstall(self): indexes = self.database.selectionModel().selectedRows(1) if len(indexes) == 0: - print('Please select at least one package!!!') - Sisyphus.PKGLIST = [] - for index in sorted(indexes): - Sisyphus.PKGLIST.append(index.data()) - self.showProgressBar() - self.installThread.start() + self.input.setText("Please select at least one package!!!") + else: + Sisyphus.PKGLIST = [] + for index in sorted(indexes): + Sisyphus.PKGLIST.append(index.data()) + self.showProgressBar() + self.installThread.start() def finishedInstall(self): self.hideProgressBar() @@ -88,12 +89,13 @@ class Sisyphus(QtWidgets.QMainWindow): def packageUninstall(self): indexes = self.database.selectionModel().selectedRows(1) if len(indexes) == 0: - print('Please select at least one package!!!') - Sisyphus.PKGLIST = [] - for index in sorted(indexes): - Sisyphus.PKGLIST.append(index.data()) - self.showProgressBar() - self.uninstallThread.start() + self.input.setText("Please select at least one package!!!") + else: + Sisyphus.PKGLIST = [] + for index in sorted(indexes): + Sisyphus.PKGLIST.append(index.data()) + self.showProgressBar() + self.uninstallThread.start() def finishedUninstall(self): self.hideProgressBar() -- cgit v1.2.3