diff --git a/gramps/gui/plug/report/_docreportdialog.py b/gramps/gui/plug/report/_docreportdialog.py index 84731f850..4bb46fc55 100644 --- a/gramps/gui/plug/report/_docreportdialog.py +++ b/gramps/gui/plug/report/_docreportdialog.py @@ -187,7 +187,10 @@ class DocReportDialog(ReportDialog): spath = self.get_default_directory() default_name = self.dbname + "_" + \ "".join(x[0].upper() for x in self.raw_name.split("_")) - base = "%s.%s" % (default_name, ext) + if self.options.get_output(): + base = os.path.basename(self.options.get_output()) + else: + base = "%s.%s" % (default_name, ext) spath = os.path.normpath(os.path.join(spath, base)) self.target_fileentry.set_filename(spath) diff --git a/gramps/gui/plug/report/_graphvizreportdialog.py b/gramps/gui/plug/report/_graphvizreportdialog.py index d968fd8c8..07e8d2deb 100644 --- a/gramps/gui/plug/report/_graphvizreportdialog.py +++ b/gramps/gui/plug/report/_graphvizreportdialog.py @@ -168,7 +168,10 @@ class GraphvizReportDialog(ReportDialog): spath = self.get_default_directory() default_name = self.dbname + "_" + \ "".join(x[0].upper() for x in self.raw_name.split("_")) - base = "%s%s" % (default_name, ext) + if self.options.get_output(): + base = os.path.basename(self.options.get_output()) + else: + base = "%s%s" % (default_name, ext) spath = os.path.normpath(os.path.join(spath, base)) self.target_fileentry.set_filename(spath)