Commit 151d870a authored by Andreas J. Guelzow 's avatar Andreas J. Guelzow

Add an interface for conditional background formatting.

2011-07-06  Andreas J. Guelzow <aguelzow@pyrshep.ca>

	* component/Gnumeric-embed.xml.in: add menu item
	* src/GNOME_Gnumeric-gtk.xml.in: ditto
	* src/HILDON_Gnumeric-gtk.xml.in: ditto
	* src/sheet-control-gui.c
	* src/style-conditions.c (gnm_style_conditions_dup): new
	(gnm_style_cond_is_valid): not all conditions need an expression
	(gnm_style_conditions_eval): not all conditions need an expression
	* src/style-conditions.h (gnm_style_conditions_dup): new
	* src/wbc-gtk-actions.c (cb_format_cells_cond): new

2011-07-06  Andreas J. Guelzow <aguelzow@pyrshep.ca>

	* cell-format-cond-def.ui: new
	* cell-format-cond.ui: new
	* dialog-cell-format-cond.c: new
	* Makefile.am: add new files
	* cell-format.ui: remove conditions tab
	* dialog-cell-format.c: remove handling of deleted conditions tab moving
	it to dialog-cell-format-cond.c
	(dialog_cell_format_select_style): new
	(dialog_cell_format_init): new
	(dialog_cell_format): use dialog_cell_format_init
	* dialogs.h (dialog_cell_format_select_style): new
	(dialog_cell_format_cond): new
	(dialog_cell_format_style_added): new
	* help.h (GNUMERIC_HELP_LINK_CELL_FORMAT_COND): new
