From 54d1d0fa7fae8df0c1d0d8d27485695c6afe2e62 Mon Sep 17 00:00:00 2001 From: Mike Alexander Date: Tue, 11 Sep 2012 03:29:46 +0000 Subject: [PATCH] [Bug 683222] Display the "to amount" in the exchange rate dialog when it is first shown. Also updated some comments to be more accurate. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22383 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/gnome-utils/dialog-transfer.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/gnome-utils/dialog-transfer.c b/src/gnome-utils/dialog-transfer.c index f7d24f07e2..13c07dbbd9 100644 --- a/src/gnome-utils/dialog-transfer.c +++ b/src/gnome-utils/dialog-transfer.c @@ -2240,9 +2240,9 @@ gboolean gnc_xfer_dialog_run_exchange_dialog( if (xaccTransUseTradingAccounts (txn)) { /* If we're using commodity trading accounts then "amount" is - really the split's amount and it's in xfer_com. We need an - exchange rate that will convert this amount into a value in - the transaction currency. */ + really the split's amount and it's in xfer_com commodity. + We need an exchange rate that will convert this amount + into a value in the transaction currency. */ if (gnc_commodity_equal(xfer_com, txn_cur)) { /* Transaction is in the same currency as the split, exchange @@ -2251,15 +2251,15 @@ gboolean gnc_xfer_dialog_run_exchange_dialog( return FALSE; } swap_amounts = expanded; - - /* We know that "amount" is always in the reg_com currency. - * Unfortunately it is possible that neither xfer_com or txn_cur are - * the same as reg_com, in which case we need to convert to the txn - * currency... Or, if the register commodity is the xfer_com, then we - * need to flip-flop the commodities and the exchange rates. - */ - } + + /* We know that "amount" is always in the reg_com currency. + * Unfortunately it is possible that neither xfer_com or txn_cur are + * the same as reg_com, in which case we need to convert to the txn + * currency... Or, if the register commodity is the xfer_com, then we + * need to flip-flop the commodities and the exchange rates. + */ + else if (gnc_commodity_equal(reg_com, txn_cur)) { /* we're working in the txn currency. Great. Nothing to do! */ @@ -2311,6 +2311,8 @@ gboolean gnc_xfer_dialog_run_exchange_dialog( gnc_xfer_dialog_hide_from_account_tree(xfer); gnc_xfer_dialog_set_amount(xfer, amount); + /* Now that from amount is set, set the to amount. */ + gnc_xfer_update_to_amount(xfer); /* * When we flip, we should tell the dialog so it can deal with the