summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-07-09 23:23:33 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-07-09 23:23:33 +0100
commit38c8f2f4bddc9eadeb69a61cc6ac3d483831228c (patch)
tree603b4903a9d03d8d5e41bb60a81b4bd48129173d /src
parentd7f47c37cbf4a6c3f92b518e6ce6e144e9e67276 (diff)
filtering works, finally
Diffstat (limited to 'src')
-rwxr-xr-xsrc/frontend/gui/sisyphus-gui.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/frontend/gui/sisyphus-gui.py b/src/frontend/gui/sisyphus-gui.py
index 1a7a64a..7fa14f7 100755
--- a/src/frontend/gui/sisyphus-gui.py
+++ b/src/frontend/gui/sisyphus-gui.py
@@ -11,6 +11,8 @@ class Sisyphus(QtWidgets.QMainWindow):
self.centerOnScreen()
self.show()
self.load_packages()
+
+ self.input.returnPressed.connect(self.filter_database)
self.install.clicked.connect(self.install_package)
self.uninstall.clicked.connect(self.uninstall_package)
@@ -42,6 +44,15 @@ class Sisyphus(QtWidgets.QMainWindow):
def exit_sisyphus(self):
self.close()
+
+ def filter_database(self):
+ items = self.database.findItems(self.input.text(), QtCore.Qt.MatchExactly)
+ if items:
+ for item in items:
+ results = ''.join('%d' % (item.row() + 0)).split()
+ coordinates = map(int, results)
+ for coordinate in coordinates:
+ self.database.setCurrentCell(coordinate, 0)
def load_packages(self):
with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: