diff --git a/pyfpdb/GuiGraphViewer.py b/pyfpdb/GuiGraphViewer.py index be9efe42..82f6d4fa 100644 --- a/pyfpdb/GuiGraphViewer.py +++ b/pyfpdb/GuiGraphViewer.py @@ -282,13 +282,18 @@ class GuiGraphViewer (threading.Thread): dia_chooser = gtk.FileChooserDialog(title="Please choose the directory you wish to export to:", action=gtk.FILE_CHOOSER_ACTION_OPEN, buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN,gtk.RESPONSE_OK)) + #TODO: Suggest path and filename to start with response = dia_chooser.run() if response == gtk.RESPONSE_OK: self.exportDir = dia_chooser.get_filename() + print "DEBUG: self.exportDir = %s" %(self.exportDir) elif response == gtk.RESPONSE_CANCEL: print 'Closed, no graph exported' dia_chooser.destroy() + #TODO: Check to see if file exists + #NOTE: Dangerous - will happily overwrite any file we have write access too + self.fig.savefig(self.exportDir, format="png") def __init__(self, db, settings, querylist, config, debug=True): """Constructor for GraphViewer"""