gnucash maint: Multiple changes pushed
Robert Fewell
bobit at code.gnucash.org
Thu Jul 8 10:32:05 EDT 2021
Updated via https://github.com/Gnucash/gnucash/commit/7b7d2d60 (commit)
via https://github.com/Gnucash/gnucash/commit/cba3aead (commit)
via https://github.com/Gnucash/gnucash/commit/8d667544 (commit)
from https://github.com/Gnucash/gnucash/commit/0f026f6a (commit)
commit 7b7d2d608f6cc8c26a66ca57c5afe74d7812df05
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Thu Jul 8 15:29:05 2021 +0100
Simplify the key_press call back in gnc-amount-edit.c
diff --git a/gnucash/gnome-utils/gnc-amount-edit.c b/gnucash/gnome-utils/gnc-amount-edit.c
index 1c6cacf23..125ca73df 100644
--- a/gnucash/gnome-utils/gnc-amount-edit.c
+++ b/gnucash/gnome-utils/gnc-amount-edit.c
@@ -276,17 +276,14 @@ gnc_amount_edit_key_press (GtkWidget *widget, GdkEventKey *event, gpointer user_
switch (event->keyval)
{
case GDK_KEY_Return:
+ if (event->state & (GDK_MODIFIER_INTENT_DEFAULT_MOD_MASK))
+ break;
+ case GDK_KEY_KP_Enter:
if (gae->evaluate_on_enter)
break;
else
g_signal_emit (gae, amount_edit_signals [ACTIVATE], 0);
- if (event->state & (GDK_MODIFIER_INTENT_DEFAULT_MOD_MASK))
- break;
return result;
- case GDK_KEY_KP_Enter:
- if (!gae->evaluate_on_enter)
- g_signal_emit (gae, amount_edit_signals [ACTIVATE], 0);
- break;
default:
return result;
}
commit cba3aeadba4ea3e6fdb95499b4661bf04e8a34dd
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Thu Jul 8 15:12:19 2021 +0100
Fix rounding in Stock Split Assistant
Correct earlier commit that rounds the share price to that of the
currency.
diff --git a/gnucash/gnome/assistant-stock-split.c b/gnucash/gnome/assistant-stock-split.c
index d33049e5d..910dfb9ae 100644
--- a/gnucash/gnome/assistant-stock-split.c
+++ b/gnucash/gnome/assistant-stock-split.c
@@ -290,8 +290,7 @@ gnc_stock_split_assistant_details_complete (GtkAssistant *assistant,
currency = gnc_currency_edit_get_currency (GNC_CURRENCY_EDIT(info->price_currency_edit));
print_info = gnc_commodity_print_info (currency, FALSE);
gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (info->price_edit), print_info);
- gnc_amount_edit_set_fraction (GNC_AMOUNT_EDIT (info->price_edit),
- gnc_commodity_get_fraction (currency));
+ gnc_amount_edit_set_fraction (GNC_AMOUNT_EDIT (info->price_edit), 0);
result = gnc_amount_edit_expr_is_valid (GNC_AMOUNT_EDIT(info->price_edit),
&amount, TRUE, NULL);
commit 8d66754429e1fda7020ebdd3cc0e756a4f5dfb74
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Thu Jul 8 14:56:48 2021 +0100
Bug 798219 - Price dialog prices truncated
Correct previous commit that truncates decimal places of prices entered
in the price dialog to that of the currency, they should not be rounded.
diff --git a/gnucash/gnome/dialog-price-editor.c b/gnucash/gnome/dialog-price-editor.c
index 94812eb65..74880aa81 100644
--- a/gnucash/gnome/dialog-price-editor.c
+++ b/gnucash/gnome/dialog-price-editor.c
@@ -138,6 +138,7 @@ type_index_to_string (int index)
static void
price_to_gui (PriceEditDialog *pedit_dialog)
{
+ GNCPrintAmountInfo print_info;
gnc_commodity *commodity = NULL;
gnc_commodity *currency = NULL;
const gchar *name_space, *fullname;
@@ -189,6 +190,10 @@ price_to_gui (PriceEditDialog *pedit_dialog)
gtk_combo_box_set_active (GTK_COMBO_BOX(pedit_dialog->type_combobox),
type_string_to_index (type));
+ print_info = gnc_commodity_print_info (currency, FALSE);
+ gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (pedit_dialog->price_edit), print_info);
+ gnc_amount_edit_set_fraction (GNC_AMOUNT_EDIT (pedit_dialog->price_edit), 0);
+
gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (pedit_dialog->price_edit), value);
}
@@ -277,8 +282,7 @@ gui_to_price (PriceEditDialog *pedit_dialog)
print_info = gnc_commodity_print_info (currency, FALSE);
gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (pedit_dialog->price_edit), print_info);
- gnc_amount_edit_set_fraction (GNC_AMOUNT_EDIT (pedit_dialog->price_edit),
- gnc_commodity_get_fraction (currency));
+ gnc_amount_edit_set_fraction (GNC_AMOUNT_EDIT (pedit_dialog->price_edit), 0);
if (!gnc_amount_edit_evaluate (GNC_AMOUNT_EDIT (pedit_dialog->price_edit), NULL))
return _("You must enter a valid amount.");
Summary of changes:
gnucash/gnome-utils/gnc-amount-edit.c | 9 +++------
gnucash/gnome/assistant-stock-split.c | 3 +--
gnucash/gnome/dialog-price-editor.c | 8 ++++++--
3 files changed, 10 insertions(+), 10 deletions(-)
More information about the gnucash-changes
mailing list