Skip to content

Commit

Permalink
Merge pull request #39 from njsmith/fix-save-option
Browse files Browse the repository at this point in the history
Fix --save
  • Loading branch information
stefanv committed Jun 26, 2018
2 parents 17feb91 + 5bd78e7 commit 634fffa
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions viscm/gui.py
Expand Up @@ -1017,8 +1017,8 @@ def main(argv):
v = viscm(cm.cmap, name=cm.name, figure=fig, uniform_space=cm.uniform_space)
mainwindow = ViewerWindow(figureCanvas, v, cm.name)
if args.save is not None:
v.fig.set_size_inches(20, 12)
v.fig.savefig(args.save)
v.figure.set_size_inches(20, 12)
v.figure.savefig(args.save)
elif args.action == "edit":
if not cm.can_edit:
sys.exit("Sorry, I don't know how to edit the specified colormap")
Expand Down Expand Up @@ -1305,9 +1305,10 @@ def closeEvent(self, ce):
self.fileQuit()

def save(self):
fileName = QtWidgets.QFileDialog.getSaveFileName(caption="Save file",
directory=self.viscm_editor.name + ".jscm",
filter="JSCM Files (*.jscm)")
fileName = QtWidgets.QFileDialog.getSaveFileName(
caption="Save file",
directory=self.viscm_editor.name + ".jscm",
filter="JSCM Files (*.jscm)")
self.viscm_editor.save_colormap(fileName)

def loadviewer(self):
Expand Down

0 comments on commit 634fffa

Please sign in to comment.