r17355 - gnucash/branches/2.2/src/gnome-utils - [r17149] Correct quickfill direction in transfer dialogs.

Andreas Köhler andi5 at cvs.gnucash.org
Sun Jul 20 19:51:56 EDT 2008


Author: andi5
Date: 2008-07-20 19:51:56 -0400 (Sun, 20 Jul 2008)
New Revision: 17355
Trac: http://svn.gnucash.org/trac/changeset/17355

Modified:
   gnucash/branches/2.2/src/gnome-utils/dialog-transfer.c
Log:
[r17149] Correct quickfill direction in transfer dialogs.

gnc_xfer_dialog_quickfill() messed up debit and credit.  When the "from
account" (left in normal mode, right/credit when using formal accounting
terms) was chosen as basis for the quickfill and a match was found, the
remote account should be selected on the "to account" side.


Modified: gnucash/branches/2.2/src/gnome-utils/dialog-transfer.c
===================================================================
--- gnucash/branches/2.2/src/gnome-utils/dialog-transfer.c	2008-07-20 23:51:46 UTC (rev 17354)
+++ gnucash/branches/2.2/src/gnome-utils/dialog-transfer.c	2008-07-20 23:51:56 UTC (rev 17355)
@@ -617,14 +617,17 @@
   {
     GNCAccountType other_type;
     GtkWidget *other_button;
-    
+    XferDirection other_direction;
+
     DEBUG("updating other split");
     if (xferData->quickfill == XFER_DIALOG_FROM) {
-      other_button = xferData->from_show_button;
+      other_button = xferData->to_show_button;
+      other_direction = XFER_DIALOG_TO;
     }
     else
     {
-      other_button = xferData->to_show_button;
+      other_button = xferData->from_show_button;
+      other_direction = XFER_DIALOG_FROM;
     }
 
     other_type = xaccAccountGetType(other_acct);
@@ -635,7 +638,7 @@
     if( (other_type == ACCT_TYPE_EXPENSE) || (other_type == ACCT_TYPE_INCOME) )
       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(other_button), TRUE);
 
-    gnc_transfer_dialog_set_selected_account (xferData, other_acct, xferData->quickfill);
+    gnc_transfer_dialog_set_selected_account (xferData, other_acct, other_direction);
 
     changed = TRUE;
   }



More information about the gnucash-changes mailing list