parent e86e668e
2011-07-06 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* component/Gnumeric-embed.xml.in: add menu item
* src/GNOME_Gnumeric-gtk.xml.in: ditto
* src/HILDON_Gnumeric-gtk.xml.in: ditto
* src/sheet-control-gui.c
* src/style-conditions.c (gnm_style_conditions_dup): new
(gnm_style_cond_is_valid): not all conditions need an expression
(gnm_style_conditions_eval): not all conditions need an expression
* src/style-conditions.h (gnm_style_conditions_dup): new
* src/wbc-gtk-actions.c (cb_format_cells_cond): new
2011-06-22 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* print.c (load_repeat_range): move from here to
......
......@@ -7,6 +7,7 @@ Andreas:
* Fix xlsx schema violations.
* Fix keyword handling in properties dialog. [#653378]
* Allow document properties to be edited and added.
* Add an interface for conditional background formatting.
Morten:
* Fix --with-gnome compilation: [#652802]
......
......@@ -142,6 +142,7 @@
<menu name="Format" action="MenuFormat">
<menu name="FormatCellsMenu" action="MenuFormatCells">
<menuitem action="FormatCells"/>
<menuitem action="FormatCellsCond"/>
<menuitem action="FormatMergeCells"/>
<menuitem action="FormatUnmergeCells"/>
<menuitem action="FormatCellsFitHeight"/>
......
......@@ -89,6 +89,7 @@ src/dialogs/dialog-autoformat.c
src/dialogs/dialog-autosave.c
src/dialogs/dialog-cell-comment.c
src/dialogs/dialog-cell-format.c
src/dialogs/dialog-cell-format-cond.c
src/dialogs/dialog-cell-sort.c
src/dialogs/dialog-col-width.c
src/dialogs/dialog-consolidate.c
......@@ -146,6 +147,8 @@ src/dialogs/dialog-zoom.c
[type: gettext/glade]src/dialogs/autosave.ui
[type: gettext/glade]src/dialogs/cell-comment.ui
[type: gettext/glade]src/dialogs/cell-format.ui
[type: gettext/glade]src/dialogs/cell-format-cond.ui
[type: gettext/glade]src/dialogs/cell-format-cond-def.ui
[type: gettext/glade]src/dialogs/cell-sort.ui
[type: gettext/glade]src/dialogs/chi-squared.ui
[type: gettext/glade]src/dialogs/col-width.ui
......
......@@ -152,6 +152,7 @@ src/dialogs/dialog-autoformat.c
src/dialogs/dialog-autosave.c
src/dialogs/dialog-cell-comment.c
src/dialogs/dialog-cell-format.c
src/dialogs/dialog-cell-format-cond.c
src/dialogs/dialog-cell-sort.c
src/dialogs/dialog-col-width.c
src/dialogs/dialog-consolidate.c
......@@ -209,6 +210,8 @@ src/dialogs/dialog-zoom.c
[type: gettext/glade]src/dialogs/autosave.ui
[type: gettext/glade]src/dialogs/cell-comment.ui
[type: gettext/glade]src/dialogs/cell-format.ui
[type: gettext/glade]src/dialogs/cell-format-cond.ui
[type: gettext/glade]src/dialogs/cell-format-cond-def.ui
[type: gettext/glade]src/dialogs/cell-sort.ui
[type: gettext/glade]src/dialogs/chi-squared.ui
[type: gettext/glade]src/dialogs/col-width.ui
......
......@@ -143,6 +143,7 @@
<menu name="Format" action="MenuFormat">
<menu name="FormatCellsMenu" action="MenuFormatCells">
<menuitem action="FormatCells"/>
<menuitem action="FormatCellsCond"/>
<menuitem action="FormatMergeCells"/>
<menuitem action="FormatUnmergeCells"/>
<menuitem action="FormatCellsFitHeight"/>
......
......@@ -152,6 +152,7 @@
<menu name="Format" action="MenuFormat">
<menu name="FormatCellsMenu" action="MenuFormatCells">
<menuitem action="FormatCells"/>
<menuitem action="FormatCellsCond"/>
<menuitem action="FormatMergeCells"/>
<menuitem action="FormatUnmergeCells"/>
<menuitem action="FormatCellsFitHeight"/>
......
2011-07-06 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* cell-format-cond-def.ui: new
* cell-format-cond.ui: new
* dialog-cell-format-cond.c: new
* Makefile.am: add new files
* cell-format.ui: remove conditions tab
* dialog-cell-format.c: remove handling of deleted conditions tab moving
it to dialog-cell-format-cond.c
(dialog_cell_format_select_style): new
(dialog_cell_format_init): new
(dialog_cell_format): use dialog_cell_format_init
* dialogs.h (dialog_cell_format_select_style): new
(dialog_cell_format_cond): new
(dialog_cell_format_style_added): new
* help.h (GNUMERIC_HELP_LINK_CELL_FORMAT_COND): new
2011-07-01 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* dialog-doc-metadata.c (dialog_doc_metadata_get_value_type_from_name):
......
......@@ -38,6 +38,7 @@ base_files = \
dialog-autosave.c \
dialog-cell-comment.c \
dialog-cell-format.c \
dialog-cell-format-cond.c \
dialog-cell-sort.c \
dialog-col-width.c \
dialog-col-row.c \
......@@ -103,6 +104,8 @@ ui_DATA = \
autosave.ui \
cell-comment.ui \
cell-format.ui \
cell-format-cond.ui \
cell-format-cond-def.ui \
cell-sort.ui \
chi-squared.ui \
col-width.ui \
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 2.12 -->
<!-- interface-naming-policy project-wide -->
<object class="GtkListStore" id="liststore1">
<columns>
<!-- column-name gchararray1 -->
<column type="gchararray"/>
<!-- column-name type -->
<column type="gint"/>
</columns>
</object>
<object class="GtkDialog" id="style-condition-def">
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="title" translatable="yes">Style Condition</property>
<property name="modal">True</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">8</property>
<child>
<object class="GtkTable" id="condition-table">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="n_rows">4</property>
<property name="n_columns">2</property>
<property name="column_spacing">5</property>
<property name="row_spacing">5</property>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Condition:</property>
</object>
<packing>
<property name="y_options">GTK_SHRINK | GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="condition-combo">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="model">liststore1</property>
</object>
<packing>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options">GTK_SHRINK | GTK_FILL</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkTable" id="table1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="n_rows">5</property>
<property name="n_columns">2</property>
<property name="column_spacing">5</property>
<property name="row_spacing">5</property>
<child>
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Applicable Style Components:</property>
</object>
<packing>
<property name="right_attach">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="check-number">
<property name="label" translatable="yes">Number Format</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="check-align">
<property name="label" translatable="yes">Alignment</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="check-font">
<property name="label" translatable="yes">Font</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton4">
<property name="label" translatable="yes">Background</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="check-protection">
<property name="label" translatable="yes">Protection</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="check-validation">
<property name="label" translatable="yes">Validation</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="check-border">
<property name="label" translatable="yes">Border</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="padding">5</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="spacing">5</property>
<child>
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Style Overlay:</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="style-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">label</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHButtonBox" id="hbuttonbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">5</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="edit-button">
<property name="label">gtk-edit</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="new-button">
<property name="label">gtk-new</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="help-button">
<property name="label">gtk-help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="cancel-button">
<property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="ok-button">
<property name="label">gtk-ok</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">3</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="0">help-button</action-widget>
<action-widget response="0">cancel-button</action-widget>
<action-widget response="0">ok-button</action-widget>
</action-widgets>
</object>
</interface>
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 2.12 -->
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkDialog" id="CellFormat">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes">Conditional Cell Formatting</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="header-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="hbuttonbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="helpbutton">
<property name="label">gtk-help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="closebutton">
<property name="label">gtk-close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkTable" id="condition-table">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">12</property>
<property name="n_rows">3</property>
<child>
<object class="GtkLabel" id="conditions_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="xpad">5</property>
<property name="ypad">5</property>
</object>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="y_options">GTK_SHRINK | GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="height_request">250</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">automatic</property>
<property name="vscrollbar_policy">automatic</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkTreeView" id="conditions_treeview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="border_width">5</property>
<property name="headers_visible">False</property>
<property name="enable_search">False</property>
<property name="level_indentation">5</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkHButtonBox" id="hbuttonbox2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="layout_style">start</property>
<child>
<object class="GtkButton" id="conditions_add">
<property name="label">gtk-add</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="conditions_remove">
<property name="label">gtk-remove</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="conditions_clear">
<property name="label">gtk-clear</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="conditions_expand">
<property name="label" translatable="yes">E_xpand</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkButton" id="conditions_edit">
<property name="label">gtk-edit</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">4</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options">GTK_SHRINK | GTK_FILL</property>
</packing>
</child>
</object>
<packing>