개정판 8701ed58
issue #700: user mode added in license with 'DOFTECH'
Change-Id: I89f8243da099ec49a759ed8ca7c7fdd6b1aef03e
DTI_PID/DTI_PID/SymbolTreeWidget.py | ||
---|---|---|
50 | 50 |
itemPosition = self.mapTo(self, position) |
51 | 51 |
item = self.itemAt(itemPosition) |
52 | 52 |
data = item.data(0, self.TREE_DATA_ROLE) |
53 |
|
|
54 |
advanced = False |
|
55 |
app_doc_data = AppDocData.instance() |
|
56 |
configs = app_doc_data.getAppConfigs('app', 'mode') |
|
57 |
if configs and 1 == len(configs) and 'advanced' == configs[0].value: |
|
58 |
advanced = True |
|
59 |
|
|
53 | 60 |
if data is not None and type(data) is symbol.SymbolBase: |
54 | 61 |
sym = self.getSymbolByItemName(item, 0) |
55 | 62 |
text = item.text(0) |
... | ... | |
61 | 68 |
level += 1 |
62 | 69 |
if sym is not None: |
63 | 70 |
menu = QMenu() |
64 |
editSymbolAction = QAction(self.tr("Edit Symbol")) |
|
65 |
editSymbolAction.triggered.connect(lambda: self.editSymbolActionClickEvent(item, 0)) |
|
66 |
menu.addAction(editSymbolAction) |
|
67 |
editDisplaySymbolAction = QAction(self.tr("Edit Symbol for Dispay")) |
|
68 |
editDisplaySymbolAction.triggered.connect(lambda: self.editDisplaySymbolActionClickEvent(item, 0)) |
|
69 |
menu.addAction(editDisplaySymbolAction) |
|
71 |
if advanced: |
|
72 |
editSymbolAction = QAction(self.tr("Edit Symbol")) |
|
73 |
editSymbolAction.triggered.connect(lambda: self.editSymbolActionClickEvent(item, 0)) |
|
74 |
menu.addAction(editSymbolAction) |
|
75 |
editDisplaySymbolAction = QAction(self.tr("Edit Symbol for Dispay")) |
|
76 |
editDisplaySymbolAction.triggered.connect(lambda: self.editDisplaySymbolActionClickEvent(item, 0)) |
|
77 |
menu.addAction(editDisplaySymbolAction) |
|
70 | 78 |
displaySymbolAction = QAction(self.tr("Display Symbol")) |
71 | 79 |
displaySymbolAction.triggered.connect(lambda: self.displaySymbolActionClickEvent(item, 0)) |
72 | 80 |
menu.addAction(displaySymbolAction) |
73 |
deleteSymbolAction = QAction(self.tr("Delete Symbol")) |
|
74 |
deleteSymbolAction.triggered.connect(lambda: self.deleteSymbolActionClickEvent(sym.getType(), text)) |
|
75 |
menu.addAction(deleteSymbolAction) |
|
81 |
if advanced: |
|
82 |
deleteSymbolAction = QAction(self.tr("Delete Symbol")) |
|
83 |
deleteSymbolAction.triggered.connect(lambda: self.deleteSymbolActionClickEvent(sym.getType(), text)) |
|
84 |
menu.addAction(deleteSymbolAction) |
|
76 | 85 |
menu.exec_(self.viewport().mapToGlobal(position)) |
77 | 86 |
else: |
78 |
menu = QMenu() |
|
79 |
editAttrAction = QAction(self.tr("Edit Attribute")) |
|
80 |
editAttrAction.triggered.connect(lambda: self.onEditAttrClicked(item, 0)) |
|
81 |
menu.addAction(editAttrAction) |
|
82 |
menu.exec_(self.viewport().mapToGlobal(position)) |
|
87 |
if advanced: |
|
88 |
menu = QMenu() |
|
89 |
editAttrAction = QAction(self.tr("Edit Attribute")) |
|
90 |
editAttrAction.triggered.connect(lambda: self.onEditAttrClicked(item, 0)) |
|
91 |
menu.addAction(editAttrAction) |
|
92 |
menu.exec_(self.viewport().mapToGlobal(position)) |
|
83 | 93 |
|
84 | 94 |
def editSymbolActionClickEvent(self, item, columNo): |
85 | 95 |
self.showSymbolEditorDialog(item, columNo) |
내보내기 Unified diff