r19860 - gnucash/trunk/src/business/business-gnome - Revert "Bug #635439: Patch to autoset owner in the payment dialog"

Mike Evans mikee at code.gnucash.org
Mon Nov 22 08:45:44 EST 2010


Author: mikee
Date: 2010-11-22 08:45:43 -0500 (Mon, 22 Nov 2010)
New Revision: 19860
Trac: http://svn.gnucash.org/trac/changeset/19860

Modified:
   gnucash/trunk/src/business/business-gnome/business-gnome-utils.c
   gnucash/trunk/src/business/business-gnome/dialog-payment.c
Log:
Revert "Bug #635439: Patch to autoset owner in the payment dialog"

This reverts commit 232ae4064952cb65e9703d61778cb1531d2e4f56.

Modified: gnucash/trunk/src/business/business-gnome/business-gnome-utils.c
===================================================================
--- gnucash/trunk/src/business/business-gnome/business-gnome-utils.c	2010-11-21 21:45:06 UTC (rev 19859)
+++ gnucash/trunk/src/business/business-gnome/business-gnome-utils.c	2010-11-22 13:45:43 UTC (rev 19860)
@@ -310,6 +310,7 @@
 
     gncOwnerCopy(owner, &isi->owner);
     isi->have_owner = TRUE;
+    gnc_general_search_set_selected(GNC_GENERAL_SEARCH(widget), NULL);
 
     /* Reset the label */
     gnc_invoice_select_search_set_label(isi);

Modified: gnucash/trunk/src/business/business-gnome/dialog-payment.c
===================================================================
--- gnucash/trunk/src/business/business-gnome/dialog-payment.c	2010-11-21 21:45:06 UTC (rev 19859)
+++ gnucash/trunk/src/business/business-gnome/dialog-payment.c	2010-11-22 13:45:43 UTC (rev 19860)
@@ -96,29 +96,17 @@
         gtk_widget_destroy (pw->dialog);
 }
 
-/* Forward declaration */
-static void gnc_payment_set_owner (PaymentWindow *pw, GncOwner *owner);
-
 static void
 gnc_payment_dialog_invoice_changed(PaymentWindow *pw)
 {
     GNCLot *lot;
     gnc_numeric val;
-    GncOwner *owner;
 
     /* Set the payment amount in the dialog */
     if (pw->invoice)
     {
         lot = gncInvoiceGetPostedLot (pw->invoice);
         val = gnc_numeric_abs (gnc_lot_get_balance (lot));
-        /* If a invoice is selected without selecting an owner first, or
-         * if the owner for the selected invoice is different from the
-         * previously selected owner, make sure the right owner is
-         * selected. */
-        owner = gncInvoiceGetOwner (pw->invoice);
-        if (pw->owner.owner.undefined == NULL || pw->owner.owner.undefined != owner->owner.undefined) {
-            gnc_payment_set_owner (pw, gncInvoiceGetOwner (pw->invoice));
-        }
     }
     else
     {
@@ -136,19 +124,18 @@
     KvpValue* value;
     KvpFrame* slots;
 
-    /* The selected invoice has a different owner than the newly
-     * selected owner, reset it */
-    if (pw->invoice != NULL && !gncOwnerEqual(gncInvoiceGetOwner(pw->invoice), &pw->owner)) {
-        pw->invoice = NULL;
-        gnc_invoice_set_invoice(pw->invoice_choice, NULL);
-    }
-
-    /* Limit the invoice selection to this owner */
+    /* If the owner changed, the invoice selection is invalid */
+    pw->invoice = NULL;
     gnc_invoice_set_owner(pw->invoice_choice, &pw->owner);
+    /* note that set_owner implies ...set_invoice(...,NULL); */
 
     /* in case we don't get the callback */
     gnc_payment_dialog_invoice_changed(pw);
 
+    /* XXX: We should set the sensitive flag on the invoice_choice
+     * based on whether 'owner' is NULL or not...
+     */
+
     /* Now handle the account tree */
     slots = gncOwnerGetSlots(&pw->owner);
     if (slots)



More information about the gnucash-changes mailing list