mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
* src/backend/file/io-example-account.[ch]: add a flag that signifies
that an account-tree should NOT be included by "select-all" * src/gnome/druid-hierachy.c: ignore account-trees that are marked for exclusion from "select-all". * accounts/C/acctchrt_business.gnucash-xea: mark this account as "excluded from select-all" git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7781 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
0ee9a57e7b
commit
f9d0134156
@ -2,6 +2,13 @@
|
||||
|
||||
* src/scm/main.scm -- mention bugzilla in the unstable message
|
||||
|
||||
* src/backend/file/io-example-account.[ch]: add a flag that signifies
|
||||
that an account-tree should NOT be included by "select-all"
|
||||
* src/gnome/druid-hierachy.c: ignore account-trees that are
|
||||
marked for exclusion from "select-all".
|
||||
* accounts/C/acctchrt_business.gnucash-xea: mark this account as
|
||||
"excluded from select-all"
|
||||
|
||||
2003-01-04 David Hampton <hampton@employees.org>
|
||||
|
||||
* src/backend/file/gnc-account-xml-v2.c:
|
||||
|
@ -8,7 +8,8 @@
|
||||
</gnc-act:short-description>
|
||||
<gnc-act:long-description>
|
||||
Users running a business want to select this instead of other choices. This includes all the accounts you need to run a most businesses, including Payables, Receivables, Income, and Expenses.
|
||||
</gnc-act:long-description>
|
||||
</gnc-act:long-description>
|
||||
<gnc-act:exclude-from-select-all>1</gnc-act:exclude-from-select-all>
|
||||
<gnc:account version="2.0.0">
|
||||
<act:name>Assets</act:name>
|
||||
<act:id type="new">c53764b4dc9f08210475c5d8ae54cb91</act:id>
|
||||
|
@ -54,6 +54,7 @@ static short module = MOD_IO;
|
||||
#define GNC_ACCOUNT_SHORT "gnc-act:short-description"
|
||||
#define GNC_ACCOUNT_LONG "gnc-act:long-description"
|
||||
#define GNC_ACCOUNT_TITLE "gnc-act:title"
|
||||
#define GNC_ACCOUNT_EXCLUDEP "gnc-act:exclude-from-select-all"
|
||||
|
||||
void
|
||||
gnc_destroy_example_account(GncExampleAccount *gea)
|
||||
@ -270,6 +271,28 @@ gnc_long_descrip_sixtp_parser_create(void)
|
||||
return sixtp_dom_parser_new(gnc_long_descrip_end_handler, NULL, NULL);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gnc_excludep_end_handler(gpointer data_for_children,
|
||||
GSList* data_from_children, GSList* sibling_data,
|
||||
gpointer parent_data, gpointer global_data,
|
||||
gpointer *result, const gchar *tag)
|
||||
{
|
||||
GncExampleAccount *gea =
|
||||
(GncExampleAccount*)((gxpf_data*)global_data)->parsedata;
|
||||
gint64 val;
|
||||
|
||||
dom_tree_to_integer ((xmlNodePtr)data_for_children, &val);
|
||||
gea->exclude_from_select_all = (dom_tree_to_integer ? TRUE : FALSE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static sixtp*
|
||||
gnc_excludep_sixtp_parser_create(void)
|
||||
{
|
||||
return sixtp_dom_parser_new(gnc_excludep_end_handler, NULL, NULL);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gnc_title_end_handler(gpointer data_for_children,
|
||||
GSList* data_from_children, GSList* sibling_data,
|
||||
@ -322,6 +345,7 @@ gnc_read_example_account(GNCBook *book, const gchar *filename)
|
||||
GNC_ACCOUNT_TITLE, gnc_titse_sixtp_parser_create(),
|
||||
GNC_ACCOUNT_SHORT, gnc_short_descrip_sixtp_parser_create(),
|
||||
GNC_ACCOUNT_LONG, gnc_long_descrip_sixtp_parser_create(),
|
||||
GNC_ACCOUNT_EXCLUDEP, gnc_excludep_sixtp_parser_create(),
|
||||
"gnc:account", gnc_account_sixtp_parser_create(),
|
||||
NULL, NULL))
|
||||
{
|
||||
@ -355,6 +379,19 @@ write_string_part(FILE *out, const char *tag, const char *data)
|
||||
xmlFreeNode(node);
|
||||
}
|
||||
|
||||
static void
|
||||
write_bool_part(FILE *out, const char *tag, gboolean data)
|
||||
{
|
||||
xmlNodePtr node;
|
||||
|
||||
node = int_to_dom_tree(tag, data);
|
||||
|
||||
xmlElemDump(out, NULL, node);
|
||||
fprintf(out, "\n");
|
||||
|
||||
xmlFreeNode(node);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gnc_write_example_account(GncExampleAccount *gea, const gchar *filename)
|
||||
{
|
||||
@ -375,6 +412,8 @@ gnc_write_example_account(GncExampleAccount *gea, const gchar *filename)
|
||||
|
||||
write_string_part(out, GNC_ACCOUNT_LONG, gea->long_description);
|
||||
|
||||
write_bool_part(out, GNC_ACCOUNT_EXCLUDEP, gea->exclude_from_select_all);
|
||||
|
||||
write_account_group(out, gea->group, NULL);
|
||||
|
||||
fprintf(out, "</" GNC_ACCOUNT_STRING ">\n\n");
|
||||
|
@ -38,6 +38,7 @@ struct GncExampleAccount_struct
|
||||
AccountGroup *group;
|
||||
gchar *short_description;
|
||||
gchar *long_description;
|
||||
gboolean exclude_from_select_all;
|
||||
};
|
||||
typedef struct GncExampleAccount_struct GncExampleAccount;
|
||||
|
||||
|
@ -464,7 +464,17 @@ static void
|
||||
select_all_clicked (GtkButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
gtk_clist_select_all (get_account_types_clist ());
|
||||
// gtk_clist_select_all (get_account_types_clist ());
|
||||
GtkCList *clist;
|
||||
gint row;
|
||||
|
||||
/* Walk the list; select the rows that are not "excluded" */
|
||||
clist = get_account_types_clist ();
|
||||
for (row = 0; row < clist->rows; row++) {
|
||||
GncExampleAccount *gea = gtk_clist_get_row_data (clist, row);
|
||||
if (! gea->exclude_from_select_all)
|
||||
gtk_clist_select_row (clist, row, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user