[Gnucash-changes] gnucash
Joshua Sled
jsled at cvs.gnucash.org
Sun Mar 14 09:57:27 EST 2004
Update of /home/cvs/cvsroot/gnucash
In directory cvs.gnucash.org:/tmp/cvs-serv31928
Modified Files:
ChangeLog
Log Message:
2004-03-14 Joshua Sled <jsled at asynchronous.org>
* src/gnome/druid-loan.c (gnc_ui_sx_loan_druid_create): Use the
account-list filtering capability of the GncAccountSel to only
show/allow-creation-of valid account-types in the
loan-druid. Fixes Bug#124595.
Update of /home/cvs/cvsroot/gnucash/src/gnome
In directory cvs.gnucash.org:/tmp/cvs-serv31928/src/gnome
Modified Files:
druid-loan.c
Log Message:
2004-03-14 Joshua Sled <jsled at asynchronous.org>
* src/gnome/druid-loan.c (gnc_ui_sx_loan_druid_create): Use the
account-list filtering capability of the GncAccountSel to only
show/allow-creation-of valid account-types in the
loan-druid. Fixes Bug#124595.
==================================================
Differences for ChangeLog (revision 1.1790 -> 1.1791)
==================================================
--- /home/cvs/cvsroot/gnucash/ChangeLog 2004/03/14 00:25:45 1.1790
+++ /home/cvs/cvsroot/gnucash/ChangeLog 2004/03/14 14:57:27 1.1791
@@ -1,3 +1,10 @@
+2004-03-14 Joshua Sled <jsled at asynchronous.org>
+
+ * src/gnome/druid-loan.c (gnc_ui_sx_loan_druid_create): Use the
+ account-list filtering capability of the GncAccountSel to only
+ show/allow-creation-of valid account-types in the
+ loan-druid. Fixes Bug#124595.
+
2004-03-13 Joshua Sled <jsled at asynchronous.org>
* src/gnome/dialog-scheduledxaction.c (gnc_sxed_check_consistent):
==================================================
Differences for druid-loan.c (revision 1.20 -> 1.21)
==================================================
--- /home/cvs/cvsroot/gnucash/src/gnome/druid-loan.c 2003/08/04 01:32:07 1.20
+++ /home/cvs/cvsroot/gnucash/src/gnome/druid-loan.c 2004/03/14 14:57:27 1.21
@@ -416,6 +416,39 @@
/* non-gladeable widget setup */
{
+ int i;
+ // LIABILITY
+ GList *liabilityAcct;
+ // BANK, CASH, CREDIT, ASSET + LIABILITY
+ GList *paymentFromAccts;
+ // EXPENSE, LIABILITY, + payment-froms.
+ GList *paymentToAccts;
+ int fromLen = 5;
+ GNCAccountType paymentFroms[] = { BANK, CASH, CREDIT, ASSET, LIABILITY };
+ int toLen = 2;
+ GNCAccountType paymentTos[] = { EXPENSE };
+
+ liabilityAcct = NULL;
+ paymentFromAccts = NULL;
+ paymentToAccts = NULL;
+
+ liabilityAcct = g_list_append( liabilityAcct,
+ GINT_TO_POINTER( LIABILITY ) );
+ for ( i = 0; i < fromLen; i++ )
+ {
+ paymentFromAccts
+ = g_list_append( paymentFromAccts,
+ GINT_TO_POINTER( paymentFroms[i] ) );
+ paymentToAccts
+ = g_list_append( paymentToAccts,
+ GINT_TO_POINTER( paymentFroms[i] ) );
+ }
+
+ for ( i = 0; i < toLen; i++ )
+ {
+ paymentToAccts = g_list_append( paymentToAccts,
+ GINT_TO_POINTER( paymentTos[i] ) );
+ }
/* All of the GncAccountSel[ectors]... */
{
@@ -427,16 +460,17 @@
GtkTable *table;
gboolean newAcctAbility;
int left, right, top, bottom;
+ GList *allowableAccounts;
} gas_data[] = {
/* These ints are the GtkTable boundries */
- { &ldd->prmAccountGAS, ldd->prmTable, TRUE, 1, 4, 0, 1 },
- { &ldd->repAssetsFromGAS, ldd->repTable, TRUE, 1, 4, 2, 3 },
- { &ldd->repPrincToGAS, ldd->repTable, TRUE, 1, 2, 3, 4 },
- { &ldd->repIntToGAS, ldd->repTable, TRUE, 3, 4, 3, 4 },
- { &ldd->payAcctFromGAS, ldd->payTable, TRUE, 1, 2, 4, 5 },
- { &ldd->payAcctEscToGAS, ldd->payTable, FALSE, 3, 4, 4, 5 },
- { &ldd->payAcctEscFromGAS, ldd->payTable, FALSE, 1, 2, 5, 6 },
- { &ldd->payAcctToGAS, ldd->payTable, TRUE, 3, 4, 5, 6 },
+ { &ldd->prmAccountGAS, ldd->prmTable, TRUE, 1, 4, 0, 1, liabilityAcct },
+ { &ldd->repAssetsFromGAS, ldd->repTable, TRUE, 1, 4, 2, 3, paymentFromAccts },
+ { &ldd->repPrincToGAS, ldd->repTable, TRUE, 1, 2, 3, 4, paymentToAccts },
+ { &ldd->repIntToGAS, ldd->repTable, TRUE, 3, 4, 3, 4, paymentToAccts },
+ { &ldd->payAcctFromGAS, ldd->payTable, TRUE, 1, 2, 4, 5, paymentFromAccts },
+ { &ldd->payAcctEscToGAS, ldd->payTable, FALSE, 3, 4, 4, 5, paymentToAccts },
+ { &ldd->payAcctEscFromGAS, ldd->payTable, FALSE, 1, 2, 5, 6, paymentFromAccts },
+ { &ldd->payAcctToGAS, ldd->payTable, TRUE, 3, 4, 5, 6, paymentToAccts },
{ NULL }
};
@@ -456,6 +490,10 @@
gas = GNC_ACCOUNT_SEL(gnc_account_sel_new());
gnc_account_sel_set_new_account_ability(
gas, gas_data[i].newAcctAbility );
+ if ( gas_data[i].allowableAccounts != NULL ) {
+ gnc_account_sel_set_acct_filters(
+ gas, gas_data[i].allowableAccounts );
+ }
gtk_container_add( GTK_CONTAINER(a),
GTK_WIDGET(gas) );
gtk_table_attach( gas_data[i].table,
More information about the Gnucash-changes
mailing list