From 863e8df48311d34ff31a4e57d8b3c8e6913f9a7e Mon Sep 17 00:00:00 2001 From: tntscreed Date: Thu, 16 Mar 2023 16:06:48 +0100 Subject: [PATCH] Bug and style fixes. - Made small changes to better fit the style of the project. - Fixed a bug that would result in a crash when details were applied with the bulk info manager. - Improved the Bulk Manager UI by adding the list-add and list-remove icons, to better fit it to Manuskript's style. Also added tooltips. --- manuskript/mainWindow.py | 2 +- manuskript/models/characterModel.py | 2 +- manuskript/ui/bulkInfoManager.py | 21 +++++++++++++--- manuskript/ui/bulkInfoManager.ui | 38 ++++++++++++++++++++++++++--- 4 files changed, 53 insertions(+), 10 deletions(-) diff --git a/manuskript/mainWindow.py b/manuskript/mainWindow.py index b3e3dcf..3e184cf 100644 --- a/manuskript/mainWindow.py +++ b/manuskript/mainWindow.py @@ -459,7 +459,7 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.setPersoBulkMode(False) self.tabPersos.setEnabled(True) - def refreshBulkAffectedCharacters(self): #Characters affected by a potential bulk-info modification + def refreshBulkAffectedCharacters(self): # Characters affected by a potential bulk-info modification self.bulkAffectedCharacters = [] for character in self.lstCharacters.currentCharacters(): self.bulkAffectedCharacters.append(character.name()) diff --git a/manuskript/models/characterModel.py b/manuskript/models/characterModel.py index a81a020..d635db6 100644 --- a/manuskript/models/characterModel.py +++ b/manuskript/models/characterModel.py @@ -230,7 +230,7 @@ class characterModel(QAbstractItemModel, searchableModel): )) self.endInsertRows() - mainWindow().updatePersoInfoView() + mainWindow().updatePersoInfoView(mainWindow().tblPersoInfos) def removeCharacterInfo(self, ID): c = self.getCharacterByID(ID) diff --git a/manuskript/ui/bulkInfoManager.py b/manuskript/ui/bulkInfoManager.py index 0de5b80..2fa0fe9 100644 --- a/manuskript/ui/bulkInfoManager.py +++ b/manuskript/ui/bulkInfoManager.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file 'manuskript\ui\bulkInfoManager.ui' +# Form implementation generated from reading ui file 'manuskript\manuskript\ui\bulkInfoManager.ui' # # Created by: PyQt5 UI code generator 5.15.4 # @@ -15,7 +15,7 @@ class Ui_BulkInfoManager(object): def setupUi(self, BulkInfoManager): BulkInfoManager.setObjectName("BulkInfoManager") BulkInfoManager.setWindowModality(QtCore.Qt.WindowModal) - BulkInfoManager.resize(548, 556) + BulkInfoManager.resize(644, 556) self.verticalLayout = QtWidgets.QVBoxLayout(BulkInfoManager) self.verticalLayout.setObjectName("verticalLayout") self.lblStaticMessage = QtWidgets.QLabel(BulkInfoManager) @@ -38,15 +38,27 @@ class Ui_BulkInfoManager(object): self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.btnPersoBulkAddInfo = QtWidgets.QPushButton(BulkInfoManager) + self.btnPersoBulkAddInfo.setText("") + icon = QtGui.QIcon.fromTheme("list-add") + self.btnPersoBulkAddInfo.setIcon(icon) self.btnPersoBulkAddInfo.setObjectName("btnPersoBulkAddInfo") self.horizontalLayout.addWidget(self.btnPersoBulkAddInfo) self.btnPersoBulkRmInfo = QtWidgets.QPushButton(BulkInfoManager) + self.btnPersoBulkRmInfo.setText("") + icon = QtGui.QIcon.fromTheme("list-remove") + self.btnPersoBulkRmInfo.setIcon(icon) self.btnPersoBulkRmInfo.setObjectName("btnPersoBulkRmInfo") self.horizontalLayout.addWidget(self.btnPersoBulkRmInfo) + spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontalLayout.addItem(spacerItem) self.btnPersoBulkApply = QtWidgets.QPushButton(BulkInfoManager) self.btnPersoBulkApply.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedKingdom)) self.btnPersoBulkApply.setObjectName("btnPersoBulkApply") self.horizontalLayout.addWidget(self.btnPersoBulkApply) + self.horizontalLayout.setStretch(0, 1) + self.horizontalLayout.setStretch(1, 1) + self.horizontalLayout.setStretch(2, 5) + self.horizontalLayout.setStretch(3, 1) self.verticalLayout.addLayout(self.horizontalLayout) self.retranslateUi(BulkInfoManager) @@ -57,8 +69,9 @@ class Ui_BulkInfoManager(object): BulkInfoManager.setWindowTitle(_translate("BulkInfoManager", "Form")) self.lblStaticMessage.setText(_translate("BulkInfoManager", "Affected Characters:")) self.lblCharactersDynamic.setText(_translate("BulkInfoManager", "NONE")) - self.btnPersoBulkAddInfo.setText(_translate("BulkInfoManager", "Add Entry")) - self.btnPersoBulkRmInfo.setText(_translate("BulkInfoManager", "Remove Entry")) + self.btnPersoBulkAddInfo.setToolTip(_translate("BulkInfoManager", "Add entry to the list.")) + self.btnPersoBulkRmInfo.setToolTip(_translate("BulkInfoManager", "Remove entry from the list.")) + self.btnPersoBulkApply.setToolTip(_translate("BulkInfoManager", "Adds all items to the selected characters.")) self.btnPersoBulkApply.setText(_translate("BulkInfoManager", "Apply Changes")) diff --git a/manuskript/ui/bulkInfoManager.ui b/manuskript/ui/bulkInfoManager.ui index 35bf8ac..83845bf 100644 --- a/manuskript/ui/bulkInfoManager.ui +++ b/manuskript/ui/bulkInfoManager.ui @@ -9,7 +9,7 @@ 0 0 - 548 + 644 556 @@ -60,23 +60,53 @@ - + + + Add entry to the list. + - Add Entry + + + + + .. + + Remove entry from the list. + - Remove Entry + + + + + .. + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + Adds all items to the selected characters. +