From 6ab09e3d39635272400cda1931738802d5e01602 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sun, 9 Mar 2008 19:39:56 +0000 Subject: [PATCH] 2008-03-09 Douglas S. Blank * src/ReportBase/_WebReportDialog.py: * src/ReportBase/_ReportDialog.py: * src/ReportBase/_GraphvizReportDialog.py: * src/ReportBase/_DocReportDialog.py: * src/ReportBase/_BareReportDialog.py: 0001814: Applied patch to move print options below option tabs svn: r10240 --- ChangeLog | 8 +++++ src/ReportBase/_BareReportDialog.py | 31 +++++++++++-------- src/ReportBase/_DocReportDialog.py | 16 +++++----- src/ReportBase/_GraphvizReportDialog.py | 18 +++++------ src/ReportBase/_ReportDialog.py | 41 ++++++++++++------------- src/ReportBase/_WebReportDialog.py | 5 ++- 6 files changed, 67 insertions(+), 52 deletions(-) diff --git a/ChangeLog b/ChangeLog index 41020566b..98c360d66 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-03-09 Douglas S. Blank + * src/ReportBase/_WebReportDialog.py: + * src/ReportBase/_ReportDialog.py: + * src/ReportBase/_GraphvizReportDialog.py: + * src/ReportBase/_DocReportDialog.py: + * src/ReportBase/_BareReportDialog.py: + 0001814: Applied patch to move print options below option tabs + 2008-03-09 Benny Malengier * src/gen/db/base.py: add docstring to find functions, #1866 * src/gen/db/dbdir.py: add docstring to find functions, #1866 diff --git a/src/ReportBase/_BareReportDialog.py b/src/ReportBase/_BareReportDialog.py index 17ed4286f..f0df3ec2b 100644 --- a/src/ReportBase/_BareReportDialog.py +++ b/src/ReportBase/_BareReportDialog.py @@ -135,16 +135,16 @@ class BareReportDialog(ManagedWindow.ManagedWindow): self.tbl.set_col_spacings(12) self.tbl.set_row_spacings(6) self.tbl.set_border_width(6) - self.col = 0 - self.window.vbox.add(self.tbl) + self.row = 0 # Build the list of widgets that are used to extend the Options # frame and to create other frames self.add_user_options() self.setup_main_options() - self.setup_target_frame() + self.setup_init() self.setup_format_frame() + self.setup_target_frame() self.setup_style_frame() self.notebook = gtk.Notebook() @@ -155,6 +155,8 @@ class BareReportDialog(ManagedWindow.ManagedWindow): self.setup_report_options_frame() self.setup_other_frames() self.notebook.set_current_page(0) + + self.window.vbox.add(self.tbl) self.show() def get_title(self): @@ -288,8 +290,8 @@ class BareReportDialog(ManagedWindow.ManagedWindow): label.set_use_markup(1) label.set_alignment(0.0,0.5) self.tbl.set_border_width(12) - self.tbl.attach(label, 0, 4, self.col, self.col+1, gtk.FILL|gtk.EXPAND) - self.col += 1 + self.tbl.attach(label, 0, 4, self.row, self.row+1, gtk.FILL|gtk.EXPAND) + self.row += 1 def setup_style_frame(self): """Set up the style frame of the dialog. This function relies @@ -313,12 +315,12 @@ class BareReportDialog(ManagedWindow.ManagedWindow): self.style_button = gtk.Button("%s..." % _("Style Editor")) self.style_button.connect('clicked',self.on_style_edit_clicked) - self.tbl.attach(label,1,2,self.col,self.col+1,gtk.SHRINK|gtk.FILL) - self.tbl.attach(self.style_menu,2,3,self.col,self.col+1, + self.tbl.attach(label,1,2,self.row,self.row+1,gtk.SHRINK|gtk.FILL) + self.tbl.attach(self.style_menu,2,3,self.row,self.row+1, yoptions=gtk.SHRINK) - self.tbl.attach(self.style_button,3,4,self.col,self.col+1, + self.tbl.attach(self.style_button,3,4,self.row,self.row+1, xoptions=gtk.SHRINK|gtk.FILL,yoptions=gtk.SHRINK) - self.col += 1 + self.row += 1 # Build the initial list of available styles sets. This # includes the default style set and any style sets saved from @@ -397,6 +399,9 @@ class BareReportDialog(ManagedWindow.ManagedWindow): table.attach(widget, 2, 3, row, row+1, yoptions=gtk.SHRINK) row = row + 1 + + def setup_init(self): + pass def setup_main_options(self): if self.frames.has_key(""): @@ -407,11 +412,11 @@ class BareReportDialog(ManagedWindow.ManagedWindow): label.set_alignment(0.0,0.5) self.tbl.set_border_width(12) - self.tbl.attach(label,0,4,self.col,self.col+1) - self.col += 1 + self.tbl.attach(label,0,4,self.row,self.row+1) + self.row += 1 - self.tbl.attach(widget,2,4,self.col,self.col+1) - self.col += 1 + self.tbl.attach(widget,2,4,self.row,self.row+1) + self.row += 1 #------------------------------------------------------------------------ diff --git a/src/ReportBase/_DocReportDialog.py b/src/ReportBase/_DocReportDialog.py index 8f446ff61..559e7b3a4 100644 --- a/src/ReportBase/_DocReportDialog.py +++ b/src/ReportBase/_DocReportDialog.py @@ -151,19 +151,19 @@ class DocReportDialog(ReportDialog): relies on the make_doc_menu() function to do all the hard work.""" - self.print_report = gtk.CheckButton (_("Print a copy")) - self.tbl.attach(self.print_report,2,4,self.col,self.col+1, - yoptions=gtk.SHRINK) - self.col += 1 - self.make_doc_menu(self.options.handler.get_format_name()) self.format_menu.connect('changed',self.doc_type_changed) label = gtk.Label("%s:" % _("Output Format")) label.set_alignment(0.0,0.5) - self.tbl.attach(label,1,2,self.col,self.col+1,gtk.SHRINK|gtk.FILL) - self.tbl.attach(self.format_menu,2,4,self.col,self.col+1, + self.tbl.attach(label,1,2,self.row,self.row+1,gtk.SHRINK|gtk.FILL) + self.tbl.attach(self.format_menu,2,4,self.row,self.row+1, yoptions=gtk.SHRINK) - self.col += 1 + self.row += 1 + + self.print_report = gtk.CheckButton (_("Print a copy")) + self.tbl.attach(self.print_report,2,4,self.row,self.row+1, + yoptions=gtk.SHRINK) + self.row += 1 ext = self.format_menu.get_ext() if ext == None: diff --git a/src/ReportBase/_GraphvizReportDialog.py b/src/ReportBase/_GraphvizReportDialog.py index dc403ff22..92d6979c8 100644 --- a/src/ReportBase/_GraphvizReportDialog.py +++ b/src/ReportBase/_GraphvizReportDialog.py @@ -49,6 +49,7 @@ import BaseDoc import Config from _Constants import CATEGORY_GRAPHVIZ from _ReportDialog import ReportDialog +from _FileEntry import FileEntry from _PaperMenu import PaperFrame from PluginUtils import NumberOption, EnumeratedListOption, TextOption @@ -853,21 +854,20 @@ class GraphvizReportDialog(ReportDialog): def setup_format_frame(self): """Set up the format frame of the dialog.""" - - self.print_report = gtk.CheckButton (_("Open with application")) - self.tbl.attach(self.print_report,2,4,self.col,self.col+1, - yoptions=gtk.SHRINK) - self.col += 1 - self.format_menu = GraphvizFormatComboBox() self.format_menu.set(self.options.handler.get_format_name()) self.format_menu.connect('changed',self.doc_type_changed) label = gtk.Label("%s:" % _("Output Format")) label.set_alignment(0.0,0.5) - self.tbl.attach(label,1,2,self.col,self.col+1,gtk.SHRINK|gtk.FILL) - self.tbl.attach(self.format_menu,2,4,self.col,self.col+1, + self.tbl.attach(label,1,2,self.row,self.row+1,gtk.SHRINK|gtk.FILL) + self.tbl.attach(self.format_menu,2,4,self.row,self.row+1, yoptions=gtk.SHRINK) - self.col += 1 + self.row += 1 + + self.print_report = gtk.CheckButton (_("Open with application")) + self.tbl.attach(self.print_report,2,4,self.row,self.row+1, + yoptions=gtk.SHRINK) + self.row += 1 ext = self.format_menu.get_ext() if ext == None: diff --git a/src/ReportBase/_ReportDialog.py b/src/ReportBase/_ReportDialog.py index fbb21eec8..2ed32f1da 100644 --- a/src/ReportBase/_ReportDialog.py +++ b/src/ReportBase/_ReportDialog.py @@ -139,6 +139,23 @@ class ReportDialog(BareReportDialog): # Functions related to setting up the dialog window. # #------------------------------------------------------------------------ + def setup_init(self): + # add any elements that we are going to need: + hid = self.get_stylesheet_savefile() + if hid[-4:]==".xml": + hid = hid[0:-4] + self.target_fileentry = FileEntry(hid,_("Save As")) + spath = self.get_default_directory() + self.target_fileentry.set_filename(spath) + self.target_fileentry.gtk_entry().set_position(len(spath)) + # need any labels at top: + label = gtk.Label("%s" % _('Document Options')) + label.set_use_markup(1) + label.set_alignment(0.0,0.5) + self.tbl.set_border_width(12) + self.tbl.attach(label, 0, 4, self.row, self.row+1, gtk.FILL) + self.row += 1 + def setup_target_frame(self): """Set up the target frame of the dialog. This function relies on several target_xxx() customization functions to @@ -147,19 +164,6 @@ class ReportDialog(BareReportDialog): directory should be used.""" # Save Frame - - label = gtk.Label("%s" % _('Document Options')) - label.set_use_markup(1) - label.set_alignment(0.0,0.5) - self.tbl.set_border_width(12) - self.tbl.attach(label, 0, 4, self.col, self.col+1, gtk.FILL) - self.col += 1 - - hid = self.get_stylesheet_savefile() - if hid[-4:]==".xml": - hid = hid[0:-4] - self.target_fileentry = FileEntry(hid,_("Save As")) - if self.get_target_is_directory(): self.target_fileentry.set_directory_entry(1) self.doc_label = gtk.Label("%s:" % _("Directory")) @@ -167,17 +171,12 @@ class ReportDialog(BareReportDialog): self.doc_label = gtk.Label("%s:" % _("Filename")) self.doc_label.set_alignment(0.0,0.5) - self.tbl.attach(self.doc_label, 1, 2, self.col, self.col+1, + self.tbl.attach(self.doc_label, 1, 2, self.row, self.row+1, xoptions=gtk.SHRINK|gtk.FILL,yoptions=gtk.SHRINK) - self.tbl.attach(self.target_fileentry, 2, 4, self.col, self.col+1, + self.tbl.attach(self.target_fileentry, 2, 4, self.row, self.row+1, xoptions=gtk.EXPAND|gtk.FILL,yoptions=gtk.SHRINK) - self.col += 1 + self.row += 1 - spath = self.get_default_directory() - - self.target_fileentry.set_filename(spath) - self.target_fileentry.gtk_entry().set_position(len(spath)) - #------------------------------------------------------------------------ # # Functions related to retrieving data from the dialog window diff --git a/src/ReportBase/_WebReportDialog.py b/src/ReportBase/_WebReportDialog.py index 3f8ed75b8..e4383f3dc 100644 --- a/src/ReportBase/_WebReportDialog.py +++ b/src/ReportBase/_WebReportDialog.py @@ -45,10 +45,13 @@ class WebReportDialog(ReportDialog): ReportDialog.__init__(self, dbstate, uistate, option_class, name, trans_name) + def setup_init(self): + pass + def setup_target_frame(self): """Target frame is not used.""" pass def parse_target_frame(self): """Target frame is not used.""" - return 1 \ No newline at end of file + return 1