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.
This commit is contained in:
tntscreed 2023-03-16 16:06:48 +01:00
parent 9b372eac73
commit 863e8df483
4 changed files with 53 additions and 10 deletions

View File

@ -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())

View File

@ -230,7 +230,7 @@ class characterModel(QAbstractItemModel, searchableModel):
))
self.endInsertRows()
mainWindow().updatePersoInfoView()
mainWindow().updatePersoInfoView(mainWindow().tblPersoInfos)
def removeCharacterInfo(self, ID):
c = self.getCharacterByID(ID)

View File

@ -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"))

View File

@ -9,7 +9,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>548</width>
<width>644</width>
<height>556</height>
</rect>
</property>
@ -60,23 +60,53 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,1,5,1">
<item>
<widget class="QPushButton" name="btnPersoBulkAddInfo">
<property name="toolTip">
<string>Add entry to the list.</string>
</property>
<property name="text">
<string>Add Entry</string>
<string/>
</property>
<property name="icon">
<iconset theme="list-add">
<normaloff>.</normaloff>.</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnPersoBulkRmInfo">
<property name="toolTip">
<string>Remove entry from the list.</string>
</property>
<property name="text">
<string>Remove Entry</string>
<string/>
</property>
<property name="icon">
<iconset theme="list-remove">
<normaloff>.</normaloff>.</iconset>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnPersoBulkApply">
<property name="toolTip">
<string>Adds all items to the selected characters.</string>
</property>
<property name="locale">
<locale language="English" country="UnitedKingdom"/>
</property>