Use the main gui askQuestion function for yes/no dialogs

This commit is contained in:
Veronica K. B. Olsen
2020-12-19 20:21:43 +01:00
parent 5b746af4bd
commit 8d71ee30d4
5 changed files with 37 additions and 49 deletions
+4 -5
View File
@@ -36,7 +36,7 @@ from PyQt5.QtGui import QKeySequence
from PyQt5.QtWidgets import (
QDialog, QHBoxLayout, QVBoxLayout, QGridLayout, QPushButton, QTreeWidget,
QAbstractItemView, QTreeWidgetItem, QDialogButtonBox, QLabel, QShortcut,
QFileDialog, QLineEdit, QMessageBox
QFileDialog, QLineEdit
)
from nw.common import formatInt
@@ -218,12 +218,11 @@ class GuiProjectLoad(QDialog):
"""
selList = self.listBox.selectedItems()
if selList:
msgBox = QMessageBox()
msgRes = msgBox.question(
self, "Remove Entry",
msgYes = self.theParent.askQuestion(
"Remove Entry",
"Remove the selected entry from the recent projects list?"
)
if msgRes == QMessageBox.Yes:
if msgYes:
self.mainConf.removeFromRecentCache(
selList[0].data(self.C_NAME, Qt.UserRole)
)