Skip to content

Commit 711ddca

Browse files
committed
update v1.1.5
1 parent dd52c9b commit 711ddca

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

app/UIHandling/aboutDialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def __init__(self, *args, obj=None, **kwargs):
1010
super().__init__(*args, **kwargs)
1111
self.setupUi(self)
1212

13-
self.labelVersion.setText(f"Version: 1.1.0")
13+
self.labelVersion.setText(f"Version: 1.1.5")
1414
self.labelPyQtVersion.setText(f"PyQt6: v{PYQT_VERSION_STR}")
1515
self.labelPyVersion.setText(f"Python: v{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}")
1616

app/UIHandling/mainWindow.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -313,20 +313,21 @@ def edit_title(self, row):
313313

314314
def delete_title(self, row):
315315
# print(f"Deleting row {row}")
316-
if row < 0 or row >= self.modelTitles.rowCount():
316+
if not row:
317317
return
318-
index = self.modelTitles.index(row, 0)
318+
proxy_index = QtCore.QModelIndex(row)
319+
source_index = self.proxy_modelTitles.mapToSource(proxy_index)
320+
row_data = self.modelTitles.data(source_index, QtCore.Qt.ItemDataRole.UserRole)
319321
reply = QtWidgets.QMessageBox.question(
320322
self, 'Delete Title',
321-
f'Are you sure you want to delete this title?',
323+
f"Are you sure you want to delete this title?\n{row_data[0]}{row_data[1]}",
322324
QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No
323325
)
324326
if reply == QtWidgets.QMessageBox.StandardButton.Yes:
325327
# Delete logic here
326-
row_data = index.data(QtCore.Qt.ItemDataRole.UserRole)
327328
if not row_data:
328329
return
329-
result = app.DeleteTitle(DB, row_data)
330+
result = app.DeleteTitle(DB, row_data[0])
330331
dlg = QtWidgets.QMessageBox(self)
331332
dlg.setWindowTitle('Deleting Title')
332333
if (result['success']):
@@ -359,17 +360,18 @@ def edit_update(self, row):
359360

360361
def delete_update(self, row):
361362
# print(f"Deleting row {row}")
362-
if row < 0 or row >= self.modelUpdates.rowCount():
363+
if not row:
363364
return
364-
index = self.modelUpdates.index(row, 0)
365+
proxy_index = QtCore.QModelIndex(row)
366+
source_index = self.proxy_modelUpdates.mapToSource(proxy_index)
367+
row_data = self.modelUpdates.data(source_index, QtCore.Qt.ItemDataRole.UserRole)
365368
reply = QtWidgets.QMessageBox.question(
366369
self, 'Delete Update',
367-
'Are you sure you want to delete this update?',
370+
f"Are you sure you want to delete this update?\nTitle: {row_data[1]} - {row_data[2]}\nUpdate: {row_data[0]} - {row_data[3]}",
368371
QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No
369372
)
370373
if reply == QtWidgets.QMessageBox.StandardButton.Yes:
371374
# Delete logic here
372-
row_data = index.data(QtCore.Qt.ItemDataRole.UserRole)
373375
if not row_data:
374376
return
375377
result = app.DeleteUpdate(DB, row_data[0])

0 commit comments

Comments
 (0)