Skip to content

use Qt window title as default savefig filename #908

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 9, 2012
Prev Previous commit
Next Next commit
convert QString to string, and fix string.replace() oops
  • Loading branch information
mspacek committed Jul 5, 2012
commit 16dd72999a9678d851663d63f864982248da72b8
4 changes: 2 additions & 2 deletions lib/matplotlib/backends/backend_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,8 @@ def save_figure(self, *args):
sorted_filetypes = filetypes.items()
sorted_filetypes.sort()
default_filetype = self.canvas.get_default_filetype()
default_filename = self.canvas.window().windowTitle() or 'image'
default_filename.replace(' ', '_')
default_filename = str(self.canvas.window().windowTitle()) or 'image'
default_filename = default_filename.replace(' ', '_')

start = default_filename + '.' + default_filetype
filters = []
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/backends/backend_qt4.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,8 +614,8 @@ def save_figure(self, *args):
sorted_filetypes = filetypes.items()
sorted_filetypes.sort()
default_filetype = self.canvas.get_default_filetype()
default_filename = self.canvas.window().windowTitle() or 'image'
default_filename.replace(' ', '_')
default_filename = str(self.canvas.window().windowTitle()) or 'image'
default_filename = default_filename.replace(' ', '_')

start = default_filename + '.' + default_filetype
filters = []
Expand Down