feature/port-to-py3 #11
@ -215,6 +215,7 @@ class Array_map(QtWidgets.QWidget):
|
||||
self.refresh_button.clicked.connect(self._refresh_drawings)
|
||||
self.map_reset_button.clicked.connect(self.org_map_view)
|
||||
self.go2eq_button.clicked.connect(self.go2eq)
|
||||
self.save_map_button.clicked.connect(self.saveFigure)
|
||||
|
||||
self.plotWidget.mpl_connect('motion_notify_event', self.mouse_moved)
|
||||
self.plotWidget.mpl_connect('scroll_event', self.mouse_scroll)
|
||||
@ -673,6 +674,16 @@ class Array_map(QtWidgets.QWidget):
|
||||
annotation.remove()
|
||||
self.annotations = []
|
||||
|
||||
def saveFigure(self):
|
||||
if self.canvas.fig:
|
||||
fd = QtWidgets.QFileDialog()
|
||||
fname, filter = fd.getSaveFileName(self.parent(), filter='Images (*.png *.svg *.jpg)')
|
||||
if not fname:
|
||||
return
|
||||
if not any([fname.endswith(item) for item in ['.png', '.svg', '.jpg']]):
|
||||
fname += '.png'
|
||||
self.canvas.fig.savefig(fname)
|
||||
|
||||
def _warn(self, message):
|
||||
self.qmb = QtWidgets.QMessageBox(QtWidgets.QMessageBox.Icon.Warning, 'Warning', message)
|
||||
self.qmb.show()
|
||||
|
@ -1218,7 +1218,7 @@ class PylotCanvas(FigureCanvas):
|
||||
parent.refreshPhaseText()
|
||||
|
||||
def keyPressHandler(self, gui_event):
|
||||
if gui_event.key == 'ctrl+s':
|
||||
if gui_event.key == 'ctrl+p':
|
||||
self.saveFigure()
|
||||
|
||||
def connectEvents(self):
|
||||
|
Loading…
Reference in New Issue
Block a user