개정판 83d5e903
issue #000: fix drawing
Change-Id: I86dbb5505a543273d405b37a39a81c790152cff9
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
504 | 504 |
try: |
505 | 505 |
app_doc_data = AppDocData.instance() |
506 | 506 |
drawings = app_doc_data.getDrawings() |
507 |
new_drawings = [] |
|
507 | 508 |
|
508 | 509 |
self.treeWidgetDrawingList.clear() |
509 | 510 |
self.treeWidgetDrawingList.root = QTreeWidgetItem(self.treeWidgetDrawingList, |
... | ... | |
521 | 522 |
x = [drawing for drawing in drawings if drawing.name == file] |
522 | 523 |
if not x or not x[0].UID: |
523 | 524 |
drawing = Drawing(None, file, None) |
524 |
drawings.append(drawing) |
|
525 |
new_drawings.append(drawing)
|
|
525 | 526 |
else: |
526 | 527 |
drawing = x[0] |
527 | 528 |
|
... | ... | |
541 | 542 |
#self.treeWidgetDrawingList.root.sortChildren(0, Qt.AscendingOrder) |
542 | 543 |
self.treeWidgetDrawingList.resizeColumnToContents(0) |
543 | 544 |
|
544 |
app_doc_data.saveDrawings(drawings) |
|
545 |
app_doc_data.saveDrawings(new_drawings)
|
|
545 | 546 |
except Exception as ex: |
546 | 547 |
message = 'error occurred({}) in {}:{}'.format(repr(ex), sys.exc_info()[-1].tb_frame.f_code.co_filename, |
547 | 548 |
sys.exc_info()[-1].tb_lineno) |
내보내기 Unified diff