개정판 8fc044e8
issue #1351: Escape 키 눌렀을때 발생하는 오류 수정
Change-Id: Ic23b88415492c11b74f58b9a38e229284bf54a4c
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
1139 | 1139 |
sys.exc_info()[-1].tb_lineno) |
1140 | 1140 |
self.addMessage.emit(MessageType.Error, message) |
1141 | 1141 |
|
1142 |
def checked_action(self): |
|
1143 |
"""return checked action""" |
|
1144 |
home_file_pane = self.ribbon.get_pane('Home File') |
|
1145 |
home_pane = self.ribbon.get_pane('Home') |
|
1146 |
visualization_pane = self.ribbon.get_pane('Home Visualization') |
|
1147 |
actions = [home_pane.ui.toolButtonRecognition, home_pane.ui.toolButtonLinkAttribute, |
|
1148 |
home_pane.ui.toolButtonLine, home_pane.ui.toolButtonOCR, visualization_pane.ui.toolButtonZoom, |
|
1149 |
visualization_pane.ui.toolButtonFitWindow, home_pane.ui.toolButtonVendor] |
|
1150 |
|
|
1151 |
checked = [ui_ for ui_ in actions if ui_.isChecked()] |
|
1152 |
return checked[0] if checked else None |
|
1153 |
|
|
1142 | 1154 |
def update_action_group(self, ui): |
1143 | 1155 |
"""Manage Checkable Action statement""" |
1144 | 1156 |
home_file_pane = self.ribbon.get_pane('Home File') |
... | ... | |
2202 | 2214 |
"""restore to default command when user press Escape key""" |
2203 | 2215 |
try: |
2204 | 2216 |
if event.key() == Qt.Key_Escape: |
2205 |
checked = self.graphicsView.command
|
|
2217 |
checked = self.checked_action()
|
|
2206 | 2218 |
if checked: |
2219 |
checked.setChecked(False) |
|
2207 | 2220 |
self.graphicsView.useDefaultCommand() |
2208 | 2221 |
elif event.key() == Qt.Key_M: # merge text as vertical |
2209 | 2222 |
from TextInfo import TextInfo |
내보내기 Unified diff