Skip to content

Commit

Permalink
Bug 102787: Allow entry completion on currency selection
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksidesw committed Sep 11, 2020
1 parent d0309b3 commit 779c6b6
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions gnucash/gnome-utils/gnc-currency-edit.c
Expand Up @@ -269,14 +269,19 @@ static void gnc_currency_edit_active_changed (GtkComboBox *gobject,
{
GNCCurrencyEdit *self = GNC_CURRENCY_EDIT (gobject);

gnc_commodity *currency = gnc_currency_edit_get_currency (self);
const gchar *mnemonic = gnc_commodity_get_mnemonic (currency);

g_signal_handlers_block_by_func(G_OBJECT(self),
G_CALLBACK(gnc_currency_edit_active_changed), user_data);
g_object_set (G_OBJECT (self), "mnemonic", mnemonic, NULL);
g_signal_handlers_unblock_by_func(G_OBJECT(self),
G_CALLBACK(gnc_currency_edit_active_changed), user_data);
/* Check that there is a proper selection before proceeding. Doing so allows
* GTK entry completion to proceed. */
if (gtk_combo_box_get_active(GTK_COMBO_BOX(self)) != -1)
{
gnc_commodity *currency = gnc_currency_edit_get_currency (self);
const gchar *mnemonic = gnc_commodity_get_mnemonic (currency);

g_signal_handlers_block_by_func(G_OBJECT(self),
G_CALLBACK(gnc_currency_edit_active_changed), user_data);
g_object_set (G_OBJECT (self), "mnemonic", mnemonic, NULL);
g_signal_handlers_unblock_by_func(G_OBJECT(self),
G_CALLBACK(gnc_currency_edit_active_changed), user_data);
}
}

/** This auxiliary function adds a single currency name to the combo
Expand Down

0 comments on commit 779c6b6

Please sign in to comment.