def __init__(self, data, summary, parent=None): super().__init__(parent) layout = QVBoxLayout() types = [] patts.connect() try: info = self._title_info(data) self._title_string = _('Reports.summaryFor').format(info) titleLabel = QLabel(self._title_string) titleLabelFont = titleLabel.font() titleLabelFont.setBold(True) titleLabel.setFont(titleLabelFont) layout.addWidget(titleLabel) sort_types(list(summary.keys()), types) for type in types: if type not in summary: continue type_info = patts.get_type_byid(type) resultBox = QHBoxLayout() resultBox.addWidget(QLabel(type_info['displayName'] + ':')) resultBox.addStretch(1) resultBox.addWidget(QLabel(result_stamp(summary[type]))) layout.addLayout(resultBox) finally: patts.close() self.setWindowTitle(_('Reports.summaryResults')) self.setLayout(layout)
def _delete(self): patts.connect() try: for id in self._ids: patts.delete_task(id) finally: patts.close() self._refresh()