From 04b99369c67481159636f9d0e38118461c7ecc69 Mon Sep 17 00:00:00 2001 From: Derek Atkins Date: Thu, 2 Jan 2003 01:10:33 +0000 Subject: [PATCH] * src/register/ledger-core/split-register-layout.c: fix the rate_cell layout for general ledgers. Fixed the critical failure from bug #101000 * src/gnome-search/search-numeric.c: * src/gnome-search/search-double.c: * src/gnome-search/search-int64.c: read the value out of the GNCAmountEdit entry when we create the Query Predicate, because we're not getting the amount_changed signal. Fixes #101000. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7748 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 13 ++++++++++++- src/gnome-search/search-double.c | 5 +++++ src/gnome-search/search-int64.c | 5 +++++ src/gnome-search/search-numeric.c | 5 +++++ src/register/ledger-core/split-register-layout.c | 2 +- 5 files changed, 28 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 89da418d36..190657cbdf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,7 +11,18 @@ * src/gnome-utils/dialog-transfer.c: always set the exchange-rate as a positive value (use ABS). Fixes the rest of #102163. - + + * src/register/ledger-core/split-register-layout.c: fix the + rate_cell layout for general ledgers. Fixed the critical + failure from bug #101000 + + * src/gnome-search/search-numeric.c: + * src/gnome-search/search-double.c: + * src/gnome-search/search-int64.c: + read the value out of the GNCAmountEdit entry when we create + the Query Predicate, because we're not getting the amount_changed + signal. Fixes #101000. + 2002-12-30 Benoit Grégoire * src/import-export/hbci/druid-hbci-initial.c * src/import-export/hbci/gnc-hbci-utils.c: diff --git a/src/gnome-search/search-double.c b/src/gnome-search/search-double.c index 27be223586..9d92c02d72 100644 --- a/src/gnome-search/search-double.c +++ b/src/gnome-search/search-double.c @@ -46,6 +46,7 @@ static void gnc_search_double_finalise (GtkObject *obj); struct _GNCSearchDoublePrivate { GtkWidget * entry; + GNCAmountEdit *gae; }; static GNCSearchCoreTypeClass *parent_class; @@ -272,6 +273,7 @@ gncs_get_widget (GNCSearchCoreType *fe) gtk_signal_connect (GTK_OBJECT (entry), "amount_changed", entry_changed, fe); gtk_box_pack_start (GTK_BOX (box), entry, FALSE, FALSE, 3); fi->priv->entry = gnc_amount_edit_gtk_entry (GNC_AMOUNT_EDIT (entry)); + fi->priv->gae = GNC_AMOUNT_EDIT (entry); /* And return the box */ return box; @@ -284,6 +286,9 @@ static QueryPredData_t gncs_get_predicate (GNCSearchCoreType *fe) g_return_val_if_fail (fi, NULL); g_return_val_if_fail (IS_GNCSEARCH_DOUBLE (fi), NULL); + /* force the computation of the entry, because we may not get the signal */ + entry_changed (fi->priv->gae, fi); + return gncQueryDoublePredicate (fi->how, fi->value); } diff --git a/src/gnome-search/search-int64.c b/src/gnome-search/search-int64.c index 6a87ec1bce..9ed854bb28 100644 --- a/src/gnome-search/search-int64.c +++ b/src/gnome-search/search-int64.c @@ -46,6 +46,7 @@ static void gnc_search_int64_finalise (GtkObject *obj); struct _GNCSearchInt64Private { GtkWidget *entry; + GNCAmountEdit *gae; }; static GNCSearchCoreTypeClass *parent_class; @@ -278,6 +279,7 @@ gncs_get_widget (GNCSearchCoreType *fe) gtk_signal_connect (GTK_OBJECT (entry), "amount_changed", entry_changed, fe); gtk_box_pack_start (GTK_BOX (box), entry, FALSE, FALSE, 3); fi->priv->entry = gnc_amount_edit_gtk_entry (GNC_AMOUNT_EDIT (entry)); + fi->priv->gae = GNC_AMOUNT_EDIT (entry); /* And return the box */ return box; @@ -290,6 +292,9 @@ static QueryPredData_t gncs_get_predicate (GNCSearchCoreType *fe) g_return_val_if_fail (fi, NULL); g_return_val_if_fail (IS_GNCSEARCH_INT64 (fi), NULL); + /* force the computation of the entry, because we may not get the signal */ + entry_changed (fi->priv->gae, fi); + return gncQueryInt64Predicate (fi->how, fi->value); } diff --git a/src/gnome-search/search-numeric.c b/src/gnome-search/search-numeric.c index 1b8847ced6..d24921b209 100644 --- a/src/gnome-search/search-numeric.c +++ b/src/gnome-search/search-numeric.c @@ -47,6 +47,7 @@ static void gnc_search_numeric_finalise (GtkObject *obj); struct _GNCSearchNumericPrivate { gboolean is_debcred; GtkWidget * entry; + GNCAmountEdit *gae; }; static GNCSearchCoreTypeClass *parent_class; @@ -348,6 +349,7 @@ gncs_get_widget (GNCSearchCoreType *fe) gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (entry), fi->value); gtk_signal_connect (GTK_OBJECT (entry), "amount_changed", entry_changed, fe); gtk_box_pack_start (GTK_BOX (box), entry, FALSE, FALSE, 3); + fi->priv->gae = GNC_AMOUNT_EDIT (entry); fi->priv->entry = gnc_amount_edit_gtk_entry (GNC_AMOUNT_EDIT (entry)); /* And return the box */ @@ -361,6 +363,9 @@ static QueryPredData_t gncs_get_predicate (GNCSearchCoreType *fe) g_return_val_if_fail (fi, NULL); g_return_val_if_fail (IS_GNCSEARCH_NUMERIC (fi), NULL); + /* force the computation of the entry, because we may not get the signal */ + entry_changed (fi->priv->gae, fi); + return gncQueryNumericPredicate (fi->how, fi->option, fi->value); } diff --git a/src/register/ledger-core/split-register-layout.c b/src/register/ledger-core/split-register-layout.c index d7fcc660b5..c1a1f4fd92 100644 --- a/src/register/ledger-core/split-register-layout.c +++ b/src/register/ledger-core/split-register-layout.c @@ -293,7 +293,7 @@ gnc_split_register_set_cells (SplitRegister *reg, TableLayout *layout) gnc_table_layout_set_cell (layout, curs, DEBT_CELL, 0, 5); gnc_table_layout_set_cell (layout, curs, CRED_CELL, 0, 6); } - gnc_table_layout_set_cell (layout, curs, RATE_CELL, 0, 8); + gnc_table_layout_set_cell (layout, curs, RATE_CELL, 0, 7); break; }