mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-06-28 03:00:59 +12:00
a046656acf
-Changed the selection mode to extended selection on the lstCharacters tree-view. This will not affect anything else other than the "detailed info" rows. Every other change to a character's descriptions, motivations and such only affect the last selected one. -Made a method to get all the IDs of the selected characters. -Added a character-info dialog UI. Originally, adding information worked by adding a placeholder and then changing it. Users never want to just add a placeholder without initialising the values. And the bulk-adding only works this way.
106 lines
5.8 KiB
Python
106 lines
5.8 KiB
Python
# -*- coding: utf-8 -*-
|
|
|
|
# Form implementation generated from reading ui file 'D:\OpensourceWork\manuskript\manuskript\ui\characterInfoDialog.ui'
|
|
#
|
|
# Created by: PyQt5 UI code generator 5.15.4
|
|
#
|
|
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
|
|
# run again. Do not edit this file unless you know what you are doing.
|
|
|
|
|
|
from PyQt5 import QtCore, QtGui, QtWidgets
|
|
|
|
|
|
class Ui_characterInfoDialog(object):
|
|
def setupUi(self, characterInfoDialog):
|
|
characterInfoDialog.setObjectName("characterInfoDialog")
|
|
characterInfoDialog.resize(481, 148)
|
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
|
|
sizePolicy.setHorizontalStretch(0)
|
|
sizePolicy.setVerticalStretch(0)
|
|
sizePolicy.setHeightForWidth(characterInfoDialog.sizePolicy().hasHeightForWidth())
|
|
characterInfoDialog.setSizePolicy(sizePolicy)
|
|
characterInfoDialog.setMinimumSize(QtCore.QSize(481, 148))
|
|
characterInfoDialog.setMaximumSize(QtCore.QSize(481, 148))
|
|
characterInfoDialog.setTabletTracking(False)
|
|
characterInfoDialog.setFocusPolicy(QtCore.Qt.NoFocus)
|
|
characterInfoDialog.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedKingdom))
|
|
self.gridLayout = QtWidgets.QGridLayout(characterInfoDialog)
|
|
self.gridLayout.setObjectName("gridLayout")
|
|
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
|
self.horizontalLayout_2.setSizeConstraint(QtWidgets.QLayout.SetDefaultConstraint)
|
|
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
|
self.label_2 = QtWidgets.QLabel(characterInfoDialog)
|
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
|
sizePolicy.setHorizontalStretch(0)
|
|
sizePolicy.setVerticalStretch(0)
|
|
sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth())
|
|
self.label_2.setSizePolicy(sizePolicy)
|
|
self.label_2.setObjectName("label_2")
|
|
self.horizontalLayout_2.addWidget(self.label_2)
|
|
self.valueLineEdit = QtWidgets.QLineEdit(characterInfoDialog)
|
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
|
sizePolicy.setHorizontalStretch(0)
|
|
sizePolicy.setVerticalStretch(0)
|
|
sizePolicy.setHeightForWidth(self.valueLineEdit.sizePolicy().hasHeightForWidth())
|
|
self.valueLineEdit.setSizePolicy(sizePolicy)
|
|
self.valueLineEdit.setFocusPolicy(QtCore.Qt.StrongFocus)
|
|
self.valueLineEdit.setLayoutDirection(QtCore.Qt.RightToLeft)
|
|
self.valueLineEdit.setObjectName("valueLineEdit")
|
|
self.horizontalLayout_2.addWidget(self.valueLineEdit)
|
|
self.gridLayout.addLayout(self.horizontalLayout_2, 3, 0, 1, 1)
|
|
self.horizontalLayout_1 = QtWidgets.QHBoxLayout()
|
|
self.horizontalLayout_1.setObjectName("horizontalLayout_1")
|
|
self.label = QtWidgets.QLabel(characterInfoDialog)
|
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
|
sizePolicy.setHorizontalStretch(0)
|
|
sizePolicy.setVerticalStretch(0)
|
|
sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
|
|
self.label.setSizePolicy(sizePolicy)
|
|
self.label.setObjectName("label")
|
|
self.horizontalLayout_1.addWidget(self.label)
|
|
self.descriptionLineEdit = QtWidgets.QLineEdit(characterInfoDialog)
|
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
|
sizePolicy.setHorizontalStretch(0)
|
|
sizePolicy.setVerticalStretch(0)
|
|
sizePolicy.setHeightForWidth(self.descriptionLineEdit.sizePolicy().hasHeightForWidth())
|
|
self.descriptionLineEdit.setSizePolicy(sizePolicy)
|
|
self.descriptionLineEdit.setFocusPolicy(QtCore.Qt.StrongFocus)
|
|
self.descriptionLineEdit.setLayoutDirection(QtCore.Qt.RightToLeft)
|
|
self.descriptionLineEdit.setObjectName("descriptionLineEdit")
|
|
self.horizontalLayout_1.addWidget(self.descriptionLineEdit)
|
|
self.gridLayout.addLayout(self.horizontalLayout_1, 2, 0, 1, 1)
|
|
self.buttonBox = QtWidgets.QDialogButtonBox(characterInfoDialog)
|
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
|
sizePolicy.setHorizontalStretch(0)
|
|
sizePolicy.setVerticalStretch(0)
|
|
sizePolicy.setHeightForWidth(self.buttonBox.sizePolicy().hasHeightForWidth())
|
|
self.buttonBox.setSizePolicy(sizePolicy)
|
|
self.buttonBox.setFocusPolicy(QtCore.Qt.StrongFocus)
|
|
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
|
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
|
self.buttonBox.setObjectName("buttonBox")
|
|
self.gridLayout.addWidget(self.buttonBox, 4, 0, 1, 1)
|
|
|
|
self.retranslateUi(characterInfoDialog)
|
|
self.buttonBox.accepted.connect(characterInfoDialog.accept)
|
|
self.buttonBox.rejected.connect(characterInfoDialog.reject)
|
|
QtCore.QMetaObject.connectSlotsByName(characterInfoDialog)
|
|
characterInfoDialog.setTabOrder(self.descriptionLineEdit, self.valueLineEdit)
|
|
|
|
def retranslateUi(self, characterInfoDialog):
|
|
_translate = QtCore.QCoreApplication.translate
|
|
characterInfoDialog.setWindowTitle(_translate("characterInfoDialog", "Add Character Info"))
|
|
self.label_2.setText(_translate("characterInfoDialog", "Value:"))
|
|
self.label.setText(_translate("characterInfoDialog", "Name:"))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
import sys
|
|
app = QtWidgets.QApplication(sys.argv)
|
|
characterInfoDialog = QtWidgets.QDialog()
|
|
ui = Ui_characterInfoDialog()
|
|
ui.setupUi(characterInfoDialog)
|
|
characterInfoDialog.show()
|
|
sys.exit(app.exec_())
|