[ghex/expand-search-options: 13/14] findrep: Show # of replacements w/ replace all




commit 55bb41242b7db02b3c2282a918568ad86478f49a
Author: Logan Rathbone <poprocks gmail com>
Date:   Tue Apr 19 04:00:26 2022 -0400

    findrep: Show # of replacements w/ replace all

 src/findreplace.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/findreplace.c b/src/findreplace.c
index 26054ee..cd74f26 100644
--- a/src/findreplace.c
+++ b/src/findreplace.c
@@ -626,14 +626,22 @@ replace_all_cb (GtkButton *button, gpointer user_data)
        count = 0;
        while (hex_document_find_forward_full (doc, find_data))
        {
-
                hex_document_set_data (doc,
                                find_data->offset, rep_str_len, find_data->found_len, rep_str,
                                TRUE);
                count++;
        }
        
-       if (count == 0) {
+       if (count)
+       {
+               char *msg;
+               msg = g_strdup_printf (_("Search complete: %d replacements made."),
+                                       count);
+               display_info_dialog (parent, msg);
+               g_free (msg);
+       }
+       else
+       {
                display_info_dialog (parent, _("No occurrences were found."));
        }
        


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]