diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-09-22 17:30:05 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-09-22 17:30:05 +0100 |
commit | 69cba5b0c4695197100bb8e2454c9e7622cfb1b2 (patch) | |
tree | b656d2a43655e42e080958253d751f5f25636d6f /src/frontend | |
parent | 2f890f90a1efeb782eda100cd95fb25194777ea4 (diff) |
backend :v4.2409.2
* Improve the database query to take SLOTS into consideration
* This addresses the unreliability of the 'upgradable' filter.
* The change ensures consistent and accurate filtering of upgradable packages.
qt frontend :
* Select the package SLOT on install and remove operations
* This resolves a rare issue where for example Blender version 4.2 is unavailable,
* and selecting version 3.6, 4.0 or 4.1 inadvertently defaults to 4.2 due to a missing SLOT.
* The change ensures consistent and accurate version selection thanks to SLOT selection.
Diffstat (limited to 'src/frontend')
-rw-r--r-- | src/frontend/gui/sisyphus-qt5.py | 13 | ||||
-rw-r--r-- | src/frontend/gui/sisyphus-qt6.py | 14 |
2 files changed, 17 insertions, 10 deletions
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) |