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




commit 66c926ed6cb5ff203b70e7216357dad380dde6c3
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 7f3125a..20a77a6 100644
--- a/src/findreplace.c
+++ b/src/findreplace.c
@@ -622,14 +622,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]