* src/gnome/glade/register.glade: add sort entries for Action and Notes

* src/gnome/gnc-split-reg.[ch]: add ability to sort by Action and Notes
	Fixes #113990.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8460 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Derek Atkins 2003-05-30 00:40:16 +00:00
parent 54fca943db
commit 8a105f741e
4 changed files with 71 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2003-05-29 Derek Atkins <derek@ihtfp.com>
* src/gnome/glade/register.glade: add sort entries for Action and Notes
* src/gnome/gnc-split-reg.[ch]: add ability to sort by Action and Notes
Fixes #113990.
2003-05-29 David Hampton <hampton@employees.org>
* src/engine/iso-4217-currencies.scm: Update the Polish Zloty for

View File

@ -1777,7 +1777,7 @@
<last_modification_time>Wed, 12 Jun 2002 02:13:24 GMT</last_modification_time>
</signal>
<label>_Standard</label>
<active>False</active>
<active>True</active>
<always_show_toggle>True</always_show_toggle>
<group>sort</group>
</widget>
@ -1888,7 +1888,37 @@
<last_modification_time>Wed, 12 Jun 2002 02:13:24 GMT</last_modification_time>
</signal>
<label>Descri_ption</label>
<active>True</active>
<active>False</active>
<always_show_toggle>True</always_show_toggle>
<group>sort</group>
</widget>
<widget>
<class>GtkRadioMenuItem</class>
<name>menu_sort_action</name>
<tooltip>Sort by Action</tooltip>
<signal>
<name>activate</name>
<handler>gnc_split_reg_sort_action_cb</handler>
<last_modification_time>Fri, 30 May 2003 00:03:32 GMT</last_modification_time>
</signal>
<label>A_ction</label>
<active>False</active>
<always_show_toggle>True</always_show_toggle>
<group>sort</group>
</widget>
<widget>
<class>GtkRadioMenuItem</class>
<name>menu_sort_notes</name>
<tooltip>Sort by Notes</tooltip>
<signal>
<name>activate</name>
<handler>gnc_split_reg_sort_notes_cb</handler>
<last_modification_time>Fri, 30 May 2003 00:05:06 GMT</last_modification_time>
</signal>
<label>N_otes</label>
<active>False</active>
<always_show_toggle>True</always_show_toggle>
<group>sort</group>
</widget>

View File

@ -174,6 +174,8 @@ void gnc_split_reg_sort_num_cb (GtkWidget *w, gpointer data);
void gnc_split_reg_sort_amount_cb (GtkWidget *w, gpointer data);
void gnc_split_reg_sort_memo_cb (GtkWidget *w, gpointer data);
void gnc_split_reg_sort_desc_cb (GtkWidget *w, gpointer data);
void gnc_split_reg_sort_action_cb (GtkWidget *w, gpointer data);
void gnc_split_reg_sort_notes_cb (GtkWidget *w, gpointer data);
void gnc_split_reg_destroy_cb(GtkWidget *widget, gpointer data);
void gnc_split_reg_size_allocate( GtkWidget *widget,
@ -1613,6 +1615,15 @@ gnc_split_reg_sort( GNCSplitReg *gsr, SortType sort_code )
p1 = g_slist_prepend (p1, SPLIT_TRANS);
p2 = standard;
break;
case BY_ACTION:
p1 = g_slist_prepend (p1, SPLIT_ACTION);
p2 = standard;
break;
case BY_NOTES:
p1 = g_slist_prepend (p1, TRANS_NOTES);
p1 = g_slist_prepend (p1, SPLIT_TRANS);
p2 = standard;
break;
default:
g_slist_free (standard);
g_return_if_fail (FALSE);
@ -1681,6 +1692,20 @@ gnc_split_reg_sort_desc_cb(GtkWidget *w, gpointer data)
gnc_split_reg_sort(gsr, BY_DESC);
}
void
gnc_split_reg_sort_action_cb(GtkWidget *w, gpointer data)
{
GNCSplitReg *gsr = data;
gnc_split_reg_sort(gsr, BY_ACTION);
}
void
gnc_split_reg_sort_notes_cb(GtkWidget *w, gpointer data)
{
GNCSplitReg *gsr = data;
gnc_split_reg_sort(gsr, BY_NOTES);
}
void
gnc_split_reg_handle_exchange_cb (GtkWidget *w, gpointer data)
{

View File

@ -173,7 +173,11 @@ typedef enum {
STYLE_SUBMENU,
} GNC_SPLIT_REG_ITEM;
/* Easy way to pass the sort-type */
/* Easy way to pass the sort-type
* Note that this is STUPID -- we should be using parameter lists,
* but this provides a simple case statement internally. This should
* probably not actually be exposed in the external interface....
*/
typedef enum {
BY_NONE = 0,
BY_STANDARD,
@ -183,7 +187,9 @@ typedef enum {
BY_NUM,
BY_AMOUNT,
BY_MEMO,
BY_DESC
BY_DESC,
BY_ACTION,
BY_NOTES
} SortType;
/**