Commit e61c2936 authored by Andreas J. Guelzow 's avatar Andreas J. Guelzow Committed by Andreas J. Guelzow

new write do_not_print field read do_not_print field initialize

2007-11-08  Andreas Guelzow  <aguelzow@pyrshep.ca>

	* src/xml-sax-read.c (xml_sax_print_do_not_print): new
	* src/xml-sax-write.c (xml_write_print_info): write do_not_print 
	  field
	* src/xml-io.c (xml_read_print_info): read do_not_print field
	* src/print-info.c (print_info_new): initialize do_not_print
	
2007-11-08  Andreas J. Guelzow <aguelzow@pyrshep.ca>

	* print.glade: add "do not print" checkbox
	* dialog-printer-setup.c (do_setup_page_info): handle 
	  do-not-print checkbox
	(do_fetch_page_info): ditto

	

svn path=/trunk/; revision=16094
parent facbe7a0
2007-11-08 Andreas Guelzow <aguelzow@pyrshep.ca>
* src/xml-sax-read.c (xml_sax_print_do_not_print): new
* src/xml-sax-write.c (xml_write_print_info): write do_not_print
field
* src/xml-io.c (xml_read_print_info): read do_not_print field
* src/print-info.c (print_info_new): initialize do_not_print
2007-11-08 Morten Welinder <terra@gnome.org>
* src/sheet.c (sheet_move_range): Initialize reloc_info.pos.
......
......@@ -6,6 +6,7 @@ Andreas:
* Load header & footer info from file
* Print headers and footers
* Reenable header/footer customization
* Add do-not-print flag to sheets. [#371754]
Jean:
* Print images.
......
......@@ -301,6 +301,12 @@
</xsd:element>
<!-- typical values are A4, US-Letter -->
<xsd:element name="paper" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<!-- do not print this sheet when "all" is selected in the job -->
<xsd:element name="do_not_print">
<xsd:complexType>
<xsd:attribute name="value" type="xsd:boolean" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
......
2007-11-08 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* print.glade: add "do not print" checkbox
* dialog-printer-setup.c (do_setup_page_info): handle do-not-print
checkbox
(do_fetch_page_info): ditto
2007-11-06 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* dialog-printer-setup.c: reenable header/footer customization
......
......@@ -1294,6 +1294,7 @@ do_setup_page_info (PrinterSetupState *state)
GtkWidget *onlystyles= glade_xml_get_widget (state->gui, "check-only-styles");
GtkWidget *bw = glade_xml_get_widget (state->gui, "check-black-white");
GtkWidget *titles = glade_xml_get_widget (state->gui, "check-print-titles");
GtkWidget *do_not_print = glade_xml_get_widget (state->gui, "check-do-not-print");
GtkWidget *order_rd = glade_xml_get_widget (state->gui, "radio-order-right");
GtkWidget *order_dr = glade_xml_get_widget (state->gui, "radio-order-down");
GtkWidget *order_table = glade_xml_get_widget (state->gui, "page-order-table");
......@@ -1350,6 +1351,8 @@ do_setup_page_info (PrinterSetupState *state)
state->pi->print_black_and_white);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (titles),
state->pi->print_titles);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (do_not_print),
state->pi->do_not_print);
order = state->pi->print_across_then_down ? order_rd : order_dr;
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (order), TRUE);
......@@ -1784,8 +1787,6 @@ printer_setup_state_new (WBCGtk *wbcg, Sheet *sheet)
PrinterSetupState *state;
GladeXML *gui;
GtkWidget *page, *notebook;
gui = gnm_glade_xml_new (GO_CMD_CONTEXT (wbcg),
"print.glade", NULL, NULL);
if (gui == NULL)
......@@ -1927,6 +1928,8 @@ do_fetch_page_info (PrinterSetupState *state)
(GTK_TOGGLE_BUTTON (glade_xml_get_widget (state->gui, "check-print-titles")));
pi->print_across_then_down = gtk_toggle_button_get_active
(GTK_TOGGLE_BUTTON (glade_xml_get_widget (state->gui, "radio-order-right")));
pi->do_not_print = gtk_toggle_button_get_active
(GTK_TOGGLE_BUTTON (glade_xml_get_widget (state->gui, "check-do-not-print")));
pi->repeat_top.use = gnm_expr_entry_get_rangesel (state->top_entry,
&pi->repeat_top.range, NULL);
pi->repeat_left.use = gnm_expr_entry_get_rangesel (state->left_entry,
......
......@@ -1155,12 +1155,27 @@
</widget>
<packing>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="check-do-not-print">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">Do not print with all sheets</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
</widget>
</child>
</widget>
......
......@@ -300,6 +300,7 @@ print_info_new (gboolean load_defaults)
res->start_page = -1;
res->n_copies = 0;
res->do_not_print = FALSE;
res->page_setup = NULL;
res->page_breaks.v = NULL;
......
......@@ -647,6 +647,11 @@ xml_read_print_info (XmlParseContext *ctxt, xmlNodePtr tree)
xml_node_get_int (child, "value", &b);
pi->print_titles = (b == 1);
}
if ((child = e_xml_get_child_by_name (tree, CC2XML ("do_not_print")))) {
xml_node_get_int (child, "value", &b);
pi->do_not_print = (b == 1);
}
xml_read_print_repeat_range (ctxt, tree, "repeat_top",
&pi->repeat_top);
......
......@@ -884,6 +884,24 @@ xml_sax_print_grid (GsfXMLIn *xin, xmlChar const **attrs)
pi->print_grid_lines = val;
}
static void
xml_sax_print_do_not_print (GsfXMLIn *xin, xmlChar const **attrs)
{
XMLSaxParseState *state = (XMLSaxParseState *)xin->user_state;
PrintInformation *pi;
int val;
g_return_if_fail (state->sheet != NULL);
g_return_if_fail (state->sheet->print_info != NULL);
pi = state->sheet->print_info;
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
if (gnm_xml_attr_int (attrs, "value", &val))
pi->do_not_print = val;
}
static void
xml_sax_monochrome (GsfXMLIn *xin, xmlChar const **attrs)
......@@ -2304,6 +2322,7 @@ GSF_XML_IN_NODE_FULL (START, WB, GNM, "Workbook", GSF_XML_NO_CONTENT, TRUE, FALS
GSF_XML_IN_NODE (SHEET_PRINTINFO, PRINT_VCENTER, GNM, "vcenter", GSF_XML_CONTENT, &xml_sax_print_vcenter, NULL),
GSF_XML_IN_NODE (SHEET_PRINTINFO, PRINT_HCENTER, GNM, "hcenter", GSF_XML_CONTENT, &xml_sax_print_hcenter, NULL),
GSF_XML_IN_NODE (SHEET_PRINTINFO, PRINT_GRID, GNM, "grid", GSF_XML_NO_CONTENT, &xml_sax_print_grid, NULL),
GSF_XML_IN_NODE (SHEET_PRINTINFO, PRINT_DO_NOT_PRINT, GNM, "do_not_print",GSF_XML_NO_CONTENT, &xml_sax_print_do_not_print, NULL),
GSF_XML_IN_NODE (SHEET_PRINTINFO, PRINT_MONO, GNM, "monochrome", GSF_XML_NO_CONTENT, &xml_sax_monochrome, NULL),
GSF_XML_IN_NODE (SHEET_PRINTINFO, PRINT_AS_DRAFT, GNM, "draft", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (SHEET_PRINTINFO, PRINT_COMMENTS, GNM, "comments", GSF_XML_NO_CONTENT, NULL, NULL),
......
......@@ -321,6 +321,11 @@ xml_write_print_info (GnmOutputXML *state, PrintInformation *pi)
gsf_xml_out_add_int (state->output, "value", pi->print_titles);
gsf_xml_out_end_element (state->output);
gsf_xml_out_start_element (state->output, GNM "do_not_print");
gsf_xml_out_add_int (state->output, "value", pi->do_not_print);
gsf_xml_out_end_element (state->output);
xml_write_print_repeat_range (state, GNM "repeat_top", &pi->repeat_top);
xml_write_print_repeat_range (state, GNM "repeat_left", &pi->repeat_left);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment