프로젝트

일반

사용자정보

개정판 d8b09f9f

IDd8b09f9f89d913b8c7c6af18b00750d5f76c56e9
상위 ef90c19c
하위 c0a42e90

함의성이(가) 7달 전에 추가함

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

클립보드 이미지 추가 (최대 크기: 500 MB)