개정판 d8b09f9f
add default symbol reset function
Change-Id: Ib06314d53bddac4c601db2eb3444236cf18d6ae3
DTI_PID/DTI_PID/SymbolBase.py | ||
---|---|---|
93 | 93 |
def getInfo(self): |
94 | 94 |
return self.info |
95 | 95 |
|
96 |
def setScale(self, x=1.0, y=1.0): |
|
97 |
self.scale = [x, y] |
|
98 |
|
|
96 | 99 |
def getScale(self): |
97 | 100 |
return self.scale |
98 | 101 |
|
DTI_PID/DTI_PID/SymbolTreeWidget.py | ||
---|---|---|
77 | 77 |
child = tree_item.child(idx) |
78 | 78 |
tree_item_stack.append(child) |
79 | 79 |
elif tree_item and tree_item.data(Qt.UserRole): |
80 |
if type(tree_item.data(Qt.UserRole)) is SymbolBase.SymbolBase: |
|
80 |
if type(tree_item.data(Qt.UserRole)) is SymbolBase.SymbolBase and tree_item.data(Qt.UserRole).iType != -1:
|
|
81 | 81 |
res.append(tree_item.data(Qt.UserRole)) |
82 | 82 |
except Exception as ex: |
83 | 83 |
from App import App |
... | ... | |
143 | 143 |
deleteAttrAction = QAction(self.tr("Delete Unused Symbols")) |
144 | 144 |
deleteAttrAction.triggered.connect(lambda: self.onDeleteSymbolBatchByCategory(item)) |
145 | 145 |
menu.addAction(deleteAttrAction) |
146 |
|
|
147 |
resetDefaultScaleAction = QAction(self.tr("Reset All Default Symbol Scale")) |
|
148 |
resetDefaultScaleAction.triggered.connect(self.resetDefaultScale) |
|
149 |
menu.addAction(resetDefaultScaleAction) |
|
150 |
|
|
146 | 151 |
menu.exec_(self.viewport().mapToGlobal(position)) |
147 | 152 |
|
153 |
def resetDefaultScale(self): |
|
154 |
text, result = QInputDialog.getText(self, self.tr('Reset all default symbol scale'), self.tr('To proceed, enter "Confirm" in the input box below.')) |
|
155 |
|
|
156 |
if result and text == 'Confirm': |
|
157 |
app_doc_data = AppDocData.instance() |
|
158 |
|
|
159 |
for sym in self.symbols: |
|
160 |
sym.setScale() |
|
161 |
app_doc_data.updateSymbol(sym) |
|
162 |
|
|
163 |
self.initSymbolTreeView() |
|
164 |
|
|
165 |
QMessageBox.information(self, self.tr('Information'), self.tr('Succeeded')) |
|
166 |
|
|
148 | 167 |
def editSymbolActionClickEvent(self, item, columNo): |
149 | 168 |
self.showSymbolEditorDialog(item, columNo) |
150 | 169 |
|
내보내기 Unified diff