set correct color, disable button until new entry created
This commit is contained in:
@@ -9,7 +9,7 @@ class NewEntry(QtWidgets.QDialog, Ui_Dialog):
|
||||
super(NewEntry, self).__init__()
|
||||
self.setupUi(self)
|
||||
self.setWindowTitle("Neues Exemplar hinzufügen")
|
||||
self.setWindowIcon(Icon("newentry").overwriteColor("#ffffff"))
|
||||
self.setWindowIcon(Icon("newentry").icon)
|
||||
self.tableWidget.horizontalHeader().setSectionResizeMode(
|
||||
QtWidgets.QHeaderView.ResizeMode.Stretch
|
||||
)
|
||||
@@ -19,8 +19,15 @@ class NewEntry(QtWidgets.QDialog, Ui_Dialog):
|
||||
self.populateTable()
|
||||
self.btn_addNewBook.clicked.connect(self.addEntry)
|
||||
self.buttonBox.accepted.connect(self.insertEntry)
|
||||
#disable buttonbox accepted
|
||||
self.buttonBox.button(
|
||||
QtWidgets.QDialogButtonBox.StandardButton.Ok
|
||||
).setEnabled(False)
|
||||
|
||||
def addEntry(self):
|
||||
self.buttonBox.button(
|
||||
QtWidgets.QDialogButtonBox.StandardButton.Ok
|
||||
).setEnabled(True)
|
||||
# clone last row and its data
|
||||
row = self.tableWidget.rowCount()
|
||||
self.tableWidget.insertRow(row)
|
||||
|
||||
Reference in New Issue
Block a user