mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Try to get rid of CRIT trace messages by checking for owner validity first.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21390 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
40000ee934
commit
30d3cfc914
@ -174,6 +174,7 @@ gnc_payment_dialog_owner_changed(PaymentWindow *pw)
|
|||||||
GncGUID *guid = NULL;
|
GncGUID *guid = NULL;
|
||||||
KvpValue* value;
|
KvpValue* value;
|
||||||
KvpFrame* slots;
|
KvpFrame* slots;
|
||||||
|
GncOwner *owner = &pw->owner;
|
||||||
|
|
||||||
/* If the owner changed, the invoice selection is invalid */
|
/* If the owner changed, the invoice selection is invalid */
|
||||||
pw->invoice = NULL;
|
pw->invoice = NULL;
|
||||||
@ -188,7 +189,7 @@ gnc_payment_dialog_owner_changed(PaymentWindow *pw)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Now handle the account tree */
|
/* Now handle the account tree */
|
||||||
slots = gncOwnerGetSlots(&pw->owner);
|
slots = gncOwnerGetSlots(owner);
|
||||||
if (slots)
|
if (slots)
|
||||||
{
|
{
|
||||||
value = kvp_frame_get_slot_path(slots, "payment", "last_acct", NULL);
|
value = kvp_frame_get_slot_path(slots, "payment", "last_acct", NULL);
|
||||||
@ -211,8 +212,9 @@ gnc_payment_dialog_owner_changed(PaymentWindow *pw)
|
|||||||
pw->acct_commodities = NULL;
|
pw->acct_commodities = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
pw->acct_types = gncOwnerGetAccountTypesList(&pw->owner);
|
pw->acct_types = gncOwnerGetAccountTypesList(owner);
|
||||||
pw->acct_commodities = gncOwnerGetCommoditiesList (&pw->owner);
|
if (gncOwnerIsValid(owner))
|
||||||
|
pw->acct_commodities = gncOwnerGetCommoditiesList (owner);
|
||||||
gnc_fill_account_select_combo (pw->post_combo, pw->book, pw->acct_types, pw->acct_commodities);
|
gnc_fill_account_select_combo (pw->post_combo, pw->book, pw->acct_types, pw->acct_commodities);
|
||||||
|
|
||||||
if (guid)
|
if (guid)
|
||||||
@ -319,7 +321,7 @@ gnc_payment_ok_cb (GtkWidget *widget, gpointer data)
|
|||||||
|
|
||||||
/* Verify the user has selected an owner */
|
/* Verify the user has selected an owner */
|
||||||
gnc_owner_get_owner (pw->owner_choice, &(pw->owner));
|
gnc_owner_get_owner (pw->owner_choice, &(pw->owner));
|
||||||
if (pw->owner.owner.undefined == NULL)
|
if (!gncOwnerIsValid(&pw->owner))
|
||||||
{
|
{
|
||||||
text = _("You must select a company for payment processing.");
|
text = _("You must select a company for payment processing.");
|
||||||
gnc_error_dialog (pw->dialog, "%s", text);
|
gnc_error_dialog (pw->dialog, "%s", text);
|
||||||
@ -563,7 +565,7 @@ new_payment_window (GncOwner *owner, QofBook *book, GncInvoice *invoice)
|
|||||||
pw = gnc_find_first_gui_component (cm_class, find_handler, NULL);
|
pw = gnc_find_first_gui_component (cm_class, find_handler, NULL);
|
||||||
if (pw)
|
if (pw)
|
||||||
{
|
{
|
||||||
if (owner->owner.undefined)
|
if (owner->owner.undefined) // FIXME: Does that mean gncOwnerIsValid(owner->owner)???
|
||||||
gnc_payment_set_owner (pw, owner);
|
gnc_payment_set_owner (pw, owner);
|
||||||
|
|
||||||
// Reset the setting about the pre-existing TXN
|
// Reset the setting about the pre-existing TXN
|
||||||
@ -582,7 +584,8 @@ new_payment_window (GncOwner *owner, QofBook *book, GncInvoice *invoice)
|
|||||||
/* Compute the post-to account types */
|
/* Compute the post-to account types */
|
||||||
pw->acct_types = gncOwnerGetAccountTypesList (owner);
|
pw->acct_types = gncOwnerGetAccountTypesList (owner);
|
||||||
|
|
||||||
pw->acct_commodities = gncOwnerGetCommoditiesList (owner);
|
if (gncOwnerIsValid(owner))
|
||||||
|
pw->acct_commodities = gncOwnerGetCommoditiesList (owner);
|
||||||
|
|
||||||
/* Open and read the XML */
|
/* Open and read the XML */
|
||||||
xml = gnc_glade_xml_new ("payment.glade", "Payment Dialog");
|
xml = gnc_glade_xml_new ("payment.glade", "Payment Dialog");
|
||||||
|
Loading…
Reference in New Issue
Block a user