From 298a023ca8a37198881e6badf64113952fc77762 Mon Sep 17 00:00:00 2001 From: Peter Landgren Date: Thu, 13 Mar 2008 18:42:44 +0000 Subject: [PATCH] Issue #1850. Warning are given for many error cases, update 2. svn: r10293 --- src/ReportBase/_GraphvizReportDialog.py | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/ReportBase/_GraphvizReportDialog.py b/src/ReportBase/_GraphvizReportDialog.py index 8b891ccf0..8a0538e19 100644 --- a/src/ReportBase/_GraphvizReportDialog.py +++ b/src/ReportBase/_GraphvizReportDialog.py @@ -960,8 +960,6 @@ class GraphvizReportDialog(ReportDialog): # If all margins are >1.0" then graphs are OK, but some graphs are # offset a lot # Note margins are always in cm. - warn_text1 = "" - warn_text2 = "" if self.paper_frame.get_paper_metric(): warn_marg = "1.3 cm." else: @@ -972,32 +970,29 @@ class GraphvizReportDialog(ReportDialog): pm_t = self.paper_frame.get_paper_margins()[2] / 2.54 pm_b = self.paper_frame.get_paper_margins()[3] / 2.54 - if ((self.h_pages.get_value() > 1) or (self.h_pages.get_value() > 1)) and \ - (self.format_menu.get_clname() != 'gspdf'): - warn_text1 = _("You have used more than one page as output.") - warn_text2 = _("This will cause incorrect and/or partial graphs.") - warn_marg = "" - if ((pm_l < 0.5 and pm_r < 0.5) or (pm_t < 0.5 and pm_b < 0.5)) and \ (self.format_menu.get_clname() == 'gvpdf'): warn_text1 = _("Two or more opposite paper margins are less than ") warn_text2 = _("This will cause incorrect and/or partial graphs.") + WarningDialog(warn_text1 + warn_marg, warn_text2) if ((pm_l < 0.5 and pm_r < 0.5) or (pm_t < 0.5 and pm_b < 0.5)) and \ (self.format_menu.get_clname() == 'gspdf') or (self.format_menu.get_clname() == 'ps'): warn_text1 = _("Two or more opposite paper margins are less than ") warn_text2 = _("More than expected number of pages will be generated.") - - if warn_text1: WarningDialog(warn_text1 + warn_marg, warn_text2) - warn_text1 = "" + + if ((self.h_pages.get_value() > 1) or (self.h_pages.get_value() > 1)) and \ + (self.format_menu.get_clname() != 'gspdf'): + warn_text1 = _("You have used more than one page as output.") + warn_text2 = _("This will cause incorrect and/or partial graphs.") + warn_marg = "" + WarningDialog(warn_text1 + warn_marg, warn_text2) if (self.format_menu.get_clname() == 'gspdf') and (self.dpi.get_value() != 75 ): warn_text1 = _("You have not used 75 dpi for Ghostscript.") warn_text2 = _("Using other dpi's will cause incorrect graphs.") warn_marg = "" - - if warn_text1: WarningDialog(warn_text1 + warn_marg, warn_text2) #======================================================================