gnucash maint: Bug 798222 - Account search dialog: Pushing enter does nothing

Robert Fewell bobit at code.gnucash.org
Wed Dec 15 09:24:54 EST 2021


Updated	 via  https://github.com/Gnucash/gnucash/commit/16e15de6 (commit)
	from  https://github.com/Gnucash/gnucash/commit/3d83f5df (commit)



commit 16e15de60e4e846e09efdcd433f67da9852e4c55
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Wed Dec 15 14:22:59 2021 +0000

    Bug 798222 - Account search dialog: Pushing enter does nothing
    
    Connect up the activate signal for the entry.

diff --git a/gnucash/gnome/dialog-find-account.c b/gnucash/gnome/dialog-find-account.c
index 438597f5b..12600c472 100644
--- a/gnucash/gnome/dialog-find-account.c
+++ b/gnucash/gnome/dialog-find-account.c
@@ -297,6 +297,21 @@ filter_button_cb (GtkButton *button, FindAccountDialog *facc_dialog)
     gtk_entry_set_text (GTK_ENTRY(facc_dialog->filter_text_entry), "");
 }
 
+static void
+filter_active_cb (GtkEntry *entry, FindAccountDialog *facc_dialog)
+{
+    get_account_info (facc_dialog, FALSE);
+
+    if (facc_dialog->saved_filter_text)
+        g_free (facc_dialog->saved_filter_text);
+
+    // save the filter in case of an account event
+    facc_dialog->saved_filter_text = g_strdup (gtk_entry_get_text
+                                     (GTK_ENTRY(facc_dialog->filter_text_entry)));
+
+    gtk_editable_select_region (GTK_EDITABLE(facc_dialog->filter_text_entry), 0, -1);
+}
+
 static void
 gnc_find_account_event_handler (QofInstance *entity,
                                 QofEventId event_type,
@@ -375,6 +390,8 @@ gnc_find_account_dialog_create (GtkWidget *parent, FindAccountDialog *facc_dialo
     facc_dialog->filter_button = GTK_WIDGET(gtk_builder_get_object (builder, "filter-button"));
     g_signal_connect (facc_dialog->filter_button, "clicked",
                       G_CALLBACK(filter_button_cb), (gpointer)facc_dialog);
+    g_signal_connect (facc_dialog->filter_text_entry, "activate",
+                      G_CALLBACK(filter_active_cb), (gpointer)facc_dialog);
 
     button = GTK_WIDGET(gtk_builder_get_object (builder, "jumpto_button"));
     g_signal_connect(button, "clicked", G_CALLBACK(gnc_find_account_dialog_jump_button_cb), facc_dialog);



Summary of changes:
 gnucash/gnome/dialog-find-account.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)



More information about the gnucash-changes mailing list