summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbionel <ionel.busuioc@gmail.com>2017-09-20 19:39:18 +0300
committerbionel <ionel.busuioc@gmail.com>2017-09-20 19:39:18 +0300
commitbd302b9c31dafd5bab1b09cc13212dd5ccc3e374 (patch)
treea57f92c551fe2b8a9f0dfe1c4cbab2ffd271f3b7 /src
parent7230097c799e81503e6cd01b30ef8fd7b4f2af99 (diff)
improve search, trigger model update after install/uninstall
Diffstat (limited to 'src')
-rwxr-xr-xsrc/frontend/gui/sisyphus-gui.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/frontend/gui/sisyphus-gui.py b/src/frontend/gui/sisyphus-gui.py
index f8be306..2b4aa6b 100755
--- a/src/frontend/gui/sisyphus-gui.py
+++ b/src/frontend/gui/sisyphus-gui.py
@@ -21,9 +21,10 @@ class Sisyphus(QtWidgets.QMainWindow):
self.selectfield.addItems(self.SEARCHFIELDS.keys())
self.selectfield.setCurrentIndex(1) # defaults to package name
self.selectfield.activated.connect(self.setSearchField)
-
+
+ Sisyphus.SEARCHTERM = "'%%'" # defaults to all
Sisyphus.SEARCHFIELD = "pn" # defaults to package name
- self.loadDatabase(Sisyphus.SEARCHFIELD,"'%%'")
+ self.loadDatabase(Sisyphus.SEARCHFIELD,Sisyphus.SEARCHTERM)
self.input.textEdited.connect(self.filterDatabase)
@@ -84,8 +85,8 @@ class Sisyphus(QtWidgets.QMainWindow):
def filterDatabase(self):
search = self.input.text()
- searchTerm = "'%" + search + "%'"
- self.loadDatabase(Sisyphus.SEARCHFIELD,searchTerm)
+ Sisyphus.SEARCHTERM = "'%" + search + "%'"
+ self.loadDatabase(Sisyphus.SEARCHFIELD,Sisyphus.SEARCHTERM)
def packageInstall(self):
indexes = self.database.selectionModel().selectedRows(1)
@@ -100,6 +101,7 @@ class Sisyphus(QtWidgets.QMainWindow):
def finishedInstall(self):
self.hideProgressBar()
+ self.loadDatabase(Sisyphus.SEARCHFIELD,Sisyphus.SEARCHTERM)
def packageUninstall(self):
indexes = self.database.selectionModel().selectedRows(1)
@@ -114,6 +116,7 @@ class Sisyphus(QtWidgets.QMainWindow):
def finishedUninstall(self):
self.hideProgressBar()
+ self.loadDatabase(Sisyphus.SEARCHFIELD,Sisyphus.SEARCHTERM)
def systemUpgrade(self):
self.showProgressBar()
@@ -128,6 +131,7 @@ class Sisyphus(QtWidgets.QMainWindow):
def finishedOrphans(self):
self.hideProgressBar()
+ self.loadDatabase(Sisyphus.SEARCHFIELD,Sisyphus.SEARCHTERM)
def showProgressBar(self):
self.hideButtons()