summaryrefslogtreecommitdiff
path: root/src/frontend/gui/sisyphus-gui.py
diff options
context:
space:
mode:
authorGhiunhan Mamut (aka V3n3RiX) <venerix@redcorelinux.org>2017-09-24 19:19:17 +0000
committerGhiunhan Mamut (aka V3n3RiX) <venerix@redcorelinux.org>2017-09-24 19:19:17 +0000
commit2462ed33f72f648f78581d49e688b51d32abe74a (patch)
tree80cbb9a5a9b6da3319fac33c5409bbadc7f1a5de /src/frontend/gui/sisyphus-gui.py
parent67c89253f7e7b3d2351121ba4a95d5ddda84f3da (diff)
parentfb5e09c06ca609788bcf2ab34eabf6d762d2817d (diff)
Merge branch 'addRemoveable' into 'master'
implement removable filter See merge request redcore/sisyphus!6
Diffstat (limited to 'src/frontend/gui/sisyphus-gui.py')
-rwxr-xr-xsrc/frontend/gui/sisyphus-gui.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/frontend/gui/sisyphus-gui.py b/src/frontend/gui/sisyphus-gui.py
index 1de49c8..05212af 100755
--- a/src/frontend/gui/sisyphus-gui.py
+++ b/src/frontend/gui/sisyphus-gui.py
@@ -27,7 +27,8 @@ class Sisyphus(QtWidgets.QMainWindow):
('All', ''),
('Available', 'AND iv IS NULL'),
('Installed', 'AND iv IS NOT NULL'),
- ('Upgradable', 'AND iv <> av')
+ ('Upgradable', 'AND iv <> av'),
+ ('Removable', 'AND rmv = "yes"')
])
Sisyphus.SEARCHFILTER = self.SEARCHFILTERS['All']
@@ -72,6 +73,9 @@ class Sisyphus(QtWidgets.QMainWindow):
self.abort.clicked.connect(self.sisyphusExit)
+ #hide removable column
+ self.database.horizontalHeader().hideSection(5)
+
def centerOnScreen(self):
resolution = QtWidgets.QDesktopWidget().screenGeometry()
self.move((resolution.width() / 2) - (self.frameSize().width() / 2),
@@ -101,22 +105,27 @@ class Sisyphus(QtWidgets.QMainWindow):
a.name AS pn,
a.version AS av,
i.version AS iv,
- a.description AS descr
+ a.description AS descr,
+ CASE WHEN rm.name ISNULL THEN 'no' ELSE 'yes' END AS rmv
FROM remote_packages AS a
LEFT JOIN local_packages AS i
ON a.category = i.category
AND a.name = i.name
AND a.slot = i.slot
+ LEFT JOIN removeable_packages as rm
+ ON i.category = rm.category
+ AND i.name = rm.name
+ AND i.slot = rm.slot
WHERE %s LIKE %s %s %s
''' % (Sisyphus.SEARCHFIELD, Sisyphus.SEARCHTERM, Sisyphus.SEARCHFILTER, FILTEROUT))
rows = cursor.fetchall()
Sisyphus.PKGCOUNT = len(rows)
Sisyphus.PKGSELECTED = 0
model = QtGui.QStandardItemModel(len(rows), 5)
- model.setHorizontalHeaderLabels(['Category', 'Name', 'Available Version', 'Installed Version', 'Description'])
+ model.setHorizontalHeaderLabels(['Category', 'Name', 'Available Version', 'Installed Version', 'Description', 'Rmv'])
for row in rows:
indx = rows.index(row)
- for column in range(0, 5):
+ for column in range(0, 6):
item = QtGui.QStandardItem("%s"%(row[column]))
model.setItem(indx, column, item)
self.database.setModel(model)