diff --git a/gramps/gui/plug/report/_docreportdialog.py b/gramps/gui/plug/report/_docreportdialog.py index 7b49d4b67..f50221d5b 100644 --- a/gramps/gui/plug/report/_docreportdialog.py +++ b/gramps/gui/plug/report/_docreportdialog.py @@ -185,10 +185,13 @@ class DocReportDialog(ReportDialog): ext = "" else: spath = self.get_default_directory() - default_name = self.dbname + "_" + self.raw_name if self.options.get_output(): base = os.path.basename(self.options.get_output()) else: + if self.dbname is None: + default_name = self.raw_name + else: + default_name = self.dbname + "_" + self.raw_name 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 62197d6e3..d949ee45a 100644 --- a/gramps/gui/plug/report/_graphvizreportdialog.py +++ b/gramps/gui/plug/report/_graphvizreportdialog.py @@ -165,10 +165,13 @@ class GraphvizReportDialog(ReportDialog): ext = "" else: spath = self.get_default_directory() - default_name = self.dbname + "_" + self.raw_name if self.options.get_output(): base = os.path.basename(self.options.get_output()) else: + if self.dbname is None: + default_name = self.raw_name + else: + default_name = self.dbname + "_" + self.raw_name base = "%s%s" % (default_name, ext) # "ext" already has a dot spath = os.path.normpath(os.path.join(spath, base)) self.target_fileentry.set_filename(spath)