[ghex/expand-search-options: 13/16] findrep: Show # of replacements w/ replace all
- From: Logan Rathbone <larathbone src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ghex/expand-search-options: 13/16] findrep: Show # of replacements w/ replace all
- Date: Sat, 23 Apr 2022 04:34:45 +0000 (UTC)
commit 39b9932e507a113763c38c6cfbfc56831a0a1574
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]