Fix disabled delete button in package UI.

The selection changed handler isn't called for the initial selection.
This commit is contained in:
Dan Albert 2020-10-19 21:34:17 -07:00
parent f65595c626
commit 5023e0d30f

View File

@ -102,7 +102,7 @@ class QPackageDialog(QDialog):
self.delete_flight_button = QPushButton("Delete Selected") self.delete_flight_button = QPushButton("Delete Selected")
self.delete_flight_button.setProperty("style", "btn-danger") self.delete_flight_button.setProperty("style", "btn-danger")
self.delete_flight_button.clicked.connect(self.on_delete_flight) self.delete_flight_button.clicked.connect(self.on_delete_flight)
self.delete_flight_button.setEnabled(False) self.delete_flight_button.setEnabled(model.rowCount() > 0)
self.button_layout.addWidget(self.delete_flight_button) self.button_layout.addWidget(self.delete_flight_button)
self.button_layout.addStretch() self.button_layout.addStretch()