feature/port-to-py3 #11

Merged
marcel merged 59 commits from feature/port-to-py3 into develop 2022-03-21 15:30:06 +01:00
2 changed files with 12 additions and 1 deletions
Showing only changes of commit dd02527c1d - Show all commits

View File

@ -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()

View File

@ -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):