diff options
author | Ghiunhan Mamut (aka V3n3RiX) <venerix@redcorelinux.org> | 2017-09-20 16:48:33 +0000 |
---|---|---|
committer | Ghiunhan Mamut (aka V3n3RiX) <venerix@redcorelinux.org> | 2017-09-20 16:48:33 +0000 |
commit | 2f6c1aacf73b1d2a7675a71f3ecbf003fa503b15 (patch) | |
tree | 7a9715d05ff8309d6d79c837f46354f790a48670 /src/frontend | |
parent | 7230097c799e81503e6cd01b30ef8fd7b4f2af99 (diff) | |
parent | a209787a0dd00a517675d704f9dbc06260fa7549 (diff) |
Merge branch 'improveSearch' into 'master'
improve search, trigger model update after install/uninstall
See merge request redcore/sisyphus!3
Diffstat (limited to 'src/frontend')
-rwxr-xr-x | src/frontend/gui/sisyphus-gui.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/frontend/gui/sisyphus-gui.py b/src/frontend/gui/sisyphus-gui.py index f8be306..07a07ac 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() @@ -121,6 +124,7 @@ class Sisyphus(QtWidgets.QMainWindow): def finishedUpgrade(self): self.hideProgressBar() + self.loadDatabase(Sisyphus.SEARCHFIELD,Sisyphus.SEARCHTERM) def orphansRemove(self): self.showProgressBar() @@ -128,6 +132,7 @@ class Sisyphus(QtWidgets.QMainWindow): def finishedOrphans(self): self.hideProgressBar() + self.loadDatabase(Sisyphus.SEARCHFIELD,Sisyphus.SEARCHTERM) def showProgressBar(self): self.hideButtons() |