mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 799491 - Add "Clear All" button to register filter
Add a 'Clear All' button to the register filter dialog
This commit is contained in:
parent
dd221e409c
commit
1fb79ef207
@ -162,8 +162,10 @@ void gnc_plugin_page_register_filter_end_cb (GtkWidget* radio,
|
||||
GncPluginPageRegister* page);
|
||||
void gnc_plugin_page_register_filter_response_cb (GtkDialog* dialog,
|
||||
gint response, GncPluginPageRegister* plugin_page);
|
||||
void gnc_plugin_page_register_filter_status_all_cb (GtkButton* button,
|
||||
GncPluginPageRegister* plugin_page);
|
||||
void gnc_plugin_page_register_filter_status_select_all_cb (GtkButton* button,
|
||||
GncPluginPageRegister* plugin_page);
|
||||
void gnc_plugin_page_register_filter_status_clear_all_cb (GtkButton* button,
|
||||
GncPluginPageRegister* plugin_page);
|
||||
void gnc_plugin_page_register_filter_status_one_cb (GtkToggleButton* button,
|
||||
GncPluginPageRegister* page);
|
||||
void gnc_plugin_page_register_filter_save_cb (GtkToggleButton* button,
|
||||
@ -2766,8 +2768,8 @@ gnc_plugin_page_register_filter_status_one_cb (GtkToggleButton* button,
|
||||
* associated with this filter dialog.
|
||||
*/
|
||||
void
|
||||
gnc_plugin_page_register_filter_status_all_cb (GtkButton* button,
|
||||
GncPluginPageRegister* page)
|
||||
gnc_plugin_page_register_filter_status_select_all_cb (GtkButton* button,
|
||||
GncPluginPageRegister* page)
|
||||
{
|
||||
GncPluginPageRegisterPrivate* priv;
|
||||
GtkWidget* widget;
|
||||
@ -2797,6 +2799,48 @@ gnc_plugin_page_register_filter_status_all_cb (GtkButton* button,
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** This function is called whenever the "clear all" status button is
|
||||
* clicked. It updates all of the checkbox widgets, then updates the
|
||||
* query on the register.
|
||||
*
|
||||
* @param button The button that was clicked.
|
||||
*
|
||||
* @param page A pointer to the GncPluginPageRegister that is
|
||||
* associated with this filter dialog.
|
||||
*/
|
||||
void
|
||||
gnc_plugin_page_register_filter_status_clear_all_cb (GtkButton* button,
|
||||
GncPluginPageRegister* page)
|
||||
{
|
||||
GncPluginPageRegisterPrivate* priv;
|
||||
GtkWidget* widget;
|
||||
gint i;
|
||||
|
||||
g_return_if_fail (GTK_IS_BUTTON (button));
|
||||
g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
|
||||
|
||||
ENTER ("(button %p, page %p)", button, page);
|
||||
|
||||
/* Turn off all the check menu items */
|
||||
for (i = 0; status_actions[i].action_name; i++)
|
||||
{
|
||||
widget = status_actions[i].widget;
|
||||
g_signal_handlers_block_by_func (widget,
|
||||
(gpointer)gnc_plugin_page_register_filter_status_one_cb, page);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE);
|
||||
g_signal_handlers_unblock_by_func (widget,
|
||||
(gpointer)gnc_plugin_page_register_filter_status_one_cb, page);
|
||||
}
|
||||
|
||||
/* Set the requested status */
|
||||
priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
|
||||
priv->fd.cleared_match = CLEARED_NONE;
|
||||
gnc_ppr_update_status_query (page);
|
||||
LEAVE (" ");
|
||||
}
|
||||
|
||||
|
||||
/** This function computes the starting and ending times for the
|
||||
* filter by examining the dialog widgets to see which ones are
|
||||
* selected, and will pull times out of the data entry boxes if
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.38.2 -->
|
||||
<!-- Generated with glade 3.40.0 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.22"/>
|
||||
<object class="GtkAdjustment" id="days_adjustment">
|
||||
@ -378,7 +378,7 @@ If 0, all previous days included</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<!-- n-columns=1 n-rows=7 -->
|
||||
<!-- n-columns=1 n-rows=8 -->
|
||||
<object class="GtkGrid" id="table1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
@ -473,7 +473,7 @@ If 0, all previous days included</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="use-underline">True</property>
|
||||
<signal name="clicked" handler="gnc_plugin_page_register_filter_status_all_cb" swapped="no"/>
|
||||
<signal name="clicked" handler="gnc_plugin_page_register_filter_status_select_all_cb" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
@ -493,6 +493,21 @@ If 0, all previous days included</property>
|
||||
<property name="top-attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="button85">
|
||||
<property name="label" translatable="yes">Clear _All</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="use-underline">True</property>
|
||||
<signal name="clicked" handler="gnc_plugin_page_register_filter_status_clear_all_cb" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">7</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
|
Loading…
Reference in New Issue
Block a user