summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/querydb.py12
-rw-r--r--src/frontend/gui/sisyphus-qt5.py13
-rw-r--r--src/frontend/gui/sisyphus-qt6.py14
3 files changed, 26 insertions, 13 deletions
diff --git a/src/backend/querydb.py b/src/backend/querydb.py
index bc87123..b1dd257 100644
--- a/src/backend/querydb.py
+++ b/src/backend/querydb.py
@@ -6,19 +6,21 @@ def start(filter, cat='', pn='', desc=''):
'all': f'''SELECT
i.category AS cat,
i.name as pn,
+ i.slot as ist,
i.version as iv,
IFNULL(a.version, 'alien') AS av,
d.description AS desc
FROM local_packages AS i LEFT OUTER JOIN remote_packages as a
ON i.category = a.category
AND i.name = a.name
- AND i.slot = i.slot
+ AND i.slot = a.slot
LEFT JOIN remote_descriptions AS d ON i.name = d.name AND i.category = d.category
WHERE cat LIKE '%{cat}%' AND pn LIKE '%{pn}%' AND desc LIKE '%{desc}%' {NOVIRT}
UNION
SELECT
a.category AS cat,
a.name as pn,
+ a.slot as ast,
IFNULL(i.version, 'None') AS iv,
a.version as av,
d.description AS desc
@@ -31,6 +33,7 @@ def start(filter, cat='', pn='', desc=''):
'installed': f'''SELECT
i.category AS cat,
i.name AS pn,
+ i.slot as ist,
i.version AS iv,
a.version as av,
d.description AS desc
@@ -38,12 +41,13 @@ def start(filter, cat='', pn='', desc=''):
LEFT JOIN remote_packages AS a
ON i.category = a.category
AND i.name = a.name
- AND i.slot = i.slot
+ AND i.slot = a.slot
LEFT JOIN remote_descriptions AS d ON i.name = d.name AND i.category = d.category
WHERE cat LIKE '%{cat}%' AND pn LIKE '%{pn}%' AND desc LIKE '%{desc}%' {NOVIRT}''',
'alien': f'''SELECT
i.category AS cat,
i.name AS pn,
+ i.slot as ist,
i.version as iv,
IFNULL(a.version, 'alien') AS av,
d.description AS desc
@@ -58,6 +62,7 @@ def start(filter, cat='', pn='', desc=''):
'available': f'''SELECT
a.category AS cat,
a.name AS pn,
+ a.slot as ast,
i.version as iv,
a.version AS av,
d.description AS desc
@@ -72,6 +77,7 @@ def start(filter, cat='', pn='', desc=''):
'upgradable': f'''SELECT
i.category AS cat,
i.name AS pn,
+ i.slot as ist,
i.version as iv,
a.version AS av,
d.description AS desc
@@ -79,7 +85,7 @@ def start(filter, cat='', pn='', desc=''):
INNER JOIN remote_packages AS a
ON i.category = a.category
AND i.name = a.name
- AND i.slot = i.slot
+ AND i.slot = a.slot
LEFT JOIN remote_descriptions AS d ON i.name = d.name AND i.category = d.category
WHERE cat LIKE '%{cat}%' AND pn LIKE '%{pn}%' AND desc LIKE '%{desc}%' {NOVIRT}
AND iv <> av'''
diff --git a/src/frontend/gui/sisyphus-qt5.py b/src/frontend/gui/sisyphus-qt5.py
index 067fe7a..2b4e1e6 100644
--- a/src/frontend/gui/sisyphus-qt5.py
+++ b/src/frontend/gui/sisyphus-qt5.py
@@ -134,12 +134,12 @@ class Sisyphus(QtWidgets.QMainWindow):
rows = cursor.fetchall()
Sisyphus.pkgCount = len(rows)
Sisyphus.pkgSelect = 0
- model = QtGui.QStandardItemModel(len(rows), 5)
+ model = QtGui.QStandardItemModel(len(rows), 6)
model.setHorizontalHeaderLabels(
- ['Package Category', 'Package Name', 'Installed Version', 'Available Version', 'Package Description'])
+ ['Package Category', 'Package Name', 'SLOT', 'Installed Version', 'Available Version', 'Package Description'])
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.databaseTable.setModel(model)
@@ -162,10 +162,13 @@ class Sisyphus(QtWidgets.QMainWindow):
for pkg in self.databaseTable.selectionModel().selectedRows(0)]
pkg_names = [{'row': pkg.row(), 'name': pkg.data()}
for pkg in self.databaseTable.selectionModel().selectedRows(1)]
+ pkg_slots = [{'row': pkg.row(), 'slot': pkg.data()}
+ for pkg in self.databaseTable.selectionModel().selectedRows(2)]
pkg_categs = sorted(pkg_categs, key=byRow)
pkg_names = sorted(pkg_names, key=byRow)
- selected_pkgs = [pkg_categs[i]['cat'] + '/' +
- pkg_names[i]['name'] for i in range(len(pkg_categs))]
+ pkg_slots = sorted(pkg_slots, key=byRow)
+ selected_pkgs = [pkg_categs[i]['cat'] + '/' + pkg_names[i]['name'] +
+ ':' + pkg_slots[i]['slot'] for i in range(len(pkg_categs))]
return (selected_pkgs)
def packageInstall(self):
diff --git a/src/frontend/gui/sisyphus-qt6.py b/src/frontend/gui/sisyphus-qt6.py
index 3886a7f..4693c5c 100644
--- a/src/frontend/gui/sisyphus-qt6.py
+++ b/src/frontend/gui/sisyphus-qt6.py
@@ -134,12 +134,12 @@ class Sisyphus(QtWidgets.QMainWindow):
rows = cursor.fetchall()
Sisyphus.pkgCount = len(rows)
Sisyphus.pkgSelect = 0
- model = QtGui.QStandardItemModel(len(rows), 5)
+ model = QtGui.QStandardItemModel(len(rows), 6)
model.setHorizontalHeaderLabels(
- ['Package Category', 'Package Name', 'Installed Version', 'Available Version', 'Package Description'])
+ ['Package Category', 'Package Name', 'SLOT', 'Installed Version', 'Available Version', 'Package Description'])
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.databaseTable.setModel(model)
@@ -162,10 +162,13 @@ class Sisyphus(QtWidgets.QMainWindow):
for pkg in self.databaseTable.selectionModel().selectedRows(0)]
pkg_names = [{'row': pkg.row(), 'name': pkg.data()}
for pkg in self.databaseTable.selectionModel().selectedRows(1)]
+ pkg_slots = [{'row': pkg.row(), 'slot': pkg.data()}
+ for pkg in self.databaseTable.selectionModel().selectedRows(2)]
pkg_categs = sorted(pkg_categs, key=byRow)
pkg_names = sorted(pkg_names, key=byRow)
- selected_pkgs = [pkg_categs[i]['cat'] + '/' +
- pkg_names[i]['name'] for i in range(len(pkg_categs))]
+ pkg_slots = sorted(pkg_slots, key=byRow)
+ selected_pkgs = [pkg_categs[i]['cat'] + '/' + pkg_names[i]['name'] +
+ ':' + pkg_slots[i]['slot'] for i in range(len(pkg_categs))]
return (selected_pkgs)
def packageInstall(self):
@@ -294,6 +297,7 @@ class ProgressWindow(QtWidgets.QMainWindow):
self.setWindowFlag(QtCore.Qt.WindowType.FramelessWindowHint)
self.centerOnScreen()
self.refreshProgressWindow()
+
self.clearButton.clicked.connect(self.clearProgressWindow)
self.hideButton.clicked.connect(self.hideProgressWindow